本文整理汇总了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;
}