예제 #1
0
파일: init.php 프로젝트: decima/M2-platine
function system_theme_action()
{
    $declared_themes = theme::list_of_declared_themes();
    foreach ($declared_themes as $theme) {
        if ($theme->action != null) {
            theme::update_action($theme->theme_name);
            switch ($theme->action) {
                case "setdefault":
                    theme::action_set_default($theme->theme_name);
                    break;
                case "disable":
                    theme::action_disable_theme($theme->theme_name);
                    break;
                case "enable":
                    theme::action_enable_theme($theme->theme_name);
                    break;
            }
        }
    }
}
예제 #2
0
파일: theme.php 프로젝트: decima/M2-platine
 public static function theme_list()
 {
     page::title("Themes");
     $array = array();
     $header = array("theme", "path", "action");
     $themes = theme::list_of_declared_themes();
     foreach ($themes as $theme) {
         $res = "";
         if ($theme->theme_enabled && !$theme->theme_default) {
             $res = page::link("admin/themes/" . $theme->theme_name . "/setdefault", "Set default");
             $res .= " / ";
             $res .= page::link("admin/themes/" . $theme->theme_name . "/disable", "disable");
         }
         if ($theme->theme_enabled && $theme->theme_default) {
             $res = "<big>default theme</big>";
         }
         if (!$theme->theme_enabled) {
             $res = page::link("admin/themes/" . $theme->theme_name . "/enable", "enable");
         }
         $array[] = array($theme->theme_name, "<small>" . $theme->theme_path . "</small>", $res);
     }
     $str = '  <a href="' . page::url("admin/themes/scan") . '">Scan for more Themes</a><br/>';
     $str .= theme::t_table($array, $header);
     return $str;
 }