comparison core/includes/menu.inc @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
8 /** 8 /**
9 * @addtogroup menu 9 * @addtogroup menu
10 * @{ 10 * @{
11 */ 11 */
12 12
13 use Drupal\Component\Utility\SafeMarkup; 13 use Drupal\Component\Render\FormattableMarkup;
14 use Drupal\Core\Render\Element; 14 use Drupal\Core\Render\Element;
15 15
16 /** 16 /**
17 * Prepares variables for single local task link templates. 17 * Prepares variables for single local task link templates.
18 * 18 *
34 34
35 if (!empty($variables['element']['#active'])) { 35 if (!empty($variables['element']['#active'])) {
36 $variables['is_active'] = TRUE; 36 $variables['is_active'] = TRUE;
37 37
38 // Add text to indicate active tab for non-visual users. 38 // Add text to indicate active tab for non-visual users.
39 $active = SafeMarkup::format('<span class="visually-hidden">@label</span>', ['@label' => t('(active tab)')]); 39 $active = new FormattableMarkup('<span class="visually-hidden">@label</span>', ['@label' => t('(active tab)')]);
40 $link_text = t('@local-task-title@active', ['@local-task-title' => $link_text, '@active' => $active]); 40 $link_text = t('@local-task-title@active', ['@local-task-title' => $link_text, '@active' => $active]);
41 } 41 }
42 42
43 $link['localized_options']['set_active_class'] = TRUE; 43 $link['localized_options']['set_active_class'] = TRUE;
44 44
159 /** 159 /**
160 * Clears all cached menu data. 160 * Clears all cached menu data.
161 * 161 *
162 * This should be called any time broad changes 162 * This should be called any time broad changes
163 * might have been made to the router items or menu links. 163 * might have been made to the router items or menu links.
164 *
165 * @deprecated in Drupal 8.6.0, will be removed before Drupal 9.0.0. Use
166 * \Drupal::cache('menu')->invalidateAll() instead.
167 *
168 * @see https://www.drupal.org/node/2989138
164 */ 169 */
165 function menu_cache_clear_all() { 170 function menu_cache_clear_all() {
171 @trigger_error("menu_cache_clear_all() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use \Drupal::cache('menu')->invalidateAll() instead. See https://www.drupal.org/node/2989138", E_USER_DEPRECATED);
166 \Drupal::cache('menu')->invalidateAll(); 172 \Drupal::cache('menu')->invalidateAll();
167 } 173 }
168 174
169 /** 175 /**
170 * @} End of "addtogroup menu". 176 * @} End of "addtogroup menu".