Exemplo n.º 1
0
 /**
  * Gets a list of all pages of the collection type
  * specified by $ctID
  * 
  * @param int $ctID ID of collection type
  */
 public function show($ctID)
 {
     $hh = Loader::helper('html');
     $th = Loader::helper('text');
     $emptyList = false;
     $this->view(false);
     Loader::model('page_list');
     $pl = new PageList();
     $pl->filterByCollectionTypeID($ctID);
     if (array_key_exists('cvName', $_REQUEST)) {
         $cvName = $th->sanitize($_REQUEST['cvName']);
         $this->set('cvName', $cvName);
         $pl->filterByName($cvName);
         if (count($pl->getPage()) <= 0) {
             $pl = new PageList();
             $emptyList = true;
         }
     }
     if (!$emptyList) {
         $pl->addtoQuery('left join Pages parent ON(p1.cParentID = parent.cID)');
         $pl->sortByMultiple('parent.cDisplayOrder asc', 'p1.cDisplayOrder asc');
         $pages = $pl->getPage();
     } else {
         $pages = '';
         $this->set('emptyList', t('No entries found'));
     }
     $ct = CollectionType::getByID($ctID);
     // add all necessary header items like JavaScript and CSS files
     if (!array_key_exists('cvName', $_REQUEST) || $cvName == '') {
         $this->addHeaderItem($hh->css('composer.sort.css', 'remo_composer_list'));
         $this->addHeaderItem($hh->javascript('composer.sort.js', 'remo_composer_list'));
     }
     $this->addHeaderItem($hh->javascript('composer.overview.js', 'remo_composer_list'));
     // add variables used by view
     $this->set('customColumns', $this->loadCustomColumns($ctID));
     $this->set('ctID', $ctID);
     $this->set('ctPublishMethod', $ct->getCollectionTypeComposerPublishMethod());
     $this->set('pages', $pages);
     $this->set('displaySearchBox', $this->displaySearchBox());
     $this->set('composerListTitel', $ct->getCollectionTypeName());
     $this->set('pagesPagination', $pl->displayPaging(false, true));
 }