本文整理匯總了PHP中Section::hasData方法的典型用法代碼示例。如果您正苦於以下問題:PHP Section::hasData方法的具體用法?PHP Section::hasData怎麽用?PHP Section::hasData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Section
的用法示例。
在下文中一共展示了Section::hasData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: makeCriteriaSectionLogic
function makeCriteriaSectionLogic($section_id)
{
require_once 'AMP/Content/Section.inc.php';
$section = new Section(AMP_Registry::getDbcon(), $section_id);
if (!$section->hasData()) {
return 'TRUE';
}
$scope = $section->getDisplayCriteria();
unset($scope['displayable']);
$value = $this->makeCriteria($scope);
if ($value) {
return join(' AND ', $value);
}
return 'TRUE';
}
示例2: Section
* Redirect to Search Page for invalid page types, i.e. no valid List or Article
*/
if (!($listType || $currentPage->isArticle())) {
AMP_make_404();
}
/**
* Redirect to Search Page for unpublished articles unless in preview mode
*/
if (!AMP_DISPLAYMODE_PREVIEW && ($currentArticle =& $currentPage->getArticle())) {
if (!$currentArticle->isLive()) {
AMP_make_404();
}
//check to make sure parent section is live
require_once 'AMP/Content/Section.inc.php';
$currentSection = new Section(AMP_Registry::getDbcon(), $currentArticle->getParent());
if (!$currentSection->hasData() || !$currentSection->isLive()) {
if ($currentSection->id != AMP_CONTENT_SECTION_ID_ROOT) {
AMP_make_404();
}
}
/**
* Check if specified article is a section header and redirect to that section
*/
if (AMP_CONTENT_REDIRECT_SECTIONHEADERS_TO_SECTIONS && $currentArticle->getClass() == AMP_CONTENT_CLASS_SECTIONHEADER) {
if ($currentSection->hasData()) {
ampredirect($currentSection->getURL());
}
}
}
/**
* Check Section List pages for a redirect in the SectionHeader
示例3: setSection
/**
* set the Section for use on the current page
*
* @param integer $section_id The database id of the Section to use
* @access public
* @since 3.5.3
* @return void
*/
function setSection($section_id)
{
require_once 'AMP/Content/Section.inc.php';
$section = new Section(AMP_Registry::getDbcon(), $section_id);
if (!$section->hasData()) {
return false;
}
if ($target = $section->getRedirect()) {
ampredirect($target);
}
if (!isset($this->template_id) && ($template = $section->getTemplate())) {
$this->template_id = $template;
}
$this->section =& $section;
$this->section_id = $section->id;
$this->_globalizePageVars();
$this->_globalizeSectionVars($section);
return true;
}