function flag_menu in Flag 7.3
Same name and namespace in other branches
- 5 flag.module \flag_menu()
- 6.2 flag.module \flag_menu()
- 6 flag.module \flag_menu()
- 7.2 flag.module \flag_menu()
Implements hook_menu().
File
- ./
flag.module, line 228 - 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',
);
$items[FLAG_ADMIN_PATH . '/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items[FLAG_ADMIN_PATH . '/add'] = array(
'title' => 'Add 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_ACTION,
'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_ACTION,
'weight' => 3,
);
$items[FLAG_ADMIN_PATH . '/manage/%flag'] = array(
// Allow for disabled flags.
'load arguments' => array(
TRUE,
),
'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',
// 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(
// Allow for disabled flags.
'load arguments' => array(
TRUE,
),
'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(
// Allow for disabled flags.
'load arguments' => array(
TRUE,
),
'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' => 'flag_page_access',
'access arguments' => array(
1,
2,
3,
),
'file' => 'includes/flag.pages.inc',
'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' => 'flag_page_access',
'access arguments' => array(
2,
3,
4,
),
'file' => 'includes/flag.pages.inc',
'type' => MENU_CALLBACK,
);
return $items;
}