[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_files/shortcode/ -> menu.sc (source)

   1  /* $Id: menu.sc,v 1.27 2006/10/14 13:13:45 lisa_ Exp $ */
   2  global $sql;
   3  global $ns;
   4  global $eMenuList;
   5  global $error_handler;
   6  $tmp = explode(":",$parm);
   7  
   8  if (!array_key_exists($tmp[0],$eMenuList)) {
   9      return;
  10  }
  11  
  12  if (isset($tmp[1]) && $tmp[1] == 'ret') {
  13      ob_start();
  14  }
  15  
  16  foreach($eMenuList[$tmp[0]] as $row)
  17  {
  18      $show_menu = TRUE;
  19      if($row['menu_pages']) {
  20          list($listtype,$listpages) = explode("-",$row['menu_pages']);
  21          $pagelist = explode("|",$listpages);
  22          $check_url = e_SELF.(e_QUERY ? "?".e_QUERY : '');
  23  
  24          if($listtype == '1')  //show menu
  25          {
  26              $show_menu = FALSE;
  27              foreach($pagelist as $p)
  28              {
  29                  if(substr($p, -1) == '!')
  30                  {
  31                      $p = substr($p, 0, -1);
  32                      if(substr($check_url, strlen($p)*-1) == $p)
  33                      {
  34                          $show_menu = TRUE;
  35                      }
  36                  }
  37                  else 
  38                  {
  39                      if(strpos($check_url,$p) !== FALSE)
  40                      {
  41                          $show_menu = TRUE;
  42                      }
  43                  }
  44              }
  45          }
  46          elseif($listtype == '2') //hide menu
  47          {
  48              $show_menu = TRUE;
  49              foreach($pagelist as $p) {
  50                  if(substr($p, -1) == '!')
  51                  {
  52                      $p = substr($p, 0, -1);
  53                      if(substr($check_url, strlen($p)*-1) == $p)
  54                      {
  55                          $show_menu = FALSE;
  56                      }
  57                  }
  58                  else 
  59                  {
  60                      if(strpos($check_url, $p) !== FALSE)
  61                      {
  62                          $show_menu = FALSE;
  63                      }
  64                  }
  65              }
  66          }
  67      }
  68      if($show_menu) {
  69          $mname = $row['menu_name'];
  70          if($error_handler->debug == true) {
  71              echo "\n<!-- Menu Start: ".$mname." -->\n";
  72          }
  73          $sql->db_Mark_Time($row['menu_name']);
  74          if(is_numeric($row['menu_path']))
  75          {
  76              global $tp;
  77              $sql -> db_Select("page", "*", "page_id='".$row['menu_path']."' ");
  78              $page  = $sql -> db_Fetch();
  79              $caption = $tp -> toHTML($page['page_title'], TRUE, 'parse_sc, constants');
  80              $text = $tp -> toHTML($page['page_text'], TRUE, 'parse_sc, constants');
  81              $ns -> tablerender($caption, $text);
  82          }
  83          else
  84          {
  85              if(is_readable(e_LANGUAGEDIR.e_LANGUAGE."/plugins/lan_{$row['menu_path']}.php")) {
  86                  include_once(e_LANGUAGEDIR.e_LANGUAGE."/plugins/lan_{$row['menu_path']}.php");
  87              } elseif (is_readable(e_PLUGIN.$row['menu_path']."/languages/".e_LANGUAGE.".php")) {
  88                  include_once(e_PLUGIN.$row['menu_path']."/languages/".e_LANGUAGE.".php");    
  89              } elseif (is_readable(e_PLUGIN.$row['menu_path']."/languages/".e_LANGUAGE."/".e_LANGUAGE.".php")) {
  90                  include_once(e_PLUGIN.$row['menu_path']."/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");    
  91              } elseif (is_readable(e_LANGUAGEDIR."english/plugins/lan_{$row['menu_path']}.php")) {
  92                  include_once(e_LANGUAGEDIR."English/plugins/lan_{$row['menu_path']}.php");
  93              } elseif (is_readable(e_PLUGIN.$row['menu_path']."/languages/English.php")) {
  94                  include_once(e_PLUGIN.$row['menu_path']."/languages/English.php");
  95              } elseif (is_readable(e_PLUGIN.$row['menu_path']."/languages/English/English.php")) {
  96                  include_once(e_PLUGIN.$row['menu_path']."/languages/English/English.php");
  97              }
  98              
  99              if(file_exists(e_PLUGIN.$row['menu_path']."/".$mname.".php"))
 100              {
 101                  include_once(e_PLUGIN.$row['menu_path']."/".$mname.".php");
 102              }
 103          }
 104          $sql->db_Mark_Time("(After ".$mname.")");
 105          if ($error_handler->debug == true) {
 106              echo "\n<!-- Menu Start: ".$mname." -->\n";            
 107          }
 108      }
 109  }
 110  
 111  if (isset($tmp[1]) && $tmp[1] == 'ret') {
 112      $ret = ob_get_contents();
 113      ob_end_clean();
 114      return $ret;
 115  }


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7