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

132 lines
3.7 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
*
---------------------------------------------------------
*/
/**
* Обработка главной страницы, т.е. УРЛа вида /index/
*
*/
class ActionIndex extends Action {
/**
* Главное меню
*
* @var unknown_type
*/
protected $sMenuHeadItemSelect='blog';
2008-09-21 09:36:57 +03:00
/**
* Меню
*
* @var unknown_type
*/
protected $sMenuItemSelect='index';
/**
* Субменю
*
* @var unknown_type
*/
protected $sMenuSubItemSelect='good';
/**
* Число новых топиков
*
* @var unknown_type
*/
protected $iCountTopicsNew=0;
/**
* Число новых топиков в коллективных блогах
*
* @var unknown_type
*/
protected $iCountTopicsCollectiveNew=0;
/**
* Число новых топиков в персональных блогах
*
* @var unknown_type
*/
protected $iCountTopicsPersonalNew=0;
/**
* Инициализация
*
*/
public function Init() {
2008-09-21 09:36:57 +03:00
/**
* Подсчитываем новые топики
*/
$this->iCountTopicsCollectiveNew=$this->Topic_GetCountTopicsCollectiveNew();
$this->iCountTopicsPersonalNew=$this->Topic_GetCountTopicsPersonalNew();
$this->iCountTopicsNew=$this->iCountTopicsCollectiveNew+$this->iCountTopicsPersonalNew;
}
/**
* Регистрация евентов
*
*/
protected function RegisterEvent() {
$this->AddEventPreg('/^(page(\d+))?$/i','EventIndex');
2008-09-21 09:36:57 +03:00
}
/**********************************************************************************
************************ РЕАЛИЗАЦИЯ ЭКШЕНА ***************************************
**********************************************************************************
*/
/**
* Реализация евента
2008-09-21 09:36:57 +03:00
*
*/
protected function EventIndex() {
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'index/',Config::Get('view.name'));
2008-09-21 09:36:57 +03:00
/**
* Меню
*/
$this->sMenuSubItemSelect='good';
/**
* Передан ли номер страницы
*/
$iPage=$this->GetEventMatch(2) ? $this->GetEventMatch(2) : 1;
2008-09-21 09:36:57 +03:00
/**
* Получаем список топиков
*/
$aResult=$this->Topic_GetTopicsGood($iPage,Config::Get('module.topic.per_page'));
2008-09-21 09:36:57 +03:00
$aTopics=$aResult['collection'];
/**
* Формируем постраничность
*/
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('index'));
2008-09-21 09:36:57 +03:00
/**
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign('aTopics',$aTopics);
$this->Viewer_Assign('aPaging',$aPaging);
/**
* Устанавливаем шаблон вывода
*/
$this->SetTemplateAction('index');
}
/**
* При завершении экшена загружаем переменные в шаблон
*
*/
public function EventShutdown() {
$this->Viewer_Assign('sMenuHeadItemSelect',$this->sMenuHeadItemSelect);
2008-09-21 09:36:57 +03:00
$this->Viewer_Assign('sMenuItemSelect',$this->sMenuItemSelect);
$this->Viewer_Assign('sMenuSubItemSelect',$this->sMenuSubItemSelect);
$this->Viewer_Assign('iCountTopicsNew',$this->iCountTopicsNew);
$this->Viewer_Assign('iCountTopicsCollectiveNew',$this->iCountTopicsCollectiveNew);
$this->Viewer_Assign('iCountTopicsPersonalNew',$this->iCountTopicsPersonalNew);
2008-09-21 09:36:57 +03:00
}
}
?>