Пример #1
0
 public function RegisterHook()
 {
     if (ACE::IsMobile()) {
         return;
     }
     if (Config::Get('plugin.' . $this->sPlugin . '.skin')) {
         $this->sSkinName = Config::Get('plugin.' . $this->sPlugin . '.skin');
     }
     Config::Set('path.admin.skin', '___path.root.web___/plugins/aceadminpanel/templates/skin/admin_' . $this->sSkinName);
     $sActionEvent = Router::GetActionEvent();
     if (Router::GetAction() == 'admin') {
         if (Config::Get('plugin.aceadminpanel.compatible.default') == 'compatible') {
             $bCompatible = !in_array($sActionEvent, ACE::Str2Array(Config::Get('plugin.aceadminpanel.autonomous.events')));
         } else {
             $bCompatible = (!$sActionEvent or in_array($sActionEvent, $this->aCompatibleEvents) or in_array($sActionEvent, ACE::Str2Array(Config::Get('plugin.aceadminpanel.compatible.events'))));
         }
         if ($bCompatible) {
             $this->_preInit();
         }
     }
     $this->_checkSkinDir();
     $this->AddHook('engine_init_complete', 'EngineInitComplete', __CLASS__, 1000);
     $this->AddHook('init_action', 'InitAction', __CLASS__, 1000);
     $this->AddHook('template_html_head_end', 'HtmlHeadEnd', __CLASS__);
     $this->AddHook('template_statistics_performance_item', 'TplStatisticsPerformanceItem', __CLASS__);
     $this->AddHook('template_profile_sidebar_end', 'TplProfileSidebarEnd', __CLASS__);
 }
 /**
  * Инициализация плагина
  *
  * @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);
     if (ACE::IsMobile()) {
         $this->_loadPluginsConfig();
     } else {
         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();
     }
 }