Changeset 252 in t29-www for lib/technikum29.php


Ignore:
Timestamp:
Apr 22, 2012, 5:48:21 PM (12 years ago)
Author:
sven
Message:

Footer verändert, Relationen eingebaut.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/technikum29.php

    r251 r252  
    3535                t29dom_add_class($current_li[0], "current");
    3636                $ancestors = $current_li[0]->xpath("ancestor-or-self::li");
    37                 array_walk($ancestors, function($i){
    38                         t29dom_add_class($i, "active");
    39                 });
     37                array_walk($ancestors, create_function('$i', 't29dom_add_class($i, "active");'));
    4038        }
    4139
     
    5149        print $xml->ul->asXML();
    5250}
     51
     52function print_relations() {
     53        global $lib, $seiten_id;
     54       
     55        $sidebar = simplexml_load_file("$lib/../de-v6/sidebar.xml");
     56        $current_a = $sidebar->xpath("//a[@seiten_id='$seiten_id']");
     57        if(count($current_a)) {
     58                $prev = $current_a[0]->xpath("preceding::a[@seiten_id][1]");
     59                if(count($prev)) {
     60                        $a = $prev[0];
     61                        print "<li class='prev'><a href='$a[href]'>vorherige Seite <strong>$a</strong></a></li>";
     62                }
     63                $next = $current_a[0]->xpath("following::a[@seiten_id][1]");
     64                if(count($next)) {
     65                        $a = $next[0];
     66                        print "<li class='next'><a href='$a[href]'>nächste Seite <strong>$a</strong></a></li>";
     67                }
     68        } else {
     69                print '<li class="start"><a href="#">Starte Führung <strong>Blabla</strong></a>';
     70        }
     71}
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License