Ignore:
Timestamp:
Oct 8, 2010, 3:02:29 AM (14 years ago)
Author:
grum
Message:

Connect the plugin to the RBuilder component + fixe some small bugs

File:
1 edited

Legend:

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

    r7125 r7128  
    276276  } //class
    277277
     278
     279
     280class GMaps_functions
     281  {
     282    static private $tables = Array();
     283    static private $config = Array();
     284
     285    /**
     286     * initialise the class
     287     *
     288     * @param String $prefixeTable : the piwigo prefixe used on tables name
     289     * @param String $pluginNameFile : the plugin name used for tables name
     290     */
     291    static public function init($prefixeTable)
     292    {
     293      GPCCore::loadConfig(GMaps_root::$pluginNameFile, self::$config);
     294      $list=GMaps_root::$pluginTables;
     295
     296      for($i=0;$i<count($list);$i++)
     297      {
     298        self::$tables[$list[$i]]=$prefixeTable.GMaps_root::$pluginNameFile.'_'.$list[$i];
     299      }
     300    }
     301
     302
     303    /**
     304     *  return all HTML&JS code necessary to display a dialogbox to choose
     305     *  geographic area
     306     */
     307    static public function dialogBoxGMaps()
     308    {
     309      global $template;
     310
     311      $template->set_filename('gmaps_choose',
     312                    dirname(__FILE__).'/templates/gmaps_dialog_area_choose.tpl');
     313
     314      $datas=Array();
     315
     316      $template->assign('datas', $datas);
     317
     318      return($template->parse('gmaps_choose', true));
     319    }
     320
     321    /**
     322     * convert a decimal degree to D°M'S'
     323     *
     324     * @param Float $value : the value to convert
     325     * @return String : value converted in DMS
     326     */
     327    static public function DDtoDMS($value)
     328    {
     329      $degrees=(int)$value;
     330      $value=($value-$degrees)*60;
     331      $minutes=(int)$value;
     332      $seconds=($value-$minutes)*60;
     333
     334      return(sprintf('%d° %d\' %.2f"', $degrees, $minutes, $seconds));
     335    }
     336
     337  } //GMaps_functions
     338
     339
     340
    278341?>
Note: See TracChangeset for help on using the changeset viewer.