本文整理汇总了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()));
}
}
示例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;
}
示例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');
}