Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
|
@ -169,6 +169,7 @@ function pager_get_query_parameters() {
|
|||
* one page.
|
||||
* - #parameters: An associative array of query string parameters to append
|
||||
* to the pager links.
|
||||
* - #route_parameters: An associative array of the route parameters.
|
||||
* - #quantity: The number of pages in the list.
|
||||
*/
|
||||
function template_preprocess_pager(&$variables) {
|
||||
|
|
@ -176,6 +177,7 @@ function template_preprocess_pager(&$variables) {
|
|||
$parameters = $variables['pager']['#parameters'];
|
||||
$quantity = $variables['pager']['#quantity'];
|
||||
$route_name = $variables['pager']['#route_name'];
|
||||
$route_parameters = isset($variables['pager']['#route_parameters']) ? $variables['pager']['#route_parameters'] : [];
|
||||
global $pager_page_array, $pager_total;
|
||||
|
||||
// Nothing to do if there is only one page.
|
||||
|
|
@ -218,7 +220,7 @@ function template_preprocess_pager(&$variables) {
|
|||
$options = array(
|
||||
'query' => pager_query_add_page($parameters, $element, 0),
|
||||
);
|
||||
$items['first']['href'] = \Drupal::url($route_name, [], $options);
|
||||
$items['first']['href'] = \Drupal::url($route_name, $route_parameters, $options);
|
||||
if (isset($tags[0])) {
|
||||
$items['first']['text'] = $tags[0];
|
||||
}
|
||||
|
|
@ -227,7 +229,7 @@ function template_preprocess_pager(&$variables) {
|
|||
$options = array(
|
||||
'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] - 1),
|
||||
);
|
||||
$items['previous']['href'] = \Drupal::url($route_name, [], $options);
|
||||
$items['previous']['href'] = \Drupal::url($route_name, $route_parameters, $options);
|
||||
if (isset($tags[1])) {
|
||||
$items['previous']['text'] = $tags[1];
|
||||
}
|
||||
|
|
@ -243,7 +245,7 @@ function template_preprocess_pager(&$variables) {
|
|||
$options = array(
|
||||
'query' => pager_query_add_page($parameters, $element, $i - 1),
|
||||
);
|
||||
$items['pages'][$i]['href'] = \Drupal::url($route_name, [], $options);
|
||||
$items['pages'][$i]['href'] = \Drupal::url($route_name, $route_parameters, $options);
|
||||
if ($i == $pager_current) {
|
||||
$variables['current'] = $i;
|
||||
}
|
||||
|
|
@ -260,7 +262,7 @@ function template_preprocess_pager(&$variables) {
|
|||
$options = array(
|
||||
'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] + 1),
|
||||
);
|
||||
$items['next']['href'] = \Drupal::url($route_name, [], $options);
|
||||
$items['next']['href'] = \Drupal::url($route_name, $route_parameters, $options);
|
||||
if (isset($tags[3])) {
|
||||
$items['next']['text'] = $tags[3];
|
||||
}
|
||||
|
|
@ -269,7 +271,7 @@ function template_preprocess_pager(&$variables) {
|
|||
$options = array(
|
||||
'query' => pager_query_add_page($parameters, $element, $pager_max - 1),
|
||||
);
|
||||
$items['last']['href'] = \Drupal::url($route_name, [], $options);
|
||||
$items['last']['href'] = \Drupal::url($route_name, $route_parameters, $options);
|
||||
if (isset($tags[4])) {
|
||||
$items['last']['text'] = $tags[4];
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue