You are here

function apps_menu in Apps 7

Implements hook_menu().

File

./apps.module, line 38
Module file for Apps

Code

function apps_menu() {
  $menu["admin/apps"] = array(
    'title' => 'Apps',
    'description' => 'Install and Manage Apps',
    'page callback' => 'apps_market_page',
    'access arguments' => array(
      'administer apps',
    ),
    'weight' => -10,
    'type' => MENU_NORMAL_ITEM,
    'file' => 'apps.pages.inc',
  );

  // App Server operations.
  $menu["admin/apps/%apps_server"] = array(
    'title callback' => "apps_server_title",
    'title arguments' => array(
      2,
    ),
    'page callback' => 'apps_install_page',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'administer apps',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_server/all"] = array(
    'title' => "All Apps",
    'weight' => 1,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $menu["admin/apps/%apps_server/manage"] = array(
    'title' => "Installed Apps",
    'page callback' => 'apps_manage_page',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'administer apps',
    ),
    'weight' => 2,
    'type' => MENU_LOCAL_TASK,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_server/update"] = array(
    'title' => "Available Updates",
    'page callback' => 'apps_update_page',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'administer apps',
    ),
    'weight' => 3,
    'type' => MENU_LOCAL_TASK,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_server/catalog.md"] = array(
    'title' => "Catelog",
    'page callback' => 'apps_catalog_page',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'administer apps',
    ),
    'file' => 'apps.pages.inc',
  );

  // App operations.
  $menu["admin/apps/%apps_app/%"] = array(
    'load arguments' => array(
      3,
    ),
    'title callback' => "apps_app_title",
    'title arguments' => array(
      2,
    ),
    'page callback' => 'apps_app_details_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'apps_app_access',
    'access arguments' => array(
      2,
      'details',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_app/%/details"] = array(
    'title' => "App Details",
    'weight' => 1,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $menu["admin/apps/%apps_app/%/install"] = array(
    'title' => "Install App",
    'page callback' => 'apps_app_install',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'apps_app_access',
    'access arguments' => array(
      2,
      'install',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_app/%/enable"] = array(
    'title' => "Enable App",
    'page callback' => 'apps_app_enable',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'apps_app_access',
    'access arguments' => array(
      2,
      'enable',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_app/%/disable"] = array(
    'title' => "Disable App",
    'page callback' => 'apps_app_disable',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'apps_app_access',
    'access arguments' => array(
      2,
      'disable',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_app/%/uninstall"] = array(
    'title' => "Uninstall App",
    'page callback' => 'apps_app_uninstall',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'apps_app_access',
    'access arguments' => array(
      2,
      'uninstall',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_app/%/update"] = array(
    'title' => "Update",
    'page callback' => 'apps_app_update',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'apps_app_access',
    'access arguments' => array(
      2,
      'update',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'apps.pages.inc',
  );
  $menu["admin/apps/%apps_app/%/configure"] = array(
    'title' => 'Configure',
    'page callback' => 'apps_app_config_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'apps_app_access',
    'access arguments' => array(
      2,
      'configure',
    ),
    'weight' => 2,
    'type' => MENU_LOCAL_TASK,
    'file' => 'apps.pages.inc',
  );
  if (module_exists('devel')) {
    $menu['admin/apps/%apps_app/%/devel'] = array(
      'title' => 'Devel',
      'page callback' => 'apps_devel_load_array',
      'page arguments' => array(
        'app',
        2,
      ),
      'access arguments' => array(
        'access devel information',
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'apps.pages.inc',
      'weight' => 300,
    );
  }

  // Config Screens.
  $menu['admin/config/system/apps'] = array(
    'title' => 'Apps Configuration',
    'description' => 'Settings for the App Module',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'apps_settings_form',
    ),
    'access arguments' => array(
      'administer apps',
    ),
    'file' => 'apps.pages.inc',
  );
  $menu['admin/config/system/apps/settings'] = array(
    'title' => 'Apps Configuration',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $menu['admin/config/system/apps/verify'] = array(
    'title' => 'Verify Apps support',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'apps_install_verify',
    ),
    'description' => 'Apps installation requirements check',
    'type' => MENU_LOCAL_TASK,
    'access arguments' => array(
      'administer apps',
    ),
    'file' => 'apps.profile.inc',
  );

  // Add a callback for voting
  // The params are server, app, vote in that order
  // @TODO: Make Voting a separate module. Not everyone wants it.
  $menu['apps/vote/%/%/%'] = array(
    'page callback' => 'apps_vote_for_app',
    'page arguments' => array(
      2,
      3,
      4,
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer apps',
    ),
    'file' => 'apps.voting.inc',
  );
  return $menu;
}