yellow/system/extensions/stockholm.php

27 lines
1.1 KiB
PHP
Raw Normal View History

2019-02-23 14:04:34 +00:00
<?php
2019-03-04 11:55:24 +00:00
// Stockholm extension, https://github.com/datenstrom/yellow-extensions/tree/master/themes/stockholm
2019-02-23 14:04:34 +00:00
// Copyright (c) 2013-2019 Datenstrom, https://datenstrom.se
// This file may be used and distributed under the terms of the public license.
2019-03-04 11:55:24 +00:00
class YellowStockholm {
const VERSION = "0.8.6";
2019-02-23 14:04:34 +00:00
const TYPE = "theme";
2019-03-18 21:07:19 +00:00
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("coreSettingDir").$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->extensions->getExtensions("theme"), array("stockholm")));
$this->yellow->system->save($fileName, array("theme" => $theme));
}
}
2019-02-23 14:04:34 +00:00
}