oUserCurrent=$this->User_GetUserCurrent(); } protected function RegisterEvent() { $this->AddEventPreg('/^(page(\d+))?$/i','EventComments'); } /********************************************************************************** ************************ РЕАЛИЗАЦИЯ ЭКШЕНА *************************************** ********************************************************************************** */ /** * Выводим комментарии * */ protected function EventComments() { /** * Передан ли номер страницы */ $iPage=$this->GetEventMatch(2) ? $this->GetEventMatch(2) : 1; /** * Исключаем из выборки идентификаторы закрытых блогов (target_parent_id) */ $aCloseBlogs = ($this->oUserCurrent) ? $this->Blog_GetInaccessibleBlogsByUser($this->oUserCurrent) : $this->Blog_GetInaccessibleBlogsByUser(); /** * Получаем список комментов */ $aResult=$this->Comment_GetCommentsAll('topic',$iPage,Config::Get('module.comment.per_page'),array(),$aCloseBlogs); $aComments=$aResult['collection']; /** * Формируем постраничность */ $aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.comment.per_page'),4,Router::GetPath('comments')); /** * Загружаем переменные в шаблон */ $this->Viewer_Assign('aPaging',$aPaging); $this->Viewer_Assign("aComments",$aComments); $this->Viewer_AddHtmlTitle($this->Lang_Get('comments_all')); $this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'allcomments/',$this->Lang_Get('comments_all')); /** * Устанавливаем шаблон вывода */ $this->SetTemplateAction('index'); } /** * Выполняется при завершении работы экшена * */ public function EventShutdown() { /** * Загружаем в шаблон необходимые переменные */ $this->Viewer_Assign('sMenuHeadItemSelect',$this->sMenuHeadItemSelect); } } ?>