Changeset 276 in t29-www for lib/template.php
- Timestamp:
- Jul 7, 2012, 7:45:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/template.php
r275 r276 121 121 // print interlanguage links for all languages except the active one 122 122 foreach($this->interlang_links as $lang => $a) { 123 if($lang != $this->conf['lang'] ) {123 if($lang != $this->conf['lang'] && !is_null($a)) { 124 124 printf('<link rel="alternate" href="%s" hreflang="%s" title="%s">', 125 $a['href'], $lang, sprintf($_('head-rel-interlang' ), $a)125 $a['href'], $lang, sprintf($_('head-rel-interlang', $lang), $a) 126 126 ); 127 127 } … … 192 192 <?php 193 193 foreach($this->interlang_links as $lang => $a) { 194 $is_current_lang = $lang == $this->conf['lang']; 195 if(is_null($a)) { 196 // when interlanguage link not present (null) = no translation exists 197 $a = t29Menu::dom_new_link('#', 'not present'); 198 $title = sprintf($_('topnav-interlang-nonexistent', $lang)); 199 $class = 'nonexistent'; 200 } elseif($is_current_lang) { 201 $title = sprintf($_('topnav-interlang-active'), $a); 202 $class = 'active'; 203 } else { 204 // ordinary interlang link 205 $title = sprintf($_('topnav-interlang-title', $lang), $a); 206 $class = ''; 207 } 194 208 printf("\t\t\t\t<li%s><a href='%s' title='%s'>%s</a></li>\n", 195 ( $lang == $this->conf['lang'] ? ' class="active"' : ''),196 $a['href'], sprintf($_('topnav-interlang-title'), $a),209 (empty($class) ? '' : " class='$class'"), 210 $a['href'], htmlspecialchars($title), 197 211 $this->conf['languages'][$lang][0] // verbose language name 198 212 );
Note: See TracChangeset
for help on using the changeset viewer.