X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FPager.php;h=390764d766ac0c20a114b5c932b0a9f3aed6cf4f;hb=73e57781380c5e928082d48d3a7e61ed1f339f78;hp=57fce5820d992abcc408ed267227198f22f03999;hpb=5afcf74389296764bd92ed3bc3b2f5f209933bfe;p=civicrm-core.git diff --git a/CRM/Utils/Pager.php b/CRM/Utils/Pager.php index 57fce5820d..390764d766 100644 --- a/CRM/Utils/Pager.php +++ b/CRM/Utils/Pager.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2018 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -27,7 +27,7 @@ /** * @package CRM - * @copyright CiviCRM LLC (c) 2004-2018 + * @copyright CiviCRM LLC (c) 2004-2019 */ /** @@ -88,11 +88,11 @@ class CRM_Utils_Pager extends Pager_Sliding { $statusMessage = ''; } else { - $statusMessage = ts('%1 - %2 of %3', array(1 => $start, 2 => $end, 3 => $params['total'])); + $statusMessage = ts('%1 - %2 of %3', [1 => $start, 2 => $end, 3 => $params['total']]); } $params['status'] = str_replace('%%StatusMessage%%', $statusMessage, $params['status']); - $this->_response = array( + $this->_response = [ 'first' => $this->getFirstPageLink(), 'back' => $this->getBackPageLink(), 'next' => $this->getNextPageLink(), @@ -104,21 +104,21 @@ class CRM_Utils_Pager extends Pager_Sliding { 'buttonTop' => CRM_Utils_Array::value('buttonTop', $params), 'buttonBottom' => CRM_Utils_Array::value('buttonBottom', $params), 'currentLocation' => $this->getCurrentLocation(), - ); + ]; /** * A page cannot have two variables with the same form name. Hence in the * pager display, we have a form submission at the top with the normal * page variable, but a different form element for one at the bottom. */ - $this->_response['titleTop'] = ts('Page %1 of %2', array( - 1 => '', - 2 => $this->_response['numPages'], - )); - $this->_response['titleBottom'] = ts('Page %1 of %2', array( - 1 => '', - 2 => $this->_response['numPages'], - )); + $this->_response['titleTop'] = ts('Page %1 of %2', [ + 1 => '', + 2 => $this->_response['numPages'], + ]); + $this->_response['titleBottom'] = ts('Page %1 of %2', [ + 1 => '', + 2 => $this->_response['numPages'], + ]); } /** @@ -148,8 +148,8 @@ class CRM_Utils_Pager extends Pager_Sliding { $params['separator'] = ''; $params['spacesBeforeSeparator'] = 1; $params['spacesAfterSeparator'] = 1; - $params['extraVars'] = array('force' => 1); - $params['excludeVars'] = array('reset', 'snippet', 'section'); + $params['extraVars'] = ['force' => 1]; + $params['excludeVars'] = ['reset', 'snippet', 'section']; // set previous and next text labels $params['prevImg'] = ' ' . ts('< Previous'); @@ -248,7 +248,7 @@ class CRM_Utils_Pager extends Pager_Sliding { $offset = ($pageId - 1) * $this->_perPage; - return array($offset, $this->_perPage); + return [$offset, $this->_perPage]; } /**