Пример #1
0
 protected function showCurrentPage()
 {
     //prepare content for display
     try {
         $oOutputHtml = $this->getoPage()->toHtml();
     } catch (AnwException $e) {
         $oOutputHtml = new AnwOutputHtml($this->getoPage());
         $oOutputHtml->setBody(self::g_("err_rendercontent"), false);
         AnwDebug::reportError($e);
     }
     $this->head($oOutputHtml->runHead());
     $this->title = $oOutputHtml->runTitle();
     $sBody = $oOutputHtml->runBody();
     //if the translation is not complete, display a notice
     if (!$this->getoPage()->isTranslated() && $this->getoPage()->isActionAllowed('translate')) {
         $sNotice = $this->t_("local_notice_incomplete", array("lnkopen" => '<a href="' . AnwUtils::link($this->getoPage(), "translate") . '">', "lnkclose" => '</a>'));
         $this->out .= $this->tpl()->drawNotice($sNotice);
     }
     //page translations
     $aoTranslations = array();
     $aoPages = $this->getoPage()->getPageGroup()->getPages();
     foreach ($aoPages as $oPage) {
         if ($oPage->isActionAllowed('view')) {
             $bCurrent = $oPage->getName() == $this->getoPage()->getName();
             $bTranslatedPercentEnough = $oPage->getTranslatedPercent() >= self::globalCfgViewUntranslatedMinpercent() ? true : false;
             $aoTranslations[] = array('current' => $bCurrent, 'page' => $oPage, 'online' => $bTranslatedPercentEnough);
         }
     }
     //display page content
     $this->out .= $this->tpl()->viewPage(self::g_("local_html_dir", array(), AnwAction::getActionLang()), AnwUtils::cssViewContent($this->getoPage()), $this->title, $sBody, str_replace(',', ' ', Anwi18n::dateTime($this->getoPage()->getTime(), AnwAction::getActionLang())), $aoTranslations);
 }