Ignore:
Timestamp:
Oct 9, 2010, 12:28:05 AM (14 years ago)
Author:
grum
Message:

KML files manager implemented + fixe some small bugs + forgotten file for the search page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GMaps/gmaps_aip.class.inc.php

    r7128 r7132  
    5050                          l10n('gmaps_associate_category_maps'),
    5151                          $this->getAdminLink()."&fGMaps_tabsheet=category_maps");
    52 /*
    5352    $this->tabsheet->add('kml_files',
    5453                          l10n('gmaps_kml_files_management'),
    55                           $this->getAdminLink()."&fGMaps_tabsheet=kml_files"); */
     54                          $this->getAdminLink()."&fGMaps_tabsheet=kml_files");
    5655    $this->tabsheet->add('search',
    5756                          l10n('gmaps_search'),
     
    128127
    129128    $template->assign('plugin', $template_plugin);
     129
     130    if($_REQUEST['errcode']!='')
     131    {
     132      $template->assign('errcode', l10n('gmaps_error_code_'.$_REQUEST['errcode']));
     133    }
     134
    130135    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    131136
     
    144149  {
    145150    //initialise $REQUEST values if not defined
     151
     152    if(!isset($_REQUEST['errcode'])) $_REQUEST['errcode']='';
    146153
    147154    if(!isset($_REQUEST['fGMaps_tabsheet']))
     
    227234      'maps' => $this->makeMapsList(),
    228235      'icons' => $this->makeIconsList(),
     236      'kmlFiles'  => $this->makeKmlFilesList()
    229237    );
    230238    $template->assign('datas', $datas);
     
    242250    global $template;
    243251
    244     /*$template->set_filename('body_page',
    245                 dirname($this->getFileLocation()).'/admin/plugin_admin_maps.tpl');
    246 
    247 
    248     $template->assign_var_from_handle('GMAPS_BODY_PAGE', 'body_page');*/
     252    $template->set_filename('body_page',
     253                dirname($this->getFileLocation()).'/admin/gmaps_kmlfiles.tpl');
     254
     255    $datas=Array(
     256      'urlRequest' => $this->getAdminLink('ajax'),
     257    );
     258    $template->assign('datas', $datas);
     259
     260    $template->assign_var_from_handle('GMAPS_BODY_PAGE', 'body_page');
    249261  }
    250262
     
    370382
    371383    return($returned);
    372   } //makeCategoriesTree
     384  } //makeMapsList
    373385
    374386
     
    395407
    396408    return($returned);
     409  } //makeIconsList
     410
     411
     412  /**
     413   * build the kml files list
     414   * @return Array : an array, ready to use in the template
     415   */
     416  private function makeKmlFilesList()
     417  {
     418    $returned=array();
     419
     420    $sql="SELECT id, name
     421          FROM ".$this->tables['kmlfiles']."
     422          ORDER BY name, id";
     423    $result = pwg_query($sql);
     424    if($result)
     425    {
     426      while($row = pwg_db_fetch_assoc($result))
     427      {
     428        $returned[]=$row;
     429      }
     430    }
     431
     432    return($returned);
    397433  } //makeCategoriesTree
    398434
    399 
    400435} //class
    401436
Note: See TracChangeset for help on using the changeset viewer.