本文整理汇总了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'); // например, задаем свой вид меню
}
示例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");
}
示例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;
}
示例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');
}
示例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;
}
示例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');
}
示例7: TopicShow
public function TopicShow($aVars)
{
$this->Viewer_Assign('oTopic', $aVars['topic']);
return $this->Viewer_Fetch(Plugin::GetTemplateDir(__CLASS__) . 'tpls/best_comment.tpl');
}
示例8: Init
public function Init()
{
$this->Viewer_AppendScript(Plugin::GetTemplateDir(__CLASS__) . "assets/js/qa.js");
// Добавление своего JS
}
示例9: Init
/**
* Инициализация плагина
*/
public function Init()
{
E::ModuleViewer()->AppendStyle(Plugin::GetTemplateDir(__CLASS__) . 'assets/css/similartopics.css');
return true;
}
示例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');
}
示例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;
}
示例12: TemplateFormAddTopic
public function TemplateFormAddTopic()
{
return $this->Fetch(Plugin::GetTemplateDir('PluginLs') . 'inc.form_topic_add_end.tpl');
}
示例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');
}
示例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;
}
示例15: RegisterHook
public function RegisterHook()
{
$this->AddHookTemplate('form_add_blog_end', Plugin::GetTemplateDir(__CLASS__) . '/tpls/hook_form_add_blog_end.tpl');
}