Changeset 201975
- Timestamp:
- 02/04/2010 09:59:40 PM (16 years ago)
- Location:
- wp-gmaps2
- Files:
-
- 4 edited
- 1 copied
-
tags/2.1 (copied) (copied from wp-gmaps2/trunk)
-
tags/2.1/readme.txt (modified) (3 diffs)
-
tags/2.1/wp_gmaps2.php (modified) (12 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wp_gmaps2.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-gmaps2/tags/2.1/readme.txt
r184177 r201975 1 1 === WP_GMaps2 === 2 2 Contributors: cesperanc 3 Tags: google maps, tinymce, post, page 3 Tags: google maps, tinymce, post, page, gmaps, maps, map 4 4 Requires at least: 2.8.4 5 Tested up to: 2.9. 06 Stable tag: 2. 05 Tested up to: 2.9.1 6 Stable tag: 2.1 7 7 8 8 This plugin allows an easy integration of Google Maps on your pages or posts. … … 10 10 == Description == 11 11 12 This plugin allows the in clusion of Google Maps on your pages or posts using just the WYSIWYG (TinyMCE) controls. You can now insert and use Maps with just your mouse. This plugins supports multiple maps on the same post/page and within each map you can set many options, like the position of the marker, controls, icon of the marker, InfoWindow with Tabs and HTML support, etc.12 This plugin allows the integration of Google Maps on your pages or posts using the Wordpress Editor (TinyMCE). It supports multiple maps on the same post/page and within each map you can set many options, like the position of the marker, controls, icon of the marker, InfoWindow with Tabs with HTML support, etc. Give it a try. 13 13 14 14 == Installation == … … 37 37 == Screenshots == 38 38 39 1. To insert a map, press 1 (kitchen sink) to show the advanced bar ethen press 2 (google maps) to open the Google Maps Window.39 1. To insert a map, press 1 (kitchen sink) to show the advanced bar and then press 2 (google maps) to open the Google Maps Window. 40 40 2. In the Google Maps window you can insert or update your map. 41 41 3. The final result. 42 42 43 43 == Changelog == 44 45 = 2.1 = 46 * json_decode substitute for those that are using a PHP version bellow 5.2 (thanks to www at walidator dot info) 47 * Plugin URI updated to the new home 48 * Plugin validated for Wordpress 2.9.1 44 49 45 50 = 2.0 = -
wp-gmaps2/tags/2.1/wp_gmaps2.php
r147909 r201975 2 2 /* 3 3 Plugin Name: WP_GMaps2 4 Plugin URI: http:// ued.ipleiria.pt4 Plugin URI: http://sites.ipleiria.pt/labsUED/en/wordpress-en/plugins/wp-gmaps2/ 5 5 Description: WP_GMaps2 adds Maps to your pages and posts in Wordpress using the Google Maps API version 2. 6 Version: 2. 06 Version: 2.1 7 7 Author: Cláudio Esperança 8 8 Author URI: http://ued.ipleiria.pt 9 9 */ 10 11 /* 10 11 /* 12 12 Copyright 2009 Cláudio Esperança ([email protected]) 13 13 14 14 This program is free software; you can redistribute it and/or modify 15 15 it under the terms of the GNU General Public License as published by 16 16 the Free Software Foundation; either version 3 of the License, or 17 17 (at your option) any later version. 18 18 19 19 This program is distributed in the hope that it will be useful, 20 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 22 GNU General Public License for more details. 23 23 24 24 You should have received a copy of the GNU General Public License 25 25 along with this program; If not, see <http://www.gnu.org/licenses/>. 26 26 27 27 */ 28 28 29 /** 30 * json_decode substitute for those that are using a PHP version bellow 5.2 31 * 32 * @author [email protected] 33 * @see http://pt2.php.net/manual/en/function.json-decode.php#91216 for reference 34 */ 35 if ( !function_exists('json_decode') ){ 36 function json_decode($json){ 37 $comment = false; 38 $out = '$x='; 39 40 for ($i=0; $i<strlen($json); $i++){ 41 if (!$comment){ 42 if ($json[$i] == '{') $out .= ' array('; 43 else if ($json[$i] == '}') $out .= ')'; 44 else if ($json[$i] == ':') $out .= '=>'; 45 else $out .= $json[$i]; 46 } 47 else $out .= $json[$i]; 48 if ($json[$i] == '"') $comment = !$comment; 49 } 50 eval($out . ';'); 51 return $x; 52 } 53 } 54 55 /** 56 * Some defines 57 */ 29 58 define('WP_GMaps', 'WP_GMaps2'); // should match the class name bellow 30 59 define('WP_GMaps_text_domain', 'wp_gmaps2'); 31 60 32 61 /** 33 62 * Class responsable for the Wordpress/TinyMCE/Google Maps integration 34 * 63 * 35 64 * @author cesperanc 36 * @version 2. 065 * @version 2.1 37 66 */ 38 67 class WP_GMaps2 { 39 68 private $_content = ""; 40 69 41 70 function __construct($content=""){ 42 71 $contents = array(); 43 72 if(preg_match_all("(<!--(gmap|googlemap) ((\n|.)*?)-->)",$content,$contents)){ 44 73 $js_addOnShowMaps=''; 45 74 46 75 foreach($contents[2] as $mapn=>$map){ 47 76 $result = ''; … … 55 84 $content = str_ireplace($contents[0][$mapn],$result,$content); 56 85 } 57 86 58 87 $this->_content .= $content.' 59 88 <script type="text/javascript"> … … 64 93 } 65 94 } 66 95 67 96 public function content(){ 68 97 return $this->_content; 69 98 } 70 99 71 100 public function filterContent($content){ 72 101 if(!isset($this)){ … … 79 108 $gmap = &$this; 80 109 } 81 110 82 111 return $gmap->content(); 83 112 } 84 113 85 114 public function appendToHeader(){ 86 115 ?> 87 116 <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo(get_option('GOOGLE_MAPS_KEY','')); ?>"></script> 88 117 <script type="text/javascript" src="<?php echo(plugin_dir_url(__FILE__)); ?>js/client.js"></script> 89 <?php 90 } 91 118 <?php 119 } 120 92 121 /** 93 * Adds a button to TinyMCE buttons list 122 * Adds a button to TinyMCE buttons list 94 123 */ 95 124 public function tinymceRegisterButton($buttons) { … … 97 126 return $buttons; 98 127 } 99 128 100 129 /** 101 130 * Set the URL to the plugin for TinyMCE … … 105 134 return $plugin_array; 106 135 } 107 136 108 137 /** 109 138 * Set the URL to the plugin for TinyMCE … … 113 142 return $init; 114 143 } 115 144 116 145 /** 117 146 * Add the necessary filters for the TinyMCE plugin … … 143 172 } 144 173 } 145 174 146 175 /** 147 176 * Register the plugin options … … 150 179 register_setting('WP_GMaps2_options', 'GOOGLE_MAPS_KEY'); 151 180 } 152 181 153 182 /** 154 183 * Output the options page and save the changes … … 159 188 if(isset($_POST[$key_name])){ 160 189 update_option('GOOGLE_MAPS_KEY', $_POST[$key_name]); 161 ?><div class="updated fade"><p><strong><?php _e('Options saved', WP_GMaps_text_domain); ?>!</strong></p></div><?php 190 ?><div class="updated fade"><p><strong><?php _e('Options saved', WP_GMaps_text_domain); ?>!</strong></p></div><?php 162 191 } 163 192 ?> … … 172 201 </form> 173 202 </div> 174 <?php 175 } 176 } 177 203 <?php 204 } 205 } 206 178 207 /** 179 208 * Output the missing config warnings … … 185 214 <p><?php printf(__('You must <a %1$s>enter your Google Maps API key</a> for <strong>WP GMaps</strong> to work.', WP_GMaps_text_domain), 'href="plugins.php?page=WP_GMaps_pluginOptionsPage"'); ?></p> 186 215 </div> 187 <?php 216 <?php 188 217 } 189 218 } 190 219 } 191 220 192 221 // load the plugin translations 193 222 load_plugin_textdomain(WP_GMaps_text_domain, false, dirname(plugin_basename(__FILE__)).'/langs'); 194 223 195 224 // insert the necessary javascript 196 225 add_action('wp_head', array(WP_GMaps, 'appendToHeader')); -
wp-gmaps2/trunk/readme.txt
r184177 r201975 1 1 === WP_GMaps2 === 2 2 Contributors: cesperanc 3 Tags: google maps, tinymce, post, page 3 Tags: google maps, tinymce, post, page, gmaps, maps, map 4 4 Requires at least: 2.8.4 5 Tested up to: 2.9. 06 Stable tag: 2. 05 Tested up to: 2.9.1 6 Stable tag: 2.1 7 7 8 8 This plugin allows an easy integration of Google Maps on your pages or posts. … … 10 10 == Description == 11 11 12 This plugin allows the in clusion of Google Maps on your pages or posts using just the WYSIWYG (TinyMCE) controls. You can now insert and use Maps with just your mouse. This plugins supports multiple maps on the same post/page and within each map you can set many options, like the position of the marker, controls, icon of the marker, InfoWindow with Tabs and HTML support, etc.12 This plugin allows the integration of Google Maps on your pages or posts using the Wordpress Editor (TinyMCE). It supports multiple maps on the same post/page and within each map you can set many options, like the position of the marker, controls, icon of the marker, InfoWindow with Tabs with HTML support, etc. Give it a try. 13 13 14 14 == Installation == … … 37 37 == Screenshots == 38 38 39 1. To insert a map, press 1 (kitchen sink) to show the advanced bar ethen press 2 (google maps) to open the Google Maps Window.39 1. To insert a map, press 1 (kitchen sink) to show the advanced bar and then press 2 (google maps) to open the Google Maps Window. 40 40 2. In the Google Maps window you can insert or update your map. 41 41 3. The final result. 42 42 43 43 == Changelog == 44 45 = 2.1 = 46 * json_decode substitute for those that are using a PHP version bellow 5.2 (thanks to www at walidator dot info) 47 * Plugin URI updated to the new home 48 * Plugin validated for Wordpress 2.9.1 44 49 45 50 = 2.0 = -
wp-gmaps2/trunk/wp_gmaps2.php
r147909 r201975 2 2 /* 3 3 Plugin Name: WP_GMaps2 4 Plugin URI: http:// ued.ipleiria.pt4 Plugin URI: http://sites.ipleiria.pt/labsUED/en/wordpress-en/plugins/wp-gmaps2/ 5 5 Description: WP_GMaps2 adds Maps to your pages and posts in Wordpress using the Google Maps API version 2. 6 Version: 2. 06 Version: 2.1 7 7 Author: Cláudio Esperança 8 8 Author URI: http://ued.ipleiria.pt 9 9 */ 10 11 /* 10 11 /* 12 12 Copyright 2009 Cláudio Esperança ([email protected]) 13 13 14 14 This program is free software; you can redistribute it and/or modify 15 15 it under the terms of the GNU General Public License as published by 16 16 the Free Software Foundation; either version 3 of the License, or 17 17 (at your option) any later version. 18 18 19 19 This program is distributed in the hope that it will be useful, 20 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 22 GNU General Public License for more details. 23 23 24 24 You should have received a copy of the GNU General Public License 25 25 along with this program; If not, see <http://www.gnu.org/licenses/>. 26 26 27 27 */ 28 28 29 /** 30 * json_decode substitute for those that are using a PHP version bellow 5.2 31 * 32 * @author [email protected] 33 * @see http://pt2.php.net/manual/en/function.json-decode.php#91216 for reference 34 */ 35 if ( !function_exists('json_decode') ){ 36 function json_decode($json){ 37 $comment = false; 38 $out = '$x='; 39 40 for ($i=0; $i<strlen($json); $i++){ 41 if (!$comment){ 42 if ($json[$i] == '{') $out .= ' array('; 43 else if ($json[$i] == '}') $out .= ')'; 44 else if ($json[$i] == ':') $out .= '=>'; 45 else $out .= $json[$i]; 46 } 47 else $out .= $json[$i]; 48 if ($json[$i] == '"') $comment = !$comment; 49 } 50 eval($out . ';'); 51 return $x; 52 } 53 } 54 55 /** 56 * Some defines 57 */ 29 58 define('WP_GMaps', 'WP_GMaps2'); // should match the class name bellow 30 59 define('WP_GMaps_text_domain', 'wp_gmaps2'); 31 60 32 61 /** 33 62 * Class responsable for the Wordpress/TinyMCE/Google Maps integration 34 * 63 * 35 64 * @author cesperanc 36 * @version 2. 065 * @version 2.1 37 66 */ 38 67 class WP_GMaps2 { 39 68 private $_content = ""; 40 69 41 70 function __construct($content=""){ 42 71 $contents = array(); 43 72 if(preg_match_all("(<!--(gmap|googlemap) ((\n|.)*?)-->)",$content,$contents)){ 44 73 $js_addOnShowMaps=''; 45 74 46 75 foreach($contents[2] as $mapn=>$map){ 47 76 $result = ''; … … 55 84 $content = str_ireplace($contents[0][$mapn],$result,$content); 56 85 } 57 86 58 87 $this->_content .= $content.' 59 88 <script type="text/javascript"> … … 64 93 } 65 94 } 66 95 67 96 public function content(){ 68 97 return $this->_content; 69 98 } 70 99 71 100 public function filterContent($content){ 72 101 if(!isset($this)){ … … 79 108 $gmap = &$this; 80 109 } 81 110 82 111 return $gmap->content(); 83 112 } 84 113 85 114 public function appendToHeader(){ 86 115 ?> 87 116 <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo(get_option('GOOGLE_MAPS_KEY','')); ?>"></script> 88 117 <script type="text/javascript" src="<?php echo(plugin_dir_url(__FILE__)); ?>js/client.js"></script> 89 <?php 90 } 91 118 <?php 119 } 120 92 121 /** 93 * Adds a button to TinyMCE buttons list 122 * Adds a button to TinyMCE buttons list 94 123 */ 95 124 public function tinymceRegisterButton($buttons) { … … 97 126 return $buttons; 98 127 } 99 128 100 129 /** 101 130 * Set the URL to the plugin for TinyMCE … … 105 134 return $plugin_array; 106 135 } 107 136 108 137 /** 109 138 * Set the URL to the plugin for TinyMCE … … 113 142 return $init; 114 143 } 115 144 116 145 /** 117 146 * Add the necessary filters for the TinyMCE plugin … … 143 172 } 144 173 } 145 174 146 175 /** 147 176 * Register the plugin options … … 150 179 register_setting('WP_GMaps2_options', 'GOOGLE_MAPS_KEY'); 151 180 } 152 181 153 182 /** 154 183 * Output the options page and save the changes … … 159 188 if(isset($_POST[$key_name])){ 160 189 update_option('GOOGLE_MAPS_KEY', $_POST[$key_name]); 161 ?><div class="updated fade"><p><strong><?php _e('Options saved', WP_GMaps_text_domain); ?>!</strong></p></div><?php 190 ?><div class="updated fade"><p><strong><?php _e('Options saved', WP_GMaps_text_domain); ?>!</strong></p></div><?php 162 191 } 163 192 ?> … … 172 201 </form> 173 202 </div> 174 <?php 175 } 176 } 177 203 <?php 204 } 205 } 206 178 207 /** 179 208 * Output the missing config warnings … … 185 214 <p><?php printf(__('You must <a %1$s>enter your Google Maps API key</a> for <strong>WP GMaps</strong> to work.', WP_GMaps_text_domain), 'href="plugins.php?page=WP_GMaps_pluginOptionsPage"'); ?></p> 186 215 </div> 187 <?php 216 <?php 188 217 } 189 218 } 190 219 } 191 220 192 221 // load the plugin translations 193 222 load_plugin_textdomain(WP_GMaps_text_domain, false, dirname(plugin_basename(__FILE__)).'/langs'); 194 223 195 224 // insert the necessary javascript 196 225 add_action('wp_head', array(WP_GMaps, 'appendToHeader'));
Note: See TracChangeset
for help on using the changeset viewer.