/[drupal]/contributions/modules/geo/geo.module
ViewVC logotype

Diff of /contributions/modules/geo/geo.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.24, Thu Jun 25 19:07:54 2009 UTC revision 1.25, Wed Aug 5 02:15:54 2009 UTC
# Line 1  Line 1 
1  <?php // $Id: geo.module,v 1.23 2009/06/18 21:00:28 vauxia Exp $  <?php // $Id: geo.module,v 1.24 2009/06/25 19:07:54 vauxialwExp $
2    
3  /**  /**
4   * Geo: Geospatial storage and retrieval.   * Geo: Geospatial storage and retrieval.
# Line 324  function theme_geo_latlon($element) { Line 324  function theme_geo_latlon($element) {
324    
325  function geo_element_set_value($element, &$form_state) {  function geo_element_set_value($element, &$form_state) {
326    if (!$element['#value']) $element['#value'] = $element['#default_value'];    if (!$element['#value']) $element['#value'] = $element['#default_value'];
327    $value = $element['#value'];    if (!isset($element['#gis_input_value'])) $element['#gis_input_value'] = $element['#value'];
   if (!isset($element['#gis_input_value'])) $element['#gis_input_value'] = $value;  
328    
329    $in  = isset($element['#gis_input']) ? $element['#gis_input'] : 'wkt';    $value = geo_value_convert($element['#value'], $element['#gis_input'], $element['#gis_output']);
330    $out = isset($element['#gis_output']) ? $element['#gis_output'] : 'wkt';    $element['#gis_output_value'] = $value;
331      form_set_value($element, $value, $form_state);
332      return $element;
333    }
334    
335    function geo_value_convert($value, $in = 'array', $out = 'wkt') {
336    // TODO We are taking the element's requested input and output formats, and    // TODO We are taking the element's requested input and output formats, and
337    // making the necessary adjustments.  This needs to be refactored and set up    // making the necessary adjustments.  This needs to be refactored and set up
338    // in some kind of a handler model.  For now it's a proof-of-concept that    // in some kind of a handler model.  For now it's a proof-of-concept that
# Line 342  function geo_element_set_value($element, Line 345  function geo_element_set_value($element,
345        break;        break;
346    }    }
347    
348    $element['#gis_output_value'] = $value;    return $value;
   form_set_value($element, $value, $form_state);  
   return $element;  
349  }  }
350    
351  /**  /**

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.2