comparison core/includes/tablesort.inc @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children 12f9dff5fda9
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
7 * All tables created when rendering a '#type' => 'table' have the option of 7 * All tables created when rendering a '#type' => 'table' have the option of
8 * having column headers that the user can click on to sort the table by that 8 * having column headers that the user can click on to sort the table by that
9 * column. 9 * column.
10 */ 10 */
11 11
12 use Drupal\Component\Utility\SafeMarkup; 12 use Drupal\Component\Render\FormattableMarkup;
13 use Drupal\Core\Url; 13 use Drupal\Core\Url;
14 use Drupal\Component\Utility\UrlHelper; 14 use Drupal\Component\Utility\UrlHelper;
15 15
16 /** 16 /**
17 * Initializes the table sort context. 17 * Initializes the table sort context.
58 else { 58 else {
59 // If the user clicks a different header, we want to sort ascending initially. 59 // If the user clicks a different header, we want to sort ascending initially.
60 $ts['sort'] = 'asc'; 60 $ts['sort'] = 'asc';
61 $image = ''; 61 $image = '';
62 } 62 }
63 $cell_content = \Drupal::l(SafeMarkup::format('@cell_content@image', ['@cell_content' => $cell_content, '@image' => $image]), new Url('<current>', [], [ 63 $cell_content = \Drupal::l(new FormattableMarkup('@cell_content@image', ['@cell_content' => $cell_content, '@image' => $image]), new Url('<current>', [], [
64 'attributes' => ['title' => $title], 64 'attributes' => ['title' => $title],
65 'query' => array_merge($ts['query'], [ 65 'query' => array_merge($ts['query'], [
66 'sort' => $ts['sort'], 66 'sort' => $ts['sort'],
67 'order' => $cell_content, 67 'order' => $cell_content,
68 ]), 68 ]),