Changeset 255 in t29-www for lib/template.php
- Timestamp:
- May 28, 2012, 2:55:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/template.php
r254 r255 12 12 13 13 class t29Template { 14 public $conf; 15 public $menu; 14 private static $legal_pagenames = array( // should be const 15 # lang => file relative to $lang_path, with starting "/". 16 "de" => "/impressum.php", 17 "en" => "/contact.php", 18 ); 19 20 public $conf, $menu, $msg; 21 public $body_classes = array(); 22 public $javascript_config = array(); 16 23 17 24 function __construct($conf_array) { 18 25 $this->conf = $conf_array; 19 26 27 // fill up configuration 28 $this->conf['legal_pagename'] = $this->conf['lang_path'] . self::$legal_pagenames[$this->conf['lang']]; 29 20 30 // create a menu: 21 31 require_once $this->conf['lib'].'/menu.php'; 22 32 $this->menu = new t29Menu($this->conf); 33 34 // create localisation class: 35 require_once $this->conf['lib'].'/messages.php'; 36 $this->msg = new t29Messages($this->conf['lang']); 37 38 // setup body classes: 39 $this->body_classes[] = "lang-" . $this->conf['lang']; 40 $this->body_classes[] = "page-" . $this->conf['seiten_id']; 41 42 // setup javascript configuration 43 $this->javascript_config['lang'] = $this->conf['lang']; 44 $this->javascript_config['seiten_id'] = $this->conf['seiten_id']; 23 45 } 24 46 … … 57 79 58 80 function print_header() { 81 $_ = $this->msg->get_shorthand_printer(); 59 82 ?> 60 83 <!doctype html> 61 <html class="no-js" lang=" de">84 <html class="no-js" lang="<?php echo $this->conf['lang']; ?>"> 62 85 <head> 63 86 <meta charset="utf-8"> 64 <title><?php isset($this->conf['titel']) ? $this->conf['titel'].' - ' : ''; ?> technikum29</title>87 <title><?php isset($this->conf['titel']) ? $this->conf['titel'].' - ' : ''; $_('html-title'); ?></title> 65 88 <meta name="description" content="Produziert am 08.01.2012"> 66 89 <meta name="author" content="Sven"> … … 75 98 </head> 76 99 77 <body >100 <body class="<?php echo implode(' ', $this->body_classes) ?>"> 78 101 <div id="footer-background-container"><!-- helper --> 79 102 <div id="container"> 80 <h1 role="banner"><a href=" #/" title="Zur technikum29 Startseite">technikum29</a></h1>103 <h1 role="banner"><a href="/" title="<?php $_('head-h1-title'); ?>"><?php $_('head-h1'); ?></a></h1> 81 104 <div id="background-color-container"><!-- helper --> 82 105 <section class="main content" role="main" id="content"> … … 90 113 91 114 function print_footer() { 115 $p = $this->msg->get_shorthand_printer(); 116 $_ = $this->msg->get_shorthand_returner(); 92 117 ?> 93 118 <!-- end content --> … … 95 120 <hr> 96 121 <section class="sidebar"> 97 <h2 class="visuallyhidden"> Museumstour</h2>122 <h2 class="visuallyhidden"><?php $p("sidebar-h2-tour"); ?></h2> 98 123 <nav class="side"> 99 <?php $this->menu->print_menu($this->menu->sidebar_menu); ?> 100 <span class="button collapse-menu">Menü ausklappen</span> 124 <?php $this->menu->print_menu(t29Menu::sidebar_menu); ?> 101 125 </nav> 102 <!-- hier dann die Buttons, die dynamisch erzeugt werden, zum Aufklappen, etc. --> 103 <!-- die werden dann mit Javascript gemacht --> 104 <span class="button get-menu">Menü anzeigen</span> 126 <!-- menu changing buttons are made with javascript --> 105 127 </section> 106 128 </div><!-- div id="background-color-container" helper end --> 107 129 <hr> 108 130 <header class="banner"> 109 <h2 class="visuallyhidden"> Hauptnavigation</h2>131 <h2 class="visuallyhidden"><?php $p("sidebar-h2-mainnav"); ?></h2> 110 132 <nav class="horizontal"> 111 <?php $this->menu->print_menu( $this->menu->horizontal_menu); ?>133 <?php $this->menu->print_menu(t29Menu::horizontal_menu); ?> 112 134 </nav> 113 135 <nav class="top"> 114 <h3 class="visuallyhidden"> Sprachauswahl</h3>136 <h3 class="visuallyhidden"><?php $p("sidebar-h2-lang"); ?></h3> 115 137 <ul> 116 <li class="active"><a href="#">Deutsch</a> 117 <li><a href="#">Englisch</a> 138 <?php 139 foreach($this->conf['languages'] as $l => $sets) { 140 printf("\t\t\t\t<li%s><a href='%s' title='%s'>%s</a></li>\n", 141 ($l == $this->conf['lang'] ? ' class="active"' : ''), 142 $sets[1].'#', 143 "View in $sets[0]", 144 $sets[0] 145 ); 146 147 } 148 ?> 118 149 </ul> 119 <form method="get" action="#"> 120 <span class="no-js">Suchen:</span> 121 <input type="text" value="" data-defaultvalue="Suchen" name="q" class="text"> 122 <input type="submit" value="Suchen" class="button"> 150 <form method="get" action="#"><?php printf(' 151 <span class="no-js">%s:</span> 152 <input type="text" value="" data-defaultvalue="%s" name="q" class="text"> 153 <input type="submit" value="%s" class="button"> 154 ', $_('sidebar-search-label'), $_('sidebar-search-label'), $_('sidebar-search-label')); ?> 123 155 </form> 124 156 </nav> … … 140 172 <div class="right"> 141 173 <img src="/shared/img-v6/logo.footer.png" title="technikum29 Logo" alt="Logo" class="logo"> 142 © 2003-2012 technikum29.143 <br/>< a href="/de-v6/impressum.php">Impressum und Kontakt</a>174 <?php $p('footer-copyright-tag'); ?> 175 <br/><?php printf('<a href="%s">%s</a>', $this->conf['legal_pagename'], $_('footer-legal-link')); ?> 144 176 <div class="icons"> 145 <a href=" /de-v6/impressum.php#image-copyright"><img src="/shared/img-v6/cc-icon.png"></a>177 <a href="<?php echo $this->conf['legal_pagename']; ?>#image-copyright"><img src="/shared/img-v6/cc-icon.png"></a> 146 178 <!--<a href="http://ufopixel.de" title="Designed by Ufopixel"><img src="http://svenk.homeip.net/dropbox/Ufopixel/Ufopixel-Design/logo_90x30/ufopixel_logo_90x30_version2.png"></a>--> 147 179 </div> … … 164 196 <script>window.jQuery || document.write('<script src="/shared/js-v6/libs/jquery-1.6.2.min.js"><\/script>')</script> 165 197 166 167 <script defer src="/shared/js-v6/plugins.js"></script> 168 <script defer src="/shared/js-v6/script.js"></script> 198 <script src="/lib/messages.php?pre=t29MSGDATA%3D&post=<?php echo urlencode('$(function(){t29.msg.setup();});'); ?>"></script> 199 <script>$(function(){t29.config = <?php print json_encode($this->javascript_config); ?>; });</script> 200 <script src="/shared/js-v6/plugins.js"></script> 201 <script src="/shared/js-v6/script.js"></script> 169 202 </div><!-- end of div id="footer-background-container" helper --> 170 203 </body>
Note: See TracChangeset
for help on using the changeset viewer.