Changeset 289 in t29-www
- Timestamp:
- Aug 16, 2012, 8:03:29 PM (12 years ago)
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/menu.php
r279 r289 157 157 } 158 158 159 // helper method 159 // helper methods 160 161 /** Check if a simplexml element has an attribute. Lightweight operation 162 * over the DOM. 163 * @returns boolean 164 **/ 165 public static function dom_has_attribute($simplexml_element, $attribute_name) { 166 $dom = dom_import_simplexml($simplexml_element); // is a fast operation 167 return $dom->hasAttribute($attribute_name); 168 } 169 170 public static function dom_prepend_attribute($simplexml_element, $attribute_name, $content, $seperator='') { 171 if(!is_array($simplexml_element)) $simplexml_element = array($simplexml_element); 172 foreach($simplexml_element as $e) 173 $e[$attribute_name] = $content . (self::dom_has_attribute($e, $attribute_name) ? ($seperator.$e[$attribute_name]) : ''); 174 } 175 176 public static function dom_append_attribute($simplexml_element, $attribute_name, $content, $seperator='') { 177 if(!is_array($simplexml_element)) $simplexml_element = array($simplexml_element); 178 foreach($simplexml_element as $e) 179 $e[$attribute_name] = (self::dom_has_attribute($e, $attribute_name) ? ($e[$attribute_name].$seperator) : '') . $content; 180 } 181 182 /** 183 * Appends a (CSS) class to a simplexml element, seperated by whitespace. Just an alias. 184 **/ 160 185 public static function dom_add_class($simplexml_element, $value) { 161 $dom = dom_import_simplexml($simplexml_element); // is a fast operation 162 $simplexml_element['class'] = 163 ($dom->hasAttribute("class") ? ($simplexml_element['class'].' '):'').$value; 186 self::dom_append_attribute($simplexml_element, 'class', $value, ' '); 164 187 } 165 188 … … 193 216 if(count($current_a)) { 194 217 $current_li = $current_a[0]->xpath("parent::li"); 195 $this->dom_add_class($current_li[0], "current"); 196 $ancestors = $current_li[0]->xpath("ancestor-or-self::li"); 197 array_walk($ancestors, create_function('$i', 't29Menu::dom_add_class($i, "active");')); 218 self::dom_add_class($current_li[0], 'current'); 219 self::dom_prepend_attribute($current_a, 'title', 'Aktuelle Seite', ': '); 220 221 $actives = $current_li[0]->xpath("ancestor-or-self::li"); 222 array_walk($actives, function($i) { t29Menu::dom_add_class($i, 'active'); }); 223 224 $ancestors = $current_li[0]->xpath("ancestor::li"); 225 array_walk($ancestors, function($i) { 226 t29Menu::dom_prepend_attribute($i->xpath("./a[1]"), 'title', 'Übergeordnete Kategorie der aktuellen Seite' , ': '); 227 }); 198 228 } 199 229 -
lib/messages.php
r288 r289 2 2 /** 3 3 * t29v6 Message subsystem. 4 * now with instanciated message overwriting. 4 5 * 5 6 **/ … … 27 28 28 29 /** 30 * Add new messages to the local overwrite array. 31 **/ 32 function set($str_id, $content) { 33 $this->local_msg[$str_id] = $content; 34 } 35 36 /** 29 37 * The translate function, shorthand like the gettext shorthand. 30 38 * There's actually no long method name version :D … … 34 42 **/ 35 43 function _($str_id, $lang=null) { 44 // local overwrites come first 45 if(isset($this->local_msg[$str_id])) 46 return $this->local_msg[$str_id]; 47 36 48 $lang = ($lang && isset(self::$order[$lang])) ? $lang : $this->lang; 37 49 if(!isset(self::$msg[$str_id])) { … … 70 82 * out only matching entries. Example: $filter_regexp = "/^js-/" 71 83 * would filter out all JavaScript related entries. 84 * This method doesn't consider the $local_msg's. 72 85 **/ 73 86 static function create_json($filter_regexp=false) { … … 80 93 )); 81 94 } 95 96 /** 97 * Since the static messages are considered as `const`, any changes/overwrites 98 * will be applied to the instanciated object. Use the gettext for correct 99 * handling. 100 * This array simply maps message id to string without language handling since 101 * the instances don't know languages. 102 */ 103 public $local_msg = array(); 82 104 83 105 /** -
lib/template.php
r279 r289 37 37 // fill up configuration 38 38 // Path names in messages 39 foreach(array('footer-legal-file', 'topnav-search-page') as $msg )40 $this-> conf[$msg] = $this->conf['lang_path'] . $this->msg->_($msg);39 foreach(array('footer-legal-file', 'topnav-search-page') as $msg_id) 40 $this->msg->set($msg_id, $this->conf['lang_path'].$this->msg->_($msg_id)); 41 41 42 42 // store informations about the current page … … 129 129 <title><?php echo $this->conf['html_title']; ?></title> 130 130 <meta name="description" content="Produziert am 08.01.2012"> 131 <meta name="author" content=" Sven">131 <meta name="author" content="technikum29-Team"> 132 132 <meta name="generator" content="t29v6"> 133 133 <meta name="t29.cachedate" content="<?php print date('r'); ?>"> … … 149 149 ?> 150 150 151 <link rel="copyright" href="<?php echo $this->conf['footer-legal-file']; ?>" title="<?php $p('footer-legal-link'); ?>">152 <link rel="search" type="application/opensearchdescription+xml" href="<?php print $this->conf['topnav-search-page'] .'?action=opensearch-desc'; ?>" title="<?php $p('opensearch-desc'); ?>">151 <link rel="copyright" href="<?php $p('footer-legal-file'); ?>" title="<?php $p('footer-legal-link'); ?>"> 152 <link rel="search" type="application/opensearchdescription+xml" href="<?php $p('topnav-search-page'); print '?action=opensearch-desc'; ?>" title="<?php $p('opensearch-desc'); ?>"> 153 153 <?php 154 154 // print interlanguage links for all languages except the active one … … 176 176 177 177 <body class="<?php echo implode(' ', $this->body_classes) ?>"> 178 <div id="footer-background-container"><!-- helper -->179 178 <div id="container"> 180 179 <h1 role="banner"><a href="/" title="<?php $p('head-h1-title'); ?>"><?php $p('head-h1'); ?></a></h1> … … 247 246 ?> 248 247 </ul> 249 <form method="get" action="<?php print $this->conf['topnav-search-page']; ?>">248 <form method="get" action="<?php $p('topnav-search-page'); ?>"> 250 249 <span class="no-js"><?php $p('topnav-search-label'); ?>:</span> 251 250 <input type="text" value="" data-defaultvalue="<?php $p('topnav-search-label'); ?>" name="q" class="text"> … … 255 254 </header> 256 255 <hr> 257 <footer >256 <footer class="in-sheet"> 258 257 <nav class="guide"> 259 258 <!-- hier wird nav.side die Liste per JS reinkopiert --> … … 274 273 </nav> 275 274 <div class="right"> 276 <img src="/shared/img-v6/logo.footer.png" title="technikum29 Logo" alt="Logo" class="logo"> 277 <?php $p('footer-copyright-tag'); ?> 278 <br/><?php printf('<a href="%s">%s</a>', $this->conf['footer-legal-file'], $_('footer-legal-link')); ?> 279 <div class="icons"> 280 <a href="<?php echo $this->conf['footer-legal-file']; ?>#image-copyright"><img src="/shared/img-v6/cc-icon.png"></a> 281 <!--<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>--> 282 </div> 283 <!--CC<br>Viele Bilder können unter einer CreativeCommons-Lizenz 284 verwendet werden. Erkundigen Sie sich.--> 275 <!-- text der rechts unten steht --> 285 276 </div> 286 277 </footer> 287 278 </div> <!--! end of #container --> 279 <footer class="attached"> 280 <ul class="clearfix"> 281 <li class="logo"> 282 <a href="<?php $p('footer-legal-file'); ?>" class="img" title="technikum29 Logo">Logo</a> 283 <p><?php $p('footer-copyright-tag'); ?> 284 <br><?php printf('<a href="%s">%s</a>', $_('footer-legal-file'), $_('footer-legal-link')); ?> 285 </p> 286 </li> 287 <li class="copy"> 288 <a href="<?php $p('footer-legal-file'); ?>#image-copyright" class="img">CC</a> 289 <p>Viele Bilder können unter einer <a href="<?php $p('footer-legal-file'); ?>#image-copyright">CreativeCommons-Lizenz</a> 290 verwendet werden. <a href="<?php $p('footer-legal-file'); ?>#image-copyright">Erkundigen Sie sich</a>.</p> 291 </li> 292 </ul> 293 </footer> 288 294 </div><!-- end of div id="footer-background-container" helper --> 289 295 -
shared/css-v6/modules/01-boilerplate.css
r285 r289 102 102 ul, ol { margin: 1em 0; padding: 0 0 0 40px; } 103 103 dd { margin: 0 0 0 40px; } 104 nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; }104 nav ul, nav ol, footer ul, footer ol { list-style: none; list-style-image: none; margin: 0; padding: 0; } 105 105 106 106 -
shared/css-v6/modules/10-window.css
r281 r289 7 7 8 8 body { 9 /* Hintergrund oben horizontal, fuer unten siehe footer css files */ 9 10 background: #cbc5bd url("/shared/img-v6/bg-v2.body.png") repeat-x; 10 11 } … … 25 26 /*font-family: "Futura Std Book", "Trebuchet MS";*/ 26 27 font-family: "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif; 27 }28 29 #footer-background-container {30 background: url("/shared/img-v6/bg-v2.body-footer.png") bottom left repeat-x;31 padding-bottom: 1px;32 28 } 33 29 -
shared/css-v6/modules/11-header.css
r272 r289 56 56 nav.horizontal .u1 > li:hover > a { 57 57 background-color: white; 58 } 59 60 nav.horizontal .u1 > li.active > a, 61 nav.horizontal .u2 > li.active > a { 62 color: #6F2A41; 58 63 } 59 64 -
shared/css-v6/modules/13-footer.css
r279 r289 11 11 **/ 12 12 13 /* Footer */14 footer {15 clear: both; 13 /* Footer innerhalb des Blattes, mit Navigationselementen */ 14 footer.in-sheet { 15 clear: both; padding-top: 1px; /* um margin innerer elemente an der oberkante beginnen zu lassen */ 16 16 height: 104px; width: 100%; 17 17 /* temp. um Navi-Kram zu uebermalen: */ … … 26 26 position: absolute; 27 27 z-index: 5; /* ueber nav.rel */ 28 top: -5px; left: -5px; 29 width: 910px; margin: 0 25px; /* wie #content, in breite ein paar px mehr wegen ueberstehenden bullets */28 top: -5px; left: -5px; /* damit bullets rausschauen */ 29 width: 870px; margin: 0 40px; /* wie #content, in breite ein paar px mehr wegen ueberstehenden bullets */ 30 30 /* width:900px, aber 10px Toleranz damit der Beam nicht umbricht wenn 31 31 eine ungerade Anzahl an Items vorhanden ist (1px Toleranz wuerde schon reichen) */ … … 118 118 /* Relationale Navigation */ 119 119 nav.rel { 120 height: 20px; 121 position: absolute; 122 top: 17px; left: 0; 123 z-index: 0; 124 width: 940px; 125 text-align: center; 126 } 120 position: relative; 121 margin: 26px 70px 0; 122 width: 800px; 123 } 124 125 nav.rel li { 126 position: absolute; 127 top: 0; 128 } 129 130 nav.rel li.prev { left: 0; } 131 nav.rel li.next { right: 0; } 127 132 128 133 nav.rel a { … … 130 135 text-transform: uppercase; 131 136 display: inline-block; 132 padding: 1 5px;133 134 font-size: 1 5px;137 padding: 10px; 138 line-height: 17px; 139 font-size: 14px; 135 140 color: rgba(65,111,124,.85); /*#416f7c;*/ 136 background-color: #dfe9f0;141 /*background-color: #dfe9f0;*/ 137 142 138 143 font-weight: bold; 139 144 140 145 position: relative; 141 height: 40px;/* wegen arrow: height+2*padding=arrowheight */146 /*height: 40px; *//* wegen arrow: height+2*padding=arrowheight */ 142 147 } 143 148 … … 148 153 } 149 154 150 nav.rel .prev a { 151 text-align: right; 152 } 153 nav.rel .next a { 154 text-align: left; 155 } 155 nav.rel li.prev a { text-align: right; padding-right: 16px; } 156 nav.rel li.next a { text-align: left; padding-left: 16px; } 156 157 157 158 nav.rel a:after { … … 160 161 position: absolute; 161 162 top: 0; 162 border-top: 35px solid transparent;163 border-bottom: 35px solid transparent;164 border-left: 30px solid #dfe9f0;165 border-right: 30px solid #dfe9f0;166 } 167 168 nav.rel a: hover:after {163 border-top: 27px solid transparent; 164 border-bottom: 27px solid transparent; 165 border-left: 24px solid #dfe9f0; 166 border-right: 24px solid #dfe9f0; 167 } 168 169 nav.rel a:focus:after, nav.rel a:active:after { 169 170 border-left-color: #40a8e2; 170 171 border-right-color: #40a8e2; … … 172 173 173 174 nav.rel .next a:after { 174 right: - 30px;175 right: -24px; 175 176 border-right: none; 176 177 } 177 178 178 179 nav.rel .prev a:after { 179 left: - 30px;180 left: -24px; 180 181 border-left: none; 181 182 } 182 183 183 184 nav.rel a:hover { 185 background-color: #dfe9f0; 186 } 187 188 nav.rel a:active, nav.rel a:focus { 184 189 background-color: #40a8e2; 185 190 color: white; … … 187 192 188 193 /* Footer Icon-Sammlung und so */ 194 /* 189 195 footer .right { 190 196 position: absolute; … … 210 216 footer .right .icons a { opacity: .5; } 211 217 footer .right .icons a:hover, footer .right .icons a:focus { opacity: 1; } 218 */ 219 220 /* Post-Footer */ 221 footer.attached { 222 /* @embed */ background: #307588 url("/shared/img-v6/bg-v2.body-footer.png") top left repeat-x; 223 margin-top: -122px; 224 padding: 122px; 225 226 color: white; 227 font-size: 14px; 228 } 229 230 footer.attached ul { 231 width: 1170px; 232 margin: 10px auto 20px; 233 /* padding: 0 20px; *//* ueberfluessig, Breite allein reguliert schon */ 234 } 235 236 footer.attached li { 237 width: 370px; 238 margin-right: 10px; 239 float: left; 240 } 241 242 footer.attached a:link, footer.attached a:visited { 243 color: #BAF1FF; 244 } 245 246 footer.attached a:hover { 247 color: #3DD8FF; 248 } 249 250 footer.attached a.img { 251 display: block; 252 float: left; 253 text-indent: -999px; 254 } 255 256 footer.attached p { 257 margin-left: 80px; 258 margin-top: 0px; 259 line-height: 115%; 260 } 261 262 263 footer.attached li.logo a.img { 264 background-image: url("/shared/img-v6/logo.footer.png"); 265 width: 46px; height: 59px; 266 } 267 footer.attached li.logo p { margin-left: 60px; } 268 269 footer.attached li.copy a.img { 270 background-image: url("/shared/img-v6/cc-icon.png"); 271 width: 90px; height: 30px; 272 } 273 footer.attached li.copy p { margin-left: 110px; } -
shared/css-v6/modules/18-content.css
r281 r289 32 32 font-size: 180%; 33 33 border-bottom: 3px double #aaa; 34 text-align: left; /* irgendwie meinen browser sonst `justify` */ 34 35 } 35 36 -
shared/js-v6/modules/menu.js
r279 r289 343 343 bwidth = $(".bullet",g).outerWidth(); 344 344 each_width = (g.width() + bwidth*2) / count; 345 a.width(Math.floor(each_width)); 345 each_width = g.width() / count; 346 347 348 // problem: each_width = 16.384023... -> Math.floor liefert zu schmale Werte, direktes 349 // a.width(each_width) hingegen kann mit Fliesskomma nicht umgehen. Daher jetzt ein Ansatz, 350 // CSS3-Subpixelwerte mit ueberschaubar vielen Dezimalstellen anzuwenden. 351 roundNumber = function(num,dec) { return Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); }; 352 subpixel_width = roundNumber(each_width, 2); 353 a.css("width", subpixel_width+"px"); 354 //a.css("width", Math.floor(each_width)+"px"); 346 355 // text-Label zentriert darstellen um den Punkt 347 356 $(".text", a).css("left", function(){return(bwidth - $(this).width())/2; });
Note: See TracChangeset
for help on using the changeset viewer.