Ejemplo n.º 1
0
function wpgmza_return_marker_list($map_id, $admin = true, $width = "100%", $mashup = false, $mashup_ids = false)
{
    global $wpdb;
    global $wpgmza_tblname;
    if ($mashup) {
        // map mashup
        $map_ids = $mashup_ids;
        $wpgmza_cnt = 0;
        if ($mashup_ids[0] == "ALL") {
            $wpgmza_sql1 = "\r\n            SELECT *\r\n            FROM {$wpgmza_tblname}\r\n            ORDER BY `id` DESC\r\n            ";
        } else {
            $wpgmza_id_cnt = count($map_ids);
            $sql_string1 = "";
            foreach ($map_ids as $wpgmza_map_id) {
                $wpgmza_cnt++;
                if ($wpgmza_cnt == 1) {
                    $sql_string1 .= "`map_id` = '{$wpgmza_map_id}' ";
                } elseif ($wpgmza_cnt > 1 && $wpgmza_cnt < $wpgmza_id_cnt) {
                    $sql_string1 .= "OR `map_id` = '{$wpgmza_map_id}' ";
                } else {
                    $sql_string1 .= "OR `map_id` = '{$wpgmza_map_id}' ";
                }
            }
            $wpgmza_sql1 = "\r\n            SELECT *\r\n            FROM {$wpgmza_tblname}\r\n            WHERE {$sql_string1} ORDER BY `id` DESC\r\n            ";
        }
    } else {
        $wpgmza_sql1 = "\r\n            SELECT *\r\n            FROM {$wpgmza_tblname}\r\n            WHERE `map_id` = '{$map_id}' ORDER BY `id` DESC\r\n            ";
    }
    $marker_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpgmza_tblname} WHERE map_id = %d", $map_id));
    if ($marker_count > 2000) {
        return __("There are too many markers to make use of the live edit function. The maximum amount for this functionality is 2000 markers. Anything more than that could crash your browser. In order to edit your markers, you would need to download the table in CSV format, edit it and re-upload it.", "wp-google-maps");
    } else {
        $results = $wpdb->get_results($wpgmza_sql1);
        $wpgmza_tmp_body = "";
        $wpgmza_tmp_head = "";
        $wpgmza_tmp_footer = "";
        $res = wpgmza_get_map_data($map_id);
        if (!$res->default_marker) {
            $default_marker = "<img src='" . wpgmaps_get_plugin_url() . "/images/marker.png' />";
        } else {
            $default_marker = "<img src='" . $res->default_marker . "' />";
        }
        foreach ($results as $result) {
            $img = $result->pic;
            $link = $result->link;
            $icon = $result->icon;
            if (isset($result->approved)) {
                $approved = $result->approved;
                if ($approved == 0) {
                    $show_approval_button = true;
                } else {
                    $show_approval_button = false;
                }
            } else {
                $show_approval_button = false;
            }
            $category_icon = wpgmza_get_category_icon($result->category);
            if (!$img) {
                $pic = "";
            } else {
                $pic = "<img src=\"" . $result->pic . "\" width=\"40\" />";
            }
            if (!$category_icon) {
                if (!$icon) {
                    $icon = $default_marker;
                } else {
                    $icon = "<img src='" . $result->icon . "' />";
                }
            } else {
                if (!$icon) {
                    $icon = "<img src='" . $category_icon . "' />";
                } else {
                    $icon = "<img src='" . $result->icon . "' />";
                }
            }
            if (!$link) {
                $linktd = "";
            } else {
                $linktd = "<a href=\"" . $result->link . "\" target=\"_BLANK\" title=\"" . __("View this link", "wp-google-maps") . "\">&gt;&gt;</a>";
            }
            if ($admin) {
                $wpgmza_tmp_body .= "<tr id=\"wpgmza_tr_" . $result->id . "\" class=\"gradeU\">";
                $wpgmza_tmp_body .= "<td height=\"40\">" . $result->id . "</td>";
                $wpgmza_tmp_body .= "<td height=\"40\">" . $icon . "<input type=\"hidden\" id=\"wpgmza_hid_marker_icon_" . $result->id . "\" value=\"" . $result->icon . "\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_anim_" . $result->id . "\" value=\"" . $result->anim . "\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_category_" . $result->id . "\" value=\"" . $result->category . "\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_infoopen_" . $result->id . "\" value=\"" . $result->infoopen . "\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_retina_" . $result->id . "\" value=\"" . $result->retina . "\" /></td>";
                $wpgmza_tmp_body .= "<td>" . stripslashes($result->title) . "<input type=\"hidden\" id=\"wpgmza_hid_marker_title_" . $result->id . "\" value=\"" . stripslashes($result->title) . "\" /></td>";
                $wpgmza_tmp_body .= "<td>" . wpgmza_return_category_name($result->category) . "<input type=\"hidden\" id=\"wpgmza_hid_marker_category_" . $result->id . "\" value=\"" . $result->category . "\" /></td>";
                $wpgmza_tmp_body .= "<td>" . stripslashes($result->address) . "<input type=\"hidden\" id=\"wpgmza_hid_marker_address_" . $result->id . "\" value=\"" . stripslashes($result->address) . "\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_lat_" . $result->id . "\" value=\"" . $result->lat . "\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_lng_" . $result->id . "\" value=\"" . $result->lng . "\" /></td>";
                $wpgmza_tmp_body .= "<td>" . stripslashes($result->description) . "<input type=\"hidden\" id=\"wpgmza_hid_marker_desc_" . $result->id . "\" value=\"" . htmlspecialchars(stripslashes($result->description)) . "\" /></td>";
                $wpgmza_tmp_body .= "<td>{$pic}<input type=\"hidden\" id=\"wpgmza_hid_marker_pic_" . $result->id . "\" value=\"" . $result->pic . "\" /></td>";
                $wpgmza_tmp_body .= "<td>{$linktd}<input type=\"hidden\" id=\"wpgmza_hid_marker_link_" . $result->id . "\" value=\"" . $result->link . "\" /></td>";
                $wpgmza_tmp_body .= "<td width='170' align='center'>";
                $wpgmza_tmp_body .= "    <a href=\"#wpgmaps_marker\" title=\"" . __("Edit this marker", "wp-google-maps") . "\" class=\"wpgmza_edit_btn button\" id=\"" . $result->id . "\"><i class=\"fa fa-edit\"> </i> </a> ";
                $wpgmza_tmp_body .= "    <a href=\"?page=wp-google-maps-menu&action=edit_marker&id=" . $result->id . "\" title=\"" . __("Edit this marker", "wp-google-maps") . "\" class=\"wpgmza_edit_btn button\" id=\"" . $result->id . "\"><i class=\"fa fa-map-marker\"> </i></a> ";
                if ($show_approval_button) {
                    $wpgmza_tmp_body .= "    <a href=\"javascript:void(0);\" title=\"" . __("Approve this marker", "wp-google-maps") . "\" class=\"wpgmza_approve_btn button\" id=\"" . $result->id . "\"><i class=\"fa fa-check\"> </i> </a> ";
                }
                $wpgmza_tmp_body .= "    <a href=\"javascript:void(0);\" title=\"" . __("Delete this marker", "wp-google-maps") . "\" class=\"wpgmza_del_btn button\" id=\"" . $result->id . "\"><i class=\"fa fa-times\"> </i></a>";
                $wpgmza_tmp_body .= "</td>";
                $wpgmza_tmp_body .= "</tr>";
            } else {
                $wpgmza_tmp_body .= "<tr id=\"wpgmza_marker_" . $result->id . "\" mid=\"" . $result->id . "\" mapid=\"" . $result->map_id . "\" class=\"wpgmaps_mlist_row\">";
                $wpgmza_tmp_body .= "   <td width='1px;' style='display:none; width:1px !important;'><span style='display:none;'>" . sprintf('%02d', $result->id) . "</span></td>";
                $wpgmza_tmp_body .= "   <td class='wpgmza_table_marker' height=\"40\">" . str_replace("'", "\"", $icon) . "</td>";
                $wpgmza_tmp_body .= "   <td class='wpgmza_table_title'>" . stripslashes($result->title) . "</td>";
                $wpgmza_tmp_body .= "   <td class='wpgmza_table_category'>" . wpgmza_return_category_name($result->category) . "</td>";
                $wpgmza_tmp_body .= "   <td class='wpgmza_table_address'>" . stripslashes($result->address) . "</td>";
                $wpgmza_tmp_body .= "   <td class='wpgmza_table_description'>" . stripslashes($result->description) . "</td>";
                $wpgmza_tmp_body .= "</tr>";
            }
        }
        if ($admin) {
            $wpgmza_tmp_head .= "<table id=\"wpgmza_table\" class=\"display\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:{$width};\">";
            $wpgmza_tmp_head .= "<thead>";
            $wpgmza_tmp_head .= "<tr>";
            $wpgmza_tmp_head .= "   <th><strong>" . __("ID", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th><strong>" . __("Icon", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th><strong>" . __("Title", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th><strong>" . __("Category", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th><strong>" . __("Address", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th><strong>" . __("Description", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th><strong>" . __("Image", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th><strong>" . __("Link", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th style='width:182px;'><strong>" . __("Action", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "</tr>";
            $wpgmza_tmp_head .= "</thead>";
            $wpgmza_tmp_head .= "<tbody>";
        } else {
            $wpgmza_tmp_head .= "<div id=\"wpgmza_marker_holder_" . $map_id . "\" style=\"width:{$width};\">";
            $wpgmza_tmp_head .= "<table id=\"wpgmza_table_" . $map_id . "\" class=\"wpgmza_table\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:{$width};\">";
            $wpgmza_tmp_head .= "<thead>";
            $wpgmza_tmp_head .= "<tr>";
            $wpgmza_tmp_head .= "   <th width='1' style='display:none; width:1px !important;'></th>";
            $wpgmza_tmp_head .= "   <th class='wpgmza_table_marker'><strong></strong></th>";
            $wpgmza_tmp_head .= "   <th class='wpgmza_table_title'><strong>" . __("Title", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th class='wpgmza_table_category'><strong>" . __("Category", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th class='wpgmza_table_address'><strong>" . __("Address", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "   <th class='wpgmza_table_description'><strong>" . __("Description", "wp-google-maps") . "</strong></th>";
            $wpgmza_tmp_head .= "</tr>";
            $wpgmza_tmp_head .= "</thead>";
            $wpgmza_tmp_head .= "<tbody>";
        }
        if ($admin) {
            $wpgmza_tmp_footer .= "</tbody></table>";
        } else {
            $wpgmza_tmp_footer .= "</tbody></table></div>";
        }
        return $wpgmza_tmp_head . $wpgmza_tmp_body . $wpgmza_tmp_footer;
    }
}
/**
 * Returns the list of polylines displayed in the map editor
 *
 * @todo Build this as a hook or filter instead of a function call
 * 
 * @param  integer  $map_id Map ID
 * @param  boolean  $admin  Identify if user is admin or not
 * @param  string   $width  Width to be used for HTML output
 * @return string           List HTML
 */
function wpgmza_b_return_polyline_list($map_id, $admin = true, $width = "100%")
{
    wpgmaps_debugger("return_marker_start");
    global $wpdb;
    global $wpgmza_tblname_polylines;
    $wpgmza_tmp = "";
    $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpgmza_tblname_polylines} WHERE `map_id` = %d ORDER BY `id` DESC", intval($map_id)));
    $wpgmza_tmp .= "\n        \n        <table id=\"wpgmza_table_polyline\" class=\"display\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:{$width};\">\n        <thead>\n        <tr>\n            <th align='left'><strong>" . __("ID", "wp-google-maps") . "</strong></th>\n            <th align='left'><strong>" . __("Name", "wp-google-maps") . "</strong></th>\n            <th align='left' style='width:182px;'><strong>" . __("Action", "wp-google-maps") . "</strong></th>\n        </tr>\n        </thead>\n        <tbody>\n    ";
    $res = wpgmza_get_map_data($map_id);
    $default_marker = "<img src='" . $res->default_marker . "' />";
    //$wpgmza_data = get_option('WPGMZA');
    //if ($wpgmza_data['map_default_marker']) { $default_icon = "<img src='".$wpgmza_data['map_default_marker']."' />"; } else { $default_icon = "<img src='".wpgmaps_get_plugin_url()."/images/marker.png' />"; }
    foreach ($results as $result) {
        unset($poly_data);
        unset($poly_array);
        $poly_data = '';
        $poly_array = wpgmza_b_return_polyline_array($result->id);
        foreach ($poly_array as $poly_single) {
            $poly_data .= $poly_single . ",";
        }
        if (isset($result->polyname) && $result->polyname != "") {
            $poly_name = $result->polyname;
        } else {
            $poly_name = "Polyline" . $result->id;
        }
        $wpgmza_tmp .= "\n            <tr id=\"wpgmza_poly_tr_" . $result->id . "\">\n                <td height=\"40\">" . $result->id . "</td>\n                <td height=\"40\">" . esc_attr(stripslashes($poly_name)) . "</td>\n                <td width='170' align='left'>\n                    <a href=\"" . get_option('siteurl') . "/wp-admin/admin.php?page=wp-google-maps-menu&action=edit_polyline&map_id=" . $map_id . "&poly_id=" . $result->id . "\" title=\"" . __("Edit", "wp-google-maps") . "\" class=\"wpgmza_edit_poly_btn button\" id=\"" . $result->id . "\"><i class=\"fa fa-edit\"> </i></a> \n                    <a href=\"javascript:void(0);\" title=\"" . __("Delete this polyline", "wp-google-maps") . "\" class=\"wpgmza_polyline_del_btn button\" id=\"" . $result->id . "\"><i class=\"fa fa-times\"> </i></a>\n                </td>\n            </tr>";
    }
    $wpgmza_tmp .= "</tbody></table>";
    return $wpgmza_tmp;
}
function wpgmza_gold_addon_display()
{
    $res = wpgmza_get_map_data($_GET['map_id']);
    if ($res->styling_enabled) {
        $wpgmza_adv_styling[$res->styling_enabled] = "SELECTED";
    } else {
        $wpgmza_adv_styling[2] = "SELECTED";
    }
    if ($res->mass_marker_support) {
        $wpgmza_adv_mass_marker_support[$res->mass_marker_support] = "SELECTED";
    } else {
        $wpgmza_adv_mass_marker_support[2] = "SELECTED";
    }
    for ($i = 0; $i < 3; $i++) {
        if (!isset($wpgmza_adv_mass_marker_support[$i])) {
            $wpgmza_adv_mass_marker_support[$i] = "";
        }
    }
    for ($i = 0; $i < 3; $i++) {
        if (!isset($wpgmza_adv_styling[$i])) {
            $wpgmza_adv_styling[$i] = "";
        }
    }
    $ret = "\r\n        <div style=\"display:block; overflow:auto; background-color:#FFFBCC; padding:10px; border:1px solid #E6DB55; margin-top:35px; margin-bottom:5px;\">\r\n            <h2 style=\"padding-top:0; margin-top:0;\">" . __("Advanced Map Settings", "wp-google-maps") . "</h2>\r\n            <p>" . __("Use the <a href='http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html' target='_BLANK'>Google Maps API Styled Map Wizard</a> to get your style settings", "wp-google-maps") . "!</p>\r\n                <form action='' method='post' id='wpgmaps_gold_option_styling'>\r\n                    <table>\r\n                    <input type=\"hidden\" name=\"wpgmza_map_id\" id=\"wpgmza_map_id\" value=\"" . $_GET['map_id'] . "\" />\r\n                        <tr style='margin-bottom:20px;'>\r\n                            <td>" . __("Enable Mass Marker Support", "wp-google-maps") . "?:</td>\r\n                            <td>\r\n                                <select id='wpgmza_adv_enable_mass_marker_support' name='wpgmza_adv_enable_mass_marker_support'>\r\n                                    <option value=\"1\" " . $wpgmza_adv_mass_marker_support[1] . ">" . __("Yes", "wp-google-maps") . "</option>\r\n                                    <option value=\"2\" " . $wpgmza_adv_mass_marker_support[2] . ">" . __("No", "wp-google-maps") . "</option>\r\n                                </select>\r\n                            </td>\r\n                         </tr>\r\n                        <tr style='margin-bottom:20px;'>\r\n                            <td>" . __("Enable Advanced Styling", "wp-google-maps") . "?:</td>\r\n                            <td>\r\n                                <select id='wpgmza_adv_styling' name='wpgmza_adv_styling'>\r\n                                    <option value=\"1\" " . $wpgmza_adv_styling[1] . ">" . __("Yes", "wp-google-maps") . "</option>\r\n                                    <option value=\"2\" " . $wpgmza_adv_styling[2] . ">" . __("No", "wp-google-maps") . "</option>\r\n                                </select>\r\n                            </td>\r\n                         </tr>\r\n                         <tr>\r\n                            <td valign='top'>" . __("Paste the JSON data here", "wp-google-maps") . ":</td>\r\n                            <td><textarea name=\"wpgmza_adv_styling_json\" id=\"wpgmza_adv_styling_json\" rows=\"8\" cols=\"40\">" . stripslashes($res->styling_json) . "</textarea></td>\r\n                         </tr>\r\n                     </table>\r\n                    <p class='submit'><input type='submit' name='wpgmza_save_style_settings' value='" . __("Save Style Settings", "wp-google-maps") . " &raquo;' /></p>\r\n                </form>\r\n        </div>\r\n    ";
    return $ret;
}
Ejemplo n.º 4
0
/**
 * Handles ajax callbacks for usage tracker
 *
 * @return void
 */
function wpgmaps_usage_tracking_callback()
{
    if (isset($_POST['action'])) {
        if ($_POST['action'] == 'track_usage') {
            $wpgmza_settings = get_option('WPGMZA_OTHER_SETTINGS');
            if (isset($wpgmza_settings['wpgmza_settings_enable_usage_tracking']) && $wpgmza_settings['wpgmza_settings_enable_usage_tracking'] == 'yes') {
                $map_data = wpgmza_get_map_data(sanitize_text_field($_POST['mapid']));
                if (isset($map_data->other_settings) && $map_data->other_settings == '') {
                    /* New map - no changes have been made to it */
                } else {
                    if (function_exists('curl_version')) {
                        $request_url = "http://ccplugins.co/usage-tracking/record.php";
                        $ch = curl_init();
                        curl_setopt($ch, CURLOPT_URL, $request_url);
                        curl_setopt($ch, CURLOPT_POST, 1);
                        curl_setopt($ch, CURLOPT_POSTFIELDS, $map_data);
                        curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_HOST']);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                        $output = curl_exec($ch);
                        curl_close($ch);
                    }
                }
            }
        }
        if ($_POST['action'] == 'request_coupon') {
            if ($_POST['status'] == 'true') {
                if (function_exists('curl_version')) {
                    $request_url = "http://ccplugins.co/usage-tracking/coupons.php";
                    $ch = curl_init();
                    curl_setopt($ch, CURLOPT_URL, $request_url);
                    curl_setopt($ch, CURLOPT_POST, 1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
                    curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_HOST']);
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                    $output = curl_exec($ch);
                    curl_close($ch);
                    $wpgmza_settings = get_option('WPGMZA_OTHER_SETTINGS');
                    $wpgmza_settings['wpgmza_settings_enable_usage_tracking'] = 'yes';
                    update_option('WPGMZA_OTHER_SETTINGS', $wpgmza_settings);
                } else {
                    $body = "Usage tracking has been enabled by " . $_POST['email'];
                    wp_mail('*****@*****.**', 'Coupon Code Request', $body);
                }
            } else {
                $wpgmza_settings = get_option('WPGMZA_OTHER_SETTINGS');
                $wpgmza_settings['wpgmza_settings_enable_usage_tracking'] = '0';
                update_option('WPGMZA_OTHER_SETTINGS', $wpgmza_settings);
            }
        }
    }
    wp_die();
}
function wpgmza_pro_return_maps_linked_to_cat($cat_id)
{
    global $wpdb;
    global $wpgmza_tblname_category_maps;
    $ret_msg = "";
    $sql = "SELECT * FROM `{$wpgmza_tblname_category_maps}` WHERE `cat_id` = '{$cat_id}'";
    $results = $wpdb->get_results($sql);
    $cnt = count($results);
    $cnt_i = 1;
    foreach ($results as $result) {
        $map_id = $result->map_id;
        if ($map_id == 0) {
            $ret_msg .= "<a href=\"?page=wp-google-maps-menu\">" . __("All maps", "wp-google-maps") . "</option>";
            return $ret_msg;
        } else {
            $map_data = wpgmza_get_map_data($map_id);
            if ($cnt_i == $cnt) {
                $wpgmza_com = "";
            } else {
                $wpgmza_com = ",";
            }
            $ret_msg .= "<a href=\"?page=wp-google-maps-menu&action=edit&map_id=" . $map_id . "\">" . $map_data->map_title . "</a>{$wpgmza_com} ";
        }
        $cnt_i++;
    }
    return $ret_msg;
}
function wpgmaps_sl_user_output_pro($map_id)
{
    $map_settings = wpgmza_get_map_data($map_id);
    $map_width = $map_settings->map_width;
    $map_width_type = stripslashes($map_settings->map_width_type);
    $map_other_settings = maybe_unserialize($map_settings->other_settings);
    if (isset($map_other_settings['store_locator_query_string'])) {
        $sl_query_string = stripslashes($map_other_settings['store_locator_query_string']);
    } else {
        $sl_query_string = __("ZIP / Address:", "wp-google-maps");
    }
    if (isset($map_other_settings['store_locator_name_string'])) {
        $sl_name_string = stripslashes($map_other_settings['store_locator_name_string']);
    } else {
        $sl_name_string = __("Title / Description:", "wp-google-maps");
    }
    if (isset($map_other_settings['store_locator_use_their_location']) && $map_other_settings['store_locator_use_their_location'] == "1") {
        $sl_use_their_location = true;
    } else {
        $sl_use_their_location = false;
    }
    if ($map_width_type == "px" && $map_width < 300) {
        $map_width = "300";
    }
    $ret_msg = "";
    $ret_msg .= "<div class=\"wpgmza_sl_main_div\">";
    $ret_msg .= "       <div class=\"wpgmza_sl_query_div\">";
    $ret_msg .= "           <div class=\"wpgmza_sl_query_innerdiv1\">" . $sl_query_string . "</div>";
    $ret_msg .= "           <div class=\"wpgmza_sl_query_innerdiv2\">";
    $ret_msg .= "\t\t\t\t<input type=\"text\" id=\"addressInput_" . $map_id . "\" size=\"20\" value=\"\" mid=\"" . $map_id . "\" class='addressInput' /> ";
    if ($sl_use_their_location) {
        $ret_msg .= "\t\t\t\t<button id=\"sl_use_my_location_" . $map_id . "\" class=\"sl_use_loc\" mid=\"" . $map_id . "\" title='" . __("Use my location", "wp-google-maps") . "' ><img src='" . plugins_url(plugin_basename(dirname(__FILE__))) . "/images/mylocation.png' title='" . __("Use my location", "wp-google-maps") . "' width='15' /></button>";
    }
    $ret_msg .= "\t\t\t</div>";
    $ret_msg .= "       </div>";
    if (isset($map_other_settings['store_locator_name_search']) && intval($map_other_settings['store_locator_name_search']) == 1) {
        $ret_msg .= "       <div class=\"wpgmza_sl_query_div\">";
        $ret_msg .= "           <div class=\"wpgmza_sl_query_innerdiv1 wpgmza_name_search_string\">" . $sl_name_string . "</div>";
        $ret_msg .= "           <div class=\"wpgmza_sl_query_innerdiv2 wpgmza_name_search_field\"><input type=\"text\" id=\"nameInput_" . $map_id . "\" size=\"20\" value=\"\" /></div>";
        $ret_msg .= "       </div>";
    }
    $ret_msg .= "       <div class=\"wpgmza_sl_radius_div\">";
    $ret_msg .= "           <div class=\"wpgmza_sl_radius_innerdiv1\">" . __("Radius", "wp-google-maps") . ":</div>";
    $ret_msg .= "           <div class=\"wpgmza_sl_radius_innerdiv2\">";
    $ret_msg .= "           <select class=\"wpgmza_sl_radius_select\" id=\"radiusSelect_" . $map_id . "\">";
    $ret_msg .= "               ";
    if ($map_other_settings['store_locator_distance'] == 1) {
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"1\">" . __("1mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"5\">" . __("5mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"10\" selected>" . __("10mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"25\">" . __("25mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"50\">" . __("50mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"75\">" . __("75mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"100\">" . __("100mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"150\">" . __("150mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"200\">" . __("200mi", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"300\">" . __("300mi", "wp-google-maps") . "</option>";
    } else {
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"1\">" . __("1km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"5\">" . __("5km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"10\" selected>" . __("10km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"25\">" . __("25km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"50\">" . __("50km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"75\">" . __("75km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"100\">" . __("100km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"150\">" . __("150km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"200\">" . __("200km", "wp-google-maps") . "</option>";
        $ret_msg .= "                   <option class=\"wpgmza_sl_select_option\" value=\"300\">" . __("300km", "wp-google-maps") . "</option>";
    }
    $ret_msg .= "               </select><input type='hidden' value='" . $map_other_settings['store_locator_distance'] . "' name='wpgmza_distance_type' id='wpgmza_distance_type_" . $map_id . "'  style='display:none;' />";
    $ret_msg .= "           </div>";
    $ret_msg .= "       </div>";
    if (function_exists("wpgmza_register_pro_version") && isset($map_other_settings['store_locator_category']) && $map_other_settings['store_locator_category'] == "1") {
        $ret_msg .= "       <div class=\"wpgmza_sl_category_div\">";
        $ret_msg .= "           <div class=\"wpgmza_sl_category_innerdiv1\">" . __("Category", "wp-google-maps") . ":</div>";
        $ret_msg .= "           <div class=\"wpgmza_sl_category_innerdiv2\">";
        $ret_msg .= "              " . wpgmza_pro_return_category_checkbox_list($map_id) . "";
        $ret_msg .= "           </div>";
        $ret_msg .= "       </div>";
    }
    $ret_msg .= "       <input class=\"wpgmza_sl_search_button_" . $map_id . "\" mid=\"" . $map_id . "\" type=\"button\" onclick=\"searchLocations({$map_id})\" value=\"" . __("Search", "wp-google-maps") . "\"/>";
    $ret_msg .= "       <input class=\"wpgmza_sl_reset_button_" . $map_id . "\" mid=\"" . $map_id . "\" type=\"button\" onclick=\"resetLocations({$map_id})\" value=\"" . __("Reset", "wp-google-maps") . "\"/>";
    $ret_msg .= "    </div>";
    $ret_msg .= "    <div><select id=\"locationSelect\" style=\"width:100%;visibility:hidden\"></select></div>";
    return $ret_msg;
}
function wpgmaps_admin_javascript_pro()
{
    global $wpdb;
    global $wpgmza_tblname_maps;
    $ajax_nonce = wp_create_nonce("wpgmza");
    if (is_admin() && $_GET['page'] == 'wp-google-maps-menu' && $_GET['action'] == "edit_marker") {
        wpgmaps_admin_edit_marker_javascript();
    } else {
        if (is_admin() && $_GET['page'] == 'wp-google-maps-menu' && $_GET['action'] == "add_poly") {
            wpgmaps_admin_add_poly_javascript($_GET['map_id']);
        } else {
            if (is_admin() && $_GET['page'] == 'wp-google-maps-menu' && $_GET['action'] == "edit_poly") {
                wpgmaps_admin_edit_poly_javascript($_GET['map_id'], $_GET['poly_id']);
            } else {
                if (is_admin() && $_GET['page'] == 'wp-google-maps-menu' && $_GET['action'] == "add_polyline") {
                    wpgmaps_admin_add_polyline_javascript($_GET['map_id']);
                } else {
                    if (is_admin() && $_GET['page'] == 'wp-google-maps-menu' && $_GET['action'] == "edit_polyline") {
                        wpgmaps_admin_edit_polyline_javascript($_GET['map_id'], $_GET['poly_id']);
                    } else {
                        if (is_admin() && $_GET['page'] == 'wp-google-maps-menu' && $_GET['action'] == "edit") {
                            wpgmaps_update_xml_file($_GET['map_id']);
                            $res = wpgmza_get_map_data($_GET['map_id']);
                            $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
                            $wpgmza_lat = $res->map_start_lat;
                            $wpgmza_lng = $res->map_start_lng;
                            $wpgmza_width = $res->map_width;
                            $wpgmza_height = $res->map_height;
                            $wpgmza_width_type = stripslashes($res->map_width_type);
                            $wpgmza_height_type = $res->map_height_type;
                            $wpgmza_map_type = $res->type;
                            $wpgmza_default_icon = $res->default_marker;
                            $kml = $res->kml;
                            $fusion = $res->fusion;
                            $wpgmza_traffic = $res->traffic;
                            $wpgmza_bicycle = $res->bicycle;
                            $wpgmza_dbox = $res->dbox;
                            $wpgmza_dbox_width = $res->dbox_width;
                            if ($wpgmza_default_icon == "0") {
                                $wpgmza_default_icon = "";
                            }
                            if (!$wpgmza_map_type || $wpgmza_map_type == "" || $wpgmza_map_type == "1") {
                                $wpgmza_map_type = "ROADMAP";
                            } else {
                                if ($wpgmza_map_type == "2") {
                                    $wpgmza_map_type = "SATELLITE";
                                } else {
                                    if ($wpgmza_map_type == "3") {
                                        $wpgmza_map_type = "HYBRID";
                                    } else {
                                        if ($wpgmza_map_type == "4") {
                                            $wpgmza_map_type = "TERRAIN";
                                        } else {
                                            $wpgmza_map_type = "ROADMAP";
                                        }
                                    }
                                }
                            }
                            $start_zoom = $res->map_start_zoom;
                            if ($start_zoom < 1 || !$start_zoom) {
                                $start_zoom = 5;
                            }
                            if (!$wpgmza_lat || !$wpgmza_lng) {
                                $wpgmza_lat = "51.5081290";
                                $wpgmza_lng = "-0.1280050";
                            }
                            // marker sorting functionality
                            if ($res->order_markers_by == 1) {
                                $order_by = 0;
                            } else {
                                if ($res->order_markers_by == 2) {
                                    $order_by = 2;
                                } else {
                                    if ($res->order_markers_by == 3) {
                                        $order_by = 4;
                                    } else {
                                        if ($res->order_markers_by == 4) {
                                            $order_by = 5;
                                        } else {
                                            if ($res->order_markers_by == 5) {
                                                $order_by = 3;
                                            } else {
                                                $order_by = 0;
                                            }
                                        }
                                    }
                                }
                            }
                            if ($res->order_markers_choice == 1) {
                                $order_choice = "asc";
                            } else {
                                $order_choice = "desc";
                            }
                            ?>
    <script type="text/javascript">
               var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
               document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.8.24/themes/smoothness/jquery-ui.css" />
    <link rel="stylesheet" type="text/css" media="all" href="<?php 
                            echo wpgmaps_get_plugin_url();
                            ?>
/css/data_table.css" />
    <script type="text/javascript" src="<?php 
                            echo wpgmaps_get_plugin_url();
                            ?>
/js/jquery.dataTables.js"></script>
    <script type="text/javascript" >

    


    jQuery(function() {

        
        

        var wpgmzaTable;

                jQuery(document).ready(function(){

                    

                    
                    
                    jQuery("#wpgmaps_show_advanced").click(function() {
                      jQuery("#wpgmaps_advanced_options").show();
                      jQuery("#wpgmaps_show_advanced").hide();
                      jQuery("#wpgmaps_hide_advanced").show();

                    });
                    jQuery("#wpgmaps_hide_advanced").click(function() {
                      jQuery("#wpgmaps_advanced_options").hide();
                      jQuery("#wpgmaps_show_advanced").show();
                      jQuery("#wpgmaps_hide_advanced").hide();

                    });



                    wpgmzaTable = jQuery('#wpgmza_table').dataTable({
                        "bProcessing": true,
                        "aaSorting": [[ <?php 
                            echo "{$order_by}";
                            ?>
, "<?php 
                            echo $order_choice;
                            ?>
" ]]
                    });
                    function wpgmza_reinitialisetbl() {
                        wpgmzaTable.fnClearTable( 0 );
                        wpgmzaTable = jQuery('#wpgmza_table').dataTable({
                            "bProcessing": true,
                            "aaSorting": [[ <?php 
                            echo "{$order_by}";
                            ?>
, "<?php 
                            echo $order_choice;
                            ?>
" ]]
                        });
                    }
                    function wpgmza_InitMap() {
                        var myLatLng = new google.maps.LatLng(<?php 
                            echo $wpgmza_lat;
                            ?>
,<?php 
                            echo $wpgmza_lng;
                            ?>
);
                        MYMAP.init('#wpgmza_map', myLatLng, <?php 
                            echo $start_zoom;
                            ?>
);
                        UniqueCode=Math.round(Math.random()*10000);
                        MYMAP.placeMarkers('<?php 
                            echo wpgmaps_get_marker_url($_GET['map_id']);
                            ?>
?u='+UniqueCode,<?php 
                            echo $_GET['map_id'];
                            ?>
);
                    }

                    jQuery("#wpgmza_map").css({
                        height:'<?php 
                            echo $wpgmza_height;
                            echo $wpgmza_height_type;
                            ?>
',
                        width:'<?php 
                            echo $wpgmza_width;
                            echo $wpgmza_width_type;
                            ?>
'

                    });
                    var geocoder = new google.maps.Geocoder();
                    wpgmza_InitMap();



                    jQuery("body").on("click", ".wpgmza_del_btn", function() {
                        var cur_id = jQuery(this).attr("id");
                        var wpgm_map_id = "0";
                        if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
                        var data = {
                                action: 'delete_marker',
                                security: '<?php 
                            echo $ajax_nonce;
                            ?>
',
                                map_id: wpgm_map_id,
                                marker_id: cur_id
                        };
                        jQuery.post(ajaxurl, data, function(response) {
                                wpgmza_InitMap();
                                jQuery("#wpgmza_marker_holder").html(response);
                                wpgmza_reinitialisetbl();

                        });

                    });
                    jQuery("body").on("click", ".wpgmza_poly_del_btn", function() {
                        var cur_id = jQuery(this).attr("id");
                        var wpgm_map_id = "0";
                        if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
                        var data = {
                                action: 'delete_poly',
                                security: '<?php 
                            echo $ajax_nonce;
                            ?>
',
                                map_id: wpgm_map_id,
                                poly_id: cur_id
                        };
                        jQuery.post(ajaxurl, data, function(response) {
                                wpgmza_InitMap();
                                jQuery("#wpgmza_poly_holder").html(response);
                                window.location.reload();

                        });

                    });



                    jQuery("body").on("click", ".wpgmza_edit_btn", function() {
                        var cur_id = jQuery(this).attr("id");

                        var wpgmza_edit_title = jQuery("#wpgmza_hid_marker_title_"+cur_id).val();
                        var wpgmza_edit_address = jQuery("#wpgmza_hid_marker_address_"+cur_id).val();
                        var wpgmza_edit_desc = jQuery("#wpgmza_hid_marker_desc_"+cur_id).val();
                        var wpgmza_edit_pic = jQuery("#wpgmza_hid_marker_pic_"+cur_id).val();
                        var wpgmza_edit_link = jQuery("#wpgmza_hid_marker_link_"+cur_id).val();
                        var wpgmza_edit_icon = jQuery("#wpgmza_hid_marker_icon_"+cur_id).val();
                        var wpgmza_edit_anim = jQuery("#wpgmza_hid_marker_anim_"+cur_id).val();
                        var wpgmza_edit_category = jQuery("#wpgmza_hid_marker_category_"+cur_id).val();
                        var wpgmza_edit_infoopen = jQuery("#wpgmza_hid_marker_infoopen_"+cur_id).val();
                        jQuery("#wpgmza_edit_id").val(cur_id);
                        jQuery("#wpgmza_add_title").val(wpgmza_edit_title);
                        jQuery("#wpgmza_add_address").val(wpgmza_edit_address);
                        jQuery("#wpgmza_add_desc").val(wpgmza_edit_desc);
                        jQuery("#wpgmza_add_pic").val(wpgmza_edit_pic);
                        jQuery("#wpgmza_link_url").val(wpgmza_edit_link);
                        jQuery("#wpgmza_animation").val(wpgmza_edit_anim);
                        jQuery("#wpgmza_category").val(wpgmza_edit_category);
                        jQuery("#wpgmza_infoopen").val(wpgmza_edit_infoopen);
                        jQuery("#wpgmza_add_custom_marker").val(wpgmza_edit_icon);
                        jQuery("#wpgmza_cmm").html("<img src='"+wpgmza_edit_icon+"' />");
                        jQuery("#wpgmza_addmarker_div").hide();
                        jQuery("#wpgmza_editmarker_div").show();


                    });

                    

                    jQuery("#wpgmza_addmarker").click(function(){
                        jQuery("#wpgmza_addmarker").hide();
                        jQuery("#wpgmza_addmarker_loading").show();

                        var wpgm_title = "";
                        var wpgm_address = "0";
                        var wpgm_desc = "0";
                        var wpgm_pic = "0";
                        var wpgm_link = "0";
                        var wpgm_icon = "0";
                        var wpgm_gps = "0";

                        var wpgm_anim = "0";
                        var wpgm_category = "0";
                        var wpgm_infoopen = "0";
                        var wpgm_map_id = "0";
                        if (document.getElementsByName("wpgmza_add_title").length > 0) { wpgm_title = jQuery("#wpgmza_add_title").val(); }
                        if (document.getElementsByName("wpgmza_add_address").length > 0) { wpgm_address = jQuery("#wpgmza_add_address").val(); }
                        if (document.getElementsByName("wpgmza_add_desc").length > 0) { wpgm_desc = jQuery("#wpgmza_add_desc").val(); }
                        if (document.getElementsByName("wpgmza_add_pic").length > 0) { wpgm_pic = jQuery("#wpgmza_add_pic").val(); }
                        if (document.getElementsByName("wpgmza_link_url").length > 0) { wpgm_link = jQuery("#wpgmza_link_url").val(); }
                        if (document.getElementsByName("wpgmza_add_custom_marker").length > 0) { wpgm_icon = jQuery("#wpgmza_add_custom_marker").val(); }
                        if (document.getElementsByName("wpgmza_animation").length > 0) { wpgm_anim = jQuery("#wpgmza_animation").val(); }
                        if (document.getElementsByName("wpgmza_category").length > 0) { wpgm_category = jQuery("#wpgmza_category").val(); }
                        if (document.getElementsByName("wpgmza_infoopen").length > 0) { wpgm_infoopen = jQuery("#wpgmza_infoopen").val(); }
                        if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }

                        geocoder.geocode( { 'address': wpgm_address}, function(results, status) {
                            if (status == google.maps.GeocoderStatus.OK) {
                                wpgm_gps = String(results[0].geometry.location);
                                var latlng1 = wpgm_gps.replace("(","");
                                var latlng2 = latlng1.replace(")","");
                                var latlngStr = latlng2.split(",",2);
                                var wpgm_lat = parseFloat(latlngStr[0]);
                                var wpgm_lng = parseFloat(latlngStr[1]);


                                var data = {
                                    action: 'add_marker',
                                    security: '<?php 
                            echo $ajax_nonce;
                            ?>
',
                                    map_id: wpgm_map_id,
                                    title: wpgm_title,
                                    address: wpgm_address,
                                    desc: wpgm_desc,
                                    link: wpgm_link,
                                    icon: wpgm_icon,
                                    pic: wpgm_pic,
                                    anim: wpgm_anim,
                                    category: wpgm_category,
                                    infoopen: wpgm_infoopen,
                                    lat: wpgm_lat,
                                    lng: wpgm_lng
                                };


                                jQuery.post(ajaxurl, data, function(response) {
                                        wpgmza_InitMap();
                                        jQuery("#wpgmza_marker_holder").html(response);
                                        jQuery("#wpgmza_addmarker").show();
                                        jQuery("#wpgmza_addmarker_loading").hide();

                                        jQuery("#wpgmza_add_title").val("");
                                        jQuery("#wpgmza_add_address").val("");
                                        jQuery("#wpgmza_add_desc").val("");
                                        jQuery("#wpgmza_add_pic").val("");
                                        jQuery("#wpgmza_link_url").val("");
                                        jQuery("#wpgmza_animation").val("None");
                                        jQuery("#wpgmza_category").val("Select");
                                        jQuery("#wpgmza_edit_id").val("");
                                        wpgmza_reinitialisetbl();
                                });

                            } else {
                                alert("<?php 
                            _e("Geocode was not successful for the following reason", "wp-google-maps");
                            ?>
: " + status);
                            }
                        });



                    });
                    jQuery("#wpgmza_editmarker").click(function(){

                        jQuery("#wpgmza_editmarker_div").hide();
                        jQuery("#wpgmza_editmarker_loading").show();


                        var wpgm_edit_id;
                        wpgm_edit_id = parseInt(jQuery("#wpgmza_edit_id").val());
                        var wpgm_title = "";
                        var wpgm_address = "0";
                        var wpgm_desc = "0";
                        var wpgm_pic = "0";
                        var wpgm_link = "0";
                        var wpgm_anim = "0";
                        var wpgm_category = "0";
                        var wpgm_infoopen = "0";
                        var wpgm_icon = "";
                        var wpgm_map_id = "0";
                        var wpgm_gps = "0";
                        if (document.getElementsByName("wpgmza_add_title").length > 0) { wpgm_title = jQuery("#wpgmza_add_title").val(); }
                        if (document.getElementsByName("wpgmza_add_address").length > 0) { wpgm_address = jQuery("#wpgmza_add_address").val(); }
                        if (document.getElementsByName("wpgmza_add_desc").length > 0) { wpgm_desc = jQuery("#wpgmza_add_desc").val(); }
                        if (document.getElementsByName("wpgmza_add_pic").length > 0) { wpgm_pic = jQuery("#wpgmza_add_pic").val(); }
                        if (document.getElementsByName("wpgmza_link_url").length > 0) { wpgm_link = jQuery("#wpgmza_link_url").val(); }
                        if (document.getElementsByName("wpgmza_animation").length > 0) { wpgm_anim = jQuery("#wpgmza_animation").val(); }
                        if (document.getElementsByName("wpgmza_category").length > 0) { wpgm_category = jQuery("#wpgmza_category").val(); }
                        if (document.getElementsByName("wpgmza_infoopen").length > 0) { wpgm_infoopen = jQuery("#wpgmza_infoopen").val(); }
                        if (document.getElementsByName("wpgmza_add_custom_marker").length > 0) { wpgm_icon = jQuery("#wpgmza_add_custom_marker").val(); }
                        if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }

                        geocoder.geocode( { 'address': wpgm_address}, function(results, status) {
                            if (status == google.maps.GeocoderStatus.OK) {
                                wpgm_gps = String(results[0].geometry.location);
                                var latlng1 = wpgm_gps.replace("(","");
                                var latlng2 = latlng1.replace(")","");
                                var latlngStr = latlng2.split(",",2);
                                var wpgm_lat = parseFloat(latlngStr[0]);
                                var wpgm_lng = parseFloat(latlngStr[1]);

                                var data = {
                                        action: 'edit_marker',
                                        security: '<?php 
                            echo $ajax_nonce;
                            ?>
',
                                        map_id: wpgm_map_id,
                                        edit_id: wpgm_edit_id,
                                        title: wpgm_title,
                                        address: wpgm_address,
                                        lat: wpgm_lat,
                                        lng: wpgm_lng,
                                        icon: wpgm_icon,
                                        desc: wpgm_desc,
                                        link: wpgm_link,
                                        pic: wpgm_pic,
                                        anim: wpgm_anim,
                                        category: wpgm_category,
                                        infoopen: wpgm_infoopen
                                };

                                jQuery.post(ajaxurl, data, function(response) {
                                    wpgmza_InitMap();
                                    jQuery("#wpgmza_marker_holder").html(response);
                                    jQuery("#wpgmza_addmarker_div").show();
                                    jQuery("#wpgmza_editmarker_loading").hide();
                                    jQuery("#wpgmza_add_title").val("");
                                    jQuery("#wpgmza_add_address").val("");
                                    jQuery("#wpgmza_add_desc").val("");
                                    jQuery("#wpgmza_add_pic").val("");
                                    jQuery("#wpgmza_link_url").val("");
                                    jQuery("#wpgmza_edit_id").val("");
                                    jQuery("#wpgmza_animation").val("None");
                                    jQuery("#wpgmza_category").val("Select");
                                    jQuery("#wpgmza_cmm").html("");
                                    wpgmza_reinitialisetbl();
                                });

                            } else {
                                alert("<?php 
                            _e("Geocode was not successful for the following reason", "wp-google-maps");
                            ?>
: " + status);
                            }
                        });





                    });
            });

            });

           

            var MYMAP = {
                map: null,
                bounds: null,
                mc: null
            }
            MYMAP.init = function(selector, latLng, zoom) {
              var myOptions = {
                zoom:zoom,

                center: latLng,
                scrollwheel: <?php 
                            if ($wpgmza_settings['wpgmza_settings_map_scroll'] == "yes") {
                                echo "false";
                            } else {
                                echo "true";
                            }
                            ?>
,
                zoomControl: <?php 
                            if ($wpgmza_settings['wpgmza_settings_map_zoom'] == "yes") {
                                echo "false";
                            } else {
                                echo "true";
                            }
                            ?>
,
                panControl: <?php 
                            if ($wpgmza_settings['wpgmza_settings_map_pan'] == "yes") {
                                echo "false";
                            } else {
                                echo "true";
                            }
                            ?>
,
                mapTypeControl: <?php 
                            if ($wpgmza_settings['wpgmza_settings_map_type'] == "yes") {
                                echo "false";
                            } else {
                                echo "true";
                            }
                            ?>
,
                streetViewControl: <?php 
                            if ($wpgmza_settings['wpgmza_settings_map_streetview'] == "yes") {
                                echo "false";
                            } else {
                                echo "true";
                            }
                            ?>
,
                mapTypeId: google.maps.MapTypeId.<?php 
                            echo $wpgmza_map_type;
                            ?>
              }
            this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
            this.bounds = new google.maps.LatLngBounds();

            google.maps.event.addListener(MYMAP.map, 'zoom_changed', function() {
                zoomLevel = MYMAP.map.getZoom();
                jQuery("#wpgmza_start_zoom").val(zoomLevel);
            });
            <?php 
                            $total_poly_array = wpgmza_return_polygon_id_array($_GET['map_id']);
                            if ($total_poly_array > 0) {
                                foreach ($total_poly_array as $poly_id) {
                                    $polyoptions = wpgmza_return_poly_options($poly_id);
                                    $linecolor = $polyoptions->linecolor;
                                    $fillcolor = $polyoptions->fillcolor;
                                    $fillopacity = $polyoptions->opacity;
                                    if (!$linecolor) {
                                        $linecolor = "000000";
                                    }
                                    if (!$fillcolor) {
                                        $fillcolor = "66FF00";
                                    }
                                    if (!$fillopacity) {
                                        $fillopacity = "0.5";
                                    }
                                    $linecolor = "#" . $linecolor;
                                    $fillcolor = "#" . $fillcolor;
                                    ?>
 
            var WPGM_PathData_<?php 
                                    echo $poly_id;
                                    ?>
 = [
                <?php 
                                    $poly_array = wpgmza_return_polygon_array($poly_id);
                                    foreach ($poly_array as $single_poly) {
                                        $poly_data_raw = str_replace(" ", "", $single_poly);
                                        $poly_data_raw = explode(",", $poly_data_raw);
                                        $lat = $poly_data_raw[0];
                                        $lng = $poly_data_raw[1];
                                        ?>
                    new google.maps.LatLng(<?php 
                                        echo $lat;
                                        ?>
, <?php 
                                        echo $lng;
                                        ?>
),            
                    <?php 
                                    }
                                    ?>
                
               
            ];
            var WPGM_Path_<?php 
                                    echo $poly_id;
                                    ?>
 = new google.maps.Polygon({
              path: WPGM_PathData_<?php 
                                    echo $poly_id;
                                    ?>
,
              strokeColor: "<?php 
                                    echo $linecolor;
                                    ?>
",
              fillOpacity: "<?php 
                                    echo $fillopacity;
                                    ?>
",
              fillColor: "<?php 
                                    echo $fillcolor;
                                    ?>
",
              strokeWeight: 2
            });

            WPGM_Path_<?php 
                                    echo $poly_id;
                                    ?>
.setMap(this.map);
            <?php 
                                }
                            }
                            ?>



           
<?php 
                            // polylines
                            $total_polyline_array = wpgmza_return_polyline_id_array($_GET['map_id']);
                            if ($total_polyline_array > 0) {
                                foreach ($total_polyline_array as $poly_id) {
                                    $polyoptions = wpgmza_return_polyline_options($poly_id);
                                    $linecolor = $polyoptions->linecolor;
                                    $fillopacity = $polyoptions->opacity;
                                    $linethickness = $polyoptions->linethickness;
                                    if (!$linecolor) {
                                        $linecolor = "000000";
                                    }
                                    if (!$linethickness) {
                                        $linethickness = "4";
                                    }
                                    if (!$fillopacity) {
                                        $fillopacity = "0.5";
                                    }
                                    $linecolor = "#" . $linecolor;
                                    ?>
 
                var WPGM_PathLineData_<?php 
                                    echo $poly_id;
                                    ?>
 = [
                    <?php 
                                    $poly_array = wpgmza_return_polyline_array($poly_id);
                                    foreach ($poly_array as $single_poly) {
                                        $poly_data_raw = str_replace(" ", "", $single_poly);
                                        $poly_data_raw = explode(",", $poly_data_raw);
                                        $lat = $poly_data_raw[0];
                                        $lng = $poly_data_raw[1];
                                        ?>
                        new google.maps.LatLng(<?php 
                                        echo $lat;
                                        ?>
, <?php 
                                        echo $lng;
                                        ?>
),            
                        <?php 
                                    }
                                    ?>
                ];
                var WPGM_PathLine_<?php 
                                    echo $poly_id;
                                    ?>
 = new google.maps.Polyline({
                  path: WPGM_PathLineData_<?php 
                                    echo $poly_id;
                                    ?>
,
                  strokeColor: "<?php 
                                    echo $linecolor;
                                    ?>
",
                  strokeOpacity: "<?php 
                                    echo $fillopacity;
                                    ?>
",
                  strokeWeight: "<?php 
                                    echo $linethickness;
                                    ?>
"
                  
                });

                WPGM_PathLine_<?php 
                                    echo $poly_id;
                                    ?>
.setMap(this.map);
                <?php 
                                }
                            }
                            ?>
    


            google.maps.event.addListener(MYMAP.map, 'center_changed', function() {
                var location = MYMAP.map.getCenter();
                jQuery("#wpgmza_start_location").val(location.lat()+","+location.lng());
                jQuery("#wpgmaps_save_reminder").show();
            });

            <?php 
                            if ($wpgmza_bicycle == "1") {
                                ?>
            var bikeLayer = new google.maps.BicyclingLayer();
            bikeLayer.setMap(this.map);
            <?php 
                            }
                            ?>
            <?php 
                            if ($wpgmza_traffic == "1") {
                                ?>
            var trafficLayer = new google.maps.TrafficLayer();
            trafficLayer.setMap(this.map);
            <?php 
                            }
                            ?>


            <?php 
                            if ($kml != "") {
                                ?>
            var georssLayer = new google.maps.KmlLayer('<?php 
                                echo $kml;
                                ?>
?tstamp=<?php 
                                echo time();
                                ?>
');
            georssLayer.setMap(this.map);
            <?php 
                            }
                            ?>
            <?php 
                            if ($fusion != "") {
                                ?>
                var fusionlayer = new google.maps.FusionTablesLayer('<?php 
                                echo $fusion;
                                ?>
', {
                      suppressInfoWindows: false
                });
                fusionlayer.setMap(this.map);
            <?php 
                            }
                            ?>


            } // end of map init

            var infoWindow = new google.maps.InfoWindow();
            <?php 
                            $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
                            $wpgmza_settings_infowindow_width = $wpgmza_settings['wpgmza_settings_infowindow_width'];
                            if (!$wpgmza_settings_infowindow_width || !isset($wpgmza_settings_infowindow_width)) {
                                $wpgmza_settings_infowindow_width = "200";
                            }
                            ?>
            infoWindow.setOptions({maxWidth:<?php 
                            echo $wpgmza_settings_infowindow_width;
                            ?>
});

            google.maps.event.addDomListener(window, 'resize', function() {
                var myLatLng = new google.maps.LatLng(<?php 
                            echo $wpgmza_lat;
                            ?>
,<?php 
                            echo $wpgmza_lng;
                            ?>
);
                MYMAP.map.setCenter(myLatLng);
            });


            

            MYMAP.placeMarkers = function(filename,map_id) {
                marker_array = [];
                    jQuery.get(filename, function(xml){
                            jQuery(xml).find("marker").each(function(){
                                    var wpgmza_def_icon = '<?php 
                            echo $wpgmza_default_icon;
                            ?>
';
                                    var wpmgza_map_id = jQuery(this).find('map_id').text();

                                    if (wpmgza_map_id == map_id) {
                                        var wpmgza_title = jQuery(this).find('title').text();
                                        var wpmgza_show_address = jQuery(this).find('address').text();
                                        var wpmgza_address = jQuery(this).find('address').text();
                                        var wpmgza_mapicon = jQuery(this).find('icon').text();
                                        var wpmgza_image = jQuery(this).find('pic').text();
                                        var wpmgza_desc  = jQuery(this).find('desc').text();
                                        var wpmgza_anim  = jQuery(this).find('anim').text();
                                        var wpmgza_infoopen  = jQuery(this).find('infoopen').text();
                                        var wpmgza_linkd = jQuery(this).find('linkd').text();
                                        if (wpmgza_title != "") {
                                            wpmgza_title = wpmgza_title+'<br />';
                                        }
                                        if (wpmgza_image != "") {

                                    <?php 
                            $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
                            $wpgmza_image_height = $wpgmza_settings['wpgmza_settings_image_height'];
                            $wpgmza_image_width = $wpgmza_settings['wpgmza_settings_image_width'];
                            if (!$wpgmza_image_height || !isset($wpgmza_image_height)) {
                                $wpgmza_image_height = "100";
                            }
                            if (!$wpgmza_image_width || !isset($wpgmza_image_width)) {
                                $wpgmza_image_width = "100";
                            }
                            $wpgmza_use_timthumb = $wpgmza_settings['wpgmza_settings_use_timthumb'];
                            if ($wpgmza_use_timthumb == "" || !isset($wpgmza_use_timthumb)) {
                                ?>
                                                wpmgza_image = "<br /><img src='<?php 
                                echo wpgmaps_get_plugin_url();
                                ?>
/timthumb.php?src="+wpmgza_image+"&h=<?php 
                                echo $wpgmza_image_height;
                                ?>
&w=<?php 
                                echo $wpgmza_image_width;
                                ?>
&zc=1' title='' alt='' style=\"float:right; margin:5px;\" />";
                                    <?php 
                            } else {
                                ?>
                                                wpmgza_image = "<br /><img src='"+wpmgza_image+"' class='wpgmza_map_image' style=\"float:right; margin:5px; height:<?php 
                                echo $wpgmza_image_height;
                                ?>
px; width:<?php 
                                echo $wpgmza_image_width;
                                ?>
px\" />";
                                    <?php 
                            }
                            ?>

                                            } else { wpmgza_image = "" }
                                        if (wpmgza_linkd != "") {
                                                <?php 
                            $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
                            $wpgmza_settings_infowindow_links = $wpgmza_settings['wpgmza_settings_infowindow_links'];
                            if ($wpgmza_settings_infowindow_links == "yes") {
                                $wpgmza_settings_infowindow_links = "target='_BLANK'";
                            }
                            ?>

                                                wpmgza_linkd = "<a href='"+wpmgza_linkd+"' <?php 
                            echo $wpgmza_settings_infowindow_links;
                            ?>
 title='<?php 
                            _e("More details", "wp-google-maps");
                            ?>
'><?php 
                            _e("More details", "wp-google-maps");
                            ?>
</a><br />";
                                            }
                                        if (wpmgza_mapicon == "" || !wpmgza_mapicon) { if (wpgmza_def_icon != "") { wpmgza_mapicon = '<?php 
                            echo $wpgmza_default_icon;
                            ?>
'; } }

                                        var lat = jQuery(this).find('lat').text();
                                        var lng = jQuery(this).find('lng').text();
                                        var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
                                        MYMAP.bounds.extend(point);
                                        if (wpmgza_anim == "1") {
                                        var marker = new google.maps.Marker({
                                                position: point,
                                                map: MYMAP.map,
                                                icon: wpmgza_mapicon,
                                                animation: google.maps.Animation.BOUNCE
                                        });
                                        }
                                        else if (wpmgza_anim == "2") {
                                            var marker = new google.maps.Marker({
                                                    position: point,
                                                    map: MYMAP.map,
                                                    icon: wpmgza_mapicon,
                                                    animation: google.maps.Animation.DROP
                                            });
                                        }
                                        else {
                                            var marker = new google.maps.Marker({
                                                    position: point,
                                                    map: MYMAP.map,
                                                    icon: wpmgza_mapicon
                                            });
                                        }
                                        //var html=''+wpmgza_image+'<strong>'+wpmgza_address+'</strong><br /><span style="font-size:12px;">'+wpmgza_desc+'<br />'+wpmgza_linkd+'</span>';
                                        <?php 
                            $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
                            $wpgmza_settings_infowindow_address = $wpgmza_settings['wpgmza_settings_infowindow_address'];
                            if ($wpgmza_settings_infowindow_address == "yes") {
                                ?>
                                        wpmgza_show_address = "";
                                        <?php 
                            }
                            ?>


                                        var html='<div id="wpgmza_markerbox">'
                                                +wpmgza_image+
                                                '<strong>'
                                                +wpmgza_title+
                                                '</strong>'+wpmgza_show_address+'<br /><span style="font-size:12px;">'
                                                +wpmgza_desc+
                                                '<br />'
                                                +wpmgza_linkd+
                                                ''
                                                +'</span></div>';
                                        if (wpmgza_infoopen == "1") {

                                            infoWindow.setContent(html);
                                            infoWindow.open(MYMAP.map, marker);
                                        }

                                        google.maps.event.addListener(marker, 'click', function() {
                                                infoWindow.close();
                                                infoWindow.setContent(html);
                                                infoWindow.open(MYMAP.map, marker);

//                                                MYMAP.map.setCenter(this.position);
                                        });
                                        //MYMAP.map.fitBounds(MYMAP.bounds);

                                    }

                        });
                });
            }

        </script>
<?php 
                        }
                    }
                }
            }
        }
    }
}
function wpgmza_return_polyline_list($map_id, $admin = true, $width = "100%")
{
    wpgmaps_debugger("return_marker_start");
    global $wpdb;
    global $wpgmza_tblname_polylines;
    $results = $wpdb->get_results("\n\tSELECT *\n\tFROM {$wpgmza_tblname_polylines}\n\tWHERE `map_id` = '{$map_id}' ORDER BY `id` DESC\n    ");
    $wpgmza_tmp .= "\n        \n        <table id=\"wpgmza_table_polyline\" class=\"display\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:{$width};\">\n        <thead>\n        <tr>\n            <th><strong>" . __("ID", "wp-google-maps") . "</strong></th>\n            <th><strong>" . __("Polyline Data", "wp-google-maps") . "</strong></th>\n            <th style='width:182px;'><strong>" . __("Action", "wp-google-maps") . "</strong></th>\n        </tr>\n        </thead>\n        <tbody>\n    ";
    $res = wpgmza_get_map_data($map_id);
    $default_marker = "<img src='" . $res->default_marker . "' />";
    //$wpgmza_data = get_option('WPGMZA');
    //if ($wpgmza_data['map_default_marker']) { $default_icon = "<img src='".$wpgmza_data['map_default_marker']."' />"; } else { $default_icon = "<img src='".wpgmaps_get_plugin_url()."/images/marker.png' />"; }
    foreach ($results as $result) {
        unset($poly_data);
        unset($poly_array);
        $poly_array = wpgmza_return_polyline_array($result->id);
        foreach ($poly_array as $poly_single) {
            $poly_data .= $poly_single . ",";
        }
        $wpgmza_tmp .= "\n            <tr id=\"wpgmza_poly_tr_" . $result->id . "\">\n                <td height=\"40\">" . $result->id . "</td>\n                <td height=\"40\"><small>" . $poly_data . "</small></td>\n                <td width='170' align='center'>\n                    <a href=\"" . get_option('siteurl') . "/wp-admin/admin.php?page=wp-google-maps-menu&action=edit_polyline&map_id=" . $map_id . "&poly_id=" . $result->id . "\" title=\"" . __("Edit", "wp-google-maps") . "\" class=\"wpgmza_edit_poly_btn\" id=\"" . $result->id . "\">" . __("Edit", "wp-google-maps") . "</a> |\n                    <a href=\"javascript:void(0);\" title=\"" . __("Delete this polyline", "wp-google-maps") . "\" class=\"wpgmza_polyline_del_btn\" id=\"" . $result->id . "\">" . __("Delete", "wp-google-maps") . "</a>\n                </td>\n            </tr>";
    }
    $wpgmza_tmp .= "</tbody></table>";
    return $wpgmza_tmp;
}
Ejemplo n.º 9
0
function wpgmza_basic_menu()
{
    wpgmaps_debugger("bm_start");
    global $wpgmza_tblname_maps;
    global $wpdb;
    if (!wpgmaps_check_permissions()) {
        wpgmaps_permission_warning();
    }
    if ($_GET['action'] == "edit" && isset($_GET['map_id'])) {
        $res = wpgmza_get_map_data($_GET['map_id']);
        if ($res->map_start_zoom) {
            $wpgmza_zoom[intval($res->map_start_zoom)] = "SELECTED";
        } else {
            $wpgmza_zoom[8] = "SELECTED";
        }
        if ($res->type) {
            $wpgmza_map_type[intval($res->type)] = "SELECTED";
        } else {
            $wpgmza_map_type[1] = "SELECTED";
        }
        if ($res->alignment) {
            $wpgmza_map_align[intval($res->alignment)] = "SELECTED";
        } else {
            $wpgmza_map_align[1] = "SELECTED";
        }
        $wpgmza_act = "disabled readonly";
        $wpgmza_act_msg = "<span style=\"font-size:16px; color:#666;\">" . __("Add custom icons, titles, descriptions, pictures and links to your markers with the", "wp-google-maps") . " \"<a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=below_marker\" title=\"" . __("Pro Edition", "wp-google-maps") . "\" target=\"_BLANK\">" . __("Pro Edition", "wp-google-maps") . "</a>\" " . __("of this plugin for just", "wp-google-maps") . " <strong>\$14.99</strong></span>";
        $wpgmza_csv = "<p><a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=csv_link\" title=\"" . __("Pro Edition", "wp-google-maps") . "\">" . __("Purchase the Pro Edition", "wp-google-maps") . "</a> " . __("of WP Google Maps and save your markers to a CSV file!", "wp-google-maps") . "</p>";
    }
    echo "\n\n           <div class='wrap'>\n                <h1>WP Google Maps</h1>\n                <div class='wide'>\n\n\n\n                    <h2>" . __("Map Settings", "wp-google-maps") . "</h2>\n                    <form action='' method='post' id='wpgmaps_options'>\n                    <p></p>\n\n                    <input type='hidden' name='http_referer' value='" . $_SERVER['PHP_SELF'] . "' />\n                    <input type='hidden' name='wpgmza_id' id='wpgmza_id' value='" . $res->id . "' />\n                    <input id='wpgmza_start_location' name='wpgmza_start_location' type='hidden' size='40' maxlength='100' value='" . $res->map_start_location . "' />\n                    <select id='wpgmza_start_zoom' name='wpgmza_start_zoom' style=\"display:none;\">\n                        <option value=\"1\" " . $wpgmza_zoom[1] . ">1</option>\n                        <option value=\"2\" " . $wpgmza_zoom[2] . ">2</option>\n                        <option value=\"3\" " . $wpgmza_zoom[3] . ">3</option>\n                        <option value=\"4\" " . $wpgmza_zoom[4] . ">4</option>\n                        <option value=\"5\" " . $wpgmza_zoom[5] . ">5</option>\n                        <option value=\"6\" " . $wpgmza_zoom[6] . ">6</option>\n                        <option value=\"7\" " . $wpgmza_zoom[7] . ">7</option>\n                        <option value=\"8\" " . $wpgmza_zoom[8] . ">8</option>\n                        <option value=\"9\" " . $wpgmza_zoom[9] . ">9</option>\n                        <option value=\"10\" " . $wpgmza_zoom[10] . ">10</option>\n                        <option value=\"11\" " . $wpgmza_zoom[11] . ">11</option>\n                        <option value=\"12\" " . $wpgmza_zoom[12] . ">12</option>\n                        <option value=\"13\" " . $wpgmza_zoom[13] . ">13</option>\n                        <option value=\"14\" " . $wpgmza_zoom[14] . ">14</option>\n                        <option value=\"15\" " . $wpgmza_zoom[15] . ">15</option>\n                        <option value=\"16\" " . $wpgmza_zoom[16] . ">16</option>\n                        <option value=\"17\" " . $wpgmza_zoom[17] . ">17</option>\n                        <option value=\"18\" " . $wpgmza_zoom[18] . ">18</option>\n                        <option value=\"19\" " . $wpgmza_zoom[19] . ">19</option>\n                        <option value=\"20\" " . $wpgmza_zoom[20] . ">20</option>\n                        <option value=\"21\" " . $wpgmza_zoom[21] . ">21</option>\n                    </select>\n                    <table>\n                        <tr>\n                            <td>" . __("Short code", "wp-google-maps") . ":</td>\n                            <td><input type='text' readonly name='shortcode' style='font-size:18px; text-align:center;' value='[wpgmza id=\"" . $res->id . "\"]' /> <small><i>" . __("copy this into your post or page to display the map", "wp-google-maps") . "</i></td>\n                        </tr>\n                        <tr>\n                            <td>" . __("Map Name", "wp-google-maps") . ":</td>\n                            <td><input id='wpgmza_title' name='wpgmza_title' type='text' size='20' maxlength='50' value='" . $res->map_title . "' /></td>\n                        </tr>\n                        <tr>\n                             <td>" . __("Width", "wp-google-maps") . ":</td>\n                             <td><input id='wpgmza_width' name='wpgmza_width' type='text' size='4' maxlength='4' value='" . $res->map_width . "' /> px </td>\n                        </tr>\n                        <tr>\n                            <td>" . __("Height", "wp-google-maps") . ":</td>\n                            <td><input id='wpgmza_height' name='wpgmza_height' type='text' size='4' maxlength='4' value='" . $res->map_height . "' /> px</td>\n                        </tr>\n\n                        <tr>\n                            <td>" . __("Default Marker Image", "wp-google-maps") . ":</td>\n                            <td><input id=\"upload_default_marker\" name=\"upload_default_marker\" type='hidden' size='35' maxlength='700' value='' " . $wpgmza_act . "/> <input id=\"upload_default_marker_btn\" type=\"button\" value=\"" . __("Upload Image", "wp-google-maps") . "\" {$wpgmza_act} /><small><i> " . __("available in the", "wp-google-maps") . " <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=default_marker\" title=\"" . __("Pro Edition", "wp-google-maps") . "\" target=\"_BLANK\">" . __("Pro Edition", "wp-google-maps") . "</a> " . __("only", "wp-google-maps") . ".   </i></small></td>\n                        </tr>\n                        <tr>\n                            <td>" . __("Map type", "wp-google-maps") . ":</td>\n                            <td><select id='wpgmza_map_type' name='wpgmza_map_type'>\n                                <option value=\"1\" " . $wpgmza_map_type[1] . ">" . __("Roadmap", "wp-google-maps") . "</option>\n                                <option value=\"2\" " . $wpgmza_map_type[2] . ">" . __("Satellite", "wp-google-maps") . "</option>\n                                <option value=\"3\" " . $wpgmza_map_type[3] . ">" . __("Hybrid", "wp-google-maps") . "</option>\n                                <option value=\"4\" " . $wpgmza_map_type[4] . ">" . __("Terrain", "wp-google-maps") . "</option>\n                            </select>\n                            </td>\n                        </tr>\n                        <tr>\n                            <td>" . __("Map Alignment", "wp-google-maps") . ":</td>\n                            <td><select id='wpgmza_map_align' name='wpgmza_map_align'>\n                                <option value=\"1\" " . $wpgmza_map_align[1] . ">" . __("Left", "wp-google-maps") . "</option>\n                                <option value=\"2\" " . $wpgmza_map_align[2] . ">" . __("Center", "wp-google-maps") . "</option>\n                                <option value=\"3\" " . $wpgmza_map_align[3] . ">" . __("Right", "wp-google-maps") . "</option>\n                                <option value=\"4\" " . $wpgmza_map_align[4] . ">" . __("None", "wp-google-maps") . "</option>\n                            </select>\n                            </td>\n                        </tr>\n                        <tr>\n                            <td>" . __("KML/GeoRSS URL", "wp-google-maps") . ":</td>\n                            <td>\n                             <input id='wpgmza_kml' name='wpgmza_kml' type='text' size='100' maxlength='700' class='regular-text' value='" . $res->kml . "' {$wpgmza_act} /><small><i> " . __("available in the", "wp-google-maps") . " <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=kml\" title=\"" . __("Pro Edition", "wp-google-maps") . "\" target=\"_BLANK\">" . __("Pro Edition", "wp-google-maps") . "</a> " . __("only", "wp-google-maps") . ".   </i></small></td>\n                            </td>\n                        </tr>\n\n\n                        </table>\n                            <div id=\"wpgmaps_save_reminder\" style=\"display:none;\"><span style=\"font-size:16px; color:#1C62B9;\">\n                            " . __("Remember to save your map!", "wp-google-maps") . "\n                            </span></div>\n                            <p class='submit'><input type='submit' name='wpgmza_savemap' class='button-primary' value='" . __("Save Map", "wp-google-maps") . " &raquo;' /></p>\n                            <p style=\"width:600px; color:#808080;\">\n                                " . __("Tip: Use your mouse to change the layout of your map. When you have positioned the map to your desired location, press \"Save Map\" to keep your settings.", "wp-google-maps") . "</p>\n\n\n                            <div id=\"wpgmza_map\">&nbsp;</div>\n                            <div style=\"display:block; overflow:auto; background-color:#FFFBCC; padding:10px; border:1px solid #E6DB55; margin-top:5px; margin-bottom:5px;\">\n                                <h2 style=\"padding-top:0; margin-top:0;\">" . __("Add a marker", "wp-google-maps") . "</h2>\n                                <p>\n                                <table>\n                                <input type=\"hidden\" name=\"wpgmza_edit_id\" id=\"wpgmza_edit_id\" value=\"\" />\n                                <tr>\n                                    <td>" . __("Title", "wp-google-maps") . ": </td>\n                                    <td><input id='wpgmza_add_title' name='wpgmza_add_title' type='text' size='35' maxlength='200' value='' {$wpgmza_act} /> &nbsp;<br /></td>\n\n                                </tr>\n                                <tr>\n                                    <td>" . __("Address/GPS", "wp-google-maps") . ": </td>\n                                    <td><input id='wpgmza_add_address' name='wpgmza_add_address' type='text' size='35' maxlength='200' value='' /> &nbsp;<br /></td>\n\n                                </tr>\n\n                                <tr><td>" . __("Description", "wp-google-maps") . ": </td>\n                                    <td><textarea id='wpgmza_add_desc' name='wpgmza_add_desc' " . $wpgmza_act . "></textarea>  &nbsp;<br /></td></tr>\n                                <tr><td>" . __("Pic URL", "wp-google-maps") . ": </td>\n                                    <td><input id='wpgmza_add_pic' name=\"wpgmza_add_pic\" type='text' size='35' maxlength='700' value='' " . $wpgmza_act . "/> <input id=\"upload_image_button\" type=\"button\" value=\"" . __("Upload Image", "wp-google-maps") . "\" {$wpgmza_act} /><br /></td></tr>\n                                <tr><td>" . __("Link URL", "wp-google-maps") . ": </td>\n                                    <td><input id='wpgmza_link_url' name='wpgmza_link_url' type='text' size='35' maxlength='700' value='' " . $wpgmza_act . " /></td></tr>\n                                <tr><td>" . __("Custom Marker", "wp-google-maps") . ": </td>\n                                    <td><input id='wpgmza_add_custom_marker' name=\"wpgmza_add_custom_marker\" type='hidden' size='35' maxlength='700' value='' " . $wpgmza_act . "/> <input id=\"upload_custom_marker_button\" type=\"button\" value=\"" . __("Upload Image", "wp-google-maps") . "\" {$wpgmza_act} /> &nbsp;</td></tr>\n                                <tr>\n                                    <td>" . __("Animation", "wp-google-maps") . ": </td>\n                                    <td>\n                                        <select name=\"wpgmza_animation\" id=\"wpgmza_animation\" readonly disabled>\n                                            <option value=\"0\">" . __("None", "wp-google-maps") . "</option>\n                                    </td>\n                                </tr>\n\n                                <tr>\n                                    <td></td>\n                                    <td>\n                                        <span id=\"wpgmza_addmarker_div\"><input type=\"button\" class='button-primary' id='wpgmza_addmarker' value='" . __("Add Marker", "wp-google-maps") . "' /></span> <span id=\"wpgmza_addmarker_loading\" style=\"display:none;\">" . __("Adding", "wp-google-maps") . "...</span>\n                                        <span id=\"wpgmza_editmarker_div\" style=\"display:none;\"><input type=\"button\" id='wpgmza_editmarker'  class='button-primary' value='" . __("Save Marker", "wp-google-maps") . "' /></span><span id=\"wpgmza_editmarker_loading\" style=\"display:none;\">" . __("Saving", "wp-google-maps") . "...</span>\n                                    </td>\n\n                                </tr>\n\n                                </table>\n                            </div>\n                            <p>{$wpgmza_act_msg}</p>\n                            <h2 style=\"padding-top:0; margin-top:0;\">" . __("Your Markers", "wp-google-maps") . "</h2>\n                            <div id=\"wpgmza_marker_holder\">\n                                " . wpgmza_return_marker_list($_GET['map_id']) . "\n                            </div>\n\n                            <br /><br />{$wpgmza_csv}\n\n                            <table>\n                                <tr>\n                                    <td><img src=\"" . wpgmaps_get_plugin_url() . "/images/custom_markers.jpg\" width=\"160\" style=\"border:3px solid #808080;\" title=\"" . __("Add detailed information to your markers!") . "\" alt=\"" . __("Add custom markers to your map!", "wp-google-maps") . "\" /><br /><br /></td>\n                                    <td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">" . __("Add detailed information to your markers for only", "wp-google-maps") . " <strong>\$14.99</strong>. " . __("Click", "wp-google-maps") . " <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=image1\" title=\"Pro Edition\" target=\"_BLANK\">" . __("here", "wp-google-maps") . "</a></span></td>\n                                </tr>\n                                <tr>\n                                    <td><img src=\"" . wpgmaps_get_plugin_url() . "/images/custom_marker_icons.jpg\" width=\"160\" style=\"border:3px solid #808080;\" title=\"" . __("Add custom markers to your map!", "wp-google-maps") . "\" alt=\"" . __("Add custom markers to your map!", "wp-google-maps") . "\" /><br /><br /></td>\n                                    <td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">" . __("Add different marker icons, or your own icons to make your map really stand out!", "wp-google-maps") . "</span></td>\n                                </tr>\n                                <tr>\n                                    <td><img src=\"" . wpgmaps_get_plugin_url() . "/images/get_directions.jpg\" width=\"160\" style=\"border:3px solid #808080;\" title=\"" . __("Add custom markers to your map!", "wp-google-maps") . "\" alt=\"" . __("Add custom markers to your map!", "wp-google-maps") . "\" /><br /><br /></td>\n                                    <td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">" . __("Allow your visitors to get directions to your markers!", "wp-google-maps") . " " . __("Click", "wp-google-maps") . " <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=image2\" title=\"" . __("Pro Edition", "wp-google-maps") . "\" target=\"_BLANK\">" . __("here", "wp-google-maps") . "</a></span></td>\n                                </tr>\n                            </table>\n\n                    </form>\n\n                    <p><br /><br />" . __("WP Google Maps encourages you to make use of the amazing icons created by Nicolas Mollet's Maps Icons Collection", "wp-google-maps") . " <a href='http://mapicons.nicolasmollet.com'>http://mapicons.nicolasmollet.com/</a> " . __("and to credit him when doing so.", "wp-google-maps") . "</p>\n                </div>\n\n\n            </div>\n\n\n\n        ";
    wpgmaps_debugger("bm_end");
}