cvs: pear /Pager Pager.php
| From: | Richard Heyes | Date: | Mon, 27 May 2002 17:37:17 +0000 |
| Subject: | cvs: pear /Pager Pager.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4158@lists.php.net to get a copy of this message | ||
richard Mon May 27 13:37:17 2002 EDT
Modified files:
/pear/Pager Pager.php
Log:
* No longer barfs with no querystring
* Now works with associative data array
Index: pear/Pager/Pager.php
diff -u pear/Pager/Pager.php:1.1 pear/Pager/Pager.php:1.2
--- pear/Pager/Pager.php:1.1 Sat Feb 9 17:46:47 2002
+++ pear/Pager/Pager.php Mon May 27 13:37:17 2002
@@ -218,8 +218,8 @@
$this->_totalPages = ceil((float)$this->_totalItems / (float)$this->_perPage);
$i = 1;
if (!empty($this->_itemData)) {
- foreach ($this->_itemData as $value) {
- $this->_pageData[$i][] = $value;
+ foreach ($this->_itemData as $key => $value) {
+ $this->_pageData[$i][$key] = $value;
if (count($this->_pageData[$i]) >= $this->_perPage) {
$i++;
}
@@ -240,6 +240,7 @@
// Sort out query string to prevent messy urls
$querystring = array();
+ $qs = array();
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$qs = explode('&', $HTTP_SERVER_VARS['QUERY_STRING']);
for ($i = 0, $cnt = count($qs); $i < $cnt; $i++) {