Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: anwiki/_override/actions/action_view/action_view.tpl.php

Issue 9055099: Fixed: current language always shows english flag (Closed)
Patch Set: Created Dec. 21, 2012, 1:36 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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('$currentText');"> 29 <div id="current-language" style="background-image: url('$currentText');">
30 <div id="flag-en" class="flag sprite"></div><span>$currentText</span> 30 <div id="flag-$currentText" class="flag sprite"></div><span>$currentText</sp an>
31 </div> 31 </div>
32 <ul> 32 <ul>
33 EOF; 33 EOF;
34 34
35 foreach ($languages as $language) 35 foreach ($languages as $language)
36 { 36 {
37 $url = $language['url']; 37 $url = $language['url'];
38 $flag = $language['flag']; 38 $flag = $language['flag'];
39 $text = $language['text']; 39 $text = $language['text'];
40 40
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 $entry['url'] = $this->xQuote($sUrl); 81 $entry['url'] = $this->xQuote($sUrl);
82 array_push($languages, $entry); 82 array_push($languages, $entry);
83 } 83 }
84 } 84 }
85 85
86 return $languages; 86 return $languages;
87 } 87 }
88 } 88 }
89 89
90 ?> 90 ?>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld