mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-08 01:14:24 +03:00
9be9867ec9
2 Адресация в Actions и Entity переопределена через вызов Роутреа. 3. От констант очищены include файыл и ajax.
86 lines
2.4 KiB
PHP
86 lines
2.4 KiB
PHP
<?php
|
|
/*-------------------------------------------------------
|
|
*
|
|
* LiveStreet Engine Social Networking
|
|
* Copyright © 2008 Mzhelskiy Maxim
|
|
*
|
|
*--------------------------------------------------------
|
|
*
|
|
* Official site: www.livestreet.ru
|
|
* Contact e-mail: rus.engine@gmail.com
|
|
*
|
|
* GNU General Public License, version 2:
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
*
|
|
---------------------------------------------------------
|
|
*/
|
|
|
|
/**
|
|
* Класс обработки УРЛа вида /comments/
|
|
*
|
|
*/
|
|
class ActionComments extends Action {
|
|
|
|
/**
|
|
* Главное меню
|
|
*
|
|
* @var unknown_type
|
|
*/
|
|
protected $sMenuHeadItemSelect='blog';
|
|
|
|
public function Init() {
|
|
}
|
|
|
|
protected function RegisterEvent() {
|
|
$this->AddEventPreg('/^(page(\d+))?$/i','EventComments');
|
|
}
|
|
|
|
|
|
/**********************************************************************************
|
|
************************ РЕАЛИЗАЦИЯ ЭКШЕНА ***************************************
|
|
**********************************************************************************
|
|
*/
|
|
|
|
/**
|
|
* Выводим комментарии
|
|
*
|
|
*/
|
|
protected function EventComments() {
|
|
/**
|
|
* Передан ли номер страницы
|
|
*/
|
|
$iPage=$this->GetEventMatch(2) ? $this->GetEventMatch(2) : 1;
|
|
/**
|
|
* Получаем список комментов
|
|
*/
|
|
$aResult=$this->Comment_GetCommentsAll('topic',$iPage,Config::Get('module.comment.per_page'));
|
|
$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);
|
|
}
|
|
}
|
|
?>
|