本文整理汇总了PHP中E::ModulePage方法的典型用法代码示例。如果您正苦于以下问题:PHP E::ModulePage方法的具体用法?PHP E::ModulePage怎么用?PHP E::ModulePage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类E
的用法示例。
在下文中一共展示了E::ModulePage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getPageFromUrl
/**
* Returns page by requested URL
*
* @return ModulePage_EntityPage
*/
protected function _getPageFromUrl()
{
// * Составляем полный URL страницы для поиска по нему в БД
$sUrlFull = join('/', $this->GetParams());
if ($sUrlFull != '') {
$sUrlFull = $this->sCurrentEvent . '/' . $sUrlFull;
} else {
$sUrlFull = $this->sCurrentEvent;
}
// * Ищем страницу в БД
$oPage = E::ModulePage()->GetPageByUrlFull($sUrlFull, 1);
return $oPage;
}
示例2: EventDefault
/**
* Default homepage
*
* @return string
*/
public function EventDefault()
{
E::ModuleViewer()->Assign('sMenuHeadItemSelect', 'homepage');
$sHomepage = Config::Get('router.config.homepage');
if ($sHomepage) {
$sHomepageSelect = Config::Get('router.config.homepage_select');
if ($sHomepageSelect == 'page') {
// if page not active or deleted then this homepage is off
$oPage = E::ModulePage()->GetPageByUrlFull($sHomepage, 1);
if ($oPage) {
$sHomepage = $oPage->getUrlPath();
} else {
$sHomepage = '';
}
} else {
if ($sHomepageSelect == 'category_homepage') {
$sHomepageSelect = 'plugin-category-homepage';
}
$aHomePageSelect = explode('-', $sHomepageSelect);
// if homepage was from plugin and plugin is not active then this homepage is off
if ($aHomePageSelect[0] == 'plugin' && isset($aHomePageSelect[1])) {
if (!E::ActivePlugin($aHomePageSelect[1])) {
$sHomepage = '';
}
}
}
if ($sHomepage == 'home') {
if (E::ModuleViewer()->TemplateExists('actions/homepage/action.homepage.index.tpl')) {
$this->SetTemplateAction('index');
return;
}
} elseif ($sHomepage) {
return R::Action($sHomepage);
}
}
return R::Action('index');
}
示例3: CheckPageFields
/**
* Проверка полей на корректность
*
* @return bool
*/
protected function CheckPageFields()
{
E::ModuleSecurity()->ValidateSendForm();
$bOk = true;
/**
* Проверяем есть ли заголовок топика
*/
if (!F::CheckVal(F::GetRequest('page_title', null, 'post'), 'text', 2, 200)) {
E::ModuleMessage()->AddError(E::ModuleLang()->Get('action.admin.pages_create_title_error'), E::ModuleLang()->Get('error'));
$bOk = false;
}
/**
* Проверяем есть ли заголовок топика, с заменой всех пробельных символов на "_"
*/
$pageUrl = preg_replace("/\\s+/", '_', (string) F::GetRequest('page_url', null, 'post'));
$_REQUEST['page_url'] = $pageUrl;
if (!F::CheckVal(F::GetRequest('page_url', null, 'post'), 'login', 1, 50)) {
E::ModuleMessage()->AddError(E::ModuleLang()->Get('action.admin.pages_create_url_error'), E::ModuleLang()->Get('error'));
$bOk = false;
}
/**
* Проверяем на счет плохих УРЛов
*/
/*if (in_array(F::GetRequest('page_url',null,'post'),$this->aBadPageUrl)) {
E::ModuleMessage()->AddError(E::ModuleLang()->Get('action.admin.pages_create_url_error_bad').' '.join(',',$this->aBadPageUrl),E::ModuleLang()->Get('error'));
$bOk=false;
}*/
/**
* Проверяем есть ли содержание страницы
*/
if (!F::CheckVal(F::GetRequest('page_text', null, 'post'), 'text', 1, 50000)) {
E::ModuleMessage()->AddError(E::ModuleLang()->Get('action.admin.pages_create_text_error'), E::ModuleLang()->Get('error'));
$bOk = false;
}
/**
* Проверяем страницу в которую хотим вложить
*/
if (F::GetRequest('page_pid') != 0 && !($oPageParent = E::ModulePage()->GetPageById(F::GetRequest('page_pid')))) {
E::ModuleMessage()->AddError(E::ModuleLang()->Get('action.admin.pages_create_parent_page_error'), E::ModuleLang()->Get('error'));
$bOk = false;
}
/**
* Проверяем сортировку
*/
if (F::GetRequest('page_sort') && !is_numeric(F::GetRequest('page_sort'))) {
E::ModuleMessage()->AddError(E::ModuleLang()->Get('action.admin.pages_create_sort_error'), E::ModuleLang()->Get('error'));
$bOk = false;
}
/**
* Выполнение хуков
*/
E::ModuleHook()->Run('check_page_fields', array('bOk' => &$bOk));
return $bOk;
}
示例4: Menu
public function Menu()
{
$aPages = E::ModulePage()->GetPages(array('pid' => null, 'main' => 1, 'active' => 1));
E::ModuleViewer()->Assign('aPagesMain', $aPages);
return E::ModuleViewer()->Fetch('menus/menu.main_pages.tpl');
}