Mercurial > hg > isophonics-drupal-site
comparison core/themes/stable/stable.theme @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 /** | |
4 * @file | |
5 * Functions to support theming in the Stable theme. | |
6 */ | |
7 | |
8 use Drupal\Component\Utility\Html; | |
9 | |
10 /** | |
11 * Implements template_preprocess_links(). | |
12 */ | |
13 function stable_preprocess_links(&$variables) { | |
14 // @deprecated in Drupal 8.0.x and will be removed before 9.0.0. This feature | |
15 // of adding a class based on the associative key can cause CSS class name | |
16 // conflicts. | |
17 if (!empty($variables['links'])) { | |
18 foreach ($variables['links'] as $key => $value) { | |
19 if (!is_numeric($key)) { | |
20 $class = Html::getClass($key); | |
21 $variables['links'][$key]['attributes']->addClass($class); | |
22 } | |
23 } | |
24 } | |
25 } |