Exemplo n.º 1
0
 public function EventExec()
 {
     $sFile = '';
     $sSourceFile = implode('/', $this->GetParams());
     $sSourceFile = str_replace('[skin]', HelperPlugin::GetTemplatePath(), $sSourceFile);
     $sSourceFile = str_replace('[admin_skin]', HelperPlugin::GetPluginPath('aceadminpanel') . '/templates/skin/' . $this->Admin_GetAdminSkin(), $sSourceFile);
     if (isset($_SERVER['QUERY_STRING']) and $_SERVER['QUERY_STRING']) {
         $sSourceFile .= '?' . $_SERVER['QUERY_STRING'];
     }
     $sCachePath = Config::Get('path.smarty.cache') . '/' . $this->Admin_GetAdminSkin();
     $aFileParts = ACE::PathInfo($sSourceFile);
     if (strtolower($aFileParts['extension']) == 'css' and getRequest('from', '', 'get') == 'less') {
         $sSourceFile = $aFileParts['dirname'] . '/' . $aFileParts['filename'] . '.less';
         $sFileType = 'less';
     } elseif (strtolower($aFileParts['extension']) == 'less') {
         $sFileType = 'less';
     } else {
         $sFileType = 'other';
     }
     if ($sFileType == 'less') {
         $sCachePath .= '/css/';
         if (!is_dir($sCachePath)) {
             ACE::MakeDir($sCachePath);
         }
         $aLessParams = array('file' => $sSourceFile, 'config' => array('formatter' => 'compressed'), 'variables' => array('gridColumns' => 16, 'gridColumnWidth' => '65px', 'gridGutterWidth' => '12px', 'baseFontSize' => '12px', 'baseLineHeight' => '18px'));
         // определяем целевой CSS-файл
         $sFile = ACE::FilePath($sCachePath . '/' . md5(serialize($aLessParams)) . '.css');
         // если целевого файла нет - компилируем его из исходного LESS-файла
         if (!is_file($sFile)) {
             $oLess = $this->PluginAceadminpanel_Aceless_GetLessCompiler();
             $oLess->setVariables($aLessParams['variables'], true);
             $oLess->setFormatter('compressed');
             $oLess->checkedCompile($sSourceFile, $sFile);
             $this->aFiles[] = array('source' => $sSourceFile, 'target' => $sFile);
         }
         $sContentType = 'text/css';
     } else {
         $sCachePath .= '/' . basename($aFileParts['dirname']) . '/';
         if (!is_dir($sCachePath)) {
             ACE::MakeDir($sCachePath);
         }
         $sFile = $sCachePath . $aFileParts['basename'];
         copy($sSourceFile, $sFile);
         $sContentType = 'image/' . strtolower($aFileParts['extension']);
     }
     if ($sFile and is_file($sFile)) {
         $sCssContent = file_get_contents($sFile);
         header('Content-type: ' . $sContentType);
         echo $sCssContent;
     }
     /* */
     exit;
 }
Exemplo n.º 2
0
 public static function GetDelegate($sType, $sFrom, $bAction = false)
 {
     $sResult = Engine::getInstance()->Plugin_GetDelegate($sType, $sFrom);
     if ($sType == 'template' and $sResult == $sFrom and $sPlugin = Engine::getInstance()->Plugin_GetDelegateSign('template', $sFrom)) {
         if ($bAction) {
             $sResult = HelperPlugin::GetTemplateActionPath($sFrom, $sPlugin);
         } else {
             $sResult = HelperPlugin::GetTemplatePath($sFrom, $sPlugin);
         }
     }
     return $sResult;
 }
Exemplo n.º 3
0
 protected function _checkAdminAddon($sAddon)
 {
     $sAddonId = strtolower($sAddon);
     if (isset($this->aAddons[$sAddonId])) {
         return $sAddonId;
     }
     if ($this->bAddonsAutoCheck) {
         $sFile = HelperPlugin::GetPluginPath() . '/classes/actions/ActionAdmin' . $sAddon . '.class.php';
         if (file_exists($sFile)) {
             $sTemplate = HelperPlugin::GetTemplatePath('admin_' . admStrUnderScore($sAddon) . '.tpl');
             $this->aAddons[$sAddonId] = array('file' => $sFile, 'class' => 'PluginAceadminpanel_Admin' . $sAddon, 'template' => file_exists($sTemplate) ? $sTemplate : '');
             return $sAddonId;
         }
     }
     return false;
 }
 public function EventShutdown()
 {
     parent::EventShutdown();
     $this->Viewer_Assign('sMenuHeadItemSelect', $this->sMenuHeadItemSelect);
     $this->Viewer_Assign('sMenuItemSelect', $this->sMenuItemSelect);
     $this->Viewer_Assign('sMenuSubItemSelect', $this->sMenuSubItemSelect);
     $this->Viewer_Assign('sMenuNavItemSelect', $this->sMenuNavItemSelect);
     $this->Viewer_Assign('aModConfig', $this->aConfig);
     $this->Viewer_Assign('DIR_PLUGIN_SKIN', Plugin::GetTemplatePath($this->sPlugin));
     //$sWebPluginSkin=ACE::Path2Url(Plugin::GetTemplatePath($this->sPlugin));
     $sWebPluginSkin = Config::Get('path.admin.skin') . '/';
     $this->Viewer_Assign('sWebPluginPath', Config::Get('path.root.web') . '/plugins/' . $this->sPlugin);
     $this->Viewer_Assign('sWebPluginSkin', $sWebPluginSkin);
     $this->Viewer_Assign('sTemplatePath', HelperPlugin::GetTemplatePath());
     $this->Viewer_Assign('sTemplatePathAction', HelperPlugin::GetTemplateActionPath());
     $this->Viewer_Assign('aPluginInfo', $this->aPluginInfo);
     $this->Viewer_Assign('sPageRef', $this->sPageRef);
     $this->Viewer_Assign('sFormAction', $this->sFormAction);
     $this->Viewer_Assign('LS_VERSION', LS_VERSION);
     //$this->Hook_AddExecFunction('template_body_begin', array($this, '_CssUrls'));
 }
Exemplo n.º 5
0
 public function EventShutdown()
 {
     $this->Viewer_AddHtmlTitle($this->Lang_Get('adm_title') . ' v.' . $this->PluginAceadminpanel_Admin_getVersion());
     $this->Viewer_Assign('sMenuHeadItemSelect', $this->sMenuHeadItemSelect);
     $this->Viewer_Assign('sMenuItemSelect', $this->sMenuItemSelect);
     $this->Viewer_Assign('sMenuSubItemSelect', $this->sMenuSubItemSelect);
     $this->Viewer_Assign('sMenuNavItemSelect', $this->sMenuNavItemSelect);
     $this->Viewer_Assign('aModConfig', $this->aConfig);
     $this->Viewer_Assign('DIR_PLUGIN_SKIN', Plugin::GetTemplatePath($this->sPlugin));
     $sWebPluginSkin = admPath2Url(Plugin::GetTemplatePath($this->sPlugin));
     $this->Viewer_Assign('sWebPluginPath', Config::Get('path.root.web') . '/plugins/' . $this->sPlugin);
     $this->Viewer_Assign('sWebPluginSkin', $sWebPluginSkin);
     if (Config::Get('plugin.avalogs.admin_enable') && $this->oLogs && $this->aLogsMsg) {
         $str = '';
         foreach ($this->aLogsMsg as $key => $val) {
             if ($key) {
                 $str .= str_repeat(' ', 20);
             }
             $str .= $val;
             if ($key < sizeof($this->aLogsMsg) - 1) {
                 $str .= "\n";
             }
         }
         $this->oLogs->Out('admin', $str);
     }
     foreach ($this->aBlocks as $sGroup => $aGroupBlocks) {
         $this->Viewer_AddBlocks($sGroup, $aGroupBlocks);
     }
     if ($this->aConfig['check_password'] && !$this->PluginAceadminpanel_Admin_IsPasswordQuality($this->oUserCurrent)) {
         $this->Message_AddError($this->Lang_Get('adm_password_quality'));
     }
     $this->MakeMenu();
     $this->Viewer_Assign('sTemplatePath', HelperPlugin::GetTemplatePath());
     $this->Viewer_Assign('sTemplatePathAction', HelperPlugin::GetTemplateActionPath());
     $this->Viewer_Assign('aPluginInfo', $this->aPluginInfo);
     $this->Viewer_Assign('sPageRef', $this->sPageRef);
     $this->Viewer_Assign('LS_VERSION', LS_VERSION);
     $this->Hook_AddExecFunction('template_body_begin', array($this, '_CssUrls'));
 }