You are here

function flag_lists_menu in Flag Lists 6

Same name and namespace in other branches
  1. 7.3 flag_lists.module \flag_lists_menu()
  2. 7 flag_lists.module \flag_lists_menu()

Implementation of hook_menu().

File

./flag_lists.module, line 16
The Flag Lists module.

Code

function flag_lists_menu() {
  $items = array();
  $items['admin/build/flags/lists'] = array(
    'title' => 'Lists',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_lists_settings_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flags',
    ),
    'description' => 'Configure default settings allowing users to mark content with personal flags.',
    'file' => 'flag_lists.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 100,
  );
  $items['admin/build/flags/lists/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_lists_settings_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flags',
    ),
    'description' => 'Configure default settings allowing users to mark content with personal flags.',
    'file' => 'flag_lists.admin.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 1,
  );
  $items['admin/build/flags/lists/list'] = array(
    'title' => 'List',
    'page callback' => 'flag_lists_admin_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flags',
    ),
    'file' => 'flag_lists.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  $items['admin/build/flags/lists/template'] = array(
    'title' => 'New template',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_lists_create_template_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flags',
    ),
    'file' => 'flag_lists.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
  );
  if (module_exists('devel_generate')) {
    $items['admin/generate/flag_lists'] = array(
      'title' => 'Generate lists',
      'description' => 'Generate a given number of lists and listings on site content. Optionally delete existing lists and listings.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'flag_lists_generate_lists_form',
      ),
      'access callback' => 'user_access',
      'access arguments' => array(
        'administer flags',
      ),
      'file' => 'flag_lists.admin.inc',
    );
  }
  $items['flags/lists/add/%'] = array(
    'title' => 'Add a list',
    'page callback' => 'flag_lists_add',
    'page arguments' => array(
      3,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'create flag lists',
    ),
    'file' => 'flag_lists.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['flags/lists/edit/%'] = array(
    'title' => 'Edit a list',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_lists_form',
      3,
    ),
    'access callback' => 'flag_lists_is_owner',
    'access arguments' => array(
      2,
      3,
    ),
    'file' => 'flag_lists.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['flags/lists/delete/%'] = array(
    'title' => 'Delete a list',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_lists_delete_confirm',
      3,
    ),
    'access callback' => 'flag_lists_is_owner',
    'access arguments' => array(
      2,
      3,
    ),
    'file' => 'flag_lists.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/build/flag_lists/rebuild'] = array(
    'title' => 'Rebuild all flag lists',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'flag_lists_rebuild_confirm',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer flag lists',
    ),
    'file' => 'flag_lists.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['flag-lists'] = array(
    'title' => 'Flag',
    'page callback' => 'flag_lists_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['user/%/flags/lists'] = array(
    'title' => 'Lists',
    'page callback' => 'flag_lists_user_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'view flag lists',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['user/%/flags/lists/%'] = array(
    'title' => 'Listed content',
    'page callback' => 'flag_lists_user_list',
    'page arguments' => array(
      1,
      4,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'view flag lists',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}