You are here

function menu_block_menu in Menu Block 7.2

Same name and namespace in other branches
  1. 5.2 menu_block.module \menu_block_menu()
  2. 5 menu_block.module \menu_block_menu()
  3. 6.2 menu_block.module \menu_block_menu()
  4. 7.3 menu_block.module \menu_block_menu()

Implements hook_menu().

File

./menu_block.module, line 33
Provides configurable blocks of menu items.

Code

function menu_block_menu() {

  // @todo Remove this check if block module is re-added as a dependency.
  if (module_exists('block')) {
    $items['admin/structure/block/add-menu-block'] = array(
      'title' => 'Add menu block',
      'description' => 'Add a new menu block.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'menu_block_add_block_form',
      ),
      'access callback' => 'menu_block_access',
      'type' => MENU_LOCAL_ACTION,
      'file' => 'menu_block.admin.inc',
    );
    $default_theme = variable_get('theme_default', 'bartik');
    foreach (list_themes() as $key => $theme) {
      if ($key != $default_theme) {
        $items['admin/structure/block/list/' . $key . '/add-menu-block'] = array(
          'title' => 'Add menu block',
          'description' => 'Add a new menu block.',
          'page callback' => 'drupal_get_form',
          'page arguments' => array(
            'menu_block_add_block_form',
          ),
          'access callback' => 'menu_block_access',
          'type' => MENU_LOCAL_ACTION,
          'file' => 'menu_block.admin.inc',
        );
      }
    }
    $items['admin/structure/block/delete-menu-block'] = array(
      'title' => 'Delete menu block',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'menu_block_delete_form',
      ),
      'access callback' => 'menu_block_access',
      'type' => MENU_CALLBACK,
      'file' => 'menu_block.admin.inc',
    );
  }
  $items['admin/config/user-interface/menu-block'] = array(
    'title' => 'Menu block',
    'description' => 'Configure menu block.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'menu_block_admin_settings_form',
    ),
    'access callback' => 'menu_block_access',
    'type' => MENU_NORMAL_ITEM,
    'file' => 'menu_block.admin.inc',
  );
  return $items;
}