You are here

function headerimage_menu in Header image 5

Same name and namespace in other branches
  1. 6 headerimage.module \headerimage_menu()
  2. 7 headerimage.module \headerimage_menu()

Implementation of hook_menu()

File

./headerimage.module, line 15
headerimage.module Conditionally display an node in a block.

Code

function headerimage_menu($may_cache) {
  $admin_access = user_access('administer Header Image');
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'title' => t('Header Image'),
      'description' => t('Control the Header Image.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'headerimage_settings_block_add',
      ),
      'path' => 'admin/settings/headerimage',
      'access' => $admin_access,
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'title' => t('List'),
      'path' => 'admin/settings/headerimage/list',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'headerimage_settings_block_add',
      ),
      'access' => $admin_access,
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -10,
    );
    $items[] = array(
      'title' => t('Settings'),
      'path' => 'admin/settings/headerimage/settings',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'headerimage_settings_form',
      ),
      'access' => $admin_access,
      'type' => MENU_LOCAL_TASK,
      'weight' => 10,
    );
  }
  else {
    $block = arg(4);
    $items[] = array(
      'title' => t('Edit'),
      'path' => 'admin/settings/headerimage/edit/' . $block,
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'headerimage_settings_block_edit',
        $block,
      ),
      'access' => $admin_access,
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'title' => t('Delete'),
      'path' => 'admin/settings/headerimage/delete/' . $block,
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'headerimage_block_confirm_delete',
        $block,
      ),
      'access' => $admin_access,
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}