diff --git a/core/includes/pager.inc b/core/includes/pager.inc index 816484f..dfffd06 100644 --- a/core/includes/pager.inc +++ b/core/includes/pager.inc @@ -20,9 +20,9 @@ * \Drupal::request()->query->get('page'), or 0 by default. Note that this * number may differ from the actual page being displayed. For example, if a * search for "example text" brings up three pages of results, but a user - * visits search/node/example+text?page=10, this function will return 10, even - * though the default pager implementation adjusts for this and still displays - * the third page of search results at that URL. + * visits search/node/example+text?page=10, this function will return 10, + * even though the default pager implementation adjusts for this and still + * displays the third page of search results at that URL. * * @see pager_default_initialize() */ @@ -36,11 +36,11 @@ function pager_find_page($element = 0) { } /** - * Initializes a pager for _theme('pager'). + * Initializes a pager. * - * This function sets up the necessary global variables so that future calls - * to _theme('pager') will render a pager that correctly corresponds to the - * items being displayed. + * This function sets up the necessary global variables so that the render + * system will correctly process #type 'pager' render arrays to output pagers + * that correspond to the items being displayed. * * If the items being displayed result from a database query performed using * Drupal's database API, and if you have control over the construction of the @@ -73,7 +73,7 @@ function pager_find_page($element = 0) { * '#result' => $result, * ]]; * - * // Finally, add the pager controls to the render array, and return. + * // Finally, add the pager to the render array, and return. * $render[] = ['#type' => 'pager']; * return $render; * @endcode @@ -103,7 +103,7 @@ function pager_find_page($element = 0) { * '#type' => 'remote', * ]]; * - * // Finally, add the pager controls to the render array, and return. + * // Finally, add the pager to the render array, and return. * $render[] = ['#type' => 'pager']; * return $render; * @endcode @@ -286,20 +286,24 @@ function template_preprocess_pager(&$variables) { * Get the query parameter array of a pager link. * * Adds or adjusts the 'page' parameter to make sure that, following the link, - * the requested $page for the given $element is displayed. + * the requested page for the given element is displayed. * The 'page' parameter is a comma-delimited string, where each value is the * target page for the corresponding pager $element. - * Since we can have multiple pagers on a single page, each pager has an index - * value assigned to it. If we have 5 pagers on a single page, we could assign - * them the index numbers: 0, 1, 2, 3, 4. To indicate that the 3rd pager is on - * page 5, we would need to indicate this in the URL query, by having index 2 - * have the value of 5. The URL query would then look like this: page=0,0,5. + * Since we can have multiple pagers on a single page, each pager has an + * element value assigned to it. If we have 5 pagers on a single page, we could + * assign them the element numbers: 0, 1, 2, 3, 4. To indicate that the 3rd + * pager needs to jump to page page 5 (note that in the pager query, the page + * numbers are zero-indexed, i.e. page at index 5 means that the pager will + * display page 6 to the users), we would need to indicate this in the URL + * query, by having element 2 have the index of 5. The URL query would then + * look like this, supposing all other pagers are on page index 0: + * ?page=0,0,5,0,0. * * @param array $query * An associative array of query parameters to add to. * @param int $element * An integer to distinguish between multiple pagers on one page. - * @param integer $index + * @param int $index * The index of the target page, for the given element, in the pager array. * * @return array