linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file common_menu.php

Documentation is available at common_menu.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage admin
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @param  $rub : connu de admin/index.php
  8.  * @access public
  9.  * @license http://opensource.org/licenses/gpl-3.0.html
  10.  */
  11.  
  12. /**
  13. * displayitem()
  14. * affichage des items du menu. Prise en charge de leur ETAT : actif ou non
  15. * 
  16. * @param string $rubactive 
  17. * @param string $currentrub 
  18. * @param string $accesskey 
  19. * @return string $content
  20. */
  21.  
  22. function displayitem($rubactive, $currentrub, $accesskey)
  23. {
  24.     if ($rubactive == $currentrub) {
  25.         $content = "<li><a href=\"index.php?rub=" . $currentrub . "\" class=\"aactif\" accesskey=\"" . $accesskey . "\" title=\"" . $GLOBALS['lang']['menu']['item'] . ' : ' . $GLOBALS['lang']['menu'][$currentrub] . "\">" . $GLOBALS['lang']['menu'][$currentrub] . " <img src=\"../gfx/" .THEME_ADMIN. "/images/admin/puce_menu_select.gif\" width=\"10\" height=\"10\" alt=\"\" id=\"imgmenu\" /></a></li>\n";
  26.     } else {
  27.         $content = "<li><a href=\"index.php?rub=" . $currentrub . "\" accesskey=\"" . $accesskey . "\" title=\"" . $GLOBALS['lang']['menu'][$currentrub] . "\">" . $GLOBALS['lang']['menu'][$currentrub] . "</a></li>\n";
  28.     } 
  29.     return $content;
  30. } 
  31.  
  32. $menu_constructor = '';
  33. if (MOD_PROJECT === 1 && IsSuperAdmin()) $menu_constructor .= displayitem($rub, 'project', 'p');
  34. if (MOD_NEWS === 1 && HaveRight('news')) $menu_constructor .= displayitem($rub, 'news', 'a');
  35. if (MOD_PUBLICATION === 1 && HaveRight('publication')) {
  36.     if ($rub == 'resources' || $rub == 'contents') {
  37.         if (isset($type) && $type == 'W') $menu_constructor .= displayitem('workshop', 'publication', 'd');
  38.         if (isset($type) && $type == 'P') $menu_constructor .= displayitem('publication', 'publication', 'd');
  39.     } else {
  40.         $menu_constructor .= displayitem($rub, 'publication', 'd');
  41.     } 
  42. } 
  43.  
  44. if (MOD_WORKSHOP === 1 && HaveRight('workshop')) {
  45.     if ($rub == 'resources' || $rub == 'content' || $rub == 'workshoprep') {
  46.         if (isset($type) && $type == 'W') $menu_constructor .= displayitem('workshop', 'workshop', 'g');
  47.         if (isset($type) && $type == 'P') $menu_constructor .= displayitem('publication', 'workshop', 'g');
  48.         if ($rub == 'workshoprep') $menu_constructor .= displayitem('workshop', 'workshop', 'g');
  49.     } else {
  50.         $menu_constructor .= displayitem($rub, 'workshop', 'g', $GLOBALS['lang']['menu']);
  51.     } 
  52. } 
  53.  
  54. if (MOD_SDI === 1 && IsSuperAdmin()) $menu_constructor .= displayitem($rub, 'sdi', 'b');
  55. if (MOD_DASHBOARD === 1 && HaveRight('dashboard')) $menu_constructor .= displayitem($rub, 'dashboard', 'i');
  56. if (MOD_YELLOWPAGES === 1 && HaveRight('yellowpages')) $menu_constructor .= displayitem($rub, 'yellowpages', 'y');
  57. if (MOD_NEWSLETTER === 1 && IsSuperAdmin()) $menu_constructor .= displayitem($rub, 'newsletter', 'r');
  58. if (MOD_USER === 1 && IsSuperAdmin()) $menu_constructor .= displayitem($rub, 'user', 'u');
  59. if (MOD_THEME === 1 && IsSuperAdmin()) $menu_constructor .= displayitem($rub, 'theme', 't');
  60. if (MOD_SCALE === 1 && IsSuperAdmin()) $menu_constructor .= displayitem($rub, 'scale', 'e');
  61. if (MOD_LEVEL === 1 && IsSuperAdmin()) $menu_constructor .= displayitem($rub, 'level', 'n');
  62. if (MOD_SYSTEM === 1 && IsSuperAdmin()) $menu_constructor .= displayitem($rub, 'system', 'n');
  63. ?>
  64. <div class="containermenu">
  65. <div class="menu"> 
  66.     <ul>
  67.         <?php echo $menu_constructor; ?>
  68.     </ul>
  69. </div>
  70. <form method="post" action="search.php">
  71.     <div id="containersearch">
  72.         <span><?php echo $GLOBALS['lang']['menu']['search'];?></span>
  73.         <input type="text" name="search" id="searchincome" maxlength="150" accesskey="s" value="" />
  74.         <input type="submit" id="gosearch" name="valid" value="" />
  75.     </div>
  76. </form>

Documentation generated on Sat, 08 Nov 2008 14:51:40 +0100 by phpDocumentor 1.4.1