conf = $conf_array; // fetch the lightweight logging object: require_once $this->conf['lib'].'/logging.php'; $this->log = t29Log::get(); // create a menu: require_once $this->conf['lib'].'/menu.php'; $this->menu = new t29Menu($this->conf); // create localisation class: require_once $this->conf['lib'].'/messages.php'; $this->msg = new t29Messages($this->conf['lang']); // create the ressourceloaders: require_once $this->conf['lib'].'/ressourceloader.php'; $this->rl = array(); foreach(array('js','css') as $type) $this->rl[$type] = t29RessourceLoader::create_from_type($type, $this->conf); // fill up configuration // optional html headers which can be filled by hooks or parts if(!isset($this->conf['header_prepend'])) $this->conf['header_prepend'] = array(); // list // as t29Host for configuration fillup fillup $this->conf['host']->fillup_template_conf($this->conf); // Path names in messages foreach(array('footer-legal-file', 'topnav-search-page') as $msg_id) $this->msg->set($msg_id, $this->conf['lang_path'].$this->msg->_($msg_id)); // store informations about the current page $this->conf['seiten_link'] = $this->menu->get_link(); $this->conf['seite_in_nav'] = $this->menu->get_link_navigation_class($this->conf['seiten_link']); $this->conf['seite_in_ul'] = $this->menu->get_link_ul_classes($this->conf['seiten_link']); // setup body classes: $body_classprefixes = array( // css prefix => configuration array value 'lang-' => 'lang', 'page-' => 'seiten_id', 'in-nav-' => 'seite_in_nav', 'in-' => 'seite_in_ul', ); foreach($body_classprefixes as $prefix => $key) { if(is_array($this->conf[$key])) // append each element of array conf values foreach($this->conf[$key] as $x) $this->body_classes[] = $prefix . $x; elseif($this->conf[$key]) // skip null/false/empty conf values $this->body_classes[] = $prefix . $this->conf[$key]; } // setup javascript configuration $javascript_transfer = array('lang', 'seiten_id', 'seite_in_nav', 'seite_in_ul'); foreach($javascript_transfer as $key) $this->javascript_config[$key] = $this->conf[$key]; // get all kind of relations $this->page_relations = $this->menu->get_page_relations(); $this->interlang_links = $this->menu->get_interlanguage_link(); // check and load additional css $this->conf['pagecss'] = '/shared/css-v6/pagestyles/'.$this->conf['seiten_id'].'.css'; $this->conf['has_pagecss'] = file_exists($this->conf['webroot'].$this->conf['pagecss']); // FIXME: There is no caching check yet for this setting // (new pagecss file won't be detected and wont purge the tmpl cache) // setup html title $this->conf['html_title'] = ''; if(isset($this->conf['titel']) && !empty($this->conf['titel'])) $this->conf['html_title'] = $this->conf['titel'] . ' - '; // Startseite macht ihren Titel jetzt selbst (SEO): //elseif($this->conf['seiten_id'] == $this->msg->_('homepage-pagename')) // {} // nop: Startseitentitel soll nur sein "technikum29" elseif($this->conf['seiten_link']) // Titel vom Menu nehmen $this->conf['html_title'] = $this->conf['seiten_link'] . ' - '; $this->conf['html_title'] .= $this->msg->_('html-title'); } /** * Main caching and output system. * Parameters (global configuration): * skip_cache - if true, skips writing output to cache file * purge_cache - if true, forces creation of new cache file * (does not change behaviour of this file's code) **/ function create_cache($cache_object) { $cache_object->start_cache(array($this, 'print_footer')); $this->print_header(); } /** * Write header and footer in separate cache files. **/ function create_separate_caches($header_cache, $footer_cache) { $header_cache->start_cache(); $this->print_header(); $header_cache->write_cache(); // will also print out header immediately. $footer_cache->start_cache(); $this->print_footer(); $footer_content = $footer_cache->write_cache(null, true); // don't print footer immediately. // print footer on exit. register_shutdown_function(function() use ($footer_content) { print $footer_content; }); } function print_header() { $p = $this->msg->get_shorthand_printer(); $_ = $this->msg->get_shorthand_returner(); ?>