ultimix
google_maps.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
27 
38  var $Settings = false;
39  var $String = false;
40 
55  function __construct()
56  {
57  try
58  {
59  $this->Settings = get_package_object( 'settings::package_settings' , 'last' , __FILE__ );
60  $this->String = get_package( 'string' , 'last' , __FILE__ );
61  }
62  catch( Exception $e )
63  {
64  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
65  }
66  }
67 
86  function pre_generation( $Options )
87  {
88  try
89  {
90  $PageJS = get_package( 'page::page_js' , 'last' , __FILE__ );
91 
92  $Path = _get_package_relative_path_ex( 'maps::google_maps' , '1.0.0' );
93  $PageJS->add_javascript( "{http_host}/$Path/include/js/google_maps.js" );
94 
95  $Key = $this->Settings->get_package_setting(
96  'maps::google_maps' , '1.0.0::1.0.0' , 'cf_google_maps' , 'google_maps_api_key'
97  );
98 
99  $URL = 'http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key='.$Key;
100  $PageJS->add_javascript( $URL , false );
101  }
102  catch( Exception $e )
103  {
104  $Args = func_get_args();throw( _get_exception_object( __METHOD__ , $Args , $e ) );
105  }
106  }
107 
131  {
132  try
133  {
134  $Settings->set_undefined( 'id' , md5( microtime( true ) ) );
135  $Settings->set_undefined( 'height' , '300px' );
136  $Settings->set_undefined( 'width' , '500px' );
137  $Settings->set_undefined( 'class' , 'google_map' );
138  $Code = $this->CachedMultyFS->get_template( __FILE__ , 'google_map_frame.tpl' );
139  return( $this->String->print_record( $Code , $Settings->get_raw_settings() ) );
140  }
141  catch( Exception $e )
142  {
143  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
144  }
145  }
146  }
147 ?>