コード例 #1
0
ファイル: user_ui.php プロジェクト: decima/M2-platine
 public static function permissions_page()
 {
     page::title("Permissions");
     $out = page::link("admin/permissions/scan", "scan for more permissions");
     $out .= "<form method='post' action='" . page::url("admin/permissions/update") . "'>";
     $array = array();
     $header = array("permissions");
     $groups = user_access::get_all_roles();
     foreach ($groups as $g) {
         $header[] = $g->groupname;
     }
     $perms = permission::get_all_permissions();
     foreach ($perms as $p) {
         $t_array = array();
         $t_array[] = "<b>{$p->permission}</b> <i>{$p->description}</i>";
         foreach ($groups as $g) {
             $o = "<input type='checkbox' name='permissions[" . $p->permission . "][" . $g->gid . "]' ";
             if (user::has_permission($p->permission, $g->gid)) {
                 $o .= "checked";
             }
             $o .= "/>";
             $t_array[] = $o;
         }
         $array[] = $t_array;
     }
     $out .= theme::t_table($array, $header);
     $out .= "<input type='submit' value='update'/>";
     $out .= "</form>";
     return $out;
 }
コード例 #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;
 }
コード例 #3
0
ファイル: module_manager.php プロジェクト: decima/M2-platine
 public static function page_list_modules()
 {
     page::title("Modules");
     $res = array();
     $head = array("module", "action");
     $modules = module_manager::list_of_declared_modules();
     foreach ($modules as $module) {
         $b = array();
         $b[0] = $module->module_name;
         $b[1] = "";
         if ($module->module_installed && !$module->module_enabled) {
             $b[1] .= page::link("admin/modules/" . $module->module_name . "/enable", "Enable");
             $b[1] .= " / ";
             $b[1] .= page::link("admin/modules/" . $module->module_name . "/uninstall", "Uninstall");
         }
         if ($module->module_installed && $module->module_enabled) {
             $b[1] .= page::link("admin/modules/" . $module->module_name . "/disable", "disable");
         }
         if (!$module->module_installed) {
             $b[1] .= page::link("admin/modules/" . $module->module_name . "/install", "install");
         }
         $res[] = $b;
     }
     $str = '  <a href="' . page::url("admin/modules/scan") . '">Scan for more modules</a><br/>';
     $str .= theme::t_table($res, $head);
     return $str;
 }