mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-17 07:10:48 +03:00
Запрет повторной инициализации Viewer`а
This commit is contained in:
parent
65e0fc70b9
commit
8eb2e75ad9
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue