当前位置: 首页>>代码示例>>PHP>>正文


PHP E::ModuleSkin方法代码示例

本文整理汇总了PHP中E::ModuleSkin方法的典型用法代码示例。如果您正苦于以下问题:PHP E::ModuleSkin方法的具体用法?PHP E::ModuleSkin怎么用?PHP E::ModuleSkin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在E的用法示例。


在下文中一共展示了E::ModuleSkin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: LoadFromXmlFile

 /**
  * @param string $sSkinId
  * @param array $aData
  */
 public function LoadFromXmlFile($sSkinId, $aData = null)
 {
     if (isset($aData['dir'])) {
         $sSkinDir = $aData['dir'];
     } else {
         $sSkinDir = null;
     }
     $sSkinXML = E::ModuleSkin()->GetSkinManifest($sSkinId, $sSkinDir);
     if (!is_array($aData)) {
         $aData = array('id' => $sSkinId);
     } elseif (!isset($aData['id'])) {
         $aData['id'] = $sSkinId;
     }
     $this->LoadFromXml($sSkinXML, $aData);
 }
开发者ID:hard990,项目名称:altocms,代码行数:19,代码来源:Skin.entity.class.php

示例2: _initRender

 /**
  * Initialization of render before Fetch() or Display()
  *
  * @param bool $bForce
  */
 protected function _initRender($bForce = false)
 {
     if ($this->bInitRender && !$bForce) {
         return;
     }
     $nTimer = microtime(true);
     E::ModuleHook()->Run('render_init_start', array('bLocal' => $this->bLocal));
     // If skin not initialized (or it was changed) then init one
     if ($this->sViewSkin != $this->GetConfigSkin()) {
         $this->_initSkin();
     } else {
         // Level could be changed after skin initialization
         Config::SetLevel(Config::LEVEL_SKIN_CUSTOM);
     }
     // init templator if not yet
     $this->_initTemplator();
     // Loads localized texts
     $aLang = E::ModuleLang()->GetLangMsg();
     // Old skin compatibility
     $aLang['registration_password_notice'] = E::ModuleLang()->Get('registration_password_notice', array('min' => C::Val('module.security.password_len', 3)));
     $this->Assign('aLang', $aLang);
     //$this->Assign('oLang', E::ModuleLang()->Dictionary());
     if (!$this->bLocal && !$this->GetResponseAjax()) {
         // Initialization of assets (JS-, CSS-files)
         $this->InitAssetFiles();
     }
     $oSkin = E::ModuleSkin()->GetSkin($this->sViewSkin);
     if (!$oSkin || !$oSkin->GetCompatible() || $oSkin->SkinCompatible('1.1', '<')) {
         // Для старых скинов загружаем объект доступа к конфигурации
         $this->Assign('oConfig', Config::getInstance());
     }
     E::ModuleHook()->Run('render_init_done', array('bLocal' => $this->bLocal));
     $this->bInitRender = true;
     self::$_preprocessTime += microtime(true) - $nTimer;
 }
开发者ID:anp135,项目名称:altocms,代码行数:40,代码来源:Viewer.class.php

示例3: SkinCompatible

 /**
  * Check the skin compatibility
  *
  * @param string      $sSkinName
  * @param string|null $sVersion
  * @param string|null $sOperator
  *
  * @return bool
  */
 public function SkinCompatible($sSkinName, $sVersion = null, $sOperator = null)
 {
     $oSkin = E::ModuleSkin()->GetSkin($sSkinName);
     return $oSkin->SkinCompatible($sVersion, $sOperator);
 }
开发者ID:Azany,项目名称:altocms,代码行数:14,代码来源:Skin.class.php

示例4: VarAssign

 /**
  * Выполняет загрузку необходимых (возможно даже системных :)) переменных в шаблонизатор
  */
 public function VarAssign()
 {
     // * Загружаем весь $_REQUEST, предварительно обработав его функцией F::HtmlSpecialChars()
     $aRequest = $_REQUEST;
     F::HtmlSpecialChars($aRequest);
     $this->Assign('_aRequest', $aRequest);
     // * Параметры стандартной сессии
     // TODO: Убрать! Не должно этого быть на страницах сайта
     $this->Assign('_sPhpSessionName', session_name());
     $this->Assign('_sPhpSessionId', session_id());
     // * Загружаем роутинг с учетом правил rewrite
     $aRouter = array();
     $aPages = Config::Get('router.page');
     if (!$aPages || !is_array($aPages)) {
         throw new Exception('Router rules is underfined.');
     }
     foreach ($aPages as $sPage => $aAction) {
         $aRouter[$sPage] = R::GetPath($sPage);
     }
     $this->Assign('aRouter', $aRouter);
     // * Загружаем виджеты
     $this->Assign('aWidgets', $this->GetWidgets());
     // * Загружаем HTML заголовки
     $this->Assign('sHtmlTitle', $this->GetHtmlTitle());
     $this->Assign('sHtmlKeywords', $this->GetHtmlKeywords());
     $this->Assign('sHtmlDescription', $this->GetHtmlDescription());
     $this->Assign('aHtmlHeadFiles', $this->aHtmlHeadFiles);
     $this->Assign('aHtmlRssAlternate', $this->aHtmlRssAlternate);
     $this->Assign('sHtmlCanonical', $this->sHtmlCanonical);
     $this->Assign('aHtmlHeadTags', $this->aHtmlHeadTags);
     $this->Assign('aJsAssets', E::ModuleViewerAsset()->GetPreparedAssetLinks());
     // * Загружаем список активных плагинов
     $aPlugins = E::GetActivePlugins();
     $this->Assign('aPluginActive', array_fill_keys(array_keys($aPlugins), true));
     // * Загружаем пути до шаблонов плагинов
     $aPluginsTemplateUrl = array();
     $aPluginsTemplateDir = array();
     /** @var Plugin $oPlugin */
     foreach ($aPlugins as $sPlugin => $oPlugin) {
         $sDir = Plugin::GetTemplateDir(get_class($oPlugin));
         $this->oSmarty->addTemplateDir(array($sDir . 'tpls/', $sDir), $oPlugin->GetName(false));
         $aPluginsTemplateDir[$sPlugin] = $sDir;
         $aPluginsTemplateUrl[$sPlugin] = Plugin::GetTemplateUrl(get_class($oPlugin));
     }
     if (E::ActivePlugin('ls')) {
         // LS-compatible //
         $this->Assign('aTemplateWebPathPlugin', $aPluginsTemplateUrl);
         $this->Assign('aTemplatePathPlugin', $aPluginsTemplateDir);
     }
     $sSkinTheme = $this->GetConfigTheme();
     if (!$sSkinTheme) {
         $sSkinTheme = 'default';
     }
     // Проверка существования темы
     if ($this->CheckTheme($sSkinTheme)) {
         $this->oSmarty->compile_id = $sSkinTheme;
     }
     $this->Assign('sSkinTheme', $sSkinTheme);
     $oSkin = E::ModuleSkin()->GetSkin($this->sViewSkin);
     if (!$oSkin->GetCompatible() || $oSkin->SkinCompatible('1.1', '<')) {
         // Для старых скинвов загружаем объект доступа к конфигурации
         $this->Assign('oConfig', Config::getInstance());
     }
 }
开发者ID:ZeoNish,项目名称:altocms,代码行数:67,代码来源:Viewer.class.php

示例5: EventSkins

 protected function EventSkins()
 {
     $this->sMainMenuItem = 'site';
     $this->_setTitle(E::ModuleLang()->Get('action.admin.skins_title'));
     $this->SetTemplateAction('site/skins');
     // Определяем скин и тему основного сайта (не админки)
     $sSiteSkin = Config::Get('view.skin', Config::LEVEL_CUSTOM);
     $sSiteTheme = Config::Get('skin.' . $sSiteSkin . '.config.view.theme');
     // Определяем скин и тему админки
     $sAdminSkin = Config::Get('view.skin');
     $sAdminTheme = Config::Get('skin.' . $sAdminSkin . '.config.view.theme');
     if (!$sSiteTheme && ($sSkinTheme = $this->_getSkinFromConfig($sSiteSkin))) {
         $sSiteTheme = $sSkinTheme;
     }
     if (!$sAdminTheme && ($sSkinTheme = $this->_getSkinFromConfig($sAdminSkin))) {
         $sAdminTheme = $sSkinTheme;
     }
     $sMode = $this->GetParam(0);
     if ($sMode == 'adm') {
         $aFilter = array('type' => 'adminpanel');
     } elseif ($sMode == 'all') {
         $aFilter = array('type' => '');
     } else {
         $sMode = 'site';
         $aFilter = array('type' => 'site');
     }
     if ($this->GetPost('submit_skins_del')) {
         // Удаление плагинов
         $this->_eventSkinsDelete($sMode);
     } elseif ($sSkin = $this->GetPost('skin_activate')) {
         $this->_eventSkinActivate($sMode, $sSkin);
     } elseif (($sSkin = $this->GetPost('skin')) && ($sTheme = $this->GetPost('theme_activate'))) {
         $this->_eventSkinThemeActivate($sMode, $sSkin, $sTheme);
     }
     $aSkins = E::ModuleSkin()->GetSkinsList($aFilter);
     $oActiveSkin = null;
     foreach ($aSkins as $sKey => $oSkin) {
         if ($sMode == 'adm') {
             if ($sKey == $sAdminSkin) {
                 $oActiveSkin = $oSkin;
                 unset($aSkins[$sKey]);
             }
         } else {
             if ($sKey == $sSiteSkin) {
                 $oActiveSkin = $oSkin;
                 unset($aSkins[$sKey]);
             }
         }
     }
     if ($sMode == 'adm') {
         E::ModuleViewer()->Assign('sSiteSkin', $sAdminSkin);
         E::ModuleViewer()->Assign('sSiteTheme', $sAdminTheme);
     } else {
         E::ModuleViewer()->Assign('sSiteSkin', $sSiteSkin);
         E::ModuleViewer()->Assign('sSiteTheme', $sSiteTheme);
     }
     E::ModuleViewer()->Assign('oActiveSkin', $oActiveSkin);
     E::ModuleViewer()->Assign('aSkins', $aSkins);
     E::ModuleViewer()->Assign('sMode', $sMode);
 }
开发者ID:ZeoNish,项目名称:altocms,代码行数:60,代码来源:ActionAdmin.class.php

示例6: _initSkin

 protected function _initSkin()
 {
     $oSkin = E::ModuleSkin()->GetSkin($this->GetConfigSkin());
     $sCompatible = $oSkin ? $oSkin->GetCompatible() : '';
     if (!$sCompatible || $sCompatible == 'ls') {
         // It's old LS skin
         $aOldJs = Config::Get('assets.ls.head.default.js');
         $aOldCss = Config::Get('assets.ls.head.default.css');
         Config::Set('head.default.js', $aOldJs);
         Config::Set('head.default.css', $aOldCss);
         Config::Set('view.compatible', 'ls');
     } else {
         Config::Set('view.compatible', $sCompatible ? $sCompatible : 'alto');
     }
     parent::_initSkin();
 }
开发者ID:ZeoNish,项目名称:altocms,代码行数:16,代码来源:Viewer.class.php

示例7: EventFollow

 /**
  * Список событий в ленте активности пользователя
  *
  */
 protected function EventFollow()
 {
     /**
      * Пользователь авторизован?
      */
     if (!$this->oUserCurrent) {
         return parent::EventNotFound();
     }
     $this->sMenuItemSelect = 'follow';
     $oSkin = E::ModuleSkin()->GetSkin(E::ModuleViewer()->GetConfigSkin());
     if ($oSkin && $oSkin->GetCompatible() == 'alto') {
         E::ModuleViewer()->AddWidget('right', 'activitySettings');
         E::ModuleViewer()->AddWidget('right', 'activityFriends');
         E::ModuleViewer()->AddWidget('right', 'activityUsers');
     } else {
         E::ModuleViewer()->AddWidget('right', 'streamConfig');
     }
     /**
      * Читаем события
      */
     $aEvents = E::ModuleStream()->Read();
     E::ModuleViewer()->Assign('bDisableGetMoreButton', E::ModuleStream()->GetCountByReaderId($this->oUserCurrent->getId()) < Config::Get('module.stream.count_default'));
     E::ModuleViewer()->Assign('aStreamEvents', $aEvents);
     if (count($aEvents)) {
         $oEvenLast = end($aEvents);
         E::ModuleViewer()->Assign('iStreamLastId', $oEvenLast->getId());
     }
 }
开发者ID:AntiqS,项目名称:altocms,代码行数:32,代码来源:ActionStream.class.php


注:本文中的E::ModuleSkin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。