示例#1
0
文件: ui.php 项目: keverage/adminserv
 /**
  * Ititialise une page en back office
  */
 public static function initBackPage()
 {
     global $client, $data, $args;
     // Pages list
     $pagesList = array('general', 'srvopts', 'gameinfos', 'chat', 'plugins-list', 'guestban');
     $pagesList = array_merge($pagesList, array_keys(ExtensionConfig::$MAPSMENU));
     $firstPage = array_shift($pagesList);
     // Render page
     if (in_array(USER_PAGE, $pagesList)) {
         $pageKey = array_search(USER_PAGE, $pagesList);
         if (AdminServAdminLevel::hasAccess($pagesList[$pageKey])) {
             self::renderPage($pagesList[$pageKey]);
         } else {
             $data = array('errorTitle' => Utils::t('Erreur d\'accès à la page'), 'errorMessage' => Utils::t('Vous n\'avez pas les droits requis pour accéder à cette page. Veuillez contacter votre administrateur.'));
             self::renderPage('page-error');
         }
     } else {
         if (self::isPageType('config')) {
             session_unset();
             session_destroy();
             Utils::redirection(false, './config/');
         } elseif (USER_PLUGIN) {
             AdminServPlugin::renderPlugin();
         } else {
             self::renderPage($firstPage);
         }
     }
 }
示例#2
0
<?php

if (!empty($data['menuList'])) {
    ?>
	<nav class="vertical-nav">
		<ul>
			<?php 
    foreach ($data['menuList'] as $page => $title) {
        ?>
				<?php 
        if (AdminServAdminLevel::hasAccess($page)) {
            ?>
					<li><a <?php 
            if (USER_PAGE == $page) {
                echo 'class="active"';
            }
            ?>
href="?p=<?php 
            echo $page;
            if ($args['directory']) {
                echo '&amp;d=' . $args['directory'];
            }
            ?>
"><?php 
            echo Utils::t($title);
            ?>
</a></li>
				<?php 
        }
        ?>
			<?php 
示例#3
0
        }
        ?>
" href="?p=gameinfos"><?php 
        echo Utils::t('Game infos');
        ?>
</a></li>
								<?php 
    }
    ?>
								<?php 
    if (AdminServAdminLevel::hasAccess('chat')) {
        ?>
									<li><a tabindex="5" class="button light<?php 
        if (USER_PAGE == 'chat') {
            echo ' active';
        }
        ?>
" href="?p=chat"><?php 
        echo Utils::t('Chat');
        ?>
</a></li>
								<?php 
    }
    ?>
								<?php 
    if (AdminServAdminLevel::hasAccess('maps_list')) {
        ?>
									<li><a tabindex="6" class="button light<?php 
        if (AdminServUI::isPageType('maps')) {
            echo ' active';
        }