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

Функции для ручного управления путями до директории шаблонов плагина

This commit is contained in:
Alexey Kachayev 2010-01-16 15:40:55 +00:00
parent e6533ed835
commit a80b582aed
2 changed files with 28 additions and 0 deletions

View file

@ -39,6 +39,11 @@ abstract class ActionPlugin extends Action {
$this->Viewer_Assign('sTemplateActionPath',$this->getTemplatePathPlugin());
}
/**
* Возвращает путь к шаблонам плагина
*
* @return string
*/
public function getTemplatePathPlugin() {
if(is_null($this->sTemplatePathPlugin)) {
preg_match('/^Plugin([\w]+)_Action([\w]+)$/i',$this->GetActionClass(),$aMatches);
@ -57,6 +62,17 @@ abstract class ActionPlugin extends Action {
return $this->sTemplatePathPlugin;
}
/**
* Установить значение пути к директории шаблонов плагина
*
* @param string $sTemplatePath
* @return bool
*/
public function setTemplatePathPlugin($sTemplatePath) {
if(!is_dir($sTemplatePath)) return false;
$this->sTemplatePathPlugin = $sTemplatePath;
}
/**
* Устанавливает какой шаблон выводить
*

View file

@ -151,5 +151,17 @@ abstract class Plugin extends Object {
return self::$aTemplatePath[$sName];
}
/**
* Устанавливает значение пути до шаблонов плагина
*
* @param string $sName
* @param string $sTemplatePath
* @return bool
*/
static public function SetTemplatePath($sName,$sTemplatePath) {
if(!is_dir($sTemplatePath)) return false;
self::$aTemplatePath[$sName]=$sTemplatePath;
}
}
?>