OLD | NEW |
1 <?php | 1 <?php |
2 | 2 |
3 class AnwTemplateOverride_action_view extends AnwTemplateDefault_action_view | 3 class AnwTemplateOverride_action_view extends AnwTemplateDefault_action_view |
4 { | 4 { |
5 function viewPage($sContentHtmlDir, $sCss, $title, $content, $editiontime, $ao
Translations) | 5 function viewPage($sContentHtmlDir, $sCss, $title, $content, $editiontime, $ao
Translations) |
6 { | 6 { |
7 $HTML = <<<EOF | 7 $HTML = <<<EOF |
8 | 8 |
9 {$this->pageTranslations($aoTranslations)} | 9 {$this->pageTranslations($aoTranslations)} |
10 | 10 |
11 <div class="$sCss" dir="$sContentHtmlDir"> | 11 <div class="$sCss" dir="$sContentHtmlDir"> |
12 $content | 12 $content |
13 </div> | 13 </div> |
14 EOF; | 14 EOF; |
15 return $HTML; | 15 return $HTML; |
16 } | 16 } |
17 | 17 |
18 function pageTranslations($aoTranslations) | 18 function pageTranslations($aoTranslations) |
19 { | 19 { |
20 $languages = $this->getLanguages($aoTranslations); | 20 $languages = $this->getLanguages($aoTranslations); |
21 $currentLanguage = array_shift($languages); | 21 $currentLanguage = array_shift($languages); |
22 $currentText = $currentLanguage['text']; | 22 $currentText = $currentLanguage['text']; |
23 $currentFlag = $currentLanguage['flag']; | 23 $currentFlag = $currentLanguage['flag']; |
24 | 24 |
25 $HTML = <<<EOF | 25 $HTML = <<<EOF |
26 | 26 |
27 {{#LANGUAGESELECTION}} | 27 {{#LANGUAGESELECTION}} |
28 <li id="language"> | 28 <li id="language"> |
29 <div id="current-language" style="background-image: url('$currentFlag');"> | 29 <div id="current-language" style="background-image: url('$currentText');"> |
30 $currentText | 30 <div id="flag-en" class="flag sprite"></div><span>$currentText</span> |
31 <img class="arrow" src="/_override-static/global/global/img/down-arrow.png"> | |
32 </div> | 31 </div> |
33 <ul> | 32 <ul> |
34 EOF; | 33 EOF; |
35 | 34 |
36 foreach ($languages as $language) | 35 foreach ($languages as $language) |
37 { | 36 { |
38 $url = $language['url']; | 37 $url = $language['url']; |
39 $flag = $language['flag']; | 38 $flag = $language['flag']; |
40 $text = $language['text']; | 39 $text = $language['text']; |
41 | 40 |
42 $HTML .= <<<EOF | 41 $HTML .= <<<EOF |
43 | 42 |
44 <li><a href="$url" style="background-image: url('$flag');$linkStyle">$text</
a></li> | 43 <li><a href="$url"><div id="flag-$text" class="flag sprite"></div>$text</a><
/li> |
45 EOF; | 44 EOF; |
46 } | 45 } |
| 46 |
47 | 47 |
48 $HTML .= <<<EOF | 48 $HTML .= <<<EOF |
49 | 49 |
50 </ul> | 50 </ul> |
51 </li> | 51 </li> |
52 {{/LANGUAGESELECTION}} | 52 {{/LANGUAGESELECTION}} |
53 EOF; | 53 EOF; |
54 return $HTML; | 54 return $HTML; |
55 } | 55 } |
56 | 56 |
(...skipping 23 matching lines...) Expand all Loading... |
80 $entry['url'] = $this->xQuote($sUrl); | 80 $entry['url'] = $this->xQuote($sUrl); |
81 array_push($languages, $entry); | 81 array_push($languages, $entry); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 return $languages; | 85 return $languages; |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 ?> | 89 ?> |
OLD | NEW |