source: t29-www/lib/template.php @ 1489

Last change on this file since 1489 was 1380, checked in by sven, 6 years ago

Füge Touch-Icon für Website hinzu (wird u.a. mittlerweile im Firefox als Icon angezeigt).

  • Property svn:keywords set to Id
File size: 21.7 KB
Line 
1<?php
2/**
3 * technikum29v6 Page Template.
4 * Initially written 08.01.2012, Sven Koeppel
5 *
6 * This file contains the t29v6 HTML5 template (header, footer, structure, ...).
7 *
8 * Global vars:
9 *  $lang = de | en
10 *  $seiten_id = kurzkennung der aktuellen seite
11 *  $root = Seiten-Root fuer URLs ($root/de, $root/shared, etc.)
12 *  $titel = Seitentitel
13 *  $header_cache_file, $footer_cache_file.
14 **/
15
16class t29Template {
17        public $conf, $menu, $msg;
18        public $body_classes = array();
19        public $javascript_config = array();
20        public $page_relations, $interlang_links;
21        public $log; // lightweight logging system
22
23        /**
24         * The t29Template constructor.
25         *
26         * The template class is embedded into the t29v6 class framework. It
27         * uses t29Log for logging, t29Messages for any localisation strings,
28         * t29RessourceLoader for resolving URLs for CSS and JavaScript ressources.
29         * t29Menu is a helper class considered for parsing and extracting
30         * any relations between pages and the menu from navigation.xml.
31         *
32         * From the t29v6 entrypoint, technikum29.php, this class is instanced
33         * at the end, if no caching has worked. That call looks like
34         *
35         *   $template = new t29Template($GLOBALS);
36         *
37         * which means that our configuration $this->conf will be set up from the
38         * former global namespace. For correct working, at least some global vars
39         * like
40         *   $lib
41         *   $lang
42         *   $host
43         *   ...
44         * are considered as present (see above for a list).
45         *
46         **/
47        function __construct($conf_array) {
48                $this->conf = $conf_array;
49               
50                // fetch the lightweight logging object:
51                require_once $this->conf['lib'].'/logging.php';
52                $this->log = t29Log::get();
53               
54                // create a menu, if not given:
55                require_once $this->conf['lib'].'/menu.php';
56                $this->menu = isset($this->conf['menu']) ? $this->conf['menu'] : new t29Menu($this->conf);
57
58                // create localisation class:
59                require_once $this->conf['lib'].'/messages.php';
60                $this->msg = new t29Messages($this->conf['lang']);
61               
62                // create the ressourceloaders:
63                require_once $this->conf['lib'].'/ressourceloader.php';
64                $this->rl = array();
65                foreach(array('js','css') as $type)
66                        $this->rl[$type] = t29RessourceLoader::create_from_type($type, $this->conf);
67
68                // fill up configuration
69               
70                // optional html headers which can be filled by hooks or parts
71                if(!isset($this->conf['header_prepend']))
72                        $this->conf['header_prepend'] = array(); // list
73                elseif(is_string($this->conf['header_prepend']))
74                        $this->conf['header_prepend'] = array($this->conf['header_prepend']); // string to list
75
76                // optional body css classes which can be filled by hooks or parts
77                if(!isset($this->conf['body_classes_append']))
78                        $this->conf['body_classes_append'] = array();
79
80                // ask t29Host for configuration fillup
81                $this->conf['host']->fillup_template_conf($this->conf);
82                $this->body_classes += $this->conf['body_classes_append'];
83               
84                // Path names in messages
85                foreach(array('footer-legal-file', 'topnav-search-page') as $msg_id)
86                        $this->msg->set($msg_id, $this->conf['lang_path'].$this->msg->_($msg_id));
87
88                // store informations about the current page
89                $this->conf['seiten_link'] = $this->menu->get_link();
90                $this->conf['seite_in_nav'] = $this->menu->get_link_navigation_class($this->conf['seiten_link']);
91                $this->conf['seite_in_ul'] = $this->menu->get_link_ul_classes($this->conf['seiten_link']);
92
93                // setup body classes:
94                $body_classprefixes = array(
95                        // css prefix => configuration array value
96                        'lang-' => 'lang',
97                        'page-' => 'seiten_id',
98                        'in-nav-' => 'seite_in_nav',
99                        'in-' => 'seite_in_ul',
100                );
101                foreach($body_classprefixes as $prefix => $key) {
102                        if(is_array($this->conf[$key]))
103                                // append each element of array conf values
104                                foreach($this->conf[$key] as $x)
105                                        $this->body_classes[] = $prefix . $x;
106                        elseif($this->conf[$key]) // skip null/false/empty conf values
107                                $this->body_classes[] = $prefix . $this->conf[$key];
108                }
109               
110                // setup javascript configuration
111                $javascript_transfer = array('lang', 'seiten_id', 'seite_in_nav', 'seite_in_ul');
112                foreach($javascript_transfer as $key)
113                        $this->javascript_config[$key] = $this->conf[$key];
114                // also collect data from other classes, e.g. t29Host:
115                $this->javascript_config['web_prefix'] = $this->conf['host']->web_prefix;
116               
117                // get all kind of relations. Pages can afterwards be overwritten with t29Template
118                // methods (see below).
119                $this->page_relations = $this->menu->get_page_relations();
120                $this->interlang_links = $this->menu->get_interlanguage_link();
121                $this->current_link_classes = $this->menu->get_link_classes();
122
123                // as a service for CSS, show all link classes in the body
124                // (added quite lately in dec 2016 as a patchy way to tag pages)
125                $this->body_classes = array_merge($this->current_link_classes, $this->body_classes);
126               
127                // 2017-06-26: Another design review, this time by switching between CSS classes.
128                $this->body_classes[] = "design-2017-06-26";
129               
130                // check and load additional css.
131                // #51: This is now checked by the site caching in technikum29.php.
132                $this->conf['pagecss'] = $this->conf['host']->ressources_get_pagestyle($this->conf['seiten_id']);
133                $this->conf['has_pagecss'] = file_exists($this->conf['webroot'].$this->conf['pagecss']);
134               
135                // setup html title
136                $this->conf['html_title'] = '';
137                if(isset($this->conf['titel']) && !empty($this->conf['titel']))
138                        $this->conf['html_title'] = $this->conf['titel'] . ' - ';
139                // Startseite macht ihren Titel jetzt selbst (SEO):
140                //elseif($this->conf['seiten_id'] == $this->msg->_('homepage-pagename'))
141                //      {} // nop: Startseitentitel soll nur sein "technikum29"
142                elseif($this->conf['seiten_link'])
143                        // Titel vom Menu nehmen
144                        $this->conf['html_title'] = $this->conf['seiten_link'] . ' - ';
145                $this->conf['html_title'] .= $this->msg->_('html-title');
146               
147                // Unfortunately mostly a t29Template instance won't be visible to a page
148                // handled by technikum29.php. Therefore there is this small "future" trick:
149                if(isset($this->conf['template_callback']))
150                        $this->conf['template_callback']($this);
151                // Now you can use code like
152                // $template_callback = function($template) {
153                //    $template->set_page_relation("next", "/de/example", "foo");
154                //    $template->menu->... read and modify anything ... etc
155                // }
156                // so the callback function is called at the end of the template constructor.
157                // This can be considered whenever giving a static configuration variables
158                // is not enough.
159        }
160       
161        /**
162         * Overwrite the page relations given by the t29Menu.
163         * By setting $relation to "prev" or "next", you can overwrite the
164         * relations which has been set up by construction by $this->menu->get_page_relations().
165         * Thus any page can state any relations. For sure they are only one-directional,
166         * the other pages don't know anything about such relations because no vice-versa
167         * introspection can be done.
168         **/
169        function set_page_relation($relation, $href, $label) {
170                // good values for $relation are: "prev", "next".
171                // Link is composed as <a href="$href">$label</a>.
172                $this->page_relations[$relation] = t29Menu::dom_new_link($href, $label);
173                //print_r($this->page_relations);
174        }
175
176        /**
177         * Overwrite the interlanguage link list given by the t29Menu.
178         * This does the same as set_page_relation() only for interlanguage links.
179         **/
180        function set_interlang_link($lang, $href, $label) {
181                // good values for $lang are: "de", "en".
182                // Link is composed as <a href="$href">$label</a>.
183                $this->interlang_links[$lang] = t29Menu::dom_new_link($href, $label);
184        }
185       
186        /**
187         * Main caching and output system.
188         * Parameters (global configuration):
189         *    skip_cache  -  if true, skips writing output to cache file
190         *    purge_cache -  if true, forces creation of new cache file
191         *                   (does not change behaviour of this file's code)
192         **/
193        function create_cache($cache_object) {
194                $cache_object->start_cache(array(
195                        'shutdown_func' => array($this, 'print_footer'), // print the footer with it
196                        'filter_func'   => $this->conf['host']->has_web_prefix ? 
197                                array($this, 'rewrite_page_prefix_links') : null, // Entrypoint for URL and content rewriting!
198                ));
199                // directly start header printing
200                $this->print_header();
201        }
202       
203        /**
204         * Write header and footer in separate cache files.
205         **/
206        function create_separate_caches($header_cache, $footer_cache) {
207                $header_cache->start_cache(array(
208                         // start with no shutdown, filter, nor writing
209                        'filter_func' => $this->conf['host']->has_web_prefix ? array($this, 'rewrite_page_prefix_links') : null,
210                        'write_cache' => false,
211                ));
212                $this->print_header();
213                $header_cache->write_cache(); // will also print out header immediately.
214               
215                $footer_cache->start_cache(array(
216                         // start with no shutdown, filter, nor writing
217                        'filter_func' => $this->conf['host']->has_web_prefix ? array($this, 'rewrite_page_prefix_links') : null,
218                        'write_cache' => false,
219                ));
220                $this->print_footer();
221                $footer_content = $footer_cache->write_cache(null, true); // don't print footer immediately.
222               
223                // print footer on exit.
224                register_shutdown_function(function() use ($footer_content) {
225                        print $footer_content;
226                });
227        }
228
229        function print_header() {
230                $p = $this->msg->get_shorthand_printer(); // t29Messages gettext printer
231                $_ = $this->msg->get_shorthand_returner(); // t29Messages gettext
232                $href = $this->conf['host']->get_shorthand_link_returner(); // t29Host link rewriter
233?>
234<!doctype html>
235<html class="no-js" lang="<?php echo $this->conf['lang']; ?>">
236<head>
237  <meta charset="utf-8">
238  <title><?php echo $this->conf['html_title']; ?></title>
239  <meta name="author" content="technikum29-Team">
240  <meta name="generator" content="<?php print $this->conf['host']; ?>">
241  <meta name="t29.cachedate" content="<?php print date('r'); ?>">
242  <?php
243        foreach($this->conf['header_prepend'] as $h) print $h."\n  ";
244       
245        $indicators = array('ajax', 'external');
246        foreach($indicators as $key)
247                if($this->conf[$key]) print "\n  <meta name='t29.$key' content='true'>";
248 
249        if(isset($this->conf['version'])) printf('<meta name="t29.version" content="%s">', $this->conf['version']);
250        if(isset($_GET['debug']))
251                foreach(explode(' ','debug rl_debug skip_cache purge_cache verbose_cache') as $x)
252                        printf("\n  <meta name='t29.template.data-%s' content='%s'>", $x, isset($_GET[$x])?'true':'false');
253  ?>
254 
255  <?php
256        foreach(array_merge(
257                array("first" => t29Menu::dom_new_link($this->conf['lang_path'], $_('head-rel-first'))),
258                $this->page_relations
259        ) as $rel => $a) {
260                if($rel == 'start') continue; // not in standard
261                printf("\n  <link rel='%s' href='%s' title='%s' />",
262                        $rel, $href($a['href']), sprintf($_('head-rel-'.$rel), $this->relational_link_to_string($a))
263                );
264        }
265  ?>
266 
267  <link rel="copyright" href="<?php print $href($_('footer-legal-file')); ?>" title="<?php $p('footer-legal-link'); ?>">
268  <link rel="search" type="application/opensearchdescription+xml" href="<?php print $href($_('topnav-search-page')); print '?action=opensearch-desc&amp;lang='.$this->conf['lang']; ?>" title="<?php $p('opensearch-desc'); ?>">
269  <link rel="alternate" type="application/rss+xml" href="/<?php print $this->conf['lang']; ?>/news.php?format=rss" title="<?php $p('rss-title'); ?>" />
270  <?php
271        // print interlanguage links for all languages except the active one
272        foreach($this->interlang_links as $lang => $a) {
273                if($lang != $this->conf['lang'] && !is_null($a)) {
274                        printf('<link rel="alternate" href="%s" hreflang="%s" title="%s">',
275                                $href($a['href']), $lang, $this->relational_link_to_string($a)
276                        );
277                }
278        }
279  ?>
280       
281  <!-- bigger favicons -->
282  <link rel="apple-touch-icon" type="image/x-icon" href="/shared/img-v6/touch-icon.png" />
283  <!--
284  <link rel="apple-touch-icon" type="image/x-icon" href="/shared/img-v6/touch-icon-76.png" sizes="76x76" />
285  <link rel="apple-touch-icon" type="image/x-icon" href="/shared/img-v6/touch-icon-120.png" sizes="120x120" />
286  <link rel="apple-touch-icon" type="image/x-icon" href="/shared/img-v6/touch-icon-152.png" sizes="152x152" />
287  -->
288 
289  <meta name="viewport" content="width=device-width,initial-scale=1">
290 
291  <?php
292        $this->print_ressourceloader_links('css', PHP_EOL . '  <link rel="stylesheet" href="%s">');
293  ?>
294
295  <script src="/shared/js-v6/libs/modernizr-2.0.6.min.js"></script>
296</head>
297
298<body class="<?php echo implode(' ', $this->body_classes) ?>">
299  <div id="container">
300        <h1 role="banner"><a href="/" title="<?php $p('head-h1-title'); ?>"><?php $p('head-h1'); ?></a></h1>
301        <div id="background-color-container"><!-- helper -->
302        <section class="main content" role="main" id="content">
303                <ul class="messages panel <?php if($this->log->is_empty()) echo 'empty'; ?> nolist">
304                <?php
305                        // This prints out error messages collected by the log only until this point
306                        $this->log->print_all();
307                        // All log entries generated until final processing will be flushed out at the
308                        // end; a userspace javascript helper will then move them here.
309                ?>
310                </ul>   
311                <!--<header class="teaser">
312                        <h2 id="pdp8L">Wissenschaftliche Rechner und Minicomputer</h2>
313                        <img width=880 src="http://www.technikum29.de/shared/photos/rechnertechnik/univac/panorama-rechts.jpg">
314                </header>-->
315        <!-- start content -->
316<?php 
317} // function print_header().
318
319        function print_footer() {
320                $p = $this->msg->get_shorthand_printer(); // t29Messages gettext printer
321                $_ = $this->msg->get_shorthand_returner(); // t29Messages gettext
322                $href = $this->conf['host']->get_shorthand_link_returner(); // t29Host link rewriter
323               
324        ?>
325        <!-- end content -->
326        </section>
327        <hr>
328        <section class="sidebar top">
329                        <?php /* Platz fuer eigentlich per "Extension" eingepflegtem Inhalt */ ?>
330                        <!-- Box (nur DE), die irgendwie sonst keinen Platz findet: -->
331                        <!--
332                        <?php if(isset($this->conf['lang']) && $this->conf['lang'] == 'de') { ?>
333                        <a class="button alertbox termine" href="/de/#termine">
334                                <strong>Aktuelle Termine</strong>
335                               
336                        </a>
337                        <?php }/* end of lang==de */ ?>
338                        -->
339                       
340                        <h2 class="visuallyhidden" id="tour-navigation"><?php $p("sidebar-h2-tour"); ?></h2>
341                        <?php
342                                $sidebar_contains_menu  = !isset($this->conf['sidebar_content']);
343                        ?>
344                        <nav class="side <?php print $sidebar_contains_menu ? 'contains-menu' : 'contains-custom'; ?>">
345                                <?php
346                                        if(!$sidebar_contains_menu)
347                                                // used in external page calls
348                                                print $this->conf['sidebar_content'];
349                                        else
350                                                $this->menu->print_menu(t29Menu::sidebar_menu, $this->conf['host']);
351                                ?>
352                        </nav>
353                        <!-- menu changing buttons are made with javascript, but  -->
354        </section>
355        <section class="sidebar bottom">
356                <!-- inhalte die unten ueber dem header sind -->
357        </section>
358        </div><!-- div id="background-color-container" helper end -->
359        <hr>
360        <header class="banner">
361                <h2 class="visuallyhidden"><?php $p("sidebar-h2-mainnav"); ?></h2>
362                <nav class="horizontal">
363                        <?php
364                                if(isset($this->conf['mainnav_content']))
365                                        // used in external page calls
366                                        print $this->conf['mainnav_content'];
367                                else
368                                        $this->menu->print_menu(t29Menu::horizontal_menu, $this->conf['host']);
369                        ?>
370                </nav>
371                <nav class="top">
372                        <h3 class="visuallyhidden"><?php $p("sidebar-h2-lang"); ?></h3>
373                        <ul>
374                                <?php
375                                        foreach($this->interlang_links as $lang => $a) {
376                                                $is_current_lang = $lang == $this->conf['lang'];
377                                                if(is_null($a)) {
378                                                        // when interlanguage link not present (null) = no translation exists
379                                                        $backtitle = isset($this->conf['titel']) ? $this->conf['titel'] : null;
380                                                       
381                                                        $a = t29Menu::dom_new_link(
382                                                                $_('topnav-interlang-nonexistent-page') . '?'
383                                                                   . htmlentities(http_build_query(array(
384                                                                        'backurl' => $_SERVER['REQUEST_URI'],
385                                                                        'backtitle' => $backtitle ? $backtitle : null,
386                                                                     ))),
387                                                                'not present'
388                                                        );
389                                                        $title = sprintf($_('topnav-interlang-nonexistent', $lang));
390                                                        $class = 'nonexistent';
391                                                } elseif($is_current_lang) {
392                                                        $title = sprintf($_('topnav-interlang-active'), $a);
393                                                        $class = 'active';
394                                                } else {
395                                                        // ordinary interlang link
396                                                        $title = sprintf($_('topnav-interlang-title', $lang), $a);
397                                                        $class = '';
398                                                }
399                                                printf("\t\t\t\t<li%s><a href='%s' title='%s'>%s</a></li>\n",
400                                                        (empty($class) ? '' : " class='$class'"),
401                                                        $href($a['href']), htmlspecialchars($title),
402                                                        $this->conf['languages'][$lang][0] // verbose language name
403                                                );
404                                        }
405                                ?>
406                        </ul>
407                        <form method="get" action="<?php $href($p('topnav-search-page')); ?>">
408                                <span class="no-js"><?php $p('topnav-search-label'); ?>:</span>
409                                <input type="text" value="" data-defaultvalue="<?php $p('topnav-search-label'); ?>" name="q" class="text">
410                                <input type="submit" value="<?php $p('topnav-search-label'); ?>" class="button">
411                        </form>
412                </nav>
413    </header>
414        <hr>
415        <?php
416                // only print menu when in sidebar where it applies.
417                // it can also be forced with a global setting $force_footer_menu = 1
418                $print_footer_menu = count($this->page_relations) || isset($this->conf['force_footer_menu']);
419                // old test: ($this->conf['seite_in_nav'] == 'side') || isset($this->conf['force_footer_menu']);
420               
421                // print next or prev entry when the current page has a
422                // "show-rel-next" or "show-rel-prev" class entry
423                $show_rel_next = in_array('show-rel-next', $this->current_link_classes);
424                $show_rel_prev = in_array('show-rel-prev', $this->current_link_classes);
425               
426        ?>
427    <footer class="in-sheet <?php if(!$print_footer_menu) print "empty-footer"; ?>">
428                <nav class="guide">
429                        <!-- hier wird nav.side die Liste per JS reinkopiert -->
430                </nav>
431                <nav class="rel clearfix <?php if(!$print_footer_menu) print "empty"; ?>">
432                <ul>
433                        <?php
434                          //if($print_footer_menu)
435                                foreach($this->page_relations as $rel => $a) {
436                                        // only show the links wanted to be shown. Only relevant if
437                                        // the "show-rel-*"-magic is working.
438                                        if( $print_footer_menu ||
439                                            (!$print_footer_menu && $rel == "prev" && $show_rel_prev) ||
440                                            (!$print_footer_menu && $rel == "next" && $show_rel_next)) {
441                                       
442                                                printf("\t<li class='%s'><a href='%s' title='%s'>%s <strong>%s</strong></a>\n",
443                                                        $rel, $href($a['href']), sprintf($_('head-rel-'.$rel), $this->relational_link_to_string($a)),
444                                                        $_('nav-rel-'.$rel), $this->relational_link_to_string($a)
445                                                );
446                                        } // endif
447                                } // endfor
448                        ?>
449                </ul>
450                </nav>
451                <?php
452                        // packe Bigfooter bei leerem Footer-Menue in footer.in-sheet
453                        if(!$print_footer_menu)
454                                $this->print_footer_text();
455                ?>
456                <div class="right">
457                        <!-- text der rechts unten steht -->
458                </div>
459    </footer>
460  </div> <!--! end of #container -->
461  <footer class="attached">
462    <!--<div class="legacy"><?php $p('footer-legacy-text'); ?></div>-->
463        <?php
464                // packe Bigfooter bei gefuelltem footer.in-sheet nach footer.attached.
465                if($print_footer_menu)
466                        $this->print_footer_text();
467       
468                // pending log messages
469                if(!$this->log->is_empty()) {
470                        echo '<ul class="messages footer nolist">';
471                        $this->log->print_all();
472                        echo '</ul>';
473                }
474        ?>
475  </footer>
476<?php /*</div><!-- end of div id="footer-background-container" helper -->*/ // seems misplaced ?>
477
478  <?php /* JavaScript at the bottom for fast page loading */ ?>
479  <script src="/shared/js-v6/libs/jquery-1.7.2.min.js"></script>
480  <script>window.t29={'conf': <?php print json_encode($this->javascript_config); ?>};</script>
481  <?php
482        $this->print_ressourceloader_links('js', '  <script src="%s"></script>'.PHP_EOL);
483  ?>
484  <?php /* Piwik Noscript, Script selbst wird asynchron im JS-Bereich aufgerufen */ ?>
485  <noscript><img src="<?php $p("js-piwik-noscript-imgsrc"); ?>" alt="" /></noscript>
486  <?php
487        if(isset($this->conf['body_append']))
488                print $this->conf['body_append'];
489  ?>
490</body>
491</html>
492<?php
493        } // function print_footer()
494       
495        /**
496         * Den "Bigfooter"-Text ausgeben.
497         * Hilfsfunktion fuer print_footer().
498         * (Grund: Implementierung als langer String in print_footer() ist unbequem)
499         **/
500        private function print_footer_text() {
501                $p = $this->msg->get_shorthand_printer(); // t29Messages gettext printer
502                $_ = $this->msg->get_shorthand_returner(); // t29Messages gettext
503                $href = $this->conf['host']->get_shorthand_link_returner(); // t29Host link rewriter
504               
505                ?><div class="bigfooter">
506                    <ul class="clearfix">
507                        <li class="haus"><a class="block" href="<?php print $href($_('footer-haus-link')); ?>">
508                                <img src="/shared/img-v6/logo-haus.footer.png" alt="Museum Haus" title="The Museum building">
509                                <span class="p"><?php $p('footer-haus-text'); ?></span>
510                        </a></li>
511                        <li class="copy"><a class="block" href="<?php print $href($_('footer-legal-file')); ?>#image-copyright" class="clearfix">
512                                <i>CC</i>
513                                <span class="p"><?php $p('footer-image-copyright-text'); ?></span>
514                        </a></li>
515                        <li class="logo"><span class="block clearfix"><!-- FIXME: clearfix should be semantically performed -->
516                                <i title="technikum29 Logo">Logo</i>
517                                <span class="p"><?php $p('footer-copyright-tag'); ?>
518                                <br><a class="u" href="<?php print $href($_('footer-legal-file')); ?>"><?php $p('footer-legal-link'); ?></a>
519                                <br><a class="u" href="<?php print $href($_('footer-sitemap-link')); ?>"><?php $p('footer-sitemap-text'); ?></a>
520                                </span>
521                        </span></li>
522
523                    </ul>
524                </div><?php
525        }
526       
527        // Hilfsfunktionen
528        private function relational_link_to_string($a) {
529                // wenn es bei einem relationalen Link einen Titel gibt, diesen ausgeben, ansonsten die
530                // Linkbeschreibung. Die Links sind XML-Elemente in der Navigation.
531                return isset($a['title']) ? $a['title'] : $a;
532        }
533
534        function print_ressourceloader_links($type, $template='<!-- RL: %s -->') {
535                $rl = $this->rl[$type];
536                $rl_links = $rl->get_urls( isset($_GET['rl_debug']) );
537                $rl_pagespecific_links = $rl->get_page_specific_urls($this->conf['seiten_id']);
538
539                foreach(array($rl_links, $rl_pagespecific_links) as $rls) {
540                        foreach($rls as $link) {
541                                // do the host link renaming conversion. This is more important if
542                                // there is a web_prefix than for the suffix rewriting.
543                                $link = $this->conf['host']->rewrite_link($link, true);
544                                printf($template, $link);
545                        }
546                }
547        }
548       
549        function rewrite_page_prefix_links($content) {
550                // called by cache: rewrite the page contents
551                return preg_replace('#(href|src|action)=("|\')/#i', '\\1=\\2'.$this->conf['host']->web_prefix.'/', $content);
552        }
553
554
555} // class t29Template
Note: See TracBrowser for help on using the repository browser.
© 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