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

fix bug + add plugin method GetPath()

This commit is contained in:
Mzhelskiy Maxim 2010-04-29 19:45:54 +00:00
parent 856980038d
commit 26fa60926b
2 changed files with 15 additions and 1 deletions

View file

@ -371,7 +371,7 @@ class LsACL extends Module {
/**
* Разрешаем удалять администраторам блога и автору, но только пустой
*/
if($oBlog->getOwenerId()==$oUser->getId()) {
if($oBlog->getOwnerId()==$oUser->getId()) {
return self::CAN_DELETE_BLOG_EMPTY_ONLY;
}

View file

@ -186,6 +186,20 @@ abstract class Plugin extends Object {
return Engine::getInstance()->_CallModule($sName,$aArgs);
}
/**
* Возвращает полный путь до плагина
*
* @param unknown_type $sName
* @return unknown
*/
static public function GetPath($sName) {
$sName = preg_match('/^Plugin([\w]+)(_[\w]+)?$/Ui',$sName,$aMatches)
? strtolower($aMatches[1])
: strtolower($sName);
return Config::Get('path.root.server').'/plugins/'.$sName.'/';
}
/**
* Возвращает правильный путь к директории шаблонов
*