#25159 [Ana]: getPerPageSelectBox doesn't works

From: Date: Wed, 20 Aug 2003 18:18:12 +0000
Subject: #25159 [Ana]: getPerPageSelectBox doesn't works
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20171@lists.php.net to get a copy of this message
ID: 25159 User updated by: maka3d at yahoo dot com dot br Reported By: maka3d at yahoo dot com dot br Status: Analyzed Bug Type: PEAR related Operating System: WINXP PHP Version: 4.3.2 Assigned To: l.alberton New Comment: what about a solution for getPerPageSelectBox? Previous Comments: ------------------------------------------------------------------------ [2003-08-20 04:01:48] nicos@php.net Index: Sliding.php =================================================================== RCS file: /repository/pear/Pager_Sliding/Sliding.php,v retrieving revision 1.15 diff -u -u -r1.15 Sliding.php --- Sliding.php 15 Jul 2003 22:25:33 -0000 1.15 +++ Sliding.php 20 Aug 2003 08:58:26 -0000 @@ -895,7 +895,7 @@ } //prevent URL manual modification - $this->_currentPage = min($this->_currentPage, $this->_totalPages); + $this->_currentPage = min($this->_currentPage, $this->_totalPages); } @@ -930,8 +930,6 @@ */ function _getLinksUrl() { - global $_SERVER; - // Sort out query string to prevent messy urls $querystring = array(); $qs = array(); @@ -985,8 +983,6 @@ */ function _setOptions($options) { - global $_GET, $_REQUEST, $_SESSION; - $allowed_options = array( 'totalItems', 'perPage', @@ -1079,4 +1075,4 @@ // }}} } -?> \ No newline at end of file +?> Btw I wonder if Lorenzo Alberton knows that if (!empty($_SESSION["$this->_sessionVar"])) is just stupid, it should be if (!empty($_SESSION[$this->_sessionVar]))... Everywhere. ------------------------------------------------------------------------ [2003-08-19 16:57:43] maka3d at yahoo dot com dot br Description: ------------ The getPerPageSelectBox method of Pager_Sliding Class doesn't memorize the _perPage inside a session Reproduce code: --------------- function _setOptions($options){ session_start(); // should have a session_start to be able to read and write the $_SESSION array global $_GET, $_REQUEST, $_SESSION; // and should take off this line or put it before session_start() cause it rewrite the $_SESSION array created before with session_start() ... session_write_close() // and add a session_write_close() at the end of the method ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25159&edit=1

« previous php.pear.dev (#20171) next »