Exemple #1
0
 /**
  * Returns a string with a XHTML SELECT menu,
  * useful for letting the user choose how many items per page should be
  * displayed. If parameter useSessions is TRUE, this value is stored in
  * a session var. The string isn't echoed right now so you can use it
  * with template engines.
  *
  * @param integer $start       starting value for the select menu
  * @param integer $end         ending value for the select menu
  * @param integer $step        step between values in the select menu
  * @param boolean $showAllData If true, perPage is set equal to totalItems.
  * @param array   $extraParams (or string $optionText for BC reasons)
  *                - 'optionText': text to show in each option.
  *                  Use '%d' where you want to see the number of pages selected.
  *                - 'attributes': (html attributes) Tag attributes or
  *                  HTML attributes (id="foo" pairs), will be inserted in the
  *                  <select> tag
  *
  * @return string xhtml select box
  * @access public
  */
 function getPerPageSelectBox($start = 5, $end = 30, $step = 5, $showAllData = false, $extraParams = array())
 {
     include_once 'Pager/HtmlWidgets.php';
     $widget = new Pager_HtmlWidgets($this);
     return $widget->getPerPageSelectBox($start, $end, $step, $showAllData, $extraParams);
 }
Exemple #2
0
 /**
  * Returns a string with a XHTML SELECT menu,
  * useful for letting the user choose how many items per page should be
  * displayed. If parameter useSessions is TRUE, this value is stored in
  * a session var. The string isn't echoed right now so you can use it
  * with template engines.
  *
  * @param integer $start       starting value for the select menu
  * @param integer $end         ending value for the select menu
  * @param integer $step        step between values in the select menu
  * @param boolean $showAllData If true, perPage is set equal to totalItems.
  * @param array   $extraParams (or string $optionText for BC reasons)
  *                - 'optionText': text to show in each option.
  *                  Use '%d' where you want to see the number of pages selected.
  *                - 'attributes': (html attributes) Tag attributes or
  *                  HTML attributes (id="foo" pairs), will be inserted in the
  *                  <select> tag
  *
  * @return string xhtml select box
  * @access public
  */
 function getPerPageSelectBox($start = 5, $end = 30, $step = 5, $showAllData = false, $extraParams = array())
 {
     $currentdir = dirname(__FILE__);
     $currentdir = str_replace("\\", "/", $currentdir);
     $currentdir = realpath($currentdir . '/..');
     include_once "{$currentdir}/Pager/HtmlWidgets.php";
     $widget = new Pager_HtmlWidgets($this);
     return $widget->getPerPageSelectBox($start, $end, $step, $showAllData, $extraParams);
 }