You are here

function bean_usage_menu in Bean (for Drupal 7) 7

Implements hook_menu()

Return value

array

File

bean_usage/bean_usage.module, line 14
Bean Admin Functions and Display

Code

function bean_usage_menu() {
  $items = array();

  // Todo: beans can be placed via context and block admin - we should account for those as well.
  // usage tab on bean view
  $items['block/%bean_delta/usage'] = array(
    'title' => 'Usage',
    'description' => 'Displays a list of entities where this bean is used.',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    'page callback' => 'bean_usage_output',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'view bean usage',
    ),
  );

  // bean usage report
  $items['admin/reports/bean/usage'] = array(
    'title' => t('Bean usage'),
    'description' => 'Displays a list of Beans (blockreferences) and where they are used.',
    'page callback' => 'bean_usage_output',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      'view bean usage',
    ),
  );
  $items['admin/reports/bean/usage/list'] = array(
    'title' => t('Usage'),
    'description' => 'Displays a list of Beans (blockreferences) and where they are used.',
    'weight' => 0,
    'page callback' => 'bean_usage_output',
    'page arguments' => array(
      5,
    ),
    'access arguments' => array(
      'view bean usage',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/reports/bean/usage/settings'] = array(
    'title' => t('Settings'),
    'description' => t('Displays a list of Beans (blockreferences) and where they are used.'),
    'weight' => 1,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'bean_usage_settings',
    ),
    'access arguments' => array(
      'administer bean usage',
    ),
    'file' => 'includes/bean_usage.forms.inc',
    'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
  );
  return $items;
}