diff --git a/classes/hooks/HookLangInit.class.php b/classes/hooks/HookLangInit.class.php new file mode 100644 index 00000000..b5857828 --- /dev/null +++ b/classes/hooks/HookLangInit.class.php @@ -0,0 +1,27 @@ +AddHook('init_action','InitLang',__CLASS__,0); + } + + public function InitLang($aVars) { + $this->Lang_GetLang(); + } +} +?> \ No newline at end of file diff --git a/engine/modules/lang/Lang.class.php b/engine/modules/lang/Lang.class.php index 7f3e016b..606c1589 100644 --- a/engine/modules/lang/Lang.class.php +++ b/engine/modules/lang/Lang.class.php @@ -51,7 +51,7 @@ class LsLang extends Module { $this->sCurrentLang = Config::Get('lang.current'); $this->sDefaultLang = Config::Get('lang.default'); $this->sLangPath = Config::Get('lang.path'); - $this->InitLang(); + $this->InitLang(); } /** * Инициализирует языковой файл @@ -72,11 +72,7 @@ class LsLang extends Module { } else { $this->LoadLangFiles($this->sDefaultLang); if($this->sCurrentLang!=$this->sDefaultLang) $this->LoadLangFiles($this->sCurrentLang); - } - /** - * Загружаем в шаблон - */ - $this->Viewer_Assign('aLang',$this->aLangMsg); + } } /** * Загружает текстовки из языковых файлов @@ -157,5 +153,16 @@ class LsLang extends Module { } return 'NOT_FOUND_LANG_TEXT'; } + + /** + * Завершаем работу модуля + * + */ + public function Shutdown() { + /** + * Загружаем в шаблон + */ + $this->Viewer_Assign('aLang',$this->aLangMsg); + } } ?> \ No newline at end of file