function menu_block_view_alter

Implements hook_block_view_alter().

File

modules/menu/menu.module, line 522

Code

function menu_block_view_alter(&$data, $block) {
    // Add contextual links for system menu blocks.
    if ($block->module == 'system' && !empty($data['content'])) {
        $system_menus = menu_list_system_menus();
        if (isset($system_menus[$block->delta])) {
            $data['content']['#contextual_links']['menu'] = array(
                'admin/structure/menu/manage',
                array(
                    $block->delta,
                ),
            );
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.