You are here

function flag_menu in Flag 7.2

Same name and namespace in other branches
  1. 5 flag.module \flag_menu()
  2. 6.2 flag.module \flag_menu()
  3. 6 flag.module \flag_menu()
  4. 7.3 flag.module \flag_menu()

Implements hook_menu().

File

./flag.module, line 27
The Flag module.

Code

function flag_menu() {
  $items[FLAG_ADMIN_PATH] = array(
    'title' => 'Flags',
    'page callback' => 'flag_admin_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flags',
    ),
    'description' => 'Configure flags for marking content with arbitrary information (such as <em>offensive</em> or <em>bookmarked</em>).',
    'file' => 'includes/flag.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items[FLAG_ADMIN_PATH . '/list'] = array(
    'title' => 'List',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items[FLAG_ADMIN_PATH . '/add'] = array(
    'title' => 'Add a new flag',
    'page callback' => 'flag_add_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flags',
    ),
    'file' => 'includes/flag.admin.inc',
    'type' => MENU_LOCAL_ACTION,
    'weight' => 1,
  );
  $items[FLAG_ADMIN_PATH . '/import'] = array(
    'title' => 'Import',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_import_form',
    ),
    'access arguments' => array(
      'use flag import',
    ),
    'file' => 'includes/flag.export.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  $items[FLAG_ADMIN_PATH . '/export'] = array(
    'title' => 'Export',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_export_form',
    ),
    'access arguments' => array(
      'administer flags',
    ),
    'file' => 'includes/flag.export.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
  );
  $items[FLAG_ADMIN_PATH . '/manage/%flag'] = array(
    'load arguments' => array(
      TRUE,
    ),
    // Allow for disabled flags.
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_form',
      FLAG_ADMIN_PATH_START + 1,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flags',
    ),
    'file' => 'includes/flag.admin.inc',
    'type' => MENU_CALLBACK,
    // Make the flag title the default title for descendant menu items.
    'title callback' => '_flag_menu_title',
    'title arguments' => array(
      FLAG_ADMIN_PATH_START + 1,
    ),
  );
  $items[FLAG_ADMIN_PATH . '/manage/%flag/edit'] = array(
    'load arguments' => array(
      TRUE,
    ),
    // Allow for disabled flags.
    'title' => 'Edit flag',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items[FLAG_ADMIN_PATH . '/manage/%flag/export'] = array(
    'title' => 'Export',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_export_form',
      FLAG_ADMIN_PATH_START + 1,
    ),
    'access arguments' => array(
      'administer flags',
    ),
    'file' => 'includes/flag.export.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 20,
  );
  $items[FLAG_ADMIN_PATH . '/manage/%flag/delete'] = array(
    'title' => 'Delete flag',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_delete_confirm',
      FLAG_ADMIN_PATH_START + 1,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flags',
    ),
    'file' => 'includes/flag.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items[FLAG_ADMIN_PATH . '/manage/%flag/update'] = array(
    'load arguments' => array(
      TRUE,
    ),
    // Allow for disabled flags.
    'title' => 'Update',
    'page callback' => 'flag_update_page',
    'page arguments' => array(
      FLAG_ADMIN_PATH_START + 1,
    ),
    'access arguments' => array(
      'administer flags',
    ),
    'file' => 'includes/flag.export.inc',
    'type' => MENU_CALLBACK,
  );
  $items['flag/%/%flag/%'] = array(
    'title' => 'Flag',
    'page callback' => 'flag_page',
    'page arguments' => array(
      1,
      2,
      3,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['flag/confirm/%/%flag/%'] = array(
    'title' => 'Flag confirm',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_confirm',
      2,
      3,
      4,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}