Mercurial > hg > isophonics-drupal-site
comparison core/modules/views/src/ViewsDataHelper.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 7a779792577d |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 <?php | 1 <?php |
2 | 2 |
3 namespace Drupal\views; | 3 namespace Drupal\views; |
4 | 4 |
5 use Drupal\Component\Utility\Unicode; | 5 use Drupal\Component\Render\FormattableMarkup; |
6 use Drupal\Component\Utility\SafeMarkup; | |
7 | 6 |
8 /** | 7 /** |
9 * Defines a helper class for stuff related to views data. | 8 * Defines a helper class for stuff related to views data. |
10 */ | 9 */ |
11 class ViewsDataHelper { | 10 class ViewsDataHelper { |
118 elseif ($string == 'help') { | 117 elseif ($string == 'help') { |
119 $strings[$field][$key][$string] = ''; | 118 $strings[$field][$key][$string] = ''; |
120 } | 119 } |
121 else { | 120 else { |
122 if ($string != 'base') { | 121 if ($string != 'base') { |
123 $strings[$field][$key][$string] = SafeMarkup::format("Error: missing @component", ['@component' => $string]); | 122 $strings[$field][$key][$string] = new FormattableMarkup("Error: missing @component", ['@component' => $string]); |
124 } | 123 } |
125 } | 124 } |
126 } | 125 } |
127 } | 126 } |
128 } | 127 } |
172 * @return int | 171 * @return int |
173 * Returns -1 if $a comes before $b, 1 other way round and 0 if it cannot be | 172 * Returns -1 if $a comes before $b, 1 other way round and 0 if it cannot be |
174 * decided. | 173 * decided. |
175 */ | 174 */ |
176 protected static function fetchedFieldSort($a, $b) { | 175 protected static function fetchedFieldSort($a, $b) { |
177 $a_group = Unicode::strtolower($a['group']); | 176 $a_group = mb_strtolower($a['group']); |
178 $b_group = Unicode::strtolower($b['group']); | 177 $b_group = mb_strtolower($b['group']); |
179 if ($a_group != $b_group) { | 178 if ($a_group != $b_group) { |
180 return $a_group < $b_group ? -1 : 1; | 179 return $a_group < $b_group ? -1 : 1; |
181 } | 180 } |
182 | 181 |
183 $a_title = Unicode::strtolower($a['title']); | 182 $a_title = mb_strtolower($a['title']); |
184 $b_title = Unicode::strtolower($b['title']); | 183 $b_title = mb_strtolower($b['title']); |
185 if ($a_title != $b_title) { | 184 if ($a_title != $b_title) { |
186 return $a_title < $b_title ? -1 : 1; | 185 return $a_title < $b_title ? -1 : 1; |
187 } | 186 } |
188 | 187 |
189 return 0; | 188 return 0; |