yellow/system/extensions/stockholm.php
2019-03-18 22:07:19 +01:00

27 lines
1 KiB
PHP

<?php
// Stockholm extension, https://github.com/datenstrom/yellow-extensions/tree/master/themes/stockholm
// Copyright (c) 2013-2019 Datenstrom, https://datenstrom.se
// This file may be used and distributed under the terms of the public license.
class YellowStockholm {
const VERSION = "0.8.3";
const TYPE = "theme";
public $yellow; //access to API
// Handle initialisation
public function onLoad($yellow) {
$this->yellow = $yellow;
}
// Handle update
public function onUpdate($action) {
$fileName = $this->yellow->system->get("settingDir").$this->yellow->system->get("systemFile");
if ($action=="install") {
$this->yellow->system->save($fileName, array("theme" => "stockholm"));
} elseif ($action=="uninstall" && $this->yellow->system->get("theme")=="stockholm") {
$theme = reset(array_diff($this->yellow->extensions->getExtensions("theme"), array("stockholm")));
$this->yellow->system->save($fileName, array("theme" => $theme));
}
}
}