yellow/system/extensions/stockholm.php
2020-07-26 16:51:07 +02:00

24 lines
910 B
PHP

<?php
// Stockholm extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/stockholm
class YellowStockholm {
const VERSION = "0.8.9";
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("coreSettingDirectory").$this->yellow->system->get("coreSystemFile");
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->system->getValues("theme"), array("stockholm")));
$this->yellow->system->save($fileName, array("theme" => $theme));
}
}
}