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


PHP E::ModuleSeopack方法代码示例

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


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

示例1: hook_meta

 /**
  * Meta hook
  *
  * @return void
  */
 public function hook_meta()
 {
     $sAction = Router::GetAction();
     $sUrl = E::ModuleSeopack()->ClearUrl(R::Url('path'));
     $oSeopack = E::ModuleSeopack()->GetSeopackByUrl($sUrl);
     E::ModuleViewer()->Assign('sCurrentUrl', $sUrl);
     if ($oSeopack) {
         E::ModuleViewer()->Assign('oSeopack', $oSeopack);
     }
     $sMetaDescriptionTemplate = Plugin::GetTemplateDir(__CLASS__) . 'tpls/meta/description/' . $sAction . '.tpl';
     if (E::ModuleViewer()->TemplateExists($sMetaDescriptionTemplate)) {
         $sMetaDescription = E::ModuleViewer()->Fetch($sMetaDescriptionTemplate);
         if ($oSeopack && $oSeopack->getDescription()) {
             E::ModuleViewer()->Assign('sHtmlDescription', htmlspecialchars($oSeopack->getDescription()));
         } else {
             E::ModuleViewer()->Assign('sHtmlDescription', htmlspecialchars($sMetaDescription));
         }
     }
     $sMetaKeywordsTemplate = Plugin::GetTemplateDir(__CLASS__) . 'tpls/meta/keywords/' . $sAction . '.tpl';
     if (E::ModuleViewer()->TemplateExists($sMetaKeywordsTemplate)) {
         $sMetaKeywords = E::ModuleViewer()->Fetch($sMetaKeywordsTemplate);
         if ($oSeopack && $oSeopack->getKeywords()) {
             E::ModuleViewer()->Assign('sHtmlKeywords', htmlspecialchars($oSeopack->getKeywords()));
         } else {
             E::ModuleViewer()->Assign('sHtmlKeywords', htmlspecialchars($sMetaKeywords));
         }
     }
     if ($oSeopack && $oSeopack->getTitle()) {
         E::ModuleViewer()->Assign('sHtmlTitle', htmlspecialchars($oSeopack->getTitle()));
     }
 }
开发者ID:Azany,项目名称:altocms,代码行数:36,代码来源:HookSeopack.class.php

示例2: EventAjaxSet

 protected function EventAjaxSet()
 {
     if (!F::isPost('url')) {
         return false;
     }
     if (!$this->CheckSeopackFields()) {
         return false;
     }
     $sUrl = E::ModuleSeopack()->ClearUrl(F::GetRequest('url'));
     if (!($oSeopack = E::ModuleSeopack()->GetSeopackByUrl($sUrl))) {
         $oSeopack = Engine::GetEntity('PluginSeopack_ModuleSeopack_EntitySeopack');
         $oSeopack->setUrl($sUrl);
     }
     if (F::GetRequest('title_auto') && F::GetRequest('description_auto') && F::GetRequest('keywords_auto')) {
         $oSeopack->Delete();
         E::ModuleMessage()->AddNotice(E::ModuleLang()->Get('plugin.seopack.seopack_edit_submit_save_ok'));
         return;
     }
     $oSeopack->setTitle(F::GetRequest('title_auto') ? null : strip_tags(F::GetRequest('title')));
     $oSeopack->setDescription(F::GetRequest('description_auto') ? null : strip_tags(F::GetRequest('description')));
     $oSeopack->setKeywords(F::GetRequest('keywords_auto') ? null : strip_tags(F::GetRequest('keywords')));
     if ($oSeopack->Save()) {
         if ($oSeopack->getTitle()) {
             E::ModuleViewer()->AssignAjax('title', $oSeopack->getTitle());
         }
         E::ModuleMessage()->AddNotice(E::ModuleLang()->Get('plugin.seopack.seopack_edit_submit_save_ok'));
     }
     return;
 }
开发者ID:Azany,项目名称:altocms,代码行数:29,代码来源:ActionSeopack.class.php

示例3: EventSeopackDelete

 protected function EventSeopackDelete()
 {
     $this->sMainMenuItem = 'content';
     E::ModuleSecurity()->ValidateSendForm();
     if ($oSeopack = E::ModuleSeopack()->GetSeopackBySeopackId($this->GetParam(0))) {
         $oSeopack->Delete();
         E::ModuleMessage()->AddNotice(E::ModuleLang()->Get('plugin.seopack.seopack_admin_action_delete_ok') . null, true);
         Router::Location('admin/seopack/');
     } else {
         E::ModuleMessage()->AddError(E::ModuleLang()->Get('plugin.seopack.seopack_admin_action_delete_error'), E::ModuleLang()->Get('error'));
     }
     $this->SetTemplateAction('seopack_list');
 }
开发者ID:Azany,项目名称:altocms,代码行数:13,代码来源:ActionAdmin.class.php


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