public static function getPanel() { if( !Authorization::isAuthorized() ) return; $panelStyles = API::parseStylesFile(CUSTOMPATH.DS."Global.views"); $paneltpl = $panelStyles["VeronicaAdminPanel"][2]; $menuItemtpl = $panelStyles["VeronicaMenuListItem"][2]; $controllers = Api::getCustom("Controller"); $modeles = Api::getCustom("Model"); $user = Authorization::getCurrentUser(); $userpanel = ViewHandler::wrap("CurrentUser", $user[0]); $paneltpl = str_replace("<? echo \$USERPANEL;?>", $userpanel, $paneltpl); $list = ""; foreach ($controllers as $controller){ if($controller::$inAdminPanel){ $l = str_replace("<? echo \$ADDCLICKHANDLER;?>", "Controller.add('".$controller::$name."');", $menuItemtpl); $l = str_replace("<? echo \$CLICKHANDLER;?>", "Controller.openDashboard('".$controller::$name."');", $l); $l = str_replace("<? echo \$COUNT;?>", "Controller.openDashboard('".$controller::$name."');", $l); $list .= str_replace("<? echo \$ALIAS;?>", $controller::$alias, $l); } } $paneltpl = str_replace("<? echo \$MENULIST;?>", $list, $paneltpl); return $paneltpl; }
/** * zobrazi zoznam vsetkych * @global array $ALIEN */ public static function showPermissionsList() { if (!Authorization::getCurrentUser()->hasPermission(38)) { new Notification("Prístup zamietnutý.", "error"); header("Location: ?page=home", false, 301); ob_end_flush(); exit; } global $ALIEN; $ALIEN['HEADER'] = 'Zoznam existujúcich oprávnení'; $limit = sizeof(Authorization::$Permissions); for ($i = 1; $i <= $limit; $i++) { $permission = new Permission(Authorization::$Permissions[$i]['label']); echo '<div class="item"><img src="images/icons/shield.png"> ID: ' . $permission->getId() . ' | <strong>' . $permission->getLabel() . '</strong> | ' . $permission->getDescription() . '</div>'; } }