Changeset 101 for openweather


Ignore:
Timestamp:
19/04/07 04:42:02 (5 years ago)
Author:
nigel
Message:

Partial upgrade to 5.x API. Graphs still don't work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • openweather/openweather.module

    r100 r101  
    8484      'type' => MENU_SUGGESTED_ITEM); 
    8585 
     86    $items[] = array('path' => 'admin/settings/openweather', 
     87          'title' => t('openweather'), 
     88          'callback' => 'drupal_get_form', 
     89          'callback arguments' => 'openweather_admin_settings', 
     90          'access' => user_access('administer site configuration'), 
     91          'type' => MENU_CALLBACK); 
     92  
    8693  } 
    8794  else { 
     
    108115          'weight' => 3, 
    109116          'type' => MENU_CALLBACK); 
     117 
    110118      } 
    111119    } 
     
    119127 */ 
    120128function openweather_node_info() { 
    121   return array('openweather' => array('name' => t("openweather"), 'base' => 'openweather')); 
     129  return array( 
     130    'openweather' => array( 
     131      'name' => t("openweather"),  
     132      'base' => 'openweather', 
     133      'module' => 'openweather', 
     134      )); 
    122135} 
    123136 
     
    135148  if ($radarURL != null) $output .= "<img src='$radarURL'/>"; 
    136149 
    137   if (module_exist("weather")){ 
     150  if (module_exists("weather")){ 
    138151    $b = weather_block('view'); 
    139152    $output .= $b['content']; 
     
    153166} 
    154167 
    155 function openweather_settings() { 
     168function openweather_admin_settings() { 
    156169  $form['openweather_radar'] = array( 
    157170    '#type'=>'textfield', 
     
    250263 *   rendering of the poll. 
    251264 */ 
    252 function openweather_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) { 
     265function openweather_view($node, $teaser = FALSE, $page = FALSE, $block = FALSE) { 
    253266  global $user; 
    254267 
     
    265278  $output .= "<img src='?q=node/".$node->nid."/graph/windspeed' />"; 
    266279 
     280  // Only show the add readings form when in full view 
     281//  $node->teaser = $output; 
     282//  $node->body = $output; //$output.drupal_get_form('openweather_add_reading', $form); 
     283  $node = node_prepare($node, $teaser); 
    267284  $node->links = $links; 
    268   // Only show the add readings form when in full view 
    269   $node->teaser = $output; 
    270   $node->body = $output; //$output.drupal_get_form('openweather_add_reading', $form); 
     285  $node->content['graphs'] = array( 
     286    '#value' => theme('openweather_graphs', $output), 
     287    '#weight' => 1, 
     288  ); 
     289  return $node; 
    271290} 
    272291 
     
    314333      'openweather.addEntry', 
    315334      'openweather_add_entry', 
    316       array('boolean','string','string', 'string', 'struct') 
     335      array('boolean','string','string', 'string', 'struct'), 
     336      t('Add data entry from remote device'), 
    317337    ), 
    318338  ); 
Note: See TracChangeset for help on using the changeset viewer.