1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-03 15:05:02 +03:00
ifhub.club/classes/actions/ActionComments.class.php

88 lines
2.5 KiB
PHP
Raw Normal View History

<?php
2008-09-21 09:36:57 +03:00
/*-------------------------------------------------------
*
* 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() {
$this->Hook_Run('action_init_comments');
2008-09-21 09:36:57 +03:00
}
protected function RegisterEvent() {
$this->AddEventPreg('/^(page(\d+))?$/i','EventComments');
2008-09-21 09:36:57 +03:00
}
/**********************************************************************************
************************ РЕАЛИЗАЦИЯ ЭКШЕНА ***************************************
**********************************************************************************
*/
/**
* Выводим комментарии
2008-09-21 09:36:57 +03:00
*
*/
protected function EventComments() {
2008-09-21 09:36:57 +03:00
/**
* Передан ли номер страницы
*/
$iPage=$this->GetEventMatch(2) ? $this->GetEventMatch(2) : 1;
2008-09-21 09:36:57 +03:00
/**
* Получаем список комментов
2009-06-23 20:06:19 +03:00
*/
$aResult=$this->Comment_GetCommentsAll('topic',$iPage,Config::Get('module.comment.per_page'));
2008-09-21 09:36:57 +03:00
$aComments=$aResult['collection'];
/**
* Формируем постраничность
*/
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.comment.per_page'),4,Router::GetPath('comments'));
2008-09-21 09:36:57 +03:00
/**
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign('aPaging',$aPaging);
$this->Viewer_Assign("aComments",$aComments);
2009-03-29 15:20:24 +03:00
$this->Viewer_AddHtmlTitle($this->Lang_Get('comments_all'));
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'allcomments/',$this->Lang_Get('comments_all'));
2008-09-21 09:36:57 +03:00
/**
* Устанавливаем шаблон вывода
*/
$this->SetTemplateAction('index');
}
/**
* Выполняется при завершении работы экшена
*
*/
public function EventShutdown() {
/**
* Загружаем в шаблон необходимые переменные
*/
$this->Viewer_Assign('sMenuHeadItemSelect',$this->sMenuHeadItemSelect);
$this->Hook_Run('action_shutdown_comments');
}
2008-09-21 09:36:57 +03:00
}
?>