- Timestamp:
- Mar 6, 2013, 5:42:27 AM (10 years ago)
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/menu.php
r348 r350 114 114 return null; 115 115 } 116 if(!$seiten_id) 116 if(!$seiten_id) $seiten_id = $this->conf['seiten_id']; 117 117 // convenience: If you found your link already. 118 118 if($seiten_id instanceof SimpleXMLElement) return $seiten_id; … … 153 153 $parent_ul = array_pop($ul); 154 154 return explode(' ',$parent_ul['class']); 155 } 156 157 /** 158 * Extracts a list of (CSS) classes the link has, 159 * e.g. <a class="foo bar"> gives array("foo","basr"). 160 * @returns array or empty array in case of error 161 **/ 162 function get_link_classes($seiten_id=false) { 163 $link = $this->get_link($seiten_id); 164 print "link:"; var_dump($this->xml); 165 if(!$link) return array(); 166 var_dump($link); exit; 167 return isset($link['class']) ? explode(' ',$link['class']) : array(); 155 168 } 156 169 … … 216 229 ///////////////////// MENU ACTIVE LINK DETECTION 217 230 /** 231 * print_menu is the central method in this class. It converts the $this->xml 232 * XML tree to valid HTML with all enrichments for appropriate CSS styling. 233 * It also removes all 'seiten_id' attributes. 234 * This method does *not* clone the structure, so this instance won't produce 235 * the same results any more after print_menu invocation! This especially will 236 * affect get_link(). 237 * 218 238 * @arg $xpath_menu_selection one of the horizontal_menu / sidebar_menu consts. 219 239 * @arg $host Instance of t29Host which can be used for link rewriting if given. 240 * @returns nothing, since the output is printed out 220 241 **/ 221 242 function print_menu($xpath_menu_selection, $host=null) { … … 234 255 } 235 256 $xml = $xml[0]; // just take the first result (should only one result be present) 257 258 /* 259 // work on a deep copy of the data. Thus this method won't make the overall 260 // class useless. 261 $dom = dom_import_simplexml($xml); 262 $xml = simplexml_import_dom($dom->cloneNode(true)); 263 */ 236 264 237 265 // aktuelle Seite anmarkern und Hierarchie hochgehen -
lib/template.php
r348 r350 339 339 // it can also be forced with a global setting $force_footer_menu = 1 340 340 $print_footer_menu = ($this->conf['seite_in_nav'] == 'side') || isset($this->conf['force_footer_menu']); 341 342 /* 343 // print next or prev entry when the current page has a 344 // "show-rel-next" or "show-rel-prev" class entry 345 $current_link_classes = $this->menu->get_link_classes(); 346 print_r($current_link_classes); exit; 347 $show_rel_next = in_array('show-rel-next', $current_link_classes); 348 $show_rel_prev = in_array('show-rel-prev', $current_link_classes); 349 */ 341 350 ?> 342 351 <footer class="in-sheet <? if(!$print_footer_menu) print "empty-footer"; ?>"> … … 347 356 <ul> 348 357 <?php 349 if($print_footer_menu) 358 if($print_footer_menu) //|| $show_rel_prev || $show_rel_next) 350 359 foreach($this->page_relations as $rel => $a) { 351 printf("\t<li class='%s'><a href='%s' title='%s'>%s <strong>%s</strong></a>\n", 352 $rel, $href($a['href']), sprintf($_('head-rel-'.$rel), $this->relational_link_to_string($a)), 353 $_('nav-rel-'.$rel), $this->relational_link_to_string($a) 354 ); 355 } 360 /* 361 // only show the links wanted to be shown. Only relevant if 362 // the "show-rel-*"-magic is working. 363 if( $print_footer_menu 364 (!$print_footer_menu && $rel == "prev" && $show_rel_prev) || 365 (!$print_footer_menu && $rel == "next" && $show_rel_next)) { 366 */ 367 printf("\t<li class='%s'><a href='%s' title='%s'>%s <strong>%s</strong></a>\n", 368 $rel, $href($a['href']), sprintf($_('head-rel-'.$rel), $this->relational_link_to_string($a)), 369 $_('nav-rel-'.$rel), $this->relational_link_to_string($a) 370 ); 371 //} // endif 372 } // endfor 356 373 ?> 357 374 </ul>
Note: See TracChangeset
for help on using the changeset viewer.