function custom_block_menu_local_tasks

Implements hook_menu_local_tasks().

File

drupal/core/modules/block/custom_block/custom_block.module, line 14
Allows the creaation of custom blocks through the user interface.

Code

function custom_block_menu_local_tasks(&$data, $router_item, $root_path) {

  // Add the "Add custom block" action link to the theme-specific block library
  // listing page.
  // @todo This should just be $root_path == 'admin/structure/block/list/%/add'
  //   but block_menu() registers static router paths instead of dynamic ones.
  if (preg_match('@^admin/structure/block/list/(.*)/add$@', $root_path)) {
    $item = menu_get_item('block/add');
    if ($item['access']) {
      $data['actions']['block/add'] = array(
        '#theme' => 'menu_local_action',
        '#link' => $item,
      );
    }
  }
}