function generateContent()
 {
     $content = '
     <h1>' . _('Proposed exercised') . '</h1>
     ';
     if (LoginManager::isLogged() && LoginManager::isAdministrator()) {
         $content .= $this->displayContent();
     } else {
         $content .= "<p>You must be logged as administrator to access to proposed exercises.</p>";
         $content .= '<p><a href="' . RessourceManager::getInnerUrl('special/login/login_form') . '">' . _('Go to login page') . '</a></p>';
     }
     return $content;
 }
Beispiel #2
0
 function execute()
 {
     $this->content = '
     <h1>' . _('Logout') . '</h1>';
     if (LoginManager::isLogged()) {
         $this->content .= '
             <p>' . sprintf(_('Logout from \'%s\' success.'), LoginManager::getLogin()) . '</p>';
     } else {
         $this->content .= '
             <p>' . _('You are not logged.') . '</p>';
     }
     $this->content .= '
         <p><a href="' . RessourceManager::getInnerUrl('index') . '">' . _('Return to index') . '</a></p>';
     LoginManager::logout();
 }
 function generateContent()
 {
     $content = '
     <h1>' . _('Add a new exercise') . '</h1>
     ';
     if (LoginManager::isLogged() && LoginManager::isAdministrator()) {
         if ($_SESSION['form_enabled']) {
             $content .= $this->displayForm();
         } else {
             $content .= '
         <p>' . $this->message . '<p/>';
             $content .= '<p><a href="' . RessourceManager::getInnerUrl('exercises/index') . '">' . _('Return to exercises index.') . '</a></p>';
         }
     } else {
         $content .= "<p>You must be logged as administrator to add an exercise.</p>";
         $content .= '<p><a href="' . RessourceManager::getInnerUrl('special/login/login_form') . '">' . _('Go to login page') . '</a></p>';
     }
     return $content;
 }
Beispiel #4
0
 function generateMenu()
 {
     $menu = '
     <div id="menu">';
     $menu .= '
         <ul>
             <li ' . ($this->id == 'index' ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('index') . '/">' . _('Presentation') . '</a></li>
             <li ' . ($this->id == 'download' ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('download') . '/">' . _('Download') . '</a></li>
             <li ' . ($this->id == 'screenshots' ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('screenshots') . '/">' . _('Screenshots') . '</a></li>
             <li ' . ($this->startswith($this->id, 'documentation') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('documentation/index') . '/">' . _('Documentation') . '</a></li>
             <li ' . ($this->startswith($this->id, 'exercises') ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('exercises/index') . '/">' . _('Exercises') . '</a></li>
             <li ' . ($this->id == 'contribute' ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('contribute') . '/">' . _('Contribute') . '</a></li>
             <li ' . ($this->id == 'contacts' ? 'class= "active"' : '') . '><a href="' . RessourceManager::getInnerUrl('contacts') . '/">' . _('Contacts') . '</a></li>
                 <li ' . ($this->id == 'forums' ? 'class= "active"' : '') . '><a href="http://perroquet.b219.org/forums">' . _('Forums') . '</a></li>
         </ul>';
     $subMenu = $this->generateSubMenu();
     if ($subMenu != '') {
         $menu .= '
           
                 <ul>
                 ' . $subMenu . '
                 </ul>
              ';
     }
     if (LoginManager::isLogged()) {
         $userMenu = $this->generateUserMenu();
         if ($userMenu != '') {
             $menu .= '
               
                     <ul>
                     ' . $userMenu . '
                     </ul>
                  ';
         }
         if (LoginManager::isAdministrator()) {
             echo 'plop';
             $adminMenu = $this->generateAdminMenu();
             if ($adminMenu != '') {
                 $menu .= '
                   
                         <ul>
                         ' . $adminMenu . '
                         </ul>
                      ';
             }
         }
     }
     $menu .= '</div>';
     return $menu;
 }