protected function _EventPluginsExternalAdmin($nOffset)
 {
     $sActionClass = 'Plugin' . ucfirst($this->GetParam($nOffset)) . '_ActionAdminPlugin';
     $sActionClass = $this->Plugin_GetDelegate('action', $sActionClass);
     if ($this->Plugin_GetDelegationChain('action', $sActionClass)) {
         $sActionClass = $this->Plugin_GetDelegate('action', $sActionClass);
     }
     $sFile = HelperPluginLoader::getInstance()->Class2Dir($sActionClass);
     if (ACE::FileExists($sFile)) {
         $this->sMenuSubItemSelect = 'plugins_admin_' . strtolower($this->GetParam($nOffset));
         $this->oAdminAction = new $sActionClass($this->oEngine, 'admin');
         if (method_exists($this->oAdminAction, 'Init')) {
             $this->oAdminAction->Init();
         }
         if (method_exists($this->oAdminAction, 'Admin')) {
             $this->oAdminAction->Admin();
         } elseif (method_exists($this->oAdminAction, 'EventIndex')) {
             $this->oAdminAction->EventIndex();
         }
         if (method_exists($this->oAdminAction, 'EventShutdown')) {
             $this->oAdminAction->EventShutdown();
         }
         if (method_exists($this->oAdminAction, 'Done')) {
             $this->oAdminAction->Done();
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Подключение файла, если он существует
  *
  * @param   string  $sFile
  * @param   bool    $bOnce
  * @return  array|mixed|null
  */
 static function FileIncludeIfExists($sFile, $bOnce = true)
 {
     $xResult = null;
     $sFile = self::FullDir($sFile);
     if (ACE::FileExists($sFile)) {
         $xResult = self::FileInclude($sFile, $bOnce);
     }
     return $xResult;
 }
Exemplo n.º 3
0
 public function TplProfileSidebarEnd()
 {
     if ($this->_checkAdmin()) {
         $sTpl = Plugin::GetTemplatePath(__CLASS__) . 'hook.profile_sidebar_end.tpl';
         if (ACE::FileExists($sTpl)) {
             return $this->Viewer_Fetch($sTpl);
         }
     }
 }
 public function Call()
 {
     if ($this->SourceTypeIsTemplate()) {
         // получаем пути к шаблонам
         $aTplDirs = $this->GetSmarty()->getTemplateDir();
         $sTemplate = $this->GetContentSource();
         $sFile = '';
         // лежит ли подгружаемый шаблон по одному из путей
         foreach ($aTplDirs as $sDir) {
             if (ACE::LocalPath(dirname($sTemplate), $sDir) and ACE::FileExists($sTemplate)) {
                 $sFile = $sTemplate;
                 break;
             }
         }
         if (!$sFile) {
             // варианты расположения шаблона
             foreach ($aTplDirs as $sDir) {
                 if (ACE::FileExists($sDir . '/' . $sTemplate)) {
                     $sFile = ACE::FilePath($sDir . '/' . $sTemplate);
                 }
             }
         }
         if (!$sFile) {
             $sFile = $sTemplate;
         }
         $sResult = file_get_contents($sFile);
     } elseif ($this->SourceTypeIsCallback()) {
         $sResult = call_user_func_array($this->GetContentSource(), array());
     } else {
         $sResult = $this->GetContentSource();
     }
     return $sResult;
 }