diff --git a/core/includes/pager.inc b/core/includes/pager.inc index 17011bf..730be44 100644 --- a/core/includes/pager.inc +++ b/core/includes/pager.inc @@ -182,15 +182,7 @@ function template_preprocess_pager(&$variables) { return; } - // Fill in default link labels. - $tags = &$variables['tags']; - $tags += array( - t('« first'), - t('‹ previous'), - '', - t('next ›'), - t('last »'), - ); + $tags = $variables['tags']; // Calculate various markers within this pager piece: // Middle is used to "center" pages around the current page. @@ -228,19 +220,18 @@ function template_preprocess_pager(&$variables) { 'query' => pager_query_add_page($parameters, $element, 0), ); $items['first']['href'] = url($current_path, $options); - $items['first']['text'] = $tags[0]; - $items['first']['attributes'] = new Attribute(array('title' => t('Go to first page'))); + if (isset($tags[0])) { + $items['first']['text'] = $tags[0]; + } $items['previous'] = array(); $options = array( 'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] - 1), ); $items['previous']['href'] = url($current_path, $options); - $items['previous']['text'] = $tags[1]; - $items['previous']['attributes'] = new Attribute(array( - 'title' => t('Go to previous page'), - 'rel' => 'prev', - )); + if (isset($tags[1])) { + $items['previous']['text'] = $tags[1]; + } } if ($i != $pager_max) { @@ -271,19 +262,18 @@ function template_preprocess_pager(&$variables) { 'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] + 1), ); $items['next']['href'] = url($current_path, $options); - $items['next']['text'] = $tags[3]; - $items['next']['attributes'] = new Attribute(array( - 'title' => t('Go to next page'), - 'rel' => 'next', - )); + if (isset($tags[3])) { + $items['next']['text'] = $tags[3]; + } $items['last'] = array(); $options = array( 'query' => pager_query_add_page($parameters, $element, $pager_max - 1), ); $items['last']['href'] = url($current_path, $options); - $items['last']['text'] = $tags[4]; - $items['last']['attributes'] = new Attribute(array('title' => t('Go to last page'))); + if (isset($tags[4])) { + $items['last']['text'] = $tags[4]; + } } $variables['items'] = $items; diff --git a/core/modules/system/templates/pager.html.twig b/core/modules/system/templates/pager.html.twig index 3c30730..4a970e0 100644 --- a/core/modules/system/templates/pager.html.twig +++ b/core/modules/system/templates/pager.html.twig @@ -39,17 +39,17 @@