You are here

function boxes_menu in Boxes 6

Same name and namespace in other branches
  1. 7.2 boxes.module \boxes_menu()
  2. 7 boxes.module \boxes_menu()

Implementation of hook_menu().

File

./boxes.module, line 6

Code

function boxes_menu() {
  $items = array();
  ctools_include('plugins');
  $plugins = ctools_get_plugins('boxes', 'plugins');
  foreach ($plugins as $key => $info) {
    if (isset($info['title'])) {
      $items['admin/build/block/box-add/' . $key] = array(
        'title' => 'Add ' . strtolower($info['title']),
        'page callback' => 'drupal_get_form',
        'page arguments' => array(
          'boxes_add_form',
          4,
        ),
        'access arguments' => array(
          'administer blocks',
        ),
        'type' => MENU_LOCAL_TASK,
        'file' => 'boxes.admin.inc',
      );
    }
  }
  $items['admin/build/block/configure/boxes/%boxes/delete'] = array(
    'title' => 'Delete box',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'boxes_delete_form',
      5,
    ),
    'access arguments' => array(
      'administer blocks',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'boxes.admin.inc',
  );
  return $items;
}