Exemplo n.º 1
0
 /**
  * Require the correct pagenav class based on template
  *
  * @param   int  $total       total
  * @param   int  $limitStart  start
  * @param   int  $limit       length of records to return
  *
  * @return  object	pageNav
  */
 public function &getPagination($total = 0, $limitStart = 0, $limit = 0)
 {
     if (!isset($this->nav)) {
         if ($this->randomRecords) {
             $limitStart = $this->getRandomLimitStart();
         }
         $params = $this->getParams();
         $this->nav = new FPagination($total, $limitStart, $limit);
         if ($limit == -1) {
             $this->nav->viewAll = true;
         }
         // $$$ rob set the nav link urls to the table action to avoid messed up url links when  doing ranged filters via the querystring
         $this->nav->url = $this->getTableAction();
         $this->nav->showAllOption = $params->get('showall-records', false);
         $this->nav->setId($this->getId());
         $this->nav->showTotal = $params->get('show-total', false);
         $item = $this->getTable();
         $this->nav->startLimit = FabrikWorker::getMenuOrRequestVar('rows_per_page', $item->rows_per_page, $this->isMambot);
         $this->nav->showDisplayNum = $params->get('show_displaynum', true);
     }
     return $this->nav;
 }