Changeset 89
- Timestamp:
- 06/01/07 18:21:09 (5 years ago)
- File:
-
- 1 edited
-
openweather/openweather.module (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
openweather/openweather.module
r88 r89 15 15 switch ($section) { 16 16 case 'admin/help#openweather': 17 $output = '<p>'. t(' Meters help keep track of our usages of resources.').'</p>';17 $output = '<p>'. t('Openweather logs and graphs weather station readings from open2300 compatible stations.').'</p>'; 18 18 return $output; 19 19 case 'admin/modules#description': 20 return t(" Allows users to track their household usages.");20 return t("Open2300 weather station logger."); 21 21 case 'node/add#openweather': 22 return t("Add a new openweatherto monitor.");22 return t("Add a new weather station to monitor."); 23 23 } 24 24 } … … 63 63 64 64 $form['title'] = array('#type' => 'textfield', '#title' => t('Station name'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5); 65 $form['suburb'] = array('#type' => 'textfield', '#title' => t('Suburb'), '#required' => TRUE, '#default_value' => "", '#weight' => -5);66 /*$form['lat'] = array('#type' => 'textfield', '#title' => t('Latitude'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5);65 /* $form['suburb'] = array('#type' => 'textfield', '#title' => t('Suburb'), '#required' => TRUE, '#default_value' => "", '#weight' => -5); 66 $form['lat'] = array('#type' => 'textfield', '#title' => t('Latitude'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5); 67 67 $form['long'] = array('#type' => 'textfield', '#title' => t('Longitude'), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5); 68 */69 /* if ($admin) {70 $form['settings'] = array('#type' => 'fieldset', '#title' => t('Settings'));71 $form['settings']['active'] = array('#type' => 'radios', '#title' => t('Poll status'), '#default_value' => isset($node->active) ? $node->active : 1, '#options' => $_active, '#description' => t('When a poll is closed, visitors can no longer vote for it.'));72 }73 $form['settings']['runtime'] = array('#type' => 'select', '#title' => t('Poll duration'), '#default_value' => $node->runtime ? $node->runtime : 0, '#options' => $_duration, '#description' => t('After this period, the poll will be closed automatically.'));74 68 */ 75 69 return $form; … … 85 79 $items[] = array('path' => 'node/add/openweather', 'title' => t('weather station'), 86 80 'access' => user_access('create weather station')); 87 $items[] = array('path' => 'openweather', 'title' => t(' my openweathers'),81 $items[] = array('path' => 'openweather', 'title' => t('openweather stations'), 88 82 'callback' => 'openweather_page', 89 83 'access' => user_access('access content'), … … 129 123 function openweather_page() { 130 124 global $user; 125 126 $output = ''; 127 128 // If there is official weather get it 129 $radarURL = get_variable('openweather_radar', null); 130 if ($radarURL != null) $output .= "<img src='$radarURL'/>"; 131 131 132 // List all of my openweathers by category 132 $sql = "SELECT n.nid, n.title FROM {node} n WHERE n.type='openweather' AND n.uid=".$user->uid; 133 //$sql = db_rewrite_sql($sql); 134 //print $sql; 133 $sql = "SELECT n.nid, n.title FROM {node} n WHERE n.type='openweather'"; 134 135 135 $result = db_query($sql); 136 $output = '<ul>';136 $output .= '<ul>'; 137 137 while ($node = db_fetch_object($result)) { 138 138 $output .= '<li>'. l($node->title, "node/$node->nid") .'</li>';
Note: See TracChangeset
for help on using the changeset viewer.
