Changeset 89


Ignore:
Timestamp:
06/01/07 18:21:09 (5 years ago)
Author:
nigel
Message:

modified _page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • openweather/openweather.module

    r88 r89  
    1515  switch ($section) { 
    1616    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>'; 
    1818      return $output; 
    1919    case 'admin/modules#description': 
    20       return t("Allows users to track their household usages."); 
     20      return t("Open2300 weather station logger."); 
    2121    case 'node/add#openweather': 
    22       return t("Add a new openweather to monitor."); 
     22      return t("Add a new weather station to monitor."); 
    2323  } 
    2424} 
     
    6363 
    6464  $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); 
    6767  $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.')); 
    7468*/ 
    7569  return $form; 
     
    8579    $items[] = array('path' => 'node/add/openweather', 'title' => t('weather station'), 
    8680      'access' => user_access('create weather station')); 
    87     $items[] = array('path' => 'openweather', 'title' => t('my openweathers'), 
     81    $items[] = array('path' => 'openweather', 'title' => t('openweather stations'), 
    8882      'callback' => 'openweather_page', 
    8983      'access' => user_access('access content'), 
     
    129123function openweather_page() { 
    130124  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 
    131132  // 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 
    135135  $result = db_query($sql); 
    136   $output = '<ul>'; 
     136  $output .= '<ul>'; 
    137137  while ($node = db_fetch_object($result)) { 
    138138    $output .= '<li>'. l($node->title, "node/$node->nid") .'</li>'; 
Note: See TracChangeset for help on using the changeset viewer.