/**
* Constants for static parameters of the pager
*/
- const ROWCOUNT = 50, PAGE_ID = 'crmPID', PAGE_ID_TOP = 'crmPID', PAGE_ID_BOTTOM = 'crmPID_B', PAGE_ROWCOUNT = 'crmRowCount';
+ const PAGE_ID = 'crmPID', PAGE_ID_TOP = 'crmPID', PAGE_ID_BOTTOM = 'crmPID_B', PAGE_ROWCOUNT = 'crmRowCount';
+
+ /**
+ * Deprecated constants that might still be used by extensions but no longer by core
+ * @deprecated
+ */
+ const ROWCOUNT = 50;
/**
* The output of the pager. This is a name/value array with various keys
* @return int
* new pageId to display to the user
*/
- public function getPageID($defaultPageId = 1, &$params) {
+ public function getPageID($defaultPageId, &$params) {
// POST has higher priority than GET vars
// else if a value is set that has higher priority and finally the GET var
$currentPage = $defaultPageId;
/**
* Get the number of rows to display from either a GET / POST variable
*
- * @param int $defaultPageRowCount
+ * @param int|null $defaultPageRowCount
* The default value if not set.
*
* @return int
* the rowCount value to use
*/
- public function getPageRowCount($defaultPageRowCount = self::ROWCOUNT) {
+ public function getPageRowCount($defaultPageRowCount = NULL) {
// POST has higher priority than GET vars
if (isset($_POST[self::PAGE_ROWCOUNT])) {
$rowCount = max((int ) @$_POST[self::PAGE_ROWCOUNT], 1);
$rowCount = max((int ) @$_GET[self::PAGE_ROWCOUNT], 1);
}
else {
- $rowCount = $defaultPageRowCount;
+ if (empty($defaultPageRowCount)) {
+ $rowCount = Civi::settings()->get('default_pager_size');
+ }
+ else {
+ $rowCount = $defaultPageRowCount;
+ }
}
return $rowCount;
}