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


PHP Section::hasData方法代码示例

本文整理汇总了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';
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:15,代码来源:Article.inc.php

示例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 
开发者ID:radicalsuz,项目名称:amp,代码行数:31,代码来源:article.php

示例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;
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:27,代码来源:Page.inc.php


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