示例#1
0
文件: bulk.php 项目: ngreimel/kovent
 /**
  * @return bool|PageList
  */
 public function getRequestedSearchResults()
 {
     $dh = Loader::helper('concrete/dashboard/sitemap');
     if (!$dh->canRead()) {
         return false;
     }
     $pageList = new PageList();
     if ($_REQUEST['submit_search']) {
         $pageList->resetSearchRequest();
     }
     $req = $_REQUEST;
     $pageList->displayUnapprovedPages();
     $pageList->sortBy('cDateModified', 'desc');
     $cvName = htmlentities($req['cvName'], ENT_QUOTES, APP_CHARSET);
     if ($cvName != '') {
         $pageList->filterByName($cvName);
     }
     if ($req['cParentIDSearchField'] > 0) {
         if ($req['cParentAll'] == 1) {
             $pc = Page::getByID($req['cParentIDSearchField']);
             $cPath = $pc->getCollectionPath();
             $pageList->filterByPath($cPath);
         } else {
             $pageList->filterByParentID($req['cParentIDSearchField']);
         }
         $parentDialogOpen = 1;
     }
     $keywords = htmlentities($req['keywords'], ENT_QUOTES, APP_CHARSET);
     $pageList->filterByKeywords($keywords, true);
     if ($req['numResults']) {
         $pageList->setItemsPerPage($req['numResults']);
     }
     if ($req['ptID']) {
         $pageList->filterByPageTypeID($req['ptID']);
     }
     if ($_REQUEST['noKeywords'] == 1) {
         $pageList->filter('CollectionSearchIndexAttributes.ak_meta_keywords', NULL, '=');
         $this->set('keywordCheck', true);
         $parentDialogOpen = 1;
     }
     if ($_REQUEST['noDescription'] == 1) {
         $pageList->filter('CollectionSearchIndexAttributes.ak_meta_description', NULL, '=');
         $this->set('descCheck', true);
         $parentDialogOpen = 1;
     }
     $this->set('searchRequest', $req);
     $this->set('parentDialogOpen', $parentDialogOpen);
     return $pageList;
 }
示例#2
0
 /**
  * @return bool|PageList
  */
 public function getRequestedSearchResults()
 {
     $dh = $this->app->make('helper/concrete/dashboard/sitemap');
     if (!$dh->canRead()) {
         return false;
     }
     $pageList = new PageList();
     if ($this->request('submit_search')) {
         $pageList->resetSearchRequest();
     }
     $pageList->displayUnapprovedPages();
     $pageList->sortBy('cDateModified', 'desc');
     $cvName = $this->request('cvName');
     if ($cvName) {
         $pageList->filterByName($cvName);
     }
     $cParentIDSearchField = $this->request('cParentIDSearchField');
     if ($cParentIDSearchField > 0) {
         if ($this->request('cParentAll') == 1) {
             $pc = Page::getByID($cParentIDSearchField);
             if ($pc && !$pc->isError()) {
                 $cPath = $pc->getCollectionPath();
                 $pageList->filterByPath($cPath);
             }
         } else {
             $pageList->filterByParentID($cParentIDSearchField);
         }
         $parentDialogOpen = 1;
     }
     $keywords = $this->request('keywords');
     $pageList->filterByKeywords($keywords, true);
     $numResults = $this->request('numResults');
     if ($numResults) {
         $pageList->setItemsPerPage($numResults);
     }
     $ptID = $this->request('ptID');
     if ($ptID) {
         $pageList->filterByPageTypeID($ptID);
     }
     if ($this->request('noDescription') == 1) {
         $pageList->filter(false, "csi.ak_meta_description is null or csi.ak_meta_description = ''");
         $this->set('descCheck', true);
         $parentDialogOpen = 1;
     } else {
         $parentDialogOpen = null;
     }
     $this->set('searchRequest', $_REQUEST);
     $this->set('parentDialogOpen', $parentDialogOpen);
     return $pageList;
 }