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

Last change on this file since 567 was 567, checked in by sven, 10 years ago

Den Footer implementiert, der seit langem unter das Design
gehört.

Ausserdem: Beam-Navigation angetestet.

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