You are here

function mongodb_block_ui_menu in MongoDB 7

Implements hook_menu().

File

mongodb_block_ui/mongodb_block_ui.module, line 60
Controls the visual building mongodb_block_uis a page is constructed with.

Code

function mongodb_block_ui_menu() {
  $default_theme = variable_get('theme_default', 'garland');
  $items['admin/structure/mongodb_block'] = array(
    'title' => 'Blocks',
    'description' => 'Configure what blocks content appears in your site\'s sidebars and other regions.',
    'page callback' => 'mongodb_block_ui_admin_display',
    'page arguments' => array(
      $default_theme,
    ),
    'access arguments' => array(
      'administer mongodb blocks',
    ),
    'file' => 'mongodb_block_ui.admin.inc',
  );
  $items['admin/structure/mongodb_block/list'] = array(
    'title' => 'List',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/structure/mongodb_block/manage/%/%/%'] = array(
    'title' => 'Configure mongodb_block',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'mongodb_block_ui_admin_configure',
      4,
      5,
      6,
    ),
    'access arguments' => array(
      'administer mongodb blocks',
    ),
    'file' => 'mongodb_block_ui.admin.inc',
  );
  $items['admin/structure/mongodb_block/manage/%/%/%/configure'] = array(
    'title' => 'Configure mongodb_blocks',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
  );
  $items['admin/structure/mongodb_block/manage/%/%/%/delete'] = array(
    'title' => 'Delete block',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'mongodb_block_ui_custom_block_delete',
      4,
      5,
      6,
    ),
    'access arguments' => array(
      'administer mongodb blocks',
    ),
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_NONE,
    'file' => 'mongodb_block_ui.admin.inc',
  );
  foreach (list_themes() as $key => $theme) {
    $items['admin/structure/mongodb_block/list/' . $key] = array(
      'title' => check_plain($theme->info['name']),
      'page arguments' => array(
        $key,
      ),
      'type' => $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
      'weight' => $key == $default_theme ? -10 : 0,
      'access callback' => '_mongodb_block_ui_themes_access',
      'access arguments' => array(
        $theme,
      ),
      'file' => 'mongodb_block_ui.admin.inc',
    );
    $items['admin/structure/mongodb_block/list/' . $key . '/add'] = array(
      'title' => 'Add block',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'mongodb_block_ui_add_block_form',
        $key,
      ),
      'access arguments' => array(
        'administer mongodb blocks',
      ),
      'type' => MENU_LOCAL_ACTION,
      'file' => 'mongodb_block_ui.admin.inc',
    );
    $items['admin/structure/mongodb_block/demo/' . $key] = array(
      'title' => check_plain($theme->info['name']),
      'page callback' => 'mongodb_block_ui_admin_demo',
      'page arguments' => array(
        $key,
      ),
      'type' => MENU_CALLBACK,
      'access callback' => '_mongodb_block_ui_themes_access',
      'access arguments' => array(
        $theme,
      ),
      'theme callback' => '_mongodb_block_ui_custom_theme',
      'theme arguments' => array(
        $key,
      ),
      'file' => 'mongodb_block_ui.admin.inc',
    );
  }
  return $items;
}