Ejemplo n.º 1
0
 protected function getPaginationFilter()
 {
     $filter = new PaginationFilter();
     $filterInfo = $this->page->getConfig()->getValue('posts_filters');
     if ($filterInfo == 'none' or $filterInfo == 'nil' or $filterInfo == '') {
         $filterInfo = null;
     }
     if (PageHelper::isTag($this->page) or PageHelper::isCategory($this->page)) {
         // If the current page is a tag/category page, add filtering
         // for that.
         $filter->addPageClauses($this->page, $filterInfo);
     } else {
         if ($filterInfo != null) {
             // Add custom filtering clauses specified by the user in the
             // page configuration header.
             $filter->addClauses($filterInfo);
         }
     }
     return $filter;
 }
Ejemplo n.º 2
0
 protected function getPaginationFilter()
 {
     $filter = new PaginationFilter();
     $filterInfo = $this->page->getConfig()->getValue('posts_filters');
     if ($filterInfo == 'none' or $filterInfo == 'nil' or $filterInfo == '') {
         $filterInfo = null;
     }
     if (PageHelper::isTag($this->page) or PageHelper::isCategory($this->page)) {
         // If the current page is a tag/category page, add filtering
         // for that.
         if ($filterInfo != null) {
             throw new PieCrustException("The `posts_filters` setting cannot be used on a tag or category listing page -- the filter will be automatically set to posts matching the request tag or category.");
         }
         $filter->addPageClauses($this->page);
     } else {
         if ($filterInfo != null) {
             // Add custom filtering clauses specified by the user in the
             // page configuration header.
             $filter->addClauses($filterInfo);
         }
     }
     return $filter;
 }