Skip to content
Snippets Groups Projects
Commit 033527dd authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4199: coding standards

parent 52061855
No related branches found
No related tags found
1 merge request!7Feature/istwcms 4199 ebremner menu items count
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
*/ */
/** /**
* * Implements hook_theme_suggestions_field_alter().
*/ */
function gesso_theme_suggestions_field_alter(&$suggestions, $variables) { function gesso_theme_suggestions_field_alter(&$suggestions, $variables) {
$suggestions[] = 'field__node__' . $variables['element']['#field_name'] . '__' . $variables['element']['#bundle'] . '__' . $variables['element']['#view_mode']; $suggestions[] = 'field__node__' . $variables['element']['#field_name'] . '__' . $variables['element']['#bundle'] . '__' . $variables['element']['#view_mode'];
......
...@@ -2,25 +2,26 @@ ...@@ -2,25 +2,26 @@
/** /**
* @file * @file
*/ * Navigation template functions.
/**
* Implements theme_preprocess_menu_local_tasks()
*
* @param $variables
*/ */
use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Html;
/** /**
* * Implements hook_reprocess_menu_local_tasks().
*/ */
function gesso_preprocess_menu_local_tasks(&$variables) { function gesso_preprocess_menu_local_tasks(&$variables) {
foreach (['primary', 'secondary'] as $type) { foreach (['primary', 'secondary'] as $type) {
$tabs = []; $tabs = [];
// Sort the tabs by #weight. // Sort the tabs by #weight.
uasort($variables[$type], ['Drupal\Component\Utility\SortArray', 'sortByWeightProperty']); uasort(
$variables[$type],
[
'Drupal\Component\Utility\SortArray',
'sortByWeightProperty',
]
);
foreach (array_keys($variables[$type]) as $key) { foreach (array_keys($variables[$type]) as $key) {
// Add the tab to a new array. // Add the tab to a new array.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment