Changeset 102
- Timestamp:
- 19/04/07 04:58:10 (5 years ago)
- File:
-
- 1 edited
-
openweather/openweather.module (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
openweather/openweather.module
r101 r102 96 96 $node = node_load(arg(1)); 97 97 if ($node->type == 'openweather'){ 98 $items[] = array('path' => 'node/'. arg(1), 99 'title' => t('view openweather'), 100 'access' => user_access('access content'), 101 'weight' => 6, 102 'type' => MENU_LOCAL_TASK); 103 104 $items[] = array('path' => 'node/'. arg(1) .'/csv_readings', 98 $items[] = array('path' => 'node/'. arg(1) .'/csv_readings', 105 99 'title' => t('readings'), 106 100 'callback' => 'openweather_csv_readings', … … 109 103 'type' => MENU_LOCAL_TASK); 110 104 111 $items[] = array('path' => 'node/'. arg(1) .'/graph',105 $items[] = array('path' => 'node/'. arg(1) .'/graph', 112 106 'title' => t('graph'), 113 107 'callback' => 'openweather_graph', … … 260 254 * 261 255 * @param $block 262 * An extra paraopenweather that adapts the hook to display a block-ready263 * rendering of the poll.264 256 */ 265 257 function openweather_view($node, $teaser = FALSE, $page = FALSE, $block = FALSE) { 266 258 global $user; 267 268 $output = ''; 269 270 $links = array(); 271 $links[] = l(t('export readings'), 'node/'.$node->nid.'/csv_readings',array('title'=>'Export the openweather readings as CSV')); 272 273 $output .= openweather_summary($node->nid); 274 275 $output .= "<img src='?q=node/".$node->nid."/graph/temp_out' />"; 276 $output .= "<img src='?q=node/".$node->nid."/graph/rel_hum_out' />"; 277 $output .= "<img src='?q=node/".$node->nid."/graph/rel_pressure' />"; 278 $output .= "<img src='?q=node/".$node->nid."/graph/windspeed' />"; 279 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); 284 $node->links = $links; 285 $node->content['graphs'] = array( 286 '#value' => theme('openweather_graphs', $output), 287 '#weight' => 1, 288 ); 259 $node->content['summary'] = array('#weight'=>0, 260 '#value'=>openweather_summary($node->nid)); 261 262 $node->content['graphs'] = array('#weight'=>1, 263 '#value'=>"<img src='?q=node/".$node->nid."/graph/temp_out' />". 264 "<img src='?q=node/".$node->nid."/graph/rel_hum_out' />". 265 "<img src='?q=node/".$node->nid."/graph/rel_pressure' />". 266 "<img src='?q=node/".$node->nid."/graph/windspeed' />"); 267 289 268 return $node; 290 269 }
Note: See TracChangeset
for help on using the changeset viewer.
