Index: anwiki/_override/actions/action_view/action_view.tpl.php |
=================================================================== |
--- a/anwiki/_override/actions/action_view/action_view.tpl.php |
+++ b/anwiki/_override/actions/action_view/action_view.tpl.php |
@@ -1,91 +1,17 @@ |
<?php |
class AnwTemplateOverride_action_view extends AnwTemplateDefault_action_view |
{ |
function viewPage($sContentHtmlDir, $sCss, $title, $content, $editiontime, $aoTranslations) |
{ |
$HTML = <<<EOF |
- {$this->pageTranslations($aoTranslations)} |
- |
<div class="$sCss" dir="$sContentHtmlDir"> |
$content |
</div> |
EOF; |
return $HTML; |
} |
- |
- function pageTranslations($aoTranslations) |
- { |
- $languages = $this->getLanguages($aoTranslations); |
- $currentLanguage = array_shift($languages); |
- $currentLang = $currentLanguage['lang']; |
- $currentText = $currentLanguage['text']; |
- |
- $HTML = <<<EOF |
- |
-{{#LANGUAGESELECTION}} |
-<li id="language"> |
- <div id="current-language"> |
- <div id="flag-$currentLang" class="flag sprite"></div><span>$currentText</span> |
- <span id="language-arrow" class="sprite"></span> |
- </div> |
- <ul id="language-selector"> |
-EOF; |
- |
- foreach ($languages as $language) |
- { |
- $url = $language['url']; |
- $linkStyle = $language['linkStyle']; |
- $lang = $language['lang']; |
- $text = $language['text']; |
- |
- $HTML .= <<<EOF |
- |
- <li class="language-entry"><a href="$url" style="$linkStyle"><div id="flag-$lang" class="flag sprite"></div>$text</a></li> |
-EOF; |
- } |
- |
- $HTML .= <<<EOF |
- |
- </ul> |
-</li> |
-{{/LANGUAGESELECTION}} |
-EOF; |
- return $HTML; |
- } |
- |
- private function getLanguages($aoTranslations) |
- { |
- $languages = array(); |
- |
- foreach ($aoTranslations as $amInfo) |
- { |
- $oPage = $amInfo['page']; |
- $bCurrent = $amInfo['current']; |
- $sLang = $this->xQuote($oPage->getLang()); |
- $sLinkStyle = $amInfo['online'] ? '' : ' text-decoration:line-through;'; |
- $sText = $this->xText(self::g_('lang_' . $sLang, array(), |
- AnwAction::getActionLang())); |
- |
- $entry = array("lang" => $sLang, "linkStyle" => $sLinkStyle, |
- "text" => $sText); |
- |
- if ($bCurrent) |
- array_unshift($languages, $entry); |
- else |
- { |
- $asParams = $_GET; |
- unset($asParams[AnwActionPage::GET_PAGENAME]); //avoid loop |
- unset($asParams['browser']); |
- $sUrl = AnwUtils::link($oPage, "view", $asParams); |
- $entry['url'] = $this->xQuote($sUrl); |
- array_push($languages, $entry); |
- } |
- } |
- |
- return $languages; |
- } |
} |
?> |