You are here

function weather_menu in Weather 5

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

Implementation of hook_menu().

File

./weather.module, line 61
Display <acronym title="METeorological Aerodrome Report">METAR</acronym> weather data from anywhere in the world

Code

function weather_menu($may_cache) {
  global $user;
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/weather',
      'title' => t('Weather'),
      'description' => t('Configure the system-wide weather block.'),
      'callback' => 'weather_custom_block',
      'callback arguments' => array(
        0,
      ),
      'access' => user_access('access administration pages'),
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'user/' . $user->uid . '/weather',
      'title' => t('My weather'),
      'description' => t('Configure your custom weather block.'),
      'callback' => 'weather_custom_block',
      'callback arguments' => array(
        $user->uid,
      ),
      'access' => user_access('administer custom weather block'),
      'type' => MENU_LOCAL_TASK,
    );
  }
  return $items;
}