/** * Инициализация плагина */ public function Init() { HelperPlugin::InitPlugin($this); $sDataFile = $this->PluginAceAdminPanel_Admin_GetCustomConfigFile(); if (!file_exists($sDataFile)) { $aConfigSet = $this->PluginAceAdminPanel_Admin_GetValueArrayByPrefix('config.all.'); @file_put_contents($sDataFile, serialize($aConfigSet)); } // поддержка именования старых классов if (defined('OLD_CLASS_LOADER') && OLD_CLASS_LOADER) { HelperPlugin::AutoLoadRegister(array($this, 'AutoLoaderOldClass')); } }
/** * Инициализация плагина * * @return void */ public function Init() { if (preg_match('/^([\\d\\.]+)([^\\d\\.].*)$/', ACEADMINPANEL_VERSION, $m)) { $sVersion = $m[1] . '.' . ACEADMINPANEL_VERSION_BUILD . $m[2]; } else { $sVersion = ACEADMINPANEL_VERSION . '.' . ACEADMINPANEL_VERSION_BUILD; } Config::Set('plugin.aceadminpanel.version', $sVersion); //HelperPlugin::InitPlugin($this); HelperPlugin::AutoLoadRegister(array($this, 'Autoloader')); $sDataFile = $this->PluginAceadminpanel_Admin_GetCustomConfigFile(); if (!file_exists($sDataFile)) { $aConfigSet = $this->PluginAceadminpanel_Admin_GetValueArrayByPrefix('config.all.'); @file_put_contents($sDataFile, serialize($aConfigSet)); } $this->_loadPluginsConfig(); $this->_ActionAdminInerits(); }
static function AutoLoadRegister($xFunc) { return HelperPlugin::AutoLoadRegister($xFunc); }
} if (isset($aClassElements['Action'])) { $sFilePath .= '/classes/actions/Action' . $aClassElements['Action'] . '.class.php'; } elseif (isset($aClassElements['Block'])) { $sFilePath .= '/classes/blocks/Block' . $aClassElements['Block'] . '.class.php'; } elseif (isset($aClassElements['Hook'])) { $sFilePath .= '/classes/hooks/Hook' . $aClassElements['Hook'] . '.class.php'; } elseif (isset($aClassElements['Module'])) { $sFilePath .= '/classes/modules/' . strtolower($aClassElements['Module']); if (isset($aClassElements['Mapper'])) { $sFilePath .= '/mapper/' . $aClassElements['Mapper'] . '.mapper.class.php'; } elseif (isset($aClassElements['Entity'])) { $sFilePath .= '/entity/' . $aClassElements['Entity'] . '.entity.class.php'; } else { $sFilePath .= '/' . ucfirst($aClassElements['Module']) . '.class.php'; } } elseif (isset($aClassElements['Mapper'])) { if (!isset($aClassElements['Plugin'])) { $sFilePath .= '/classes/modules/' . strtolower($aClassElements['Mapper']) . '/mapper/' . ucfirst(strtolower($aClassElements['Mapper'])) . '.mapper.class.php'; } } if (DIRECTORY_SEPARATOR != '/') { $sFilePath = str_replace(DIRECTORY_SEPARATOR, '/', $sFilePath); } return $sFilePath; } } // class HelperOldClassLoader HelperPlugin::AutoLoadRegister(array(HelperOldClassLoader::Init(), 'AutoLoader')); } // EOF