1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-17 07:10:48 +03:00

Запрет повторной инициализации Viewer`а

This commit is contained in:
Alexey Kachayev 2010-02-03 11:02:01 +00:00
parent 65e0fc70b9
commit 8eb2e75ad9
2 changed files with 23 additions and 0 deletions

View file

@ -20,8 +20,20 @@
*
*/
abstract class Module extends Object {
/**
* Engine object
*
* @var Engine
*/
protected $oEngine=null;
/**
* Указывает на то, была ли проведенна инициализация модуля
*
* @var bool
*/
protected $bIsInit=false;
final public function __construct(Engine $oEngine) {
$this->oEngine=$oEngine;
}

View file

@ -165,6 +165,13 @@ class LsViewer extends Module {
*
*/
public function Init() {
/**
* Проверяем, не была ли уже проведена инициализация
*/
if($this->bIsInit) {
return ;
}
$this->Hook_Run('viewer_init_start');
/**
* Заголовок HTML страницы
@ -202,6 +209,10 @@ class LsViewer extends Module {
*/
$this->InitFileParams();
$this->sCacheDir = Config::Get('path.smarty.cache');
/**
* Устанавливаем флаг инициализации
*/
$this->bIsInit=true;
}
/**