alexgieg

WP Google Maps Bug Fixes (Diff Version)

Jan 21st, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.93 KB | None | 0 0
  1. diff -rupN wp-google-maps-orig/wpGoogleMaps.php wp-google-maps/wpGoogleMaps.php
  2. --- wp-google-maps-orig/wpGoogleMaps.php    2013-01-21 08:37:22.278997000 -0300
  3. +++ wp-google-maps/wpGoogleMaps.php 2013-01-22 16:47:38.254002953 -0300
  4. @@ -222,7 +222,10 @@ function wpgmaps_admin_edit_marker_javas
  5.          $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
  6.  
  7.          ?>
  8. -        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  9. +       <script type="text/javascript">
  10. +           var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
  11. +           document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
  12. +       </script>
  13.          <link rel='stylesheet' id='wpgooglemaps-css'  href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
  14.          <link rel="stylesheet" type="text/css" media="all" href="<?php echo wpgmaps_get_plugin_url(); ?>/css/data_table.css" />
  15.          <script type="text/javascript" src="<?php echo wpgmaps_get_plugin_url(); ?>/js/jquery.dataTables.js"></script>
  16. @@ -287,12 +290,12 @@ function wpgmaps_admin_javascript_basic(
  17.      $ajax_nonce = wp_create_nonce("wpgmza");
  18.      wpgmaps_debugger("admin_js_basic_start");
  19.  
  20. -    if (is_admin() && $_GET['page'] == 'wp-google-maps-menu' && $_GET['action'] == "edit_marker") {
  21. +    if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit_marker") {
  22.          wpgmaps_admin_edit_marker_javascript();
  23.  
  24.      }
  25.  
  26. -    else if (is_admin() && $_GET['page'] == 'wp-google-maps-menu' && $_GET['action'] == "edit") {
  27. +    else if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit") {
  28.  
  29.          if ($debug) { echo ""; }
  30.  
  31. @@ -326,7 +329,10 @@ function wpgmaps_admin_javascript_basic(
  32.  
  33.  
  34.      ?>
  35. -    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  36. +   <script type="text/javascript">
  37. +       var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
  38. +       document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
  39. +   </script>
  40.      <link rel='stylesheet' id='wpgooglemaps-css'  href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
  41.      <link rel="stylesheet" type="text/css" media="all" href="<?php echo wpgmaps_get_plugin_url(); ?>/css/data_table.css" />
  42.      <script type="text/javascript" src="<?php echo wpgmaps_get_plugin_url(); ?>/js/jquery.dataTables.js"></script>
  43. @@ -629,7 +635,10 @@ function wpgmaps_user_javascript_basic()
  44.          if (!$wpgmza_lat || !$wpgmza_lng) { $wpgmza_lat = "51.5081290"; $wpgmza_lng = "-0.1280050"; }
  45.  
  46.          ?>
  47. -        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  48. +       <script type="text/javascript">
  49. +           var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
  50. +           document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
  51. +       </script>
  52.          <script type="text/javascript" >
  53.  
  54.  
  55. @@ -750,7 +759,7 @@ function wpgmaps_update_xml_file()
  56.  
  57.  
  58.      // PREVIOUS VERSION HANDLING
  59. -    if (function_exists(wpgmza_register_pro_version)) {
  60. +    if (function_exists('wpgmza_register_pro_version')) {
  61.              $prov = get_option("WPGMZA_PRO");
  62.              $wpgmza_pro_version = $prov['version'];
  63.                  $results = $wpdb->get_results(
  64. @@ -828,7 +837,7 @@ function wpgmaps_update_xml_file()
  65.      } else {
  66.  
  67.          // PREVIOUS VERSION HANDLING
  68. -        if (function_exists(wpgmza_register_pro_version)) {
  69. +        if (function_exists('wpgmza_register_pro_version')) {
  70.              $prov = get_option("WPGMZA_PRO");
  71.              $wpgmza_pro_version = $prov['version'];
  72.              @$dom->save(WP_PLUGIN_DIR.'/'.plugin_basename(dirname(__FILE__)).'/'.$mapid.'markers.xml');
  73. @@ -1134,7 +1143,7 @@ function wpgmaps_head() {
  74.  
  75.  function wpgmaps_admin_menu() {
  76.      add_menu_page('WPGoogle Maps', __('Maps','wp-google-maps'), 'manage_options', 'wp-google-maps-menu', 'wpgmaps_menu_layout', wpgmaps_get_plugin_url()."/images/map_app_small.png");
  77. -    if (function_exists(wpgmza_pro_advanced_menu)) {
  78. +    if (function_exists('wpgmza_pro_advanced_menu')) {
  79.          add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Advanced Options', __('Advanced','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-advanced', 'wpgmaps_menu_advanced_layout');
  80.      }
  81.          add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Settings', __('Settings','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-settings', 'wpgmaps_menu_settings_layout');
Add Comment
Please, Sign In to add comment