You are here

function _environment_indicator_switcher_toolbar_links in Environment Indicator 8.3

Same name and namespace in other branches
  1. 4.x environment_indicator.module \_environment_indicator_switcher_toolbar_links()

Helper function to get the links for the toolbar.

Return value

array A renderable array for the toolbar tray.

1 call to _environment_indicator_switcher_toolbar_links()
environment_indicator_toolbar in ./environment_indicator.module
Implements hook_toolbar().

File

./environment_indicator.module, line 262
Module implementation file.

Code

function _environment_indicator_switcher_toolbar_links() {
  if (!($items = _environment_indicator_switcher_links())) {
    return [];
  }
  $menu = [
    '#theme' => 'links__toolbar_shortcuts',
    '#links' => $items,
    '#attributes' => [
      'class' => [
        'toolbar-menu',
      ],
    ],
  ];
  return $menu;
}