Ignore:
Timestamp:
Feb 25, 2011, 12:44:14 PM (13 years ago)
Author:
cljosse
Message:

[edit_gmaps] adding support to the altitude.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/edit_gmaps/admin/admin.php

    r8501 r9377  
    33include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    44
     5$colonnes = cl_get_columns_of(IMAGES_TABLE);
     6$key = array_search('alt', $colonnes[IMAGES_TABLE]);
     7if (!$key){
     8    $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `alt` DOUBLE(9,6)';
     9    pwg_query($q);     
     10}               
     11/**
     12* list all columns of each given table
     13*
     14* @return array of array
     15*/
     16function cl_get_columns_of($table)
     17{
     18    $columns_of = array();
     19    $query = 'DESC '.$table.';';
     20    $result = mysql_query($query);     
     21    $columns_of[$table] = array();   
     22
     23    if ($result)   
     24        while ($row = mysql_fetch_row($result))
     25           array_push($columns_of[$table], $row[0]);
     26       
     27    return $columns_of;
     28}
     29
     30
    531$template->set_filename('plugin_admin_content', dirname(__FILE__).'/admin.tpl');
    632
    733if (!isset($_GET['tab']))
    8   $page['tab'] = 'config';
     34  $page['tab'] = 'edit';
    935else
    1036  $page['tab'] = $_GET['tab'];
    11   $page['tab'] =   'edit';
     37
    1238$my_base_url = get_admin_plugin_menu_link(__FILE__);
    1339
    1440$tabsheet = new tabsheet();
    1541$tabsheet->add( 'edit', 'Edit', add_url_params( $my_base_url, array('tab'=>'edit') ) );
     42//$tabsheet->add( 'edit_meta', 'Edit_meta', add_url_params( $my_base_url, array('tab'=>'edit_meta') ) );
    1643$tabsheet->select($page['tab']);
    1744$tabsheet->assign();
     
    2451$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
    2552
    26 
    2753?>
Note: See TracChangeset for help on using the changeset viewer.