yellow/system/extensions/stockholm.php

24 lines
910 B
PHP
Raw Normal View History

2019-02-23 14:04:34 +00:00
<?php
2020-07-24 08:18:18 +00:00
// Stockholm extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/stockholm
2019-02-23 14:04:34 +00:00
2019-03-04 11:55:24 +00:00
class YellowStockholm {
const VERSION = "0.8.9";
2020-07-24 08:18:18 +00:00
public $yellow; // access to API
2019-03-18 21:07:19 +00:00
// Handle initialisation
public function onLoad($yellow) {
$this->yellow = $yellow;
}
// Handle update
public function onUpdate($action) {
2020-06-25 19:36:27 +00:00
$fileName = $this->yellow->system->get("coreSettingDirectory").$this->yellow->system->get("coreSystemFile");
2019-03-18 21:07:19 +00:00
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")));
2019-03-18 21:07:19 +00:00
$this->yellow->system->save($fileName, array("theme" => $theme));
}
}
2019-02-23 14:04:34 +00:00
}