Changeset 279 in t29-www for lib/template.php


Ignore:
Timestamp:
Jul 19, 2012, 7:10:15 AM (12 years ago)
Author:
sven
Message:

Design: Linkfarben, Footerrelationslinks, Einblendlogik von Relationen.

  • menu.php: Linkdetail-Getter umgeformt
  • template.php: Mehr Daten in bodyclasses und javascriptconfig durchgeben
  • a.go-Doppelfeile, mal testweise per content-before umgesetzt
  • Relationale Navigation huebscher Formatiert, nach dem Vorschlag von Intsar vom 23.04.2012
  • Inhalts-Linkfarben mit dunkler Linkfarbe
  • menu.js: Beam nur anzeigen wenn im Inhalt, ebenso mit Relationslinks (template.php)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/template.php

    r278 r279  
    4040                        $this->conf[$msg] = $this->conf['lang_path'] . $this->msg->_($msg);
    4141
     42                // store informations about the current page
     43                $this->conf['seiten_link'] = $this->menu->get_link();
     44                $this->conf['seite_in_nav'] = $this->menu->get_link_navigation_class($this->conf['seiten_link']);
     45                $this->conf['seite_in_ul'] = $this->menu->get_link_ul_classes($this->conf['seiten_link']);
     46
    4247                // setup body classes:
    43                 $this->body_classes[] = "lang-" . $this->conf['lang'];
    44                 $this->body_classes[] = "page-" . $this->conf['seiten_id'];
    45                 $this->body_classes = array_merge($this->body_classes, $this->menu->get_link_classes());
     48                $body_classprefixes = array(
     49                        // css prefix => configuration array value
     50                        'lang-' => 'lang',
     51                        'page-' => 'seiten_id',
     52                        'in-nav-' => 'seite_in_nav',
     53                        'in-' => 'seite_in_ul',
     54                );
     55                foreach($body_classprefixes as $prefix => $key) {
     56                        if(is_array($this->conf[$key]))
     57                                // append each element of array conf values
     58                                foreach($this->conf[$key] as $x)
     59                                        $this->body_classes[] = $prefix . $x;
     60                        elseif($this->conf[$key]) // skip null/false/empty conf values
     61                                $this->body_classes[] = $prefix . $this->conf[$key];
     62                }
    4663               
    4764                // setup javascript configuration
    48                 $this->javascript_config['lang'] = $this->conf['lang'];
    49                 $this->javascript_config['seiten_id'] = $this->conf['seiten_id'];
     65                $javascript_transfer = array('lang', 'seiten_id', 'seite_in_nav', 'seite_in_ul');
     66                foreach($javascript_transfer as $key)
     67                        $this->javascript_config[$key] = $this->conf[$key];
    5068               
    5169                // get all kind of relations
     
    5876                // FIXME: There is no caching check yet for this setting
    5977                //        (new pagecss file won't be detected and wont purge the tmpl cache)
     78               
     79                // setup html title
     80                $this->conf['html_title'] = '';
     81                if(isset($this->conf['titel']) && !empty($this->conf['titel']))
     82                        $this->conf['html_title'] = $this->conf['titel'] . ' - ';
     83                elseif($this->conf['seiten_id'] == $this->msg->_('homepage-pagename'))
     84                        {} // nop: Startseitentitel soll nur sein "technikum29"
     85                elseif($this->conf['seiten_link'])
     86                        // Titel vom Menu nehmen
     87                        $this->conf['html_title'] = $this->conf['seiten_link'] . ' - ';
     88                $this->conf['html_title'] .= $this->msg->_('html-title');
    6089        }
    6190       
     
    98127<head>
    99128  <meta charset="utf-8">
    100   <title><?php echo isset($this->conf['titel']) ? $this->conf['titel'].' - ' : ''; $p('html-title'); ?></title>
     129  <title><?php echo $this->conf['html_title']; ?></title>
    101130  <meta name="description" content="Produziert am 08.01.2012">
    102131  <meta name="author" content="Sven">
     
    233262                <ul>
    234263                        <?php
     264                          // only print menu when in sidebar where it applies
     265                          if($this->conf['seite_in_nav'] == 'side')
    235266                                foreach($this->page_relations as $rel => $a) {
    236267                                        printf("\t<li class='%s'><a href='%s' title='%s'>%s <strong>%s</strong></a>\n",
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