/[drupal]/contributions/modules/geo/modules/geo_data/geo_data.admin.inc
ViewVC logotype

Diff of /contributions/modules/geo/modules/geo_data/geo_data.admin.inc

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

revision 1.4, Thu Sep 25 21:51:33 2008 UTC revision 1.5, Fri Nov 6 01:27:44 2009 UTC
# Line 1  Line 1 
1  <?php // $Id: geo_data.admin.inc,v 1.3 2008/08/28 09:37:04 vauxia Exp $  <?php // $Id: geo_data.admin.inc,v 1.4 2008/09/25 21:51:33 vauxia Exp $
2    
3  /**  /**
4   * Put together a form of all the spatial columns.   * Put together a form of all the spatial columns.
# Line 17  function geo_data_admin() { Line 17  function geo_data_admin() {
17        '#title' => t('Table Label'),        '#title' => t('Table Label'),
18        '#default_value' => '', // TODO set as table label from link table        '#default_value' => '', // TODO set as table label from link table
19      );      );
   
 /*  
     foreach (geo('table_desc', $table) as $col => $desc) {  
       $form['tables'][$table][$col] = array(  
         //'view_field' => array('#type' => 'select', '#options' => $views_field_options),  
         'exposed' => array( '#type' => 'checkbox', '#default_value' => isset($fields[$table][$col]) ),  
         'name'    => array( '#type' => 'markup', '#value' => $desc['name'] ),  
         'type'    => array( '#type' => 'markup', '#value' => $desc['type'] ),  
         'type_hidden' => array( '#type' => 'value', '#value' => $desc['type']),  
         'desc'    => array( '#type' => 'textfield', '#default_value' => $fields[$table][$col]['title'], '#size' => 30 ),  
       );  
     }  
 */  
   }  
   
 /*  
   if (module_exists('views')) {  
     $known_fields = geo_data_fields();  
   
     views_load_cache(); // get access to some useful views_cache.inc functions  
     $views_fields = _views_get_fields();  
   
     // construct an #options array out of the field names:  
     $views_field_options['NONE'] = t('No link');  
     foreach ($views_fields as $id => $field) {  
       if ($field['notafield']) { continue; } // skip things we can't really link to in the db.  
   
       $views_field_options[$id] = $field['name'];  
     }  
20    }    }
 */  
21    
22    $form['#attributes']['enctype'] = 'multipart/form-data';    $form['#attributes']['enctype'] = 'multipart/form-data';
23    $form['import'] = array(    $form['import'] = array(
# Line 90  function geo_data_admin_submit($form, &$ Line 60  function geo_data_admin_submit($form, &$
60      $srid = $form_state['values']['import']['srid'];      $srid = $form_state['values']['import']['srid'];
61      geo_shp2sql($file, $table_name, $create, $srid);      geo_shp2sql($file, $table_name, $create, $srid);
62    }    }
 /*  
   $views_fields = _views_get_fields();  
   
   foreach ($values['tables'] as $table => $fields) {  
     foreach ($fields as $col => $data) {  
       if ($link_field = $views_fields[$data['view_field']]) {  
         // get the "column" we will join on and the table where that column exists.  
         $link_column = substr($data['view_field'], strpos($data['view_field'], '.') + 1);  
         $link_table = $link_field['table'];  
         $additional_columns = array();  
         // now we iterate through this table again, to find all the "exposed" fields  
         foreach ($fields as $ecol => $edata) {  
           if ($edata['exposed']) {  
             $additional_columns[$ecol] = array(  
               'label' => $edata['desc'],  
               'type' => $edata['type_hidden'],  
             );  
           }  
         }  
       }  
     }  
   }  
 */  
63  }  }
64    
65  function theme_geo_data_admin_tables($form) {  function theme_geo_data_admin_tables($form) {
# Line 142  function theme_geo_data_admin_tables($fo Line 89  function theme_geo_data_admin_tables($fo
89    
90    return $output;    return $output;
91  }  }
   
 /*  
 function geo_data_theme($existing, $type, $theme, $path) {  
   return array(  
     'geo_data_admin_tables' => array(  
       'arguments' => array('form' => array()),  
     ),  
   );  
 }  
 */  

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2