LEFT | RIGHT |
1 <?php | 1 <?php |
2 | 2 |
3 class AnwTemplateOverride_contentclass_menu extends AnwTemplateDefault_contentcl
ass_menu | 3 class AnwTemplateOverride_contentclass_menu extends AnwTemplateDefault_contentcl
ass_menu |
4 { | 4 { |
5 private $firstItem; | 5 private $firstItem; |
6 | 6 |
7 function openMenu() | 7 function openMenu() |
8 { | 8 { |
9 $this->firstItem = true; | 9 $this->firstItem = true; |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 private function getLanguages() | 80 private function getLanguages() |
81 { | 81 { |
82 $languages = array(); | 82 $languages = array(); |
83 | 83 |
84 $currentPageName = AnwActionPage::getCurrentPageName(); | 84 $currentPageName = AnwActionPage::getCurrentPageName(); |
85 if (!AnwPage::isValidPageName($currentPageName)) | 85 if (!AnwPage::isValidPageName($currentPageName)) |
86 return $languages; | 86 return $languages; |
87 | 87 |
88 $currentPage = new AnwPageByName($currentPageName); | 88 $currentPage = new AnwPageByName($currentPageName); |
| 89 if (!$currentPage->exists()) |
| 90 return $languages; |
| 91 |
89 $pages = $currentPage->getPageGroup()->getPages(); | 92 $pages = $currentPage->getPageGroup()->getPages(); |
90 $translationThreshold = AnwComponent::globalCfgViewUntranslatedMinpercent(); | 93 $translationThreshold = AnwComponent::globalCfgViewUntranslatedMinpercent(); |
91 foreach ($pages as $page) | 94 foreach ($pages as $page) |
92 { | 95 { |
93 if ($page->isActionAllowed('view')) | 96 if ($page->isActionAllowed('view')) |
94 { | 97 { |
95 $current = ($page->getName() == $currentPageName); | 98 $current = ($page->getName() == $currentPageName); |
96 $online = ($page->getTranslatedPercent() >= $translationThreshold); | 99 $online = ($page->getTranslatedPercent() >= $translationThreshold); |
97 $linkStyle = ($online ? '' : ' style="text-decoration:line-through;"'); | 100 $linkStyle = ($online ? '' : ' style="text-decoration:line-through;"'); |
98 $lang = $this->xQuote($page->getLang()); | 101 $lang = $this->xQuote($page->getLang()); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 function closeMenu() | 170 function closeMenu() |
168 { | 171 { |
169 $HTML = <<<EOF | 172 $HTML = <<<EOF |
170 </ul> | 173 </ul> |
171 EOF; | 174 EOF; |
172 return $HTML; | 175 return $HTML; |
173 } | 176 } |
174 } | 177 } |
175 | 178 |
176 ?> | 179 ?> |
LEFT | RIGHT |