| 1 |
<?php if (!defined('ABSPATH')) { |
| 2 |
exit; |
| 3 |
} |
| 4 |
if ( |
| 5 |
!isset($_GET['wgm_map_create_nonce']) || |
| 6 |
!wp_verify_nonce(sanitize_text_field(wp_unslash($_GET['wgm_map_create_nonce'])), 'wgm_create_map') |
| 7 |
) { |
| 8 |
wp_die(esc_html__('Invalid request. Nonce verification failed.', 'gmap-embed')); |
| 9 |
} |
| 10 |
//phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 11 |
$gmap_embed_admin_map_id = 0; |
| 12 |
if (isset($_GET['id'])) { |
| 13 |
$gmap_embed_admin_map_id = intval(sanitize_text_field(wp_unslash($_GET['id']))); |
| 14 |
} |
| 15 |
$gmap_embed_admin_gmap_data = $this->get_wpgmapembed_data(intval($gmap_embed_admin_map_id)); |
| 16 |
$gmap_embed_admin_single_map = json_decode($gmap_embed_admin_gmap_data); |
| 17 |
|
| 18 |
// Hardening: Ensure $gmap_embed_admin_single_map is a valid object and properties exist before access |
| 19 |
if (!$gmap_embed_admin_single_map || !is_object($gmap_embed_admin_single_map)) { |
| 20 |
wp_die(esc_html__('Failed to load map data. The data may be corrupted.', 'gmap-embed')); |
| 21 |
} |
| 22 |
|
| 23 |
// Ensure center lat/lng property exists before explode |
| 24 |
$gmap_embed_admin_center_lat_lng = isset($gmap_embed_admin_single_map->wpgmap_center_lat_lng) ? $gmap_embed_admin_single_map->wpgmap_center_lat_lng : '0,0'; |
| 25 |
list($gmap_embed_admin_center_lat, $gmap_embed_admin_center_lng) = explode(',', esc_html($gmap_embed_admin_center_lat_lng)); |
| 26 |
?> |
| 27 |
<div class="wrap"> |
| 28 |
<h1 class="wp-heading-inline"><?php esc_html_e('Edit Map', 'gmap-embed'); ?></h1> |
| 29 |
<?php if (_wgm_can_add_new_map()) { ?> |
| 30 |
<a href="<?php echo esc_url(admin_url('admin.php?page=wpgmapembed-new')); ?>" |
| 31 |
class="page-title-action"><?php esc_html_e('Add New', 'gmap-embed'); ?></a> |
| 32 |
<?php |
| 33 |
} else { |
| 34 |
// translators: %s: Premium version URL. |
| 35 |
echo '<a href="#" class="page-title-action wgm_enable_premium" style="opacity: .3" data-notice="' . esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Create Unlimited Maps</b>.', 'gmap-embed'), esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-add-new-lock'))) . '">' . esc_html__('Add New', 'gmap-embed') . '</a><sup class="wgm-pro-label">' . esc_html__('Pro', 'gmap-embed') . '</sup>'; |
| 36 |
} |
| 37 |
?> |
| 38 |
<?php |
| 39 |
if (!_wgm_is_premium()) { |
| 40 |
echo '<a target="_blank" href="' . esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-header-upgrade-btn') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-left:5px;"><i style="line-height: 25px;" class="dashicons dashicons-star-filled"></i> ' . esc_html__('Upgrade ($19 only)', 'gmap-embed') . '</a>'; |
| 41 |
} |
| 42 |
echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . esc_html__('LIVE Chat', 'gmap-embed') . '</a>'; |
| 43 |
echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . esc_html__('Documentation', 'gmap-embed') . '</a>'; |
| 44 |
?> |
| 45 |
<span style="float: right;margin: 0 8px 0 0;">Shortcode <input type="text" |
| 46 |
value="<?php echo esc_attr('[gmap-embed id="' . intval($gmap_embed_admin_map_id) . '"]'); ?>" |
| 47 |
style="padding: 2px 10px;border: 2px #008dff solid;" onclick="this.select()"></span> |
| 48 |
<hr class="wp-header-end"> |
| 49 |
<div id="gmap_container_inner"> |
| 50 |
<span class="wpgmap_msg_error" style="width:80%;"></span> |
| 51 |
<div id="wp-gmap-edit" style="padding:5px;"> |
| 52 |
<?php require_once WGM_PLUGIN_PATH . 'admin/includes/wgm_messages_viewer.php'; ?> |
| 53 |
|
| 54 |
<input id="wpgmap_map_id" name="wpgmap_map_id" value="<?php echo esc_attr($gmap_embed_admin_map_id); ?>" |
| 55 |
type="hidden" /> |
| 56 |
<div class="wp-gmap-properties-outer"> |
| 57 |
<div class="wgm_wpgmap_tab"> |
| 58 |
<ul class="wgm_wpgmap_tab"> |
| 59 |
<li class="active" id="wp-gmap-properties">General</li> |
| 60 |
<li id="wgm_gmap_markers">Markers</li> |
| 61 |
<li id="wgm_marker_listing">Marker Listing</li> |
| 62 |
<li id="wgm_store_locator"><?php esc_html_e('Store Locator', 'gmap-embed'); ?></li> |
| 63 |
</ul> |
| 64 |
</div> |
| 65 |
<div class="wp-gmap-tab-contents wp-gmap-properties active"> |
| 66 |
<table class="gmap_properties"> |
| 67 |
<tr> |
| 68 |
<td> |
| 69 |
<label |
| 70 |
for="wpgmap_title"><b><?php esc_html_e('Map Title', 'gmap-embed'); ?></b></label><br /> |
| 71 |
<input id="wpgmap_title" name="wpgmap_title" |
| 72 |
value="<?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_title); ?>" type="text" |
| 73 |
class="regular-text"> |
| 74 |
<br /> |
| 75 |
|
| 76 |
<input type="checkbox" value="1" name="wpgmap_show_heading" id="wpgmap_show_heading" |
| 77 |
<?php echo esc_attr(($gmap_embed_admin_single_map->wpgmap_show_heading == 1) ? 'checked' : ''); ?>> |
| 78 |
<label |
| 79 |
for="wpgmap_show_heading"><?php esc_html_e('Show as map title', 'gmap-embed'); ?></label> |
| 80 |
</td> |
| 81 |
</tr> |
| 82 |
|
| 83 |
<tr> |
| 84 |
<td> |
| 85 |
<label |
| 86 |
for="wpgmap_latlng"><b><?php esc_html_e('Latitude, Longitude(Approx)', 'gmap-embed'); ?></b></label><br /> |
| 87 |
<input id="wpgmap_latlng" name="wpgmap_latlng" |
| 88 |
value="<?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_latlng); ?>" type="text" |
| 89 |
class="regular-text"> |
| 90 |
<input type="hidden" name="wpgmap_center_lat_lng" id="wpgmap_center_lat_lng" |
| 91 |
value="<?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_center_lat_lng); ?>"> |
| 92 |
</td> |
| 93 |
</tr> |
| 94 |
|
| 95 |
<tr> |
| 96 |
<td> |
| 97 |
<label |
| 98 |
for="wpgmap_map_zoom"><b><?php esc_html_e('Zoom', 'gmap-embed'); ?></b></label><br /> |
| 99 |
<input id="wpgmap_map_zoom" name="wpgmap_map_zoom" |
| 100 |
value="<?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_map_zoom); ?>" type="text" |
| 101 |
class="regular-text"> |
| 102 |
|
| 103 |
|
| 104 |
</td> |
| 105 |
</tr> |
| 106 |
|
| 107 |
<tr> |
| 108 |
<td> |
| 109 |
<label |
| 110 |
for="wpgmap_map_width"><b><?php esc_html_e('Width (%)', 'gmap-embed'); ?></b></label><br /> |
| 111 |
<input id="wpgmap_map_width" name="wpgmap_map_width" |
| 112 |
value="<?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_map_width); ?>" type="text" |
| 113 |
class="regular-text"> |
| 114 |
</td> |
| 115 |
</tr> |
| 116 |
|
| 117 |
<tr> |
| 118 |
<td> |
| 119 |
<label |
| 120 |
for="wpgmap_map_height"><b><?php esc_html_e('Height (px)', 'gmap-embed'); ?></b></label><br /> |
| 121 |
<input id="wpgmap_map_height" name="wpgmap_map_height" |
| 122 |
value="<?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_map_height); ?>" type="text" |
| 123 |
class="regular-text"> |
| 124 |
</td> |
| 125 |
</tr> |
| 126 |
|
| 127 |
<tr> |
| 128 |
<td> |
| 129 |
<label><b><?php esc_html_e('Map Type', 'gmap-embed'); ?></b></label><br /> |
| 130 |
<select id="wpgmap_map_type" class="regular-text"> |
| 131 |
<option <?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_map_type == 'ROADMAP' ? 'selected' : ''); ?>> |
| 132 |
ROADMAP |
| 133 |
</option> |
| 134 |
<option <?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_map_type == 'SATELLITE' ? 'selected' : ''); ?>> |
| 135 |
SATELLITE |
| 136 |
</option> |
| 137 |
<option <?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_map_type == 'HYBRID' ? 'selected' : ''); ?>> |
| 138 |
HYBRID |
| 139 |
</option> |
| 140 |
<option <?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_map_type == 'TERRAIN' ? 'selected' : ''); ?>> |
| 141 |
TERRAIN |
| 142 |
</option> |
| 143 |
</select> |
| 144 |
</td> |
| 145 |
</tr> |
| 146 |
|
| 147 |
<tr> |
| 148 |
<td> |
| 149 |
<label |
| 150 |
for="wpgmap_heading_class"><b><?php esc_html_e('Heading Custom Class', 'gmap-embed'); ?></b></label><br /> |
| 151 |
<input id="wpgmap_heading_class" name="wpgmap_heading_class" |
| 152 |
value="<?php echo esc_attr($gmap_embed_admin_single_map->wpgmap_heading_class); ?>" type="text" |
| 153 |
class="regular-text"> |
| 154 |
</td> |
| 155 |
</tr> |
| 156 |
<tr> |
| 157 |
<td> |
| 158 |
<div style="display: flex; align-items: center; justify-content: space-between; max-width: 400px; margin: 15px 0;"> |
| 159 |
<label for="wpgmap_enable_direction" <?php echo !_wgm_is_premium() ? ' class="wgm_enable_premium" " ' : ''; ?> |
| 160 |
data-notice="<?php |
| 161 |
// translators: %s: Premium version URL. |
| 162 |
echo esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Enable Direction Option on Map</b>.', 'gmap-embed'), esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-enable-direction-lock'))); ?>"> |
| 163 |
<b><?php esc_html_e('Enable Direction feature(legacy) below map', 'gmap-embed'); ?></b> |
| 164 |
<?php echo !_wgm_is_premium() ? '<sup class="wgm-pro-label">' . esc_html__('Pro', 'gmap-embed') . '</sup>' : ''; ?> |
| 165 |
</label> |
| 166 |
<div class="wgm_switch"> |
| 167 |
<input type="checkbox" value="1" <?php echo !_wgm_is_premium() ? 'disabled="disabled"' : ''; ?> name="wpgmap_enable_direction" |
| 168 |
id="wpgmap_enable_direction" <?php echo esc_attr(($gmap_embed_admin_single_map->wpgmap_enable_direction == 1) ? 'checked' : ''); ?>> |
| 169 |
<span class="wgm_slider round"></span> |
| 170 |
</div> |
| 171 |
</div> |
| 172 |
|
| 173 |
<div style="display: flex; align-items: center; justify-content: space-between; max-width: 400px; margin: 15px 0;"> |
| 174 |
<label for="wpgmap_enable_modern_direction" <?php echo !_wgm_is_premium() ? ' class="wgm_enable_premium" ' : ''; ?> |
| 175 |
data-notice="<?php |
| 176 |
// translators: %s: Premium version URL. |
| 177 |
echo esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b>Enable Modern Direction Option</b>.', 'gmap-embed'), esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-enable-modern-direction-lock'))); ?>"> |
| 178 |
<b><?php esc_html_e('Enable Direction feature(modern) inside map', 'gmap-embed'); ?></b> |
| 179 |
<?php echo !_wgm_is_premium() ? '<sup class="wgm-pro-label">' . esc_html__('Pro', 'gmap-embed') . '</sup>' : ''; ?> |
| 180 |
</label> |
| 181 |
<div class="wgm_switch"> |
| 182 |
<input type="checkbox" value="1" <?php echo !_wgm_is_premium() ? 'disabled="disabled"' : ''; ?> name="wpgmap_enable_modern_direction" |
| 183 |
id="wpgmap_enable_modern_direction" <?php echo esc_attr((isset($gmap_embed_admin_single_map->wpgmap_enable_modern_direction) && $gmap_embed_admin_single_map->wpgmap_enable_modern_direction == 1) ? 'checked' : ''); ?>> |
| 184 |
<span class="wgm_slider round"></span> |
| 185 |
</div> |
| 186 |
</div> |
| 187 |
</td> |
| 188 |
</tr> |
| 189 |
<?php |
| 190 |
$gmap_embed_admin_enable_modern_direction_val = (isset($gmap_embed_admin_single_map->wpgmap_enable_modern_direction) && $gmap_embed_admin_single_map->wpgmap_enable_modern_direction == 1) ? true : false; |
| 191 |
?> |
| 192 |
<tr id="wgm_direction_drawer_width_row" style="<?php echo $gmap_embed_admin_enable_modern_direction_val ? '' : 'display:none;'; ?>"> |
| 193 |
<td> |
| 194 |
<label for="wpgmap_direction_drawer_width" <?php echo !_wgm_is_premium() ? ' class="wgm_enable_premium" ' : ''; ?> |
| 195 |
data-notice="<?php |
| 196 |
// translators: %s: Premium version URL. |
| 197 |
echo esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Adjust Direction Drawer Width</b>.', 'gmap-embed'), esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-direction-drawer-width-lock'))); ?>"><?php esc_html_e('Direction drawer width (px)', 'gmap-embed'); ?> |
| 198 |
<b><?php esc_html_e('Direction drawer width (px)', 'gmap-embed'); ?></b> |
| 199 |
<?php echo !_wgm_is_premium() ? '<sup class="wgm-pro-label">' . esc_html__('Pro', 'gmap-embed') . '</sup>' : ''; ?> |
| 200 |
<br /> |
| 201 |
<input type="number" id="wpgmap_direction_drawer_width" name="wpgmap_direction_drawer_width" |
| 202 |
value="<?php echo esc_attr(!empty($gmap_embed_admin_single_map->wpgmap_direction_drawer_width) ? $gmap_embed_admin_single_map->wpgmap_direction_drawer_width : '300'); ?>" |
| 203 |
class="regular-text" <?php echo !_wgm_is_premium() ? 'disabled="disabled"' : ''; ?> |
| 204 |
placeholder="300"> |
| 205 |
</label> |
| 206 |
</td> |
| 207 |
</tr> |
| 208 |
<tr> |
| 209 |
<td style="padding-top: 9px;"> |
| 210 |
<label |
| 211 |
for="wpgmap_map_theme"><b><?php esc_html_e('Map Theme Presets', 'gmap-embed'); ?></b> |
| 212 |
</label><br /> |
| 213 |
<?php |
| 214 |
require_once WGM_PLUGIN_PATH . 'admin/includes/map_theme_presets.php'; |
| 215 |
?> |
| 216 |
<select id="wpgmap_map_theme" name="wpgmap_map_theme" |
| 217 |
style="width:99%;max-width:99%;margin-bottom: 5px;"> |
| 218 |
<?php |
| 219 |
echo '<option value="[]">Default Theme</option>'; |
| 220 |
foreach ($gmap_embed_map_styles as $gmap_embed_key => $gmap_embed_style) { |
| 221 |
echo '<option value="' . esc_attr($gmap_embed_style) . '">' . esc_html($gmap_embed_key) . '</option>'; |
| 222 |
} |
| 223 |
?> |
| 224 |
</select> |
| 225 |
<?php if (!_wgm_is_premium()) { ?> |
| 226 |
<a target="_blank" |
| 227 |
href="<?php echo esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-theme-presets-lock'); ?>"> |
| 228 |
Unlock unlimited custom themes by Pro version</a> |
| 229 |
<?php |
| 230 |
} |
| 231 |
?> |
| 232 |
<br /> |
| 233 |
<span style="<?php echo (!_wgm_is_premium()) ? 'display: none' : ''; ?>"> |
| 234 |
<label for="wgm_theme_json"><b><?php esc_html_e('Map Theme JSON', 'gmap-embed'); ?> |
| 235 |
</b></label> |
| 236 |
<br /> |
| 237 |
<textarea rows="5" cols="50" class="wgm_theme_json" id="wgm_theme_json" |
| 238 |
style="width:99%;max-width:99%;"><?php echo esc_html($gmap_embed_admin_single_map->wgm_theme_json); ?></textarea> |
| 239 |
You may create your own map style from |
| 240 |
<a target="_blank" href="<?php echo esc_url('https://snazzymaps.com'); ?>"> |
| 241 |
Snazzy Maps</a> and use JSON here. |
| 242 |
</span> |
| 243 |
</td> |
| 244 |
</tr> |
| 245 |
<tr> |
| 246 |
<td style="padding-top: 20px;"> |
| 247 |
<div class="wgm-toggle-header" id="wgm-map-controls-toggle" style="cursor: pointer; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px;"> |
| 248 |
<b><?php esc_html_e('Advanced Map Controls', 'gmap-embed'); ?></b> |
| 249 |
<span class="dashicons dashicons-arrow-down-alt2"></span> |
| 250 |
</div> |
| 251 |
<div id="wgm-map-controls-container" style="display:none; padding-top: 10px;"> |
| 252 |
<?php |
| 253 |
$gmap_embed_admin_map_controls = [ |
| 254 |
'zoom_control' => [ |
| 255 |
'label' => __('Zoom Control', 'gmap-embed'), |
| 256 |
'meta_enable' => 'wpgmap_zoom_control', |
| 257 |
'meta_pos' => 'wpgmap_zoom_control_pos' |
| 258 |
], |
| 259 |
'map_type_control' => [ |
| 260 |
'label' => __('Map Type Control', 'gmap-embed'), |
| 261 |
'meta_enable' => 'wpgmap_map_type_control', |
| 262 |
'meta_pos' => 'wpgmap_map_type_control_pos' |
| 263 |
], |
| 264 |
'street_view_control' => [ |
| 265 |
'label' => __('Street View Control', 'gmap-embed'), |
| 266 |
'meta_enable' => 'wpgmap_street_view_control', |
| 267 |
'meta_pos' => 'wpgmap_street_view_control_pos' |
| 268 |
], |
| 269 |
'fullscreen_control' => [ |
| 270 |
'label' => __('Fullscreen Control', 'gmap-embed'), |
| 271 |
'meta_enable' => 'wpgmap_fullscreen_control', |
| 272 |
'meta_pos' => 'wpgmap_fullscreen_control_pos' |
| 273 |
], |
| 274 |
'rotate_control' => [ |
| 275 |
'label' => __('Rotate Control', 'gmap-embed'), |
| 276 |
'meta_enable' => 'wpgmap_rotate_control', |
| 277 |
'meta_pos' => 'wpgmap_rotate_control_pos' |
| 278 |
], |
| 279 |
'scale_control' => [ |
| 280 |
'label' => __('Scale Control', 'gmap-embed'), |
| 281 |
'meta_enable' => 'wpgmap_scale_control', |
| 282 |
'meta_pos' => 'wpgmap_scale_control_pos' |
| 283 |
], |
| 284 |
]; |
| 285 |
|
| 286 |
$gmap_embed_admin_control_positions = [ |
| 287 |
'' => __('Global/Default', 'gmap-embed'), |
| 288 |
'TOP_LEFT' => 'TOP_LEFT', |
| 289 |
'TOP_CENTER' => 'TOP_CENTER', |
| 290 |
'TOP_RIGHT' => 'TOP_RIGHT', |
| 291 |
'LEFT_TOP' => 'LEFT_TOP', |
| 292 |
'LEFT_CENTER' => 'LEFT_CENTER', |
| 293 |
'LEFT_BOTTOM' => 'LEFT_BOTTOM', |
| 294 |
'RIGHT_TOP' => 'RIGHT_TOP', |
| 295 |
'RIGHT_CENTER' => 'RIGHT_CENTER', |
| 296 |
'RIGHT_BOTTOM' => 'RIGHT_BOTTOM', |
| 297 |
'BOTTOM_LEFT' => 'BOTTOM_LEFT', |
| 298 |
'BOTTOM_CENTER' => 'BOTTOM_CENTER', |
| 299 |
'BOTTOM_RIGHT' => 'BOTTOM_RIGHT', |
| 300 |
]; |
| 301 |
|
| 302 |
foreach ($gmap_embed_admin_map_controls as $gmap_embed_admin_control_key => $gmap_embed_admin_control_data) { |
| 303 |
$gmap_embed_admin_enabled_val = isset($gmap_embed_admin_single_map->{$gmap_embed_admin_control_data['meta_enable']}) ? $gmap_embed_admin_single_map->{$gmap_embed_admin_control_data['meta_enable']} : ''; |
| 304 |
$gmap_embed_admin_position_val = isset($gmap_embed_admin_single_map->{$gmap_embed_admin_control_data['meta_pos']}) ? $gmap_embed_admin_single_map->{$gmap_embed_admin_control_data['meta_pos']} : ''; |
| 305 |
?> |
| 306 |
<div class="wgm-control-setting-row"> |
| 307 |
<div class="wgm-control-main"> |
| 308 |
<label class="wgm-control-title"><?php echo esc_html($gmap_embed_admin_control_data['label']); ?></label> |
| 309 |
<select name="<?php echo esc_attr($gmap_embed_admin_control_data['meta_enable']); ?>" id="<?php echo esc_attr($gmap_embed_admin_control_data['meta_enable']); ?>"> |
| 310 |
<option value="" <?php selected($gmap_embed_admin_enabled_val, ''); ?>><?php esc_html_e('Global/Default', 'gmap-embed'); ?></option> |
| 311 |
<option value="1" <?php selected($gmap_embed_admin_enabled_val, '1'); ?>><?php esc_html_e('Enable', 'gmap-embed'); ?></option> |
| 312 |
<option value="0" <?php selected($gmap_embed_admin_enabled_val, '0'); ?>><?php esc_html_e('Disable', 'gmap-embed'); ?></option> |
| 313 |
</select> |
| 314 |
</div> |
| 315 |
<div class="wgm-control-sub"> |
| 316 |
<label class="wgm-control-sub-label"><?php esc_html_e('Position', 'gmap-embed'); ?></label> |
| 317 |
<select name="<?php echo esc_attr($gmap_embed_admin_control_data['meta_pos']); ?>" id="<?php echo esc_attr($gmap_embed_admin_control_data['meta_pos']); ?>"> |
| 318 |
<?php foreach ($gmap_embed_admin_control_positions as $gmap_embed_admin_pos_key => $gmap_embed_admin_pos_label) : ?> |
| 319 |
<option value="<?php echo esc_attr($gmap_embed_admin_pos_key); ?>" <?php selected($gmap_embed_admin_position_val, $gmap_embed_admin_pos_key); ?>><?php echo esc_html($gmap_embed_admin_pos_label); ?></option> |
| 320 |
<?php endforeach; ?> |
| 321 |
</select> |
| 322 |
</div> |
| 323 |
</div> |
| 324 |
<?php |
| 325 |
} |
| 326 |
?> |
| 327 |
</div> |
| 328 |
</td> |
| 329 |
</tr> |
| 330 |
|
| 331 |
</table> |
| 332 |
</div> |
| 333 |
<div class="wp-gmap-tab-contents wgm_gmap_markers hidden" style="padding:15px;background:#fff;border-radius:6px;"> |
| 334 |
<?php |
| 335 |
require_once plugin_dir_path(__FILE__) . 'markers-settings.php'; |
| 336 |
?> |
| 337 |
</div> |
| 338 |
<div class="wp-gmap-tab-contents wgm_marker_listing hidden" |
| 339 |
style="padding:15px;background:#fff;border-radius:6px;"> |
| 340 |
<!-- Redesigned Marker Listing UI --> |
| 341 |
<?php if (!_wgm_is_premium()) : ?> |
| 342 |
<div class="wgm-upgrade-banner"> |
| 343 |
<div class="wgm-upgrade-banner-icon"> |
| 344 |
<span class="dashicons dashicons-star-filled"></span> |
| 345 |
</div> |
| 346 |
<div class="wgm-upgrade-banner-content"> |
| 347 |
<p> |
| 348 |
<?php |
| 349 |
echo sprintf( |
| 350 |
/* translators: %s: Premium version URL. */ |
| 351 |
esc_html__('Marker listing styles and advanced options are available in the %s.', 'gmap-embed'), |
| 352 |
'<b>' . esc_html__('Premium Version', 'gmap-embed') . '</b>' |
| 353 |
); |
| 354 |
?> |
| 355 |
</p> |
| 356 |
</div> |
| 357 |
<a href="<?php echo esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-marker-listing-tab-banner'); ?>" target="_blank" class="wgm-upgrade-banner-btn"><?php esc_html_e('Upgrade Now', 'gmap-embed'); ?></a> |
| 358 |
</div> |
| 359 |
<?php endif; ?> |
| 360 |
<div class="wgm-marker-listing-container"> |
| 361 |
<div class="wgm-row wgm-listing-top"> |
| 362 |
<div class="wgm-col wgm-col-7"><br /> |
| 363 |
<label |
| 364 |
for="wpgmap_marker_listing_style"><b><?php esc_html_e('Marker Listing Style', 'gmap-embed'); ?></b></label> |
| 365 |
|
| 366 |
<div id="wpgmap_marker_listing_style" class="wgm-marker-style-grid wgm-style-carousel" |
| 367 |
role="radiogroup" |
| 368 |
aria-label="<?php esc_attr_e('Marker listing styles', 'gmap-embed'); ?>"> |
| 369 |
|
| 370 |
<button type="button" class="wgm-carousel-btn wgm-carousel-prev" |
| 371 |
aria-label="<?php esc_attr_e('Previous styles', 'gmap-embed'); ?>">‹</button> |
| 372 |
<div class="wgm-style-viewport" aria-hidden="false"> |
| 373 |
<div class="wgm-style-track"> |
| 374 |
<?php |
| 375 |
$gmap_embed_current_style = (isset($gmap_embed_admin_single_map->wpgmap_marker_listing_style) && !empty($gmap_embed_admin_single_map->wpgmap_marker_listing_style)) ? $gmap_embed_admin_single_map->wpgmap_marker_listing_style : 'none'; |
| 376 |
$gmap_embed_styles = array( |
| 377 |
'none' => array('file' => 'none', 'label' => __('No marker listing', 'gmap-embed'), 'img' => 'gmap_embed_logo.jpg'), |
| 378 |
'basic_table' => array('file' => 'basic_table', 'label' => __('Basic table', 'gmap-embed'), 'img' => 'basic_table.png'), |
| 379 |
'basic_list' => array('file' => 'basic_list', 'label' => __('Basic list', 'gmap-embed'), 'img' => 'basic_list.png'), |
| 380 |
'advanced_table' => array('file' => 'advanced_table', 'label' => __('Advanced table', 'gmap-embed'), 'img' => 'advanced_table.png'), |
| 381 |
'carousel' => array('file' => 'carousel', 'label' => __('Carousel', 'gmap-embed'), 'img' => 'carousel.png'), |
| 382 |
//'modern' => array('file' => 'modern', 'label' => __('Modern', 'gmap-embed')), |
| 383 |
//'grid' => array('file' => 'grid', 'label' => __('Grid', 'gmap-embed')) |
| 384 |
); |
| 385 |
foreach ($gmap_embed_styles as $gmap_embed_key => $gmap_embed_style_item) { |
| 386 |
// fallback thumb - keep path but use placeholder widely available in the plugin |
| 387 |
$gmap_embed_img_src = esc_url(plugins_url('../assets/images/' . $gmap_embed_style_item['img'], __FILE__)); |
| 388 |
$gmap_embed_label_attr = esc_attr($gmap_embed_style_item['label']); |
| 389 |
$gmap_embed_is_checked = ($gmap_embed_current_style === $gmap_embed_key) ? 'true' : 'false'; |
| 390 |
|
| 391 |
// Pro feature logic |
| 392 |
$gmap_embed_is_premium = _wgm_is_premium(); |
| 393 |
$gmap_embed_is_pro_feature = (!$gmap_embed_is_premium && $gmap_embed_key !== 'none'); |
| 394 |
$gmap_embed_disabled_attr = $gmap_embed_is_pro_feature ? 'disabled="disabled"' : ''; |
| 395 |
$gmap_embed_class = 'wgm-style-option wgm-style-card'; |
| 396 |
$gmap_embed_wrapper_style = ''; |
| 397 |
$gmap_embed_data_notice = ''; |
| 398 |
|
| 399 |
if ($gmap_embed_is_pro_feature) { |
| 400 |
$gmap_embed_class .= ' wgm_enable_premium'; |
| 401 |
$gmap_embed_wrapper_style = 'style="opacity: 0.6;"'; // Lower opacity for content |
| 402 |
// translators: %s: Premium version URL. |
| 403 |
$gmap_embed_data_notice = esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> use this Marker Listing Style</b>.', 'gmap-embed'), esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-marker-listing-style-lock'))); |
| 404 |
} |
| 405 |
?> |
| 406 |
<label class="<?php echo esc_attr($gmap_embed_class); ?>" |
| 407 |
title="<?php echo esc_attr($gmap_embed_label_attr); ?>" role="radio" |
| 408 |
aria-checked="<?php echo esc_attr($gmap_embed_is_checked); ?>" |
| 409 |
tabindex="0" data-value="<?php echo esc_attr($gmap_embed_key); ?>" |
| 410 |
<?php echo $gmap_embed_is_pro_feature ? 'data-notice="' . esc_attr($gmap_embed_data_notice) . '"' : ''; ?>> |
| 411 |
<input type="radio" name="marker_listing_style" |
| 412 |
value="<?php echo esc_attr($gmap_embed_key); ?>" <?php checked($gmap_embed_current_style, $gmap_embed_key); ?> |
| 413 |
<?php echo esc_attr($gmap_embed_disabled_attr); ?> /> |
| 414 |
|
| 415 |
<div class="wgm-style-content-wrapper" <?php echo $gmap_embed_wrapper_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| 416 |
<div class="wgm-style-thumb"> |
| 417 |
<img src="<?php echo esc_url($gmap_embed_img_src); ?>" |
| 418 |
alt="<?php echo esc_attr($gmap_embed_label_attr); ?>" |
| 419 |
onerror="this.onerror=null;this.src='<?php echo esc_url(plugins_url('../assets/images/marker_listing_placeholder.png', __FILE__)); ?>'"> |
| 420 |
</div> |
| 421 |
<div class="wgm-style-info"> |
| 422 |
<span class="wgm-style-label"><?php echo esc_html($gmap_embed_style_item['label']); ?></span> |
| 423 |
<span class="wgm-style-selected-dot" aria-hidden="true"></span> |
| 424 |
</div> |
| 425 |
</div> |
| 426 |
</label> |
| 427 |
<?php |
| 428 |
} |
| 429 |
?> |
| 430 |
</div> |
| 431 |
</div> |
| 432 |
<button type="button" class="wgm-carousel-btn wgm-carousel-next" |
| 433 |
aria-label="<?php esc_attr_e('Next styles', 'gmap-embed'); ?>">›</button> |
| 434 |
</div> |
| 435 |
|
| 436 |
<p class="description"> |
| 437 |
<?php esc_html_e('Choose how markers are listed. Select "No marker listing" to disable.', 'gmap-embed'); ?> |
| 438 |
</p> |
| 439 |
|
| 440 |
</div> |
| 441 |
|
| 442 |
<div class="wgm-col wgm-col-5"> |
| 443 |
|
| 444 |
<!-- Listing Placement - Premium Feature --> |
| 445 |
<?php |
| 446 |
$gmap_embed_is_premium_placement = _wgm_is_premium(); |
| 447 |
$gmap_embed_placement_class = !$gmap_embed_is_premium_placement ? ' wgm_enable_premium' : ''; |
| 448 |
$gmap_embed_placement_style = !$gmap_embed_is_premium_placement ? 'style="opacity: 0.5; pointer-events: none;"' : ''; |
| 449 |
$gmap_embed_placement_notice = !$gmap_embed_is_premium_placement ? 'data-notice="' . esc_attr(sprintf( |
| 450 |
/* translators: %s: Premium version URL. */ |
| 451 |
__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b>change Listing Placement</b>.', 'gmap-embed'), |
| 452 |
esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-marker-listing-placement-lock') |
| 453 |
)) . '"' : ''; |
| 454 |
?> |
| 455 |
<div class="<?php echo esc_attr($gmap_embed_placement_class); ?>" <?php echo $gmap_embed_placement_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php echo $gmap_embed_placement_notice; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| 456 |
<fieldset class="wgm-fieldset-spacing" style="display:block;"> |
| 457 |
<legend><b><?php esc_html_e('Listing Placement', 'gmap-embed'); ?></b></legend> |
| 458 |
|
| 459 |
<?php |
| 460 |
$gmap_embed_admin_placement = (isset($gmap_embed_admin_single_map->wpgmap_marker_listing_placement) && !empty($gmap_embed_admin_single_map->wpgmap_marker_listing_placement)) ? $gmap_embed_admin_single_map->wpgmap_marker_listing_placement : 'below_map'; |
| 461 |
?> |
| 462 |
<input type="hidden" id="wpgmap_marker_listing_placement" name="marker_listing_placement" value="<?php echo esc_attr($gmap_embed_admin_placement); ?>"> |
| 463 |
|
| 464 |
<div class="wgm-placement-grid"> |
| 465 |
<div class="wgm-placement-btn <?php echo ($gmap_embed_admin_placement == 'above_map') ? 'active' : ''; ?>" data-value="above_map"> |
| 466 |
<i class="fas fa-arrow-up"></i> |
| 467 |
<span><?php esc_html_e('Above', 'gmap-embed'); ?></span> |
| 468 |
</div> |
| 469 |
<div class="wgm-placement-btn <?php echo ($gmap_embed_admin_placement == 'below_map') ? 'active' : ''; ?>" data-value="below_map"> |
| 470 |
<i class="fas fa-arrow-down"></i> |
| 471 |
<span><?php esc_html_e('Below', 'gmap-embed'); ?></span> |
| 472 |
</div> |
| 473 |
<div class="wgm-placement-btn <?php echo ($gmap_embed_admin_placement == 'left_map') ? 'active' : ''; ?>" data-value="left_map"> |
| 474 |
<i class="fas fa-arrow-left"></i> |
| 475 |
<span><?php esc_html_e('Left', 'gmap-embed'); ?></span> |
| 476 |
</div> |
| 477 |
<div class="wgm-placement-btn <?php echo ($gmap_embed_admin_placement == 'right_map') ? 'active' : ''; ?>" data-value="right_map"> |
| 478 |
<i class="fas fa-arrow-right"></i> |
| 479 |
<span><?php esc_html_e('Right', 'gmap-embed'); ?></span> |
| 480 |
</div> |
| 481 |
</div> |
| 482 |
<div style="margin-top: 15px;"> |
| 483 |
<label for="wpgmap_marker_listing_width"><b><?php esc_html_e('Marker Listing Width (px)', 'gmap-embed'); ?></b></label> |
| 484 |
<input type="number" id="wpgmap_marker_listing_width" name="marker_listing_width" value="<?php echo (isset($gmap_embed_admin_single_map->wpgmap_marker_listing_width)) ? esc_attr($gmap_embed_admin_single_map->wpgmap_marker_listing_width) : ''; ?>" class="regular-text" style="width: 100%; margin-top: 5px;" placeholder="<?php esc_attr_e('e.g. 300 (leave empty for default)', 'gmap-embed'); ?>"> |
| 485 |
<p class="description"><?php esc_html_e('Default: 300px for Left/Right placement, 100% for Above/Below.', 'gmap-embed'); ?></p> |
| 486 |
</div> |
| 487 |
</fieldset> |
| 488 |
</div> |
| 489 |
|
| 490 |
<?php if (!_wgm_is_premium()) : ?> |
| 491 |
<div class="wgm_enable_premium" style="opacity: 0.5; position: relative; margin-top: 20px;" <?php |
| 492 |
echo 'data-notice="' . esc_attr(sprintf( |
| 493 |
/* translators: %s: Premium version URL. */ |
| 494 |
__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b>configure Sorting & Ordering options</b>.', 'gmap-embed'), |
| 495 |
esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-marker-listing-sorting-lock') |
| 496 |
)) . '"'; |
| 497 |
?>> |
| 498 |
<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; cursor: pointer;"></div> |
| 499 |
<?php endif; ?> |
| 500 |
<fieldset class="wgm-fieldset-spacing" style="display:block; margin-top: 20px;"> |
| 501 |
<legend><b><?php esc_html_e('Sorting & Ordering', 'gmap-embed'); ?></b></legend> |
| 502 |
|
| 503 |
<div style="margin-bottom: 15px;"> |
| 504 |
<label for="wpgmap_marker_orderby_field"><b><?php esc_html_e('Order Markers By', 'gmap-embed'); ?></b></label> |
| 505 |
<?php |
| 506 |
$gmap_embed_admin_orderby_field = (isset($gmap_embed_admin_single_map->wpgmap_marker_orderby_field) && !empty($gmap_embed_admin_single_map->wpgmap_marker_orderby_field)) ? $gmap_embed_admin_single_map->wpgmap_marker_orderby_field : 'id'; |
| 507 |
?> |
| 508 |
<select id="wpgmap_marker_orderby_field" name="marker_orderby_field" class="regular-text" style="width: 100%; margin-top: 5px;"> |
| 509 |
<option value="id" <?php selected($gmap_embed_admin_orderby_field, 'id'); ?>><?php esc_html_e('ID', 'gmap-embed'); ?></option> |
| 510 |
<option value="marker_name" <?php selected($gmap_embed_admin_orderby_field, 'marker_name'); ?>><?php esc_html_e('Title/Name', 'gmap-embed'); ?></option> |
| 511 |
<option value="address" <?php selected($gmap_embed_admin_orderby_field, 'address'); ?>><?php esc_html_e('Address', 'gmap-embed'); ?></option> |
| 512 |
<option value="marker_desc" <?php selected($gmap_embed_admin_orderby_field, 'marker_desc'); ?>><?php esc_html_e('Description', 'gmap-embed'); ?></option> |
| 513 |
<option value="created_at" <?php selected($gmap_embed_admin_orderby_field, 'created_at'); ?>><?php esc_html_e('Created Date', 'gmap-embed'); ?></option> |
| 514 |
<option value="updated_at" <?php selected($gmap_embed_admin_orderby_field, 'updated_at'); ?>><?php esc_html_e('Updated Date', 'gmap-embed'); ?></option> |
| 515 |
<option value="lat_lng" <?php selected($gmap_embed_admin_orderby_field, 'lat_lng'); ?>><?php esc_html_e('Latitude/Longitude', 'gmap-embed'); ?></option> |
| 516 |
</select> |
| 517 |
</div> |
| 518 |
|
| 519 |
<div> |
| 520 |
<label for="wpgmap_marker_orderby_dir"><b><?php esc_html_e('Sorting Order', 'gmap-embed'); ?></b></label> |
| 521 |
<?php |
| 522 |
$gmap_embed_admin_orderby_dir = (isset($gmap_embed_admin_single_map->wpgmap_marker_orderby_dir) && !empty($gmap_embed_admin_single_map->wpgmap_marker_orderby_dir)) ? $gmap_embed_admin_single_map->wpgmap_marker_orderby_dir : 'ASC'; |
| 523 |
?> |
| 524 |
<select id="wpgmap_marker_orderby_dir" name="marker_orderby_dir" class="small-text" style="width: 100%; margin-top: 5px;"> |
| 525 |
<option value="ASC" <?php selected($gmap_embed_admin_orderby_dir, 'ASC'); ?>><?php esc_html_e('Ascending', 'gmap-embed'); ?></option> |
| 526 |
<option value="DESC" <?php selected($gmap_embed_admin_orderby_dir, 'DESC'); ?>><?php esc_html_e('Descending', 'gmap-embed'); ?></option> |
| 527 |
</select> |
| 528 |
</div> |
| 529 |
</fieldset> |
| 530 |
<?php if (!_wgm_is_premium()) : ?> |
| 531 |
</div> |
| 532 |
<div class="wgm_enable_premium" style="opacity: 0.5; position: relative; margin-top: 20px;" <?php |
| 533 |
echo 'data-notice="' . esc_attr(sprintf( |
| 534 |
/* translators: %s: Premium version URL. */ |
| 535 |
__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b>configure Icon Visibility options</b>.', 'gmap-embed'), |
| 536 |
esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-marker-listing-icons-lock') |
| 537 |
)) . '"'; |
| 538 |
?>> |
| 539 |
<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; cursor: pointer;"></div> |
| 540 |
<?php endif; ?> |
| 541 |
<fieldset class="wgm-fieldset-spacing" style="display:block; margin-top: 20px;"> |
| 542 |
<legend><b><?php esc_html_e('Icon Visibility', 'gmap-embed'); ?></b></legend> |
| 543 |
<table class="form-table"> |
| 544 |
<tr> |
| 545 |
<th><label for="wgm_enable_show_on_map_icon"><?php esc_html_e('Enable show on map icon', 'gmap-embed'); ?></label></th> |
| 546 |
<td> |
| 547 |
<div class="wgm_switch"> |
| 548 |
<input id="wgm_enable_show_on_map_icon" name="wgm_enable_show_on_map_icon" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_enable_show_on_map_icon) && $gmap_embed_admin_single_map->wgm_enable_show_on_map_icon == 1) ? 'checked' : ''; ?>> |
| 549 |
<span class="wgm_slider round"></span> |
| 550 |
</div> |
| 551 |
</td> |
| 552 |
</tr> |
| 553 |
<tr> |
| 554 |
<th><label for="wgm_enable_get_direction_icon"><?php esc_html_e('Enable Get direction icon', 'gmap-embed'); ?></label></th> |
| 555 |
<td> |
| 556 |
<div class="wgm_switch"> |
| 557 |
<input id="wgm_enable_get_direction_icon" name="wgm_enable_get_direction_icon" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_enable_get_direction_icon) && $gmap_embed_admin_single_map->wgm_enable_get_direction_icon == 1) ? 'checked' : ''; ?>> |
| 558 |
<span class="wgm_slider round"></span> |
| 559 |
</div> |
| 560 |
</td> |
| 561 |
</tr> |
| 562 |
<tr> |
| 563 |
<th><label for="wgm_enable_direction_link"><?php esc_html_e('Enable direction link', 'gmap-embed'); ?></label></th> |
| 564 |
<td> |
| 565 |
<div class="wgm_switch"> |
| 566 |
<input id="wgm_enable_direction_link" name="wgm_enable_direction_link" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_enable_direction_link) && $gmap_embed_admin_single_map->wgm_enable_direction_link == 1) ? 'checked' : ''; ?>> |
| 567 |
<span class="wgm_slider round"></span> |
| 568 |
</div> |
| 569 |
<p class="description"><?php esc_html_e('If enabled, a "Get Directions" link will be added to the marker infowindow.', 'gmap-embed'); ?></p> |
| 570 |
</td> |
| 571 |
</tr> |
| 572 |
</table> |
| 573 |
</fieldset> |
| 574 |
|
| 575 |
<fieldset class="wgm-fieldset-spacing" style="display:block; margin-top: 20px;"> |
| 576 |
<legend><b><?php esc_html_e('Search & Filtering', 'gmap-embed'); ?></b></legend> |
| 577 |
<table class="form-table"> |
| 578 |
<tr> |
| 579 |
<th><label for="wgm_enable_title_search"><?php esc_html_e('Enable Title Search', 'gmap-embed'); ?></label></th> |
| 580 |
<td> |
| 581 |
<div class="wgm_switch"> |
| 582 |
<input id="wgm_enable_title_search" name="wgm_enable_title_search" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_enable_title_search) && $gmap_embed_admin_single_map->wgm_enable_title_search == 1) ? 'checked' : ''; ?>> |
| 583 |
<span class="wgm_slider round"></span> |
| 584 |
</div> |
| 585 |
</td> |
| 586 |
</tr> |
| 587 |
<tr> |
| 588 |
<th><label for="wgm_enable_category_filter"><?php esc_html_e('Enable Category Filter', 'gmap-embed'); ?></label></th> |
| 589 |
<td> |
| 590 |
<div class="wgm_switch"> |
| 591 |
<input id="wgm_enable_category_filter" name="wgm_enable_category_filter" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_enable_category_filter) && $gmap_embed_admin_single_map->wgm_enable_category_filter == 1) ? 'checked' : ''; ?>> |
| 592 |
<span class="wgm_slider round"></span> |
| 593 |
</div> |
| 594 |
</td> |
| 595 |
</tr> |
| 596 |
</table> |
| 597 |
</fieldset> |
| 598 |
<?php if (!_wgm_is_premium()) : ?> |
| 599 |
</div> |
| 600 |
<?php endif; ?> |
| 601 |
</div> |
| 602 |
</div> |
| 603 |
</div> |
| 604 |
</div> |
| 605 |
<div class="wp-gmap-tab-contents wgm_store_locator hidden" style="padding:15px;background:#fff;border-radius:6px;"> |
| 606 |
<?php if (!_wgm_is_premium()) : ?> |
| 607 |
<div class="wgm-upgrade-banner"> |
| 608 |
<div class="wgm-upgrade-banner-icon"> |
| 609 |
<span class="dashicons dashicons-star-filled"></span> |
| 610 |
</div> |
| 611 |
<div class="wgm-upgrade-banner-content"> |
| 612 |
<p> |
| 613 |
<?php |
| 614 |
echo sprintf( |
| 615 |
/* translators: %s: Premium version URL. */ |
| 616 |
esc_html__('Store Locator feature is available in the %s.', 'gmap-embed'), |
| 617 |
'<b>' . esc_html__('Premium Version', 'gmap-embed') . '</b>' |
| 618 |
); |
| 619 |
?> |
| 620 |
</p> |
| 621 |
</div> |
| 622 |
<a href="<?php echo esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-store-locator-tab-btn'); ?>" target="_blank" class="wgm-upgrade-banner-btn"><?php esc_html_e('Upgrade Now', 'gmap-embed'); ?></a> |
| 623 |
</div> |
| 624 |
<div class="wgm_enable_premium" style="opacity: 0.5; position: relative;" <?php |
| 625 |
echo 'data-notice="' . esc_attr(sprintf( |
| 626 |
/* translators: %s: Premium version URL. */ |
| 627 |
__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> use Store Locator Feature</b>.', 'gmap-embed'), |
| 628 |
esc_url('https://wpgooglemap.com/pricing?utm_source=gmap-embed&utm_medium=wordpress-plugin&utm_campaign=upgrade-to-pro&utm_content=edit-map-store-locator-lock') |
| 629 |
)) . '"'; |
| 630 |
?>> |
| 631 |
<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; cursor: pointer;"></div> |
| 632 |
<?php endif; ?> |
| 633 |
<table class="form-table"> |
| 634 |
<tr> |
| 635 |
<th><label for="wgm_enable_store_locator"><?php esc_html_e('Enable Store Locator', 'gmap-embed'); ?></label></th> |
| 636 |
<td> |
| 637 |
<div class="wgm_switch"> |
| 638 |
<input id="wgm_enable_store_locator" name="wgm_enable_store_locator" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_enable_store_locator) && $gmap_embed_admin_single_map->wgm_enable_store_locator == 1) ? 'checked' : ''; ?>> |
| 639 |
<span class="wgm_slider round"></span> |
| 640 |
</div> |
| 641 |
<p class="description"><?php esc_html_e('When enabled, a radius-based search control will be displayed on the map.', 'gmap-embed'); ?></p> |
| 642 |
</td> |
| 643 |
</tr> |
| 644 |
<!-- Moved to Marker Listing tab --> |
| 645 |
<tr> |
| 646 |
<th><label for="wgm_title_search_placeholder"><?php esc_html_e('Title Search Placeholder', 'gmap-embed'); ?></label></th> |
| 647 |
<td> |
| 648 |
<input type="text" id="wgm_title_search_placeholder" class="regular-text" value="<?php echo (isset($gmap_embed_admin_single_map->wgm_title_search_placeholder) && !empty($gmap_embed_admin_single_map->wgm_title_search_placeholder)) ? esc_attr($gmap_embed_admin_single_map->wgm_title_search_placeholder) : esc_attr__('Search by Title/Description', 'gmap-embed'); ?>"> |
| 649 |
</td> |
| 650 |
</tr> |
| 651 |
<tr> |
| 652 |
<th><label for="wgm_address_search_placeholder"><?php esc_html_e('Address Search Placeholder', 'gmap-embed'); ?></label></th> |
| 653 |
<td> |
| 654 |
<input type="text" id="wgm_address_search_placeholder" class="regular-text" value="<?php echo (isset($gmap_embed_admin_single_map->wgm_address_search_placeholder) && !empty($gmap_embed_admin_single_map->wgm_address_search_placeholder)) ? esc_attr($gmap_embed_admin_single_map->wgm_address_search_placeholder) : esc_attr__('Search by Address, Zip Code...', 'gmap-embed'); ?>"> |
| 655 |
</td> |
| 656 |
</tr> |
| 657 |
<tr> |
| 658 |
<th><label for="wgm_default_address"><?php esc_html_e('Default Address', 'gmap-embed'); ?></label></th> |
| 659 |
<td> |
| 660 |
<input type="text" id="wgm_default_address" class="regular-text" value="<?php echo isset($gmap_embed_admin_single_map->wgm_default_address) ? esc_attr($gmap_embed_admin_single_map->wgm_default_address) : ''; ?>"> |
| 661 |
</td> |
| 662 |
</tr> |
| 663 |
<tr> |
| 664 |
<th><label for="wgm_default_radius"><?php esc_html_e('Default Radius', 'gmap-embed'); ?></label></th> |
| 665 |
<td> |
| 666 |
<input type="number" id="wgm_default_radius" class="small-text" value="<?php echo isset($gmap_embed_admin_single_map->wgm_default_radius) ? esc_attr($gmap_embed_admin_single_map->wgm_default_radius) : ''; ?>"> |
| 667 |
</td> |
| 668 |
</tr> |
| 669 |
<tr> |
| 670 |
<th><label for="wgm_not_found_message"><?php esc_html_e('Not Found Message', 'gmap-embed'); ?></label></th> |
| 671 |
<td> |
| 672 |
<input type="text" id="wgm_not_found_message" class="regular-text" value="<?php echo (isset($gmap_embed_admin_single_map->wgm_not_found_message) && !empty($gmap_embed_admin_single_map->wgm_not_found_message)) ? esc_attr($gmap_embed_admin_single_map->wgm_not_found_message) : esc_attr__('No results found.', 'gmap-embed'); ?>"> |
| 673 |
</td> |
| 674 |
</tr> |
| 675 |
|
| 676 |
<tr> |
| 677 |
<th><label for="wgm_hide_markers_until_search"><?php esc_html_e('Hide markers until search', 'gmap-embed'); ?></label></th> |
| 678 |
<td> |
| 679 |
<div class="wgm_switch"> |
| 680 |
<input id="wgm_hide_markers_until_search" name="wgm_hide_markers_until_search" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_hide_markers_until_search) && $gmap_embed_admin_single_map->wgm_hide_markers_until_search == 1) ? 'checked' : ''; ?>> |
| 681 |
<span class="wgm_slider round"></span> |
| 682 |
</div> |
| 683 |
<p class="description"><?php esc_html_e('If enabled, markers will be hidden until a search is performed.', 'gmap-embed'); ?></p> |
| 684 |
</td> |
| 685 |
</tr> |
| 686 |
<tr> |
| 687 |
<th><label for="wgm_show_center_icon"><?php esc_html_e('Show center point as an icon', 'gmap-embed'); ?></label></th> |
| 688 |
<td> |
| 689 |
<div class="wgm_switch"> |
| 690 |
<input id="wgm_show_center_icon" name="wgm_show_center_icon" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_show_center_icon) && $gmap_embed_admin_single_map->wgm_show_center_icon == 1) ? 'checked' : ''; ?>> |
| 691 |
<span class="wgm_slider round"></span> |
| 692 |
</div> |
| 693 |
</td> |
| 694 |
</tr> |
| 695 |
<tr> |
| 696 |
<th><label for="wgm_show_distance"><?php esc_html_e('Show distance from search', 'gmap-embed'); ?></label></th> |
| 697 |
<td> |
| 698 |
<div class="wgm_switch"> |
| 699 |
<input id="wgm_show_distance" name="wgm_show_distance" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_show_distance) && $gmap_embed_admin_single_map->wgm_show_distance == 1) ? 'checked' : ''; ?>> |
| 700 |
<span class="wgm_slider round"></span> |
| 701 |
</div> |
| 702 |
</td> |
| 703 |
</tr> |
| 704 |
<tr> |
| 705 |
<th><label for="wgm_distance_unit"><?php esc_html_e('Show distance in', 'gmap-embed'); ?></label></th> |
| 706 |
<td> |
| 707 |
<select id="wgm_distance_unit"> |
| 708 |
<option value="miles" <?php echo (isset($gmap_embed_admin_single_map->wgm_distance_unit) && $gmap_embed_admin_single_map->wgm_distance_unit === 'miles') ? 'selected' : ''; ?>><?php esc_html_e('Miles', 'gmap-embed'); ?></option> |
| 709 |
<option value="km" <?php echo (isset($gmap_embed_admin_single_map->wgm_distance_unit) && $gmap_embed_admin_single_map->wgm_distance_unit === 'km') ? 'selected' : ''; ?>><?php esc_html_e('Kilometers', 'gmap-embed'); ?></option> |
| 710 |
</select> |
| 711 |
</td> |
| 712 |
</tr> |
| 713 |
<tr> |
| 714 |
<th><label for="wgm_sort_by_distance"><?php esc_html_e('Markers listing sort by distance', 'gmap-embed'); ?></label></th> |
| 715 |
<td> |
| 716 |
<div class="wgm_switch"> |
| 717 |
<input id="wgm_sort_by_distance" name="wgm_sort_by_distance" type="checkbox" <?php echo (isset($gmap_embed_admin_single_map->wgm_sort_by_distance) && $gmap_embed_admin_single_map->wgm_sort_by_distance == 1) ? 'checked' : ''; ?>> |
| 718 |
<span class="wgm_slider round"></span> |
| 719 |
</div> |
| 720 |
</td> |
| 721 |
</tr> |
| 722 |
<tr> |
| 723 |
<th><label for="wgm_store_locator_placement"><?php esc_html_e('Store Locator Placement', 'gmap-embed'); ?></label></th> |
| 724 |
<td> |
| 725 |
<select id="wgm_store_locator_placement"> |
| 726 |
<option value="inside_map" <?php echo (isset($gmap_embed_admin_single_map->wgm_store_locator_placement) && $gmap_embed_admin_single_map->wgm_store_locator_placement === 'inside_map') ? 'selected' : ( (!isset($gmap_embed_admin_single_map->wgm_store_locator_placement) || empty($gmap_embed_admin_single_map->wgm_store_locator_placement)) ? 'selected' : '' ); ?>><?php esc_html_e('Inside Map', 'gmap-embed'); ?></option> |
| 727 |
<option value="above_map" <?php echo (isset($gmap_embed_admin_single_map->wgm_store_locator_placement) && $gmap_embed_admin_single_map->wgm_store_locator_placement === 'above_map') ? 'selected' : ''; ?>><?php esc_html_e('Above Map', 'gmap-embed'); ?></option> |
| 728 |
<option value="below_map" <?php echo (isset($gmap_embed_admin_single_map->wgm_store_locator_placement) && $gmap_embed_admin_single_map->wgm_store_locator_placement === 'below_map') ? 'selected' : ''; ?>><?php esc_html_e('Below Map', 'gmap-embed'); ?></option> |
| 729 |
</select> |
| 730 |
</td> |
| 731 |
</tr> |
| 732 |
|
| 733 |
<!-- Circle Settings --> |
| 734 |
<tr> |
| 735 |
<th colspan="2"><h3 style="margin:0;"><?php esc_html_e('Radius Circle Settings', 'gmap-embed'); ?></h3></th> |
| 736 |
</tr> |
| 737 |
<tr> |
| 738 |
<th><label for="wgm_radius_circle_stroke_color"><?php esc_html_e('Stroke Color', 'gmap-embed'); ?></label></th> |
| 739 |
<td> |
| 740 |
<input type="color" id="wgm_radius_circle_stroke_color" value="<?php echo (isset($gmap_embed_admin_single_map->wgm_radius_circle_stroke_color) && !empty($gmap_embed_admin_single_map->wgm_radius_circle_stroke_color)) ? esc_attr($gmap_embed_admin_single_map->wgm_radius_circle_stroke_color) : '#4285F4'; ?>"> |
| 741 |
</td> |
| 742 |
</tr> |
| 743 |
<tr> |
| 744 |
<th><label for="wgm_radius_circle_stroke_opacity"><?php esc_html_e('Stroke Opacity (0-1)', 'gmap-embed'); ?></label></th> |
| 745 |
<td> |
| 746 |
<input type="number" step="0.1" min="0" max="1" id="wgm_radius_circle_stroke_opacity" class="small-text" value="<?php echo (isset($gmap_embed_admin_single_map->wgm_radius_circle_stroke_opacity) && $gmap_embed_admin_single_map->wgm_radius_circle_stroke_opacity !== '') ? esc_attr($gmap_embed_admin_single_map->wgm_radius_circle_stroke_opacity) : '0.8'; ?>"> |
| 747 |
</td> |
| 748 |
</tr> |
| 749 |
<tr> |
| 750 |
<th><label for="wgm_radius_circle_stroke_weight"><?php esc_html_e('Stroke Weight', 'gmap-embed'); ?></label></th> |
| 751 |
<td> |
| 752 |
<input type="number" min="0" id="wgm_radius_circle_stroke_weight" class="small-text" value="<?php echo (isset($gmap_embed_admin_single_map->wgm_radius_circle_stroke_weight) && $gmap_embed_admin_single_map->wgm_radius_circle_stroke_weight !== '') ? esc_attr($gmap_embed_admin_single_map->wgm_radius_circle_stroke_weight) : '2'; ?>"> |
| 753 |
</td> |
| 754 |
</tr> |
| 755 |
<tr> |
| 756 |
<th><label for="wgm_radius_circle_fill_color"><?php esc_html_e('Fill Color', 'gmap-embed'); ?></label></th> |
| 757 |
<td> |
| 758 |
<input type="color" id="wgm_radius_circle_fill_color" value="<?php echo (isset($gmap_embed_admin_single_map->wgm_radius_circle_fill_color) && !empty($gmap_embed_admin_single_map->wgm_radius_circle_fill_color)) ? esc_attr($gmap_embed_admin_single_map->wgm_radius_circle_fill_color) : '#4285F4'; ?>"> |
| 759 |
</td> |
| 760 |
</tr> |
| 761 |
<tr> |
| 762 |
<th><label for="wgm_radius_circle_fill_opacity"><?php esc_html_e('Fill Opacity (0-1)', 'gmap-embed'); ?></label></th> |
| 763 |
<td> |
| 764 |
<input type="number" step="0.1" min="0" max="1" id="wgm_radius_circle_fill_opacity" class="small-text" value="<?php echo (isset($gmap_embed_admin_single_map->wgm_radius_circle_fill_opacity) && $gmap_embed_admin_single_map->wgm_radius_circle_fill_opacity !== '') ? esc_attr($gmap_embed_admin_single_map->wgm_radius_circle_fill_opacity) : '0.2'; ?>"> |
| 765 |
</td> |
| 766 |
</tr> |
| 767 |
</table> |
| 768 |
<?php if (!_wgm_is_premium()) : ?> |
| 769 |
</div> |
| 770 |
<?php endif; ?> |
| 771 |
</div> |
| 772 |
</div> |
| 773 |
|
| 774 |
|
| 775 |
<div class="wp-gmap-preview"> |
| 776 |
<h1 id="wpgmap_heading_preview" style="padding: 0px;margin: 0px;"> |
| 777 |
<?php echo esc_html($gmap_embed_admin_single_map->wpgmap_title); ?> |
| 778 |
</h1> |
| 779 |
<input id="wgm_pac_input" class="wgm_controls" type="text" |
| 780 |
placeholder="<?php esc_html_e('Search by Address, Zip Code, (Latitude,Longitude)', 'gmap-embed'); ?>" /> |
| 781 |
<!-- Category Filter Toggle Icon --> |
| 782 |
|
| 783 |
<div id="wgm_map" style="height: 520px;"></div> |
| 784 |
<div class="" style="width: 100%;float:left;text-align: right;margin-bottom: 5px;margin-top: 5px;"> |
| 785 |
<span class="spinner" style="margin: 0 !important;float: none;"></span> |
| 786 |
<button class="button wgm_btn" style="width: auto;padding: 5px 12px;" |
| 787 |
id="wp-gmap-embed-update"><?php esc_html_e('Update Map', 'gmap-embed'); ?></button> |
| 788 |
</div> |
| 789 |
</div> |
| 790 |
</div> |
| 791 |
</div> |
| 792 |
</div> |