function weather_menu in Weather 7
Same name and namespace in other branches
- 5.6 weather.module \weather_menu()
- 5 weather.module \weather_menu()
- 6.5 weather.module \weather_menu()
- 7.3 weather.module \weather_menu()
- 7.2 weather.module \weather_menu()
Implement hook_menu().
File
- ./
weather.module, line 44 - 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.',
'page callback' => 'weather_admin_main_page',
'file' => 'weather.forms.inc',
'access arguments' => array(
'administer site configuration',
),
'type' => MENU_NORMAL_ITEM,
);
$items['admin/config/user-interface/weather/default'] = array(
'title' => 'Edit default display',
'description' => 'Configure settings for the default display.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'weather_display_settings_form',
4,
),
'file' => 'weather.forms.inc',
'access arguments' => array(
'administer site configuration',
),
'type' => MENU_LOCAL_ACTION,
);
$items['admin/config/user-interface/weather/system-wide/add'] = array(
'title' => 'Add display',
'description' => 'Configure settings for a weather display.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'weather_display_settings_form',
4,
5,
),
'file' => 'weather.forms.inc',
'access arguments' => array(
'administer site configuration',
),
'type' => MENU_LOCAL_ACTION,
);
$items['admin/config/user-interface/weather/system-wide/%'] = array(
'title' => 'Edit display',
'description' => 'Configure settings for a weather display.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'weather_display_settings_form',
4,
5,
),
'file' => 'weather.forms.inc',
'access arguments' => array(
'administer site configuration',
),
'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 site configuration',
),
'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 site configuration',
),
'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 site configuration',
),
'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 site configuration',
),
'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 settings for your custom weather display.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'weather_display_settings_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 pages',
),
'type' => MENU_NORMAL_ITEM,
);
$items['weather/autocomplete'] = array(
'page callback' => 'weather_search_autocomplete',
'file' => 'weather.forms.inc',
'access arguments' => array(
'access weather pages',
),
'type' => MENU_CALLBACK,
);
return $items;
}