Archive actions

This commit is contained in:
Alexander Yakovlev 2017-12-15 21:35:55 +07:00
parent bff8949d1f
commit ef2cc72d3e
1 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,55 @@
<?php
/**
* Страницы с архивами
*
* @package application.actions
* @since 1.0
*/
class ActionArchive extends Action
{
/**
* Инициализация экшена
*
*/
public function Init()
{
/**
* Устанавливаем дефолтный евент
*/
$this->SetDefaultEvent('index');
}
/**
* Регистрируем евенты
*
*/
protected function RegisterEvent()
{
$this->AddEvent('index', 'EventIndex');
$this->AddEvent('wiki', 'EventIfwiki');
}
/**
* Вывод списка архивов
*
*/
protected function EventIndex()
{
/**
* Устанавливаем title страницы
*/
$this->Viewer_AddHtmlTitle('Архивы');
$this->SetTemplateAction('index');
}
/**
* Архивы вики
*/
protected function EventIfwiki()
{
$this->Viewer_AddHtmlTitle('Архивы IFWiki');
$files = array_slice(scandir('./wikidump'), 2);
$this->SetTemplateAction('archive');
$this->Viewer_Assign('files', $files);
}
}