1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-14 23:08:18 +03:00
ifhub.club/classes/actions/ActionTag.class.php
2012-07-09 09:47:42 +04:00

102 lines
2.8 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
*
---------------------------------------------------------
*/
/**
* Экшен обработки поиска по тегам
*
* @package actions
* @since 1.0
*/
class ActionTag extends Action {
/**
* Главное меню
*
* @var string
*/
protected $sMenuHeadItemSelect='blog';
/**
* Инициализация
*
*/
public function Init() {
}
/**
* Регистрация евентов
*/
protected function RegisterEvent() {
$this->AddEventPreg('/^.+$/i','/^(page([1-9]\d{0,5}))?$/i','EventTags');
}
/**********************************************************************************
************************ РЕАЛИЗАЦИЯ ЭКШЕНА ***************************************
**********************************************************************************
*/
/**
* Отображение топиков
*
*/
protected function EventTags() {
/**
* Получаем тег из УРЛа
*/
$sTag=$this->sCurrentEvent;
/**
* Передан ли номер страницы
*/
$iPage=$this->GetParamEventMatch(0,2) ? $this->GetParamEventMatch(0,2) : 1;
/**
* Получаем список топиков
*/
$aResult=$this->Topic_GetTopicsByTag($sTag,$iPage,Config::Get('module.topic.per_page'));
$aTopics=$aResult['collection'];
/**
* Вызов хуков
*/
$this->Hook_Run('topics_list_show',array('aTopics'=>$aTopics));
/**
* Формируем постраничность
*/
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),Config::Get('pagination.pages.count'),Router::GetPath('tag').htmlspecialchars($sTag));
/**
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign('aPaging',$aPaging);
$this->Viewer_Assign('aTopics',$aTopics);
$this->Viewer_Assign('sTag',$sTag);
$this->Viewer_AddHtmlTitle($this->Lang_Get('tag_title'));
$this->Viewer_AddHtmlTitle($sTag);
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'tag/'.$sTag.'/',$sTag);
/**
* Устанавливаем шаблон вывода
*/
$this->SetTemplateAction('index');
}
/**
* Выполняется при завершении работы экшена
*
*/
public function EventShutdown() {
/**
* Загружаем в шаблон необходимые переменные
*/
$this->Viewer_Assign('sMenuHeadItemSelect',$this->sMenuHeadItemSelect);
}
}
?>