Changeset 350 in t29-www


Ignore:
Timestamp:
Mar 6, 2013, 5:42:27 AM (10 years ago)
Author:
sven
Message:
  • Eintrag "Pianola" unter Lernprojekten geht jetzt auch auf Geraete-Extraseite "Funktionserklaerung" statt auf Lernprojekt
  • Halbe Implementierung von durch linkspezifische Attribute seitenweise ein/ausstellbare Relationsnavigationssichtbarkeit, Ticket #6.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • de/lernprojekte/index.php

    r344 r350  
    5757
    5858<table>
    59 <tr><th><a href="pianola">Pianola</a>          <td>Funktionserklärung und Entwurf einer Präsentation
     59<tr><th><a href="/de/geraete/pianola-funktionserklaerung/">Pianola</a>          <td>Funktionserklärung und Entwurf einer Präsentation
    6060<tr><th><a href="schach">Schach</a>            <td>Anleitung für ein Schachspiel gegen den PDP 8 Computer mit 8KB Arbeitsspeicher (freier Zugriff, kein Passwort erforderlich)
    6161<tr><th><a href="speichermedien">Speichermedien</a>   <td>Entwurf einer Präsentation über historische Speichermedien
  • lib/menu.php

    r348 r350  
    114114                        return null;
    115115                }
    116                 if(!$seiten_id) $seiten_id = $this->conf['seiten_id'];
     116                if(!$seiten_id) $seiten_id = $this->conf['seiten_id'];
    117117                // convenience: If you found your link already.
    118118                if($seiten_id instanceof SimpleXMLElement) return $seiten_id;
     
    153153                $parent_ul = array_pop($ul);
    154154                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();
    155168        }
    156169
     
    216229        ///////////////////// MENU ACTIVE LINK DETECTION
    217230        /**
     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         *
    218238         * @arg $xpath_menu_selection  one of the horizontal_menu / sidebar_menu consts.
    219239         * @arg $host Instance of t29Host which can be used for link rewriting if given.
     240         * @returns nothing, since the output is printed out
    220241         **/
    221242        function print_menu($xpath_menu_selection, $host=null) {
     
    234255                }
    235256                $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                */
    236264
    237265                // aktuelle Seite anmarkern und Hierarchie hochgehen
  • lib/template.php

    r348 r350  
    339339                // it can also be forced with a global setting $force_footer_menu = 1
    340340                $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                */
    341350        ?>
    342351    <footer class="in-sheet <? if(!$print_footer_menu) print "empty-footer"; ?>">
     
    347356                <ul>
    348357                        <?php
    349                           if($print_footer_menu)
     358                          if($print_footer_menu) //|| $show_rel_prev || $show_rel_next)
    350359                                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
    356373                        ?>
    357374                </ul>
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