You are here

function imagepicker_menu in Image Picker 7

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_menu()
  2. 5 imagepicker.module \imagepicker_menu()
  3. 6.2 imagepicker.module \imagepicker_menu()

Implement hook_menu().

File

./imagepicker.module, line 91
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_menu() {
  $items = array();
  $items['imagepicker'] = array(
    'title' => 'Image picker',
    'page callback' => 'imagepicker_box',
    'access callback' => 'imagepicker_access_use',
    'type' => MENU_CALLBACK,
    'file' => 'imagepicker.upload.inc',
    'theme callback' => 'imagepicker_access_theme',
  );
  $items['imagepicker/upload'] = array(
    'title' => 'Upload',
    'access callback' => 'imagepicker_access_use',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
  );
  $items['imagepicker/browse'] = array(
    'title' => 'Browse',
    'page callback' => 'imagepicker_box',
    'access callback' => 'imagepicker_access_use',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  $items['imagepicker/browse_public'] = array(
    'title' => 'Browse Public',
    'page callback' => 'imagepicker_box',
    'access callback' => 'imagepicker_access_use_public',
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
  );
  $items['imagepicker/groups'] = array(
    'title' => 'Groups',
    'page callback' => 'imagepicker_box',
    'access callback' => 'imagepicker_access_use_group',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.group.inc',
    'weight' => 4,
  );
  $items['imagepicker/browse/%imagepicker_id'] = array(
    'title' => 'Browse',
    'page callback' => 'imagepicker_box',
    'access callback' => 'imagepicker_access_use',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  $items['imagepicker/edit'] = array(
    'title' => 'Edit image',
    'page callback' => 'imagepicker_box',
    'access callback' => 'imagepicker_access_use',
    'type' => MENU_CALLBACK,
    'file' => 'imagepicker.edit.inc',
  );
  $items['imagepicker/image'] = array(
    'title' => 'Imagepicker',
    'page callback' => 'imagepicker_box',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );

  // uploadprogress callback
  $items['imagepicker/progress'] = array(
    'page callback' => 'imagepicker_uploadprogress_callback',
    'access arguments' => array(
      TRUE,
    ),
    'type' => MENU_CALLBACK,
  );

  // admin settings
  $items[IMAGEPICKER_ADMIN_PATH] = array(
    'title' => 'Imagepicker',
    'description' => 'Imagepicker settings and administration.',
    'page callback' => 'imagepicker_settings_page',
    'access callback' => 'imagepicker_access_admin',
    'type' => MENU_NORMAL_ITEM,
    'file' => 'imagepicker.admin.inc',
    'weight' => 0,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/general'] = array(
    'title' => 'General',
    'description' => 'Imagepicker settings.',
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_settings_page',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -10,
  );

  // admin groups
  $items[IMAGEPICKER_ADMIN_PATH . '/groups'] = array(
    'title' => 'Groups',
    'description' => 'Show user groups.',
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_admin_groups',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -8,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/groups/users'] = array(
    'title' => 'Users',
    'description' => 'Show user groups.',
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_admin_groups',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -10,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/groups/stats'] = array(
    'title' => 'Stats',
    'description' => 'Show user group stats.',
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_admin_groups',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -8,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/groups/user/%imagepicker_id'] = array(
    'title' => 'Groups',
    'description' => 'Show user groups.',
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_admin_groups',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -7,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/groups/user/%imagepicker_id/stats'] = array(
    'title' => 'Stats',
    'description' => 'Show user stats.',
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_admin_groups',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -8,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/groups/autocomplete'] = array(
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_group_search_autocomplete',
    'type' => MENU_CALLBACK,
    'file' => 'imagepicker.admin.inc',
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/stats'] = array(
    'title' => 'Stats All',
    'description' => 'Show user statistics.',
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -7,
  );

  // admin images
  $items[IMAGEPICKER_ADMIN_PATH . '/images'] = array(
    'title' => 'Images',
    'description' => 'Show user images.',
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -9,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/browse_public'] = array(
    'title' => 'Browse All',
    'description' => 'Browse user images.',
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -9,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/list_public'] = array(
    'title' => 'List All',
    'description' => 'List user images.',
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -8,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/users'] = array(
    'title' => 'Users',
    'description' => 'List users.',
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -10,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/user/%imagepicker_id/browse'] = array(
    'title' => 'Browse',
    'description' => 'Browse user images.',
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -4,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/user/%imagepicker_id/browseadmin'] = array(
    'title' => 'List',
    'description' => 'List user images.',
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -3,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/user/%imagepicker_id/upload'] = array(
    'title' => 'Upload',
    'description' => 'Browse user images.',
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -6,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/user/%imagepicker_id/stats'] = array(
    'title' => 'Stats',
    'description' => 'Browse user images.',
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -2,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/user/%imagepicker_id/groups'] = array(
    'title' => 'Groups',
    'description' => 'List user groups.',
    'access callback' => 'imagepicker_access_admin_group',
    'page callback' => 'imagepicker_admin_images',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -1,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/images/autocomplete'] = array(
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_user_autocomplete',
    'type' => MENU_CALLBACK,
    'file' => 'imagepicker.admin.inc',
  );

  // Import
  $items[IMAGEPICKER_ADMIN_PATH . '/import'] = array(
    'title' => 'Import',
    'description' => 'Manage bulk imports.',
    'page callback' => 'imagepicker_admin_import',
    'access callback' => 'imagepicker_access_import',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -8,
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/import/autocomplete'] = array(
    'access callback' => 'imagepicker_access_import',
    'page callback' => 'imagepicker_user_autocomplete',
    'type' => MENU_CALLBACK,
    'file' => 'imagepicker.admin.inc',
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/import/user/%imagepicker_id'] = array(
    'title' => 'Import',
    'description' => 'Import files.',
    'access callback' => 'imagepicker_access_import',
    'page callback' => 'imagepicker_admin_import',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.admin.inc',
    'weight' => -3,
  );

  // multitask
  $items[IMAGEPICKER_ADMIN_PATH . '/multitask'] = array(
    'title' => 'Bulk Operations',
    'page callback' => 'imagepicker_multitask',
    'access callback' => 'imagepicker_access_admin',
    'type' => MENU_CALLBACK,
  );

  // orphans
  $items[IMAGEPICKER_ADMIN_PATH . '/orphans'] = array(
    'title' => 'Orphaned images',
    'description' => 'Manage orphaned images.',
    'page callback' => 'imagepicker_admin_orphans',
    'access callback' => 'imagepicker_access_admin',
    'type' => MENU_CALLBACK,
    'file' => 'imagepicker.admin.inc',
  );
  $items[IMAGEPICKER_ADMIN_PATH . '/orphans/autocomplete'] = array(
    'access callback' => 'imagepicker_access_admin',
    'page callback' => 'imagepicker_user_autocomplete',
    'type' => MENU_CALLBACK,
    'file' => 'imagepicker.admin.inc',
  );

  // My imagepicker
  $items['user/%imagepicker_uid/imagepicker'] = array(
    'title' => 'My imagepicker',
    'description' => 'Manage your imagepicker files.',
    'page callback' => 'imagepicker_user_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'imagepicker_access_user_pages',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.user.inc',
    'weight' => 0,
  );
  $items['user/%imagepicker_uid/imagepicker/upload'] = array(
    'title' => 'Upload',
    'description' => 'Upload images.',
    'page callback' => 'imagepicker_user_page',
    'page arguments' => array(
      1,
      3,
    ),
    'access callback' => 'imagepicker_access_user_pages',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.user.inc',
    'weight' => -9,
  );
  $items['user/%imagepicker_uid/imagepicker/images/browse'] = array(
    'title' => 'Browse',
    'description' => 'Browse your imagepicker files.',
    'page callback' => 'imagepicker_user_page',
    'page arguments' => array(
      1,
      3,
      4,
      5,
    ),
    'access callback' => 'imagepicker_access_user_pages',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.user.inc',
    'weight' => -7,
  );
  $items['user/%imagepicker_uid/imagepicker/images/browseadmin'] = array(
    'title' => 'List',
    'description' => 'List your imagepicker files.',
    'page callback' => 'imagepicker_user_page',
    'page arguments' => array(
      1,
      3,
      4,
      5,
    ),
    'access callback' => 'imagepicker_access_user_pages',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.user.inc',
    'weight' => -6,
  );

  // groups
  $items['user/%imagepicker_uid/imagepicker/images/browse_public'] = array(
    'title' => 'Browse Public',
    'description' => 'Browse public imagepicker files.',
    'page callback' => 'imagepicker_user_page',
    'page arguments' => array(
      1,
      3,
      4,
      5,
    ),
    'access callback' => 'imagepicker_access_user_public',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.user.inc',
    'weight' => -5,
  );
  $items['user/%imagepicker_uid/imagepicker/groups/browse'] = array(
    'title' => 'Groups',
    'description' => 'Manage your imagepicker groups.',
    'page callback' => 'imagepicker_user_page',
    'page arguments' => array(
      1,
      3,
      4,
      5,
    ),
    'access callback' => 'imagepicker_access_user_groups',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.user.inc',
    'weight' => -4,
  );
  $items['user/%imagepicker_uid/imagepicker/stats'] = array(
    'title' => 'Stats',
    'description' => 'View your imagepicker statistics.',
    'page callback' => 'imagepicker_user_page',
    'page arguments' => array(
      1,
      3,
    ),
    'access callback' => 'imagepicker_access_user_groups',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.user.inc',
    'weight' => -3,
  );
  $items['user/%imagepicker_uid/imagepicker/config'] = array(
    'title' => 'Config',
    'description' => 'Administer user configuration.',
    'page callback' => 'imagepicker_user_page',
    'page arguments' => array(
      1,
      3,
    ),
    'access callback' => 'imagepicker_access_user_config',
    'type' => MENU_LOCAL_TASK,
    'file' => 'imagepicker.user.inc',
    'weight' => -2,
  );

  // multitask
  $items['user/%imagepicker_uid/imagepicker/multitask'] = array(
    'title' => 'Bulk Operations',
    'page callback' => 'imagepicker_multitask',
    'access callback' => 'imagepicker_access_user_pages',
    'type' => MENU_CALLBACK,
  );
  return $items;
}