PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » Pager » Bug #9946

Update to Pager (bug fix in file HTMLWidgets.php)

Details

Submitted2007-01-25 17:31 UTC
Fromgurbani at gmail dot com
Assignedquipo
StatusClosed
PackagePager
PHP Version5.2.0
Roadmaps(Not assigned)

Comments

[2007-01-25 17:31 UTC] gurbani at gmail dot com

Description:
------------
Hi Lorenzo,

I think I found a tiny bug in Pager.
Basically, this is the case:
- if the minimum limit in Pager is set e.g. to 25
- you only have e.g. 5 values
- you want to have a Select Box
- you set e.g. 'showAllText' => "All"

THEN

- The select box is returned with no option values, i.e. an empty Select Box

I've put the following fix at the end of function getPerPageSelectBox in HtmlWidgets.php. It seems to work for me.
Does it make sense to you? If so, can the library be updated with this fix?

Thanks
Prem

Test script:
---------------
(end of function getPerPageSelectBox, HtmlWidgets.php)

[..........]
$tmp .= $this->pager->_showAllText;
}
$tmp .= '</option>';
} else if ($showAllData) {
$tmp .= '<option value="'.$this->pager->_totalItems.'" selected="selected">';

if (empty($this->pager->_showAllText)) {
$tmp .= str_replace('%d', $this->pager->_totalItems, $optionText);
} else {
$tmp .= $this->pager->_showAllText;
}
$tmp .= '</option>';
}
$tmp .= '</select>';
return $tmp;
}