Changeset 347 in t29-www for lib/menu.php
- Timestamp:
- Mar 6, 2013, 3:58:15 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/menu.php
r301 r347 7 7 8 8 require_once dirname(__FILE__).'/messages.php'; 9 require_once dirname(__FILE__).'/logging.php'; 9 10 10 11 class t29Menu { 11 12 public $conf; 12 13 public $xml; 14 public $log; // just for convenience 13 15 14 16 // Bevor es eine ordentliche Dev-Moeglichkeit gibt: Der magische … … 26 28 function __construct($conf_array) { 27 29 $this->conf = $conf_array; 30 $this->log = t29Log::get(); // just for convenience 28 31 29 32 // create a message object if not given … … 70 73 if(!array_reduce(array_map(function($x) use ($fields,$e){ return isset($e[$x]); }, $fields), 71 74 function($a,$b){ return $a && $b;}, true)) { 72 $li = "<li>Fehler in Formatierung!"; 75 $li = "<li><a href='#'>Fehler in Formatierung!<em>Dieser Menüeintrag ist falsch formatiert</em></a></li>"; 76 $this->log->WARN("<h5>Neuigkeiten-Menü: Fehler in Formatierung</h5><p>Ein Eintrag im Neuigkeiten-Menü ist falsch formatiert."); 73 77 } else { 74 78 $url = ($e['link']{0} == '#' ? $this->conf['lang_path'].'/'.self::news_file : '').$e['link']; … … 205 209 /** 206 210 * @arg $xpath_menu_selection one of the horizontal_menu / sidebar_menu consts. 207 **/ 208 function print_menu($xpath_menu_selection) { 211 * @arg $host Instance of t29Host which can be used for link rewriting if given. 212 **/ 213 function print_menu($xpath_menu_selection, $host=null) { 209 214 if($this->xml_is_defective()) { 210 215 print "The Menu file is broken."; … … 254 259 $uld->parentNode->removeChild($uld); 255 260 } 261 } 262 263 // alle Links mittels t29Host umwandeln (idR .php-Endung entfernen), 264 // falls erwuenscht 265 if($host) { 266 $links = $xml->xpath("//a[@href]"); 267 foreach($links as $a) 268 $a['href'] = $host->rewrite_link($a['href']); 256 269 } 257 270
Note: See TracChangeset
for help on using the changeset viewer.