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


PHP Plugin::GetTemplateDir方法代码示例

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


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

示例1: Init

 public function Init()
 {
     E::ModuleViewer()->AppendStyle(Plugin::GetTemplateDir(__CLASS__) . "assets/css/style.css");
     // Добавление своего CSS
     E::ModuleViewer()->AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/script.js");
     // Добавление своего JS
     //E::ModuleViewer()->AddMenu('blog',Plugin::GetTemplateDir(__CLASS__).'menu.blog.tpl'); // например, задаем свой вид меню
 }
开发者ID:ZeoNish,项目名称:altocms,代码行数:8,代码来源:PluginExample.class.php

示例2: Init

 /**
  * Инициализация плагина
  */
 public function Init()
 {
     $this->Viewer_Assign("sTemplatePathEstheme", Plugin::GetTemplatePath(__CLASS__));
     E::ModuleViewer()->AppendStyle(Plugin::GetTemplateDir(__CLASS__) . "assets/css/style.min.css");
     E::ModuleViewer()->AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/develop/jquery.color.js");
     E::ModuleViewer()->AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/develop/colorPicker.js");
     E::ModuleViewer()->AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/develop/esTheme.js");
 }
开发者ID:AntiqS,项目名称:altocms,代码行数:11,代码来源:PluginEstheme.class.php

示例3: TplTopicShowEnd

 public function TplTopicShowEnd($aParams)
 {
     if ((!isset($aParams['bTopicList']) || !$aParams['bTopicList']) && isset($aParams['topic']) || isset($aParams['oTopic'])) {
         if (isset($aParams['topic'])) {
             E::ModuleViewer()->Assign('oTopic', $aParams['topic']);
         }
         E::ModuleViewer()->Assign('aWidgetParams', Config::Get('plugin.similartopics.widget_showtopic'));
         return E::ModuleViewer()->Fetch(Plugin::GetTemplateDir(__CLASS__) . 'tpls/widgets/widget.similartopics_bottom.tpl');
     }
     return null;
 }
开发者ID:Azany,项目名称:altocms,代码行数:11,代码来源:HookSimilartopics.class.php

示例4: RegisterHook

 public function RegisterHook()
 {
     // Хуки для меню
     $this->AddHook('module_menu_createmenu_after', 'onAfterModuleMenuCreate');
     $this->AddHook('module_menu_resetmenu_after', 'onAfterModuleMenuReset');
     $this->AddHook('new_sandbox_count', 'newSandboxCount');
     $this->AddHook('render_init_start', 'renderInitStart');
     $this->AddHook('comment_add_after', 'clearSandboxCache');
     $this->AddHookTemplate('menu_profile_created_item', Plugin::GetTemplateDir(__CLASS__) . '/tpls/menu_profile_created_item.tpl');
     $this->AddHookTemplate('menu_blog_blog_item', Plugin::GetTemplateDir(__CLASS__) . '/tpls/menu_blog_item.tpl');
 }
开发者ID:altocms,项目名称:alto-plugin-sandbox,代码行数:11,代码来源:HookSandbox.class.php

示例5: SetTemplateAction

 /**
  * Устанавливает какой шаблон выводить
  *
  * @param string $sTemplate Путь до шаблона относительно каталога шаблонов экшена
  */
 protected function SetTemplateAction($sTemplate)
 {
     if (substr($sTemplate, -4) != '.tpl') {
         $sTemplate = $sTemplate . '.tpl';
     }
     $sActionTemplatePath = $sTemplate;
     if (!F::File_IsLocalDir($sActionTemplatePath)) {
         // If not absolute path then defines real path of template
         $aDelegates = E::ModulePlugin()->GetDelegationChain('action', $this->GetActionClass());
         foreach ($aDelegates as $sAction) {
             if (preg_match('/^(Plugin([\\w]+)_)?Action([\\w]+)$/i', $sAction, $aMatches)) {
                 // for LS-compatibility
                 $sActionNameOriginal = $aMatches[3];
                 // New-style action templates
                 $sActionName = strtolower($sActionNameOriginal);
                 $sTemplatePath = E::ModulePlugin()->GetDelegate('template', 'actions/' . $sActionName . '/action.' . $sActionName . '.' . $sTemplate);
                 $sActionTemplatePath = $sTemplatePath;
                 if (!empty($aMatches[1])) {
                     $aPluginTemplateDirs = array(Plugin::GetTemplateDir($sAction));
                     if (basename($aPluginTemplateDirs[0]) !== 'default') {
                         $aPluginTemplateDirs[] = dirname($aPluginTemplateDirs[0]) . '/default/';
                     }
                     if ($sTemplatePath = F::File_Exists('tpls/' . $sTemplatePath, $aPluginTemplateDirs)) {
                         $sActionTemplatePath = $sTemplatePath;
                         break;
                     }
                     if ($sTemplatePath = F::File_Exists($sTemplatePath, $aPluginTemplateDirs)) {
                         $sActionTemplatePath = $sTemplatePath;
                         break;
                     }
                     // LS-compatibility
                     if (E::ModulePlugin()->IsActivePlugin('ls')) {
                         $sLsTemplatePath = E::ModulePlugin()->GetDelegate('template', 'actions/Action' . ucfirst($sActionName) . '/' . $sTemplate);
                         if ($sTemplatePath = F::File_Exists($sLsTemplatePath, $aPluginTemplateDirs)) {
                             $sActionTemplatePath = $sTemplatePath;
                             break;
                         }
                         $sLsTemplatePath = E::ModulePlugin()->GetDelegate('template', 'actions/Action' . ucfirst($sActionNameOriginal) . '/' . $sTemplate);
                         if ($sTemplatePath = F::File_Exists($sLsTemplatePath, $aPluginTemplateDirs)) {
                             $sActionTemplatePath = $sTemplatePath;
                             break;
                         }
                     }
                 }
             }
         }
     }
     $this->sActionTemplate = $sActionTemplatePath;
 }
开发者ID:anp135,项目名称:altocms,代码行数:54,代码来源:Action.class.php

示例6: Init

 public function Init()
 {
     $this->Viewer_AppendScript(Plugin::GetTemplateDir(__CLASS__) . 'assets/js/smiles.js');
     $this->Viewer_AppendStyle(Plugin::GetTemplateDir(__CLASS__) . 'assets/css/smiles.css');
 }
开发者ID:Azany,项目名称:altocms,代码行数:5,代码来源:PluginSmiles.class.php

示例7: TopicShow

 public function TopicShow($aVars)
 {
     $this->Viewer_Assign('oTopic', $aVars['topic']);
     return $this->Viewer_Fetch(Plugin::GetTemplateDir(__CLASS__) . 'tpls/best_comment.tpl');
 }
开发者ID:shtrih,项目名称:alto-plugin-qa,代码行数:5,代码来源:HookQa.class.php

示例8: Init

 public function Init()
 {
     $this->Viewer_AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/qa.js");
     // Добавление своего JS
 }
开发者ID:shtrih,项目名称:alto-plugin-qa,代码行数:5,代码来源:PluginQa.class.php

示例9: Init

 /**
  * Инициализация плагина
  */
 public function Init()
 {
     E::ModuleViewer()->AppendStyle(Plugin::GetTemplateDir(__CLASS__) . 'assets/css/similartopics.css');
     return true;
 }
开发者ID:Azany,项目名称:altocms,代码行数:8,代码来源:PluginSimilartopics.class.php

示例10: Init

 /**
  * Plugin Initialization
  *
  * @return void
  */
 public function Init()
 {
     E::ModuleViewer()->AppendScript(Plugin::GetTemplateDir(__CLASS__) . 'assets/js/seopack.js');
     E::ModuleViewer()->AppendStyle(Plugin::GetTemplateDir(__CLASS__) . 'assets/css/seopack.css');
 }
开发者ID:Azany,项目名称:altocms,代码行数:10,代码来源:PluginSeopack.class.php

示例11: _displaySitemap

 /**
  * Display content of sitemap and save it in cache
  *
  * @param string       $sCacheKey
  * @param string|array $xData
  * @param string       $sTemplate
  */
 protected function _displaySitemap($sCacheKey, $xData, $sTemplate = 'sitemap.tpl')
 {
     E::ModuleViewer()->SetResponseHeader('Content-type', 'application/xml; charset=utf-8');
     if (is_array($xData)) {
         $sTemplate = Plugin::GetTemplateDir('sitemap') . 'tpls/' . $sTemplate;
         $sSiteMapContent = E::ModuleViewer()->Fetch($sTemplate, array('aData' => $xData));
         $sPeriod = C::Get();
         foreach ($xData as $aItem) {
             if (!empty($aItem['changefreq'])) {
                 if (in_array($aItem['changefreq'], $this->aPeriods)) {
                     $sPeriod = $this->aPeriods[$aItem['changefreq']];
                 }
             }
         }
         if (!$sPeriod) {
             $sPeriod = 'P1D';
         }
         //$this->_setCache($sCacheKey, $sSiteMapContent, $sPeriod);
     } else {
         $sSiteMapContent = $xData;
     }
     E::ModuleViewer()->Flush($sSiteMapContent);
     exit;
 }
开发者ID:Azany,项目名称:altocms,代码行数:31,代码来源:ActionSitemap.class.php

示例12: TemplateFormAddTopic

 public function TemplateFormAddTopic()
 {
     return $this->Fetch(Plugin::GetTemplateDir('PluginLs') . 'inc.form_topic_add_end.tpl');
 }
开发者ID:AntiqS,项目名称:altocms,代码行数:4,代码来源:Viewer.class.php

示例13: hook_admin_menu

 /**
  * Admin menu hook
  *
  * @return string
  */
 public function hook_admin_menu()
 {
     return E::ModuleViewer()->Fetch(Plugin::GetTemplateDir(__CLASS__) . 'tpls/admin_menu.tpl');
 }
开发者ID:Azany,项目名称:altocms,代码行数:9,代码来源:HookSeopack.class.php

示例14: GetDir

 /**
  * Returns dir of template widget
  *
  * @return mixed
  */
 public function GetDir()
 {
     $sDir = $this->getProp('_dir');
     if (is_null($sDir)) {
         $sDir = $this->GetParam('dir');
         if ($sPlugin = $this->GetPluginId()) {
             $sDir = F::File_NormPath(Plugin::GetTemplateDir($sPlugin) . '/' . $sDir);
         }
         $this->setProp('_dir', $sDir);
     }
     return $sDir;
 }
开发者ID:ZeoNish,项目名称:altocms,代码行数:17,代码来源:Widget.entity.class.php

示例15: RegisterHook

 public function RegisterHook()
 {
     $this->AddHookTemplate('form_add_blog_end', Plugin::GetTemplateDir(__CLASS__) . '/tpls/hook_form_add_blog_end.tpl');
 }
开发者ID:altocms,项目名称:alto-plugin-blogsubtitle,代码行数:4,代码来源:HookBlogsubtitle.class.php


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