You are here

function panopoly_widgets_menu_block_tree_alter in Panopoly Widgets 7

Implements hook_menu_block_tree_alter().

File

./panopoly_widgets.module, line 575

Code

function panopoly_widgets_menu_block_tree_alter(&$tree, $config) {

  // Only alter if 'expanded' is enabled and the max isn't 'Expand all children'
  if ($config['expanded'] && isset($config['expanded_max_depth']) && $config['expanded_max_depth'] > 0) {
    _panopoly_widgets_menu_block_tree_expanded_max_depth_alter($tree, $config);
  }

  // Updates menu block settings in case of IPE callback magic. This will only
  // work in limited cases but will be fixed when the page refreshes.
  if (arg(0) == 'panels' && arg(1) == 'ajax') {
    foreach ($tree as $key => $value) {
      $tree[$key]['link']['in_active_trail'] = TRUE;
    }
  }
}