You are here

function weather_menu in Weather 7.2

Same name and namespace in other branches
  1. 5.6 weather.module \weather_menu()
  2. 5 weather.module \weather_menu()
  3. 6.5 weather.module \weather_menu()
  4. 7.3 weather.module \weather_menu()
  5. 7 weather.module \weather_menu()

Implements hook_menu().

File

./weather.module, line 71
Display current weather data from many places in the world.

Code

function weather_menu() {
  $items['admin/config/user-interface/weather'] = array(
    'title' => 'Weather',
    'description' => 'Configure system-wide weather displays and the default configuration of new displays. Add new places to the module.',
    'page callback' => 'weather_admin_main_page',
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/config/user-interface/weather/displays'] = array(
    'title' => 'Displays',
    'description' => 'Configure system-wide weather displays and the default configuration of new displays.',
    'page callback' => 'weather_admin_main_page',
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/user-interface/weather/places'] = array(
    'title' => 'Places',
    'description' => 'Configure places for weather.',
    'page callback' => 'weather_admin_places',
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/user-interface/weather/default'] = array(
    'title' => 'Edit default display',
    'description' => 'Configure the default display.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_display_config_form',
      4,
    ),
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/config/user-interface/weather/system-wide/add'] = array(
    'title' => 'Add display',
    'description' => 'Configure a weather display.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_display_config_form',
      4,
      5,
    ),
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/config/user-interface/weather/system-wide/%'] = array(
    'title' => 'Edit display',
    'description' => 'Configure a weather display.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_display_config_form',
      4,
      5,
    ),
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/user-interface/weather/system-wide/%/delete'] = array(
    'title' => 'Delete display',
    'description' => 'Delete a weather display.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_display_delete_confirm',
      4,
      5,
    ),
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/user-interface/weather/system-wide/%/add'] = array(
    'title' => 'Add location',
    'description' => 'Configure settings for a location.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_location_settings_form',
      4,
      5,
      6,
    ),
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/user-interface/weather/system-wide/%/%'] = array(
    'title' => 'Edit location',
    'description' => 'Configure settings for a location.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_location_settings_form',
      4,
      5,
      6,
    ),
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/user-interface/weather/system-wide/%/%/delete'] = array(
    'title' => 'Delete location',
    'description' => 'Delete a location from a system-wide weather display.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_location_delete_confirm',
      6,
    ),
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'administer system-wide weather',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['user/%/weather'] = array(
    'title' => 'Weather',
    'description' => 'Configure your custom weather display.',
    'page callback' => 'weather_user_main_page',
    'page arguments' => array(
      1,
    ),
    'file' => 'weather.forms.inc',
    'access callback' => 'weather_access_userblock',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['user/%/weather/display'] = array(
    'title' => 'Edit display',
    'description' => 'Configure your custom weather display.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_display_config_form',
      0,
      1,
    ),
    'file' => 'weather.forms.inc',
    'access callback' => 'weather_access_userblock',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['user/%/weather/display/delete'] = array(
    'title' => 'Delete display',
    'description' => 'Delete your custom weather display.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_display_delete_confirm',
      0,
      1,
    ),
    'file' => 'weather.forms.inc',
    'access callback' => 'weather_access_userblock',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['user/%/weather/add'] = array(
    'title' => 'Add location',
    'description' => 'Configure settings for a location.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_location_settings_form',
      0,
      1,
      3,
    ),
    'file' => 'weather.forms.inc',
    'access callback' => 'weather_access_userblock',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['user/%/weather/%'] = array(
    'title' => 'Edit location',
    'description' => 'Configure settings for a location.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_location_settings_form',
      0,
      1,
      3,
    ),
    'file' => 'weather.forms.inc',
    'access callback' => 'weather_access_userblock',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['user/%/weather/%/delete'] = array(
    'title' => 'Delete location',
    'description' => 'Delete a location from your custom weather display.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'weather_location_delete_confirm',
      3,
    ),
    'file' => 'weather.forms.inc',
    'access callback' => 'weather_access_userblock',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['weather'] = array(
    'title' => 'Weather',
    'description' => 'Search for locations and display their current weather.',
    'page callback' => 'weather_search_location',
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'access weather search page',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['weather/autocomplete/%'] = array(
    'page callback' => 'weather_search_autocomplete',
    'page arguments' => array(
      2,
    ),
    'file' => 'weather.forms.inc',
    'access arguments' => array(
      'access weather search page',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['weather/%/%menu_tail'] = array(
    'title' => 'Weather forecast',
    'description' => 'Display current weather and detailed forecast.',
    'page callback' => 'weather_show_detailed_forecast',
    'page arguments' => array(
      1,
      2,
    ),
    'file' => 'weather.common.inc',
    'load arguments' => array(
      '%map',
      '%index',
    ),
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}