mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-28 20:45:00 +03:00
Инициализация языка вынесена в HookLangInit.class.php
This commit is contained in:
parent
9af150ec36
commit
4aea20cd45
27
classes/hooks/HookLangInit.class.php
Normal file
27
classes/hooks/HookLangInit.class.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/*-------------------------------------------------------
|
||||
*
|
||||
* 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
|
||||
*
|
||||
---------------------------------------------------------
|
||||
*/
|
||||
|
||||
class HookLangInit extends Hook {
|
||||
public function RegisterHook() {
|
||||
$this->AddHook('init_action','InitLang',__CLASS__,0);
|
||||
}
|
||||
|
||||
public function InitLang($aVars) {
|
||||
$this->Lang_GetLang();
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue