www.mapsmarker.com"); } include('inc' . DIRECTORY_SEPARATOR . 'admin-header.php'); require_once( ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'file.php' ); WP_Filesystem(); global $wpdb, $allowedtags, $wp_version, $locale, $wp_filesystem, $allowedposttags; $additionaltags = array('iframe' => array('id' => true,'name' => true,'src' => true,'class' => true,'style' => true,'frameborder' => true,'scrolling' => true,'align' => true,'width' => true,'height' => true,'marginwidth' => true,'marginheight' => true),'style' => array('media' => true,'scoped' => true,'type' => true),'input' => array('accept' => true,'align' => true,'alt' => true,'autocomplete' => true,'autofocus' => true,'checked' => true,'dirname' => true,'disabled' => true,'form' => true,'formaction' => true,'formenctype' => true,'formmethod' => true,'formnovalidate' => true,'formtarget' => true,'height' => true,'id' => true,'list' => true,'max' => true,'maxlength' => true,'min' => true,'multiple' => true,'name' => true,'pattern' => true,'placeholder' => true,'readonly' => true,'required' => true,'size' => true,'src' => true,'step' => true,'type' => true,'value' => true,'width' => true), 'source' => array('type' => true,'src' => true)); $lmm_options = get_option( 'leafletmapsmarker_options' ); //info: set marker shadow url if ( $lmm_options['defaults_marker_icon_shadow_url_status'] == 'default' ) { if ( $lmm_options['defaults_marker_icon_shadow_url'] == NULL ) { $marker_shadow_url = ''; } else { $marker_shadow_url = LEAFLET_PLUGIN_URL . 'leaflet-dist/images/marker-shadow.png'; } } else { $marker_shadow_url = htmlspecialchars($lmm_options['defaults_marker_icon_shadow_url']); } $current_editor = get_option( 'leafletmapsmarker_editor' ); $new_editor = isset($_GET['new_editor']) ? $_GET['new_editor'] : ''; $current_editor_css = ($current_editor == 'simplified') ? 'display:none;' : ''; //info: workaround - select shortcode on input focus doesnt work on iOS $is_ios = wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] ); if ( version_compare( $wp_version, '3.4', '>=' ) ) { $shortcode_select = ( $is_ios ) ? '' : 'onfocus="this.select();" readonly="readonly"'; } else { $shortcode_select = ''; } //info: workaround for datetime-local issue on iOS if ($is_ios) { $datetime_ios_workaround = 'text'; } else { $datetime_ios_workaround = 'datetime-local'; } $table_name_markers = $wpdb->prefix.'leafletmapsmarker_markers'; $table_name_layers = $wpdb->prefix.'leafletmapsmarker_layers'; $action = isset($_POST['action']) ? $_POST['action'] : (isset($_GET['action']) ? $_GET['action'] : ''); $addtoLayer = isset($_GET['addtoLayer']) ? intval($_GET['addtoLayer']) : (isset($_POST['layer']) ? intval($_POST['layer']) : ''); $layername = isset($_GET['Layername']) ? stripslashes($_GET['Layername']) : ''; $layer_show_button = ($addtoLayer != NULL && $addtoLayer != 0) ? "" . __('edit assigned layer','lmm') . "   " : ""; $oid = isset($_POST['id']) ? intval($_POST['id']) : (isset($_GET['id']) ? intval($_GET['id']) : ''); $lat_check = isset($_POST['lat']) ? $_POST['lat'] : (isset($_GET['lat']) ? $_GET['lat'] : ''); $lon_check = isset($_POST['lon']) ? $_POST['lon'] : (isset($_GET['lon']) ? $_GET['lon'] : ''); $markerid = isset($_GET['markerid']) ? intval($_GET['markerid']) : ''; //info: for switcheditor-js-forward //info: for datetime check in Firefox function lmm_validateDate($date) { return (bool)strtotime($date); } if (!empty($action)) { $markernonce = isset($_POST['_wpnonce']) ? $_POST['_wpnonce'] : (isset($_GET['_wpnonce']) ? $_GET['_wpnonce'] : ''); if (! wp_verify_nonce($markernonce, 'marker-nonce') ) die('
'.__('Security check failed - please call this function from the according admin page!','lmm').''); $layer = isset($_POST['layer']) ? intval($_POST['layer']) : 0; if ($action == 'add') { if ( ($lat_check != NULL) && ($lon_check != NULL) ) { global $current_user; wp_get_current_user(); //info: set values for wms checkboxes status $wms_checkbox = isset($_POST['wms']) ? '1' : '0'; $wms2_checkbox = isset($_POST['wms2']) ? '1' : '0'; $wms3_checkbox = isset($_POST['wms3']) ? '1' : '0'; $wms4_checkbox = isset($_POST['wms4']) ? '1' : '0'; $wms5_checkbox = isset($_POST['wms5']) ? '1' : '0'; $wms6_checkbox = isset($_POST['wms6']) ? '1' : '0'; $wms7_checkbox = isset($_POST['wms7']) ? '1' : '0'; $wms8_checkbox = isset($_POST['wms8']) ? '1' : '0'; $wms9_checkbox = isset($_POST['wms9']) ? '1' : '0'; $wms10_checkbox = isset($_POST['wms10']) ? '1' : '0'; $openpopup_checkbox = isset($_POST['openpopup']) ? '1' : '0'; $panel_checkbox = isset($_POST['panel']) ? '1' : '0'; $markername_quotes = str_replace("\\\\","/", str_replace("\"","'", sanitize_text_field($_POST['markername']))); //info: geojson validity fixes $popuptext = preg_replace("/\t/", " ", str_replace("\\\\","/", $_POST['popuptext'])); //info: geojson validity fixes $address = preg_replace("/(\\\\)(?!')/","/", preg_replace("/\t/", " ", sanitize_text_field($_POST['address']))); //info: geojson validity fixes $gpx_url = ''; //info: added for compat $gpx_panel_checkbox = '0'; //info: added for compat if ($_POST['kml_timestamp'] == NULL) { $result = $wpdb->prepare( "INSERT INTO `$table_name_markers` (`markername`, `basemap`, `layer`, `lat`, `lon`, `icon`, `popuptext`, `zoom`, `openpopup`, `mapwidth`, `mapwidthunit`, `mapheight`, `panel`, `createdby`, `createdon`, `updatedby`, `updatedon`, `controlbox`, `overlays_custom`, `overlays_custom2`, `overlays_custom3`, `overlays_custom4`, `wms`, `wms2`, `wms3`, `wms4`, `wms5`, `wms6`, `wms7`, `wms8`, `wms9`, `wms10`, `address`, `gpx_url`, `gpx_panel`) VALUES (%s, %s, %d, %s, %s, %s, %s, %d, %d, %d, %s, %d, %d, %s, %s, %s, %s, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %s, %d )", $markername_quotes, $_POST['basemap'], $layer, str_replace(',', '.', floatval($_POST['lat'])), str_replace(',', '.', floatval($_POST['lon'])), $_POST['icon_hidden'], $popuptext, $_POST['zoom'], $openpopup_checkbox, $_POST['mapwidth'], $_POST['mapwidthunit'], $_POST['mapheight'], $panel_checkbox, $current_user->user_login, current_time('mysql',0), $current_user->user_login, current_time('mysql',0), $_POST['controlbox'], $_POST['overlays_custom'], $_POST['overlays_custom2'], $_POST['overlays_custom3'], $_POST['overlays_custom4'], $wms_checkbox, $wms2_checkbox, $wms3_checkbox, $wms4_checkbox, $wms5_checkbox, $wms6_checkbox, $wms7_checkbox, $wms8_checkbox, $wms9_checkbox, $wms10_checkbox, $address, $gpx_url, $gpx_panel_checkbox ); } else if ($_POST['kml_timestamp'] != NULL) { //info: for datetime check in Firefox $kml_timestamp = (lmm_validateDate($_POST['kml_timestamp']) == TRUE) ? $_POST['kml_timestamp'] : current_time('mysql',0); $result = $wpdb->prepare( "INSERT INTO `$table_name_markers` (`markername`, `basemap`, `layer`, `lat`, `lon`, `icon`, `popuptext`, `zoom`, `openpopup`, `mapwidth`, `mapwidthunit`, `mapheight`, `panel`, `createdby`, `createdon`, `updatedby`, `updatedon`, `controlbox`, `overlays_custom`, `overlays_custom2`, `overlays_custom3`, `overlays_custom4`, `wms`, `wms2`, `wms3`, `wms4`, `wms5`, `wms6`, `wms7`, `wms8`, `wms9`, `wms10`, `kml_timestamp`, `address`, `gpx_url`, `gpx_panel`) VALUES (%s, %s, %d, %s, %s, %s, %s, %d, %d, %d, %s, %d, %d, %s, %s, %s, %s, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %s, %s, %d )", $markername_quotes, $_POST['basemap'], $layer, str_replace(',', '.', floatval($_POST['lat'])), str_replace(',', '.', floatval($_POST['lon'])), $_POST['icon_hidden'], $popuptext, $_POST['zoom'], $openpopup_checkbox, $_POST['mapwidth'], $_POST['mapwidthunit'], $_POST['mapheight'], $panel_checkbox, $current_user->user_login, current_time('mysql',0), $current_user->user_login, current_time('mysql',0), $_POST['controlbox'], $_POST['overlays_custom'], $_POST['overlays_custom2'], $_POST['overlays_custom3'], $_POST['overlays_custom4'], $wms_checkbox, $wms2_checkbox, $wms3_checkbox, $wms4_checkbox, $wms5_checkbox, $wms6_checkbox, $wms7_checkbox, $wms8_checkbox, $wms9_checkbox, $wms10_checkbox, $kml_timestamp, $address, $gpx_url, $gpx_panel_checkbox ); } $wpdb->query( $result ); $wpdb->query( "OPTIMIZE TABLE `$table_name_markers`" ); echo ' '; } else { echo '

' . __('Error: coordinates cannot be empty!','lmm') . '

' . __('Go back to form','lmm') . '

'; } } elseif ($action == 'edit') { if ( ($lat_check != NULL) && ($lon_check != NULL) ) { global $current_user; wp_get_current_user(); //info: set values for wms checkboxes status $wms_checkbox = isset($_POST['wms']) ? '1' : '0'; $wms2_checkbox = isset($_POST['wms2']) ? '1' : '0'; $wms3_checkbox = isset($_POST['wms3']) ? '1' : '0'; $wms4_checkbox = isset($_POST['wms4']) ? '1' : '0'; $wms5_checkbox = isset($_POST['wms5']) ? '1' : '0'; $wms6_checkbox = isset($_POST['wms6']) ? '1' : '0'; $wms7_checkbox = isset($_POST['wms7']) ? '1' : '0'; $wms8_checkbox = isset($_POST['wms8']) ? '1' : '0'; $wms9_checkbox = isset($_POST['wms9']) ? '1' : '0'; $wms10_checkbox = isset($_POST['wms10']) ? '1' : '0'; $openpopup_checkbox = isset($_POST['openpopup']) ? '1' : '0'; $panel_checkbox = isset($_POST['panel']) ? '1' : '0'; $markername_quotes = str_replace("\\\\","/", str_replace("\"","'", $_POST['markername'])); //info: geojson validity fixes $popuptext = preg_replace("/\t/", " ", str_replace("\\\\","/", $_POST['popuptext'])); //info: geojson validity fixes $address = preg_replace("/(\\\\)(?!')/","/", preg_replace("/\t/", " ", $_POST['address'])); //info: geojson validity fixes $gpx_url = ''; //info: added for compat $gpx_panel_checkbox = '0'; //info: added for compat if ($_POST['kml_timestamp'] == NULL) { $result = $wpdb->prepare( "UPDATE `$table_name_markers` SET `markername` = %s, `basemap` = %s, `layer` = %d, `lat` = %s, `lon` = %s, `icon` = %s, `popuptext` = %s, `zoom` = %d, `openpopup` = %d, `mapwidth` = %d, `mapwidthunit` = %s, `mapheight` = %d, `panel` = %d, `updatedby` = %s, `updatedon` = %s, `controlbox` = %d, `overlays_custom` = %s, `overlays_custom2` = %s, `overlays_custom3` = %s, `overlays_custom4` = %s, `wms` = %d, `wms2` = %d, `wms3` = %d, `wms4` = %d, `wms5` = %d, `wms6` = %d, `wms7` = %d, `wms8` = %d, `wms9` = %d, `wms10` = %d, `address` = %s, `gpx_url` = %s, `gpx_panel` = %d WHERE `id` = %d", $markername_quotes, $_POST['basemap'], $layer, str_replace(',', '.', floatval($_POST['lat'])), str_replace(',', '.', floatval($_POST['lon'])), $_POST['icon_hidden'], $popuptext, $_POST['zoom'], $openpopup_checkbox, $_POST['mapwidth'], $_POST['mapwidthunit'], $_POST['mapheight'], $panel_checkbox, $current_user->user_login, current_time('mysql',0), $_POST['controlbox'], $_POST['overlays_custom'], $_POST['overlays_custom2'], $_POST['overlays_custom3'], $_POST['overlays_custom4'], $wms_checkbox, $wms2_checkbox, $wms3_checkbox, $wms4_checkbox, $wms5_checkbox, $wms6_checkbox, $wms7_checkbox, $wms8_checkbox, $wms9_checkbox, $wms10_checkbox, $address, $gpx_url, $gpx_panel_checkbox, $oid ); } else if ($_POST['kml_timestamp'] != NULL) { //info: for datetime check in Firefox $kml_timestamp = (lmm_validateDate($_POST['kml_timestamp']) == TRUE) ? $_POST['kml_timestamp'] : current_time('mysql',0); $result = $wpdb->prepare( "UPDATE `$table_name_markers` SET `markername` = %s, `basemap` = %s, `layer` = %d, `lat` = %s, `lon` = %s, `icon` = %s, `popuptext` = %s, `zoom` = %d, `openpopup` = %d, `mapwidth` = %d, `mapwidthunit` = %s, `mapheight` = %d, `panel` = %d, `updatedby` = %s, `updatedon` = %s, `controlbox` = %d, `overlays_custom` = %s, `overlays_custom2` = %s, `overlays_custom3` = %s, `overlays_custom4` = %s, `wms` = %d, `wms2` = %d, `wms3` = %d, `wms4` = %d, `wms5` = %d, `wms6` = %d, `wms7` = %d, `wms8` = %d, `wms9` = %d, `wms10` = %d, `kml_timestamp` = %s, `address` = %s, `gpx_url` = %s, `gpx_panel` = %d WHERE `id` = %d", $markername_quotes, $_POST['basemap'], $layer, str_replace(',', '.', floatval($_POST['lat'])), str_replace(',', '.', floatval($_POST['lon'])), $_POST['icon_hidden'], $popuptext, $_POST['zoom'], $openpopup_checkbox, $_POST['mapwidth'], $_POST['mapwidthunit'], $_POST['mapheight'], $panel_checkbox, $current_user->user_login, current_time('mysql',0), $_POST['controlbox'], $_POST['overlays_custom'], $_POST['overlays_custom2'], $_POST['overlays_custom3'], $_POST['overlays_custom4'], $wms_checkbox, $wms2_checkbox, $wms3_checkbox, $wms4_checkbox, $wms5_checkbox, $wms6_checkbox, $wms7_checkbox, $wms8_checkbox, $wms9_checkbox, $wms10_checkbox, $kml_timestamp, $address, $gpx_url, $gpx_panel_checkbox, $oid ); } $wpdb->query( $result ); $wpdb->query( "OPTIMIZE TABLE `$table_name_markers`" ); echo ' '; } else { echo '

' . __('Error: coordinates cannot be empty!','lmm') . '

' . __('Go back to form','lmm') . '

'; } } elseif ($action == 'delete') { if (!empty($oid)) { $result = $wpdb->prepare( "DELETE FROM `$table_name_markers` WHERE `id` = %d", $oid ); $wpdb->query( $result ); $wpdb->query( "OPTIMIZE TABLE `$table_name_markers`" ); echo '

' . __('Marker has been successfully deleted','lmm') . '
' . __('list all markers','lmm') . '   ' . __('add new marker','lmm') . '

'; } } elseif ($action == 'switcheditor') { if ($new_editor == 'advanced') { update_option( 'leafletmapsmarker_editor', $new_editor ); if ( $markerid != NULL ) { echo ' '; } else { echo ' '; } } else if ($new_editor == 'simplified') { update_option( 'leafletmapsmarker_editor', $new_editor ); if ( $markerid != NULL ) { echo ' '; } else { echo ' '; } } } } else { //info: get icons list $iconlist = array(); $dir = opendir(LEAFLET_PLUGIN_ICONS_DIR); while ($file = readdir($dir)) { if ($file === false) { break; } if ($file != "." and $file != "..") { $path_info = pathinfo($file); if (!is_dir($dir.$file) && ((strtolower($path_info['extension']) == 'png') || (strtolower($path_info['extension']) == 'jpg') || (strtolower($path_info['extension']) == 'gif')) ) { $iconlist[] = $file; } } } closedir($dir); sort($iconlist); global $current_user; wp_get_current_user(); //info: get layers list $layerlist = $wpdb->get_results('SELECT * FROM `'.$table_name_layers.'` WHERE `id` > 0', ARRAY_A); $id = ''; $markername = ''; $basemap = $lmm_options[ 'standard_basemap' ]; //info: fallback for existing maps if Google API is disabled if (($lmm_options['google_maps_api_status'] == 'disabled') && (($basemap == 'googleLayer_roadmap') || ($basemap == 'googleLayer_satellite') || ($basemap == 'googleLayer_hybrid') || ($basemap == 'googleLayer_terrain')) ) { $basemap = 'osm_mapnik'; } $layer = ($lmm_options[ 'defaults_marker_default_layer' ] == '0') ? '' : intval($lmm_options[ 'defaults_marker_default_layer' ]); $lat = str_replace(',', '.', floatval($lmm_options[ 'defaults_marker_lat' ])); $lon = str_replace(',', '.', floatval($lmm_options[ 'defaults_marker_lon' ])); $icon = ($lmm_options[ 'defaults_marker_icon' ] == NULL) ? '' : esc_html($lmm_options[ 'defaults_marker_icon' ]); $popuptext = ''; $zoom = intval($lmm_options[ 'defaults_marker_zoom' ]); $openpopup = $lmm_options[ 'defaults_marker_openpopup' ]; $mapwidth = intval($lmm_options[ 'defaults_marker_mapwidth' ]); $mapwidthunit = $lmm_options[ 'defaults_marker_mapwidthunit' ]; $mapheight = intval($lmm_options[ 'defaults_marker_mapheight' ]); $panel = $lmm_options[ 'defaults_marker_panel' ]; $mcreatedby = ''; $mcreatedon = ''; $mupdatedby = ''; $mupdatedon = ''; $controlbox = $lmm_options[ 'defaults_marker_controlbox' ]; $overlays_custom = ( (isset($lmm_options[ 'defaults_marker_overlays_custom_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_overlays_custom_active' ] == 1 ) ) ? '1' : '0'; $overlays_custom2 = ( (isset($lmm_options[ 'defaults_marker_overlays_custom2_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_overlays_custom2_active' ] == 1 ) ) ? '1' : '0'; $overlays_custom3 = ( (isset($lmm_options[ 'defaults_marker_overlays_custom3_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_overlays_custom3_active' ] == 1 ) ) ? '1' : '0'; $overlays_custom4 = ( (isset($lmm_options[ 'defaults_marker_overlays_custom4_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_overlays_custom4_active' ] == 1 ) ) ? '1' : '0'; $wms = ( (isset($lmm_options[ 'defaults_marker_wms_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms_active' ] == 1 ) ) ? '1' : '0'; $wms2 = ( (isset($lmm_options[ 'defaults_marker_wms2_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms2_active' ] == 1 ) ) ? '1' : '0'; $wms3 = ( (isset($lmm_options[ 'defaults_marker_wms3_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms3_active' ] == 1 ) ) ? '1' : '0'; $wms4 = ( (isset($lmm_options[ 'defaults_marker_wms4_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms4_active' ] == 1 ) ) ? '1' : '0'; $wms5 = ( (isset($lmm_options[ 'defaults_marker_wms5_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms5_active' ] == 1 ) ) ? '1' : '0'; $wms6 = ( (isset($lmm_options[ 'defaults_marker_wms6_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms6_active' ] == 1 ) ) ? '1' : '0'; $wms7 = ( (isset($lmm_options[ 'defaults_marker_wms7_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms7_active' ] == 1 ) ) ? '1' : '0'; $wms8 = ( (isset($lmm_options[ 'defaults_marker_wms8_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms8_active' ] == 1 ) ) ? '1' : '0'; $wms9 = ( (isset($lmm_options[ 'defaults_marker_wms9_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms9_active' ] == 1 ) ) ? '1' : '0'; $wms10 = ( (isset($lmm_options[ 'defaults_marker_wms10_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_wms10_active' ] == 1 ) ) ? '1' : '0'; $kml_timestamp = ''; $address = ''; $isedit = isset($_GET['id']); if ($isedit) { $id = intval($_GET['id']); $row = $wpdb->get_row('SELECT `markername`,`basemap`,`layer`,`lat`,`lon`,`icon`,`popuptext`,`zoom`,`openpopup`,`mapwidth`,`mapwidthunit`,`mapheight`,`panel`,`createdby`,`createdon`,`updatedby`,`updatedon`,`controlbox`,`overlays_custom`,`overlays_custom2`,`overlays_custom3`,`overlays_custom4`,`wms`,`wms2`,`wms3`,`wms4`,`wms5`,`wms6`,`wms7`,`wms8`,`wms9`,`wms10`,`kml_timestamp`,`address` FROM `'.$table_name_markers.'` WHERE `id`='.$id, ARRAY_A); $markername = esc_js(htmlspecialchars($row['markername'])); $basemap = $row['basemap']; $layer = $row['layer']; $lat = $row['lat']; $lon = $row['lon']; $icon = $row['icon']; $popuptext = $row['popuptext']; $zoom = $row['zoom']; $openpopup = $row['openpopup']; $mapwidth = $row['mapwidth']; $mapwidthunit = $row['mapwidthunit']; $mapheight = $row['mapheight']; $panel = $row['panel']; $mcreatedby = esc_html($row['createdby']); $mcreatedon = $row['createdon']; $mupdatedby = esc_html($row['updatedby']); $mupdatedon = $row['updatedon']; $controlbox = $row['controlbox']; $overlays_custom = $row['overlays_custom']; $overlays_custom2 = $row['overlays_custom2']; $overlays_custom3 = $row['overlays_custom3']; $overlays_custom4 = $row['overlays_custom4']; $wms = $row['wms']; $wms2 = $row['wms2']; $wms3 = $row['wms3']; $wms4 = $row['wms4']; $wms5 = $row['wms5']; $wms6 = $row['wms6']; $wms7 = $row['wms7']; $wms8 = $row['wms8']; $wms9 = $row['wms9']; $wms10 = $row['wms10']; //info: for datetime check in Firefox if ($row['kml_timestamp'] == NULL) { $kml_timestamp = ''; } else { $kml_timestamp = date('Y-m-d\TH:i:s', strtotime($row['kml_timestamp'])); } $address = htmlspecialchars($row['address']); } ?>
' . $error_marker_not_exists . '

'; echo '

' . __('list all markers','lmm') . '   ' . __('add new marker','lmm') . '

'; } else { ?>
' . __('Marker has been successfully updated','lmm') . '
'; } else if ( $edit_status == 'published') { echo '

' . __('Marker has been successfully published','lmm') . '
'; } else if ( $edit_status == 'simplified') { echo '

' . __('You successfully switched to the simplified editor.','lmm') . '
'; } else if ( $edit_status == 'advanced') { echo '

' . __('You successfully switched to the advanced editor.','lmm') . '
'; } ?>
     
Editor-Switch-Icon
' . __('switch to advanced editor','lmm') . ''; } else if ($current_editor == 'advanced') { echo ''; } ?>

create a layer first (e.g. "company locations") and then add markers (e.g. "headquarters", "store A", "store B") assigned to that layer.','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_layer'); ?>

> ' . __('show API links','lmm') . ''; echo '
( )

' . sprintf(__('%1$s requests/%2$s','lmm'), $mapzen_rate_limit, $mapzen_rate_limit_period) . ''; } else if ($lmm_options['geocoding_provider'] == 'algolia-places') { $geocoding_provider_settings_internal_link = '#lmm-geocoding-algolia'; $geocoding_provider_selected_algolia = 'selected'; if ( ($lmm_options['geocoding_algolia_appId'] != NULL) && ($lmm_options['geocoding_algolia_apiKey'] != NULL) ){ $algolia_rate_limit = '100.000'; $algolia_rate_limit_period = __('month','lmm'); } else { $algolia_rate_limit = '1.000'; $algolia_rate_limit_period = __('day','lmm'); } $geocoding_provider_rate_limit_details = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/domain/%2$s','lmm'), $algolia_rate_limit, $algolia_rate_limit_period); } else if ($lmm_options['geocoding_provider'] == 'photon') { $geocoding_provider_settings_internal_link = '#lmm-geocoding-photon'; $geocoding_provider_selected_photon = 'selected'; $geocoding_provider_rate_limit_details = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/domain/%2$s','lmm'), '1.000', __('day','lmm')) . ''; } else if ($lmm_options['geocoding_provider'] == 'mapquest-geocoding') { $geocoding_provider_settings_internal_link = '#lmm-geocoding-mapquest'; $geocoding_provider_selected_mapquest = 'selected'; $geocoding_provider_rate_limit_details = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), '15.000', __('month','lmm')); } else if ($lmm_options['geocoding_provider'] == 'google-geocoding') { $geocoding_provider_settings_internal_link = '#lmm-geocoding-google'; $geocoding_provider_selected_google = 'selected'; $geocoding_provider_rate_limit_details = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), '1.000', __('day','lmm')); } //info: Get all the limits for each provider $geocoding_limits = array(); $mapzen_rate_limit = '30.000'; $mapzen_rate_limit_period = __('day','lmm'); $geocoding_limits['mapzen'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), $mapzen_rate_limit, $mapzen_rate_limit_period) . ''; if ( ($lmm_options['geocoding_algolia_appId'] != NULL) && ($lmm_options['geocoding_algolia_apiKey'] != NULL) ){ $algolia_rate_limit = '100.000'; $algolia_rate_limit_period = __('month','lmm'); $geocoding_limits['algolia'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), $algolia_rate_limit, $algolia_rate_limit_period); } else { $algolia_rate_limit = '1.000'; $algolia_rate_limit_period = __('day','lmm'); $geocoding_limits['algolia'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/domain/%2$s','lmm'), $algolia_rate_limit, $algolia_rate_limit_period); } $geocoding_limits['photon'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s out of %2$s requests/domain/%3$s','lmm'), '?', '1.000', __('day','lmm')); $geocoding_limits['mapquest'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), '15.000', __('month','lmm')); $geocoding_limits['google'] = __('Rate limit','lmm') . ': ' . sprintf(__('%1$s requests/%2$s','lmm'), '1.000', __('day','lmm')); //info: check if Mapzen Search API key is set $geocoding_provider_mapzen_disabled = ''; if ($lmm_options['geocoding_mapzen_search_api_key'] == NULL) { $option_mapzen_inactive = ''; $option_mapzen_active = ''; } else { $option_mapzen_active = ''; $option_mapzen_inactive = ''; } //info: check if MapQuest API key is set $geocoding_provider_mapquest_disabled = ''; if ($lmm_options['geocoding_mapquest_geocoding_api_key'] == NULL) { $option_mapquest_inactive = ''; $option_mapquest_active = ''; } else { $option_mapquest_active = ''; $option_mapquest_inactive = ''; } //info: check if Google Geocoding API key is set $geocoding_provider_google_disabled = ''; if ( ( ($lmm_options['geocoding_google_geocoding_auth_method'] == 'api-key') && ($lmm_options['geocoding_google_geocoding_api_key'] == NULL) ) || ( ($lmm_options['geocoding_google_geocoding_auth_method'] == 'clientid-signature') && (($lmm_options['geocoding_google_geocoding_premium_client'] == NULL) || ($lmm_options['geocoding_google_geocoding_premium_signature'] == NULL)) ) ) { $option_google_inactive = ''; $option_google_active = ''; } else { $option_google_active = ''; $option_google_inactive = ''; } echo '' . __('Geocoding provided by','lmm') . ':'; if (current_user_can('activate_plugins')) { echo ''; } echo ' '; echo ''; echo '' . $geocoding_provider_rate_limit_details . ''; ?>
enter your %2$s-API key or select an alternative geocoding provider!','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding-google', 'Google Geocoding', LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding'); $location_input_css = 'background:#ff9999;'; } else if (($lmm_options['geocoding_mapquest_geocoding_api_key'] == NULL) && ($lmm_options['geocoding_provider'] == 'mapquest-geocoding')) { $geocoding_provider_status_text = sprintf(__('Error: please enter your %2$s-API key or select an alternative geocoding provider!','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding-mapquest', 'MapQuest Geocoding', LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding'); $location_input_css = 'background:#ff9999;'; } else if (($lmm_options['geocoding_mapquest_geocoding_api_key'] != NULL) && ($lmm_options['geocoding_provider'] == 'mapquest-geocoding')) { $geocoding_provider_status_text = ' '; $location_input_css = ''; } else if (($lmm_options['geocoding_mapzen_search_api_key'] == NULL) && ($lmm_options['geocoding_provider'] == 'mapzen-search')) { $geocoding_provider_status_text = sprintf(__('Error: please enter your %2$s-API key or select an alternative geocoding provider!','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding-mapzen', 'Mapzen Search', LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding'); $location_input_css = 'background:#ff9999;'; } else if ($lmm_options['geocoding_provider'] == $lmm_options['geocoding_provider_fallback']) { $geocoding_provider_status_text = sprintf(__('Warning: you did not configure an alternative geocoding provider - no fallback will be available if main geocoding provider is unavailable!','lmm'), LEAFLET_WP_ADMIN_URL . 'admin.php?page=leafletmapsmarker_settings#lmm-geocoding'); $location_input_css = 'background:yellow;'; } else { $geocoding_provider_status_text = ' '; $location_input_css = ''; } echo '
' . $geocoding_provider_status_text . '
'; $placeholder_text = ( (intval($lmm_options['geocoding_min_chars_search_autostart']) == 0) || (intval($lmm_options['geocoding_min_chars_search_autostart']) == 1) ) ? esc_attr__('Please enter a location','lmm') : sprintf(esc_attr__('Please enter a location (%1$s characters minimum to start typeahead suggestions)','lmm'), intval($lmm_options['geocoding_min_chars_search_autostart'])); echo ''; //info: needed in free version only for geocoding.js if ($address == NULL) { echo ''; } else { echo ''; } ?> ( )
: :


>    >
px


 
' . __('Global maximum zoom level','lmm') . ': ' . __('pro version only','lmm') . ''; ?>
' . __('Upgrade to pro for assigning markers to multiple layers','lmm') . '
' ?>

" . __('edit layer','lmm') . " (ID ".$layer.") " . __('or','lmm') . "" : "" ?>
preview icon

  


' . __('add','lmm') . ' | ' . __('convert','lmm') . ' | ' . __('merge','lmm') . ' | ' . __('settings','lmm') . ' | ' . __('fit bounds','lmm') . ''; ?>


:
>
>
>
  >

'.PHP_EOL; //info: panel for marker name and API URLs $panel_state = ($panel == 1) ? 'block' : 'none'; echo '
'.PHP_EOL; echo '
'; if ( (isset($lmm_options[ 'defaults_marker_panel_directions' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_directions' ] == 1 ) ) { //info: Google language localization (directions) if ($lmm_options['google_maps_language_localization'] == 'browser_setting') { $google_language = ''; } else if ($lmm_options['google_maps_language_localization'] == 'wordpress_setting') { if ($locale != NULL ) { $google_language = '&hl=' . substr($locale, 0, 2); } else { $google_language = '&hl=en'; } } else { $google_language = '&hl=' . $lmm_options['google_maps_language_localization']; } //info: build directions provider links if ($lmm_options['directions_provider'] == 'googlemaps') { if ( isset($lmm_options['google_maps_base_domain_custom']) && ($lmm_options['google_maps_base_domain_custom'] == NULL) ) { $gmaps_base_domain_directions = $lmm_options['google_maps_base_domain']; } else { $gmaps_base_domain_directions = htmlspecialchars($lmm_options['google_maps_base_domain_custom']); } if ((isset($lmm_options[ 'directions_googlemaps_route_type_walking' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_walking' ] == 1 )) { $directions_transport_type_icon = 'icon-walk.png'; } else { $directions_transport_type_icon = 'icon-car.png'; } if ( $address != NULL ) { $google_from = urlencode($address); } else { $google_from = $lat . ',' . $lon; } $avoidhighways = (isset($lmm_options[ 'directions_googlemaps_route_type_highways' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_highways' ] == 1 ) ? '&dirflg=h' : ''; $avoidtolls = (isset($lmm_options[ 'directions_googlemaps_route_type_tolls' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_tolls' ] == 1 ) ? '&dirflg=t' : ''; $publictransport = (isset($lmm_options[ 'directions_googlemaps_route_type_public_transport' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_public_transport' ] == 1 ) ? '&dirflg=r' : ''; $walking = (isset($lmm_options[ 'directions_googlemaps_route_type_walking' ] ) == TRUE ) && ( $lmm_options[ 'directions_googlemaps_route_type_walking' ] == 1 ) ? '&dirflg=w' : ''; echo ''; } else if ($lmm_options['directions_provider'] == 'yours') { if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'motorcar') { $directions_transport_type_icon = 'icon-car.png'; } else if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'bicycle') { $directions_transport_type_icon = 'icon-bicycle.png'; } else if ($lmm_options[ 'directions_yours_type_of_transport' ] == 'foot') { $directions_transport_type_icon = 'icon-walk.png'; } echo ''; } else if ($lmm_options['directions_provider'] == 'ors') { if ($lmm_options[ 'directions_ors_routeOpt' ] == 'Pedestrian') { $directions_transport_type_icon = 'icon-walk.png'; } else if ($lmm_options[ 'directions_ors_routeOpt' ] == 'Bicycle') { $directions_transport_type_icon = 'icon-bicycle.png'; } else { $directions_transport_type_icon = 'icon-car.png'; } echo ''; } else if ($lmm_options['directions_provider'] == 'bingmaps') { if ( $address != NULL ) { $bing_to = '_' . urlencode($address); } else { $bing_to = ''; } echo ''; } } if ( (isset($lmm_options[ 'defaults_marker_panel_kml' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_kml' ] == 1 ) ) { echo 'KML-Logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_fullscreen' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_fullscreen' ] == 1 ) ) { echo 'Fullscreen-Logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_qr_code' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_qr_code' ] == 1 ) ) { echo 'QR-code-logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_geojson' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_geojson' ] == 1 ) ) { echo 'GeoJSON-Logo'; } if ( (isset($lmm_options[ 'defaults_marker_panel_georss' ] ) == TRUE ) && ( $lmm_options[ 'defaults_marker_panel_georss' ] == 1 ) ) { echo 'GeoRSS-Logo'; } echo '
'.PHP_EOL; echo '
' . (($markername == NULL) ? __('if set, markername will be displayed here','lmm') : stripslashes($markername)) . '
'.PHP_EOL; ?>
" . __("Settings","lmm") . ")" : ""; } else { //info: outside next condition to prevent PHP warnings if disabled $directionslink = ''; $directions_settings_link = ''; //info: needed for geocoding.js, line 426 if ($address == NULL) { echo ''; } else { echo ''; } } ?>

'; } ?> Map Icons Collection', LEAFLET_PLUGIN_ICONS_URL); $mapicons_user = sprintf( __('If you want to use different icons, please visit the %1$s (offering more than 700 compatible icons) and ask your WordPress admin to upload the new icons to the directory %2$s/','lmm'), 'Map Icons Collection', LEAFLET_PLUGIN_ICONS_URL); $upload_icons_button_text = '

' . __('You can also upload the icons by clicking the button "upload new icon"','lmm') . ' (' . __('pro version only','lmm') . ')'; if (current_user_can('activate_plugins')) { echo $mapicons_admin . $upload_icons_button_text; } else { echo $mapicons_user . $upload_icons_button_text; } if (is_multisite()) { $mapicons_directory = sprintf( __('As you are running your blog within a WordPress Multisite installation, please use this icon directory on your server: %2$s/','lmm'), 'Map Icons Collection', LEAFLET_PLUGIN_ICONS_DIR); echo '
' . $mapicons_directory; } ?> '; } ?>

'; if ($icon != NULL) { $filename_without_dots = str_replace('.','_',$icon); //info: dots in not allowed in selectors echo '

'; echo ''; echo '



  >


  


  '; } else { echo ''; } ?>

=' ) ) { $settings = array( 'wpautop' => true, 'tinymce' => array( 'height' => '250', 'content_style' => 'img {' . htmlspecialchars($lmm_options['defaults_marker_popups_image_css']) . '} a {text-decoration:none;} a:hover {text-decoration:underline;}', 'setup' => 'function(ed) { ed.on("keyup", function(ed,e) { var popup_panel = "
"+document.getElementById("address").value+" (' . __('Directions','lmm') . ')' . $directions_settings_link . '
"; marker._popup.setContent(tinymce.activeEditor.getContent()' . $popup_panel . '); unsaved = true; }); //info: remove disabled attribute for HTML editor mode only - text mode see line 2600 ed.on("LoadContent", function(ed, e){ jQuery("#submit_top").removeAttr("disabled"); jQuery("#submit_bottom").removeAttr("disabled"); jQuery("#delete").removeAttr("disabled"); }); }' ), 'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,code,close')); } else { $settings = array( 'wpautop' => true, 'tinymce' => array( 'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,|,fontselect,fontsizeselect,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,outdent,indent,blockquote,|,link,unlink,|,ltr,rtl', 'theme' => 'advanced', 'height' => '250', 'content_style' => 'html .mcecontentbody {font:12px/1.4 "Helvetica Neue",Arial,Helvetica,sans-serif; max-width:' . intval($lmm_options['defaults_marker_popups_maxwidth']) + 1 . 'px; /* Default + 1 fix */ word-wrap:break-word;} .mcecontentbody a {text-decoration:none;} .mcecontentbody a:hover {text-decoration:underline;} .mcecontentbody img {' . htmlspecialchars($lmm_options['defaults_marker_popups_image_css']) . '}', 'theme_advanced_statusbar_location' => 'bottom', 'setup' => 'function(ed) { ed.onKeyUp.add(function(ed, e) { var popup_panel = "
"+document.getElementById("address").value+" (' . __('Directions','lmm') . ')' . $directions_settings_link . '
"; marker._popup.setContent(ed.getContent()' . $popup_panel . '); unsaved = true; }); ed.onInit.add(function(ed) { jQuery("#submit_top").removeAttr("disabled"); jQuery("#submit_bottom").removeAttr("disabled"); jQuery("#delete").removeAttr("disabled"); }); }' ), 'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,code,close')); } $sanitize_popuptext_from = array( '#(\s)*()*(\s)*#si', '#(\s)*()*(\s)*#si', '#(\s)*()*(\s)*#si', '#(\s)*()*(\s)*#si', '#(\s)*()*(\s)*#si', '#(){1}\s*#si', '#(){1}\s*#si', '#\s*(){1}#si', '#\s*(){1}#si', ); $sanitize_popuptext_to = array( '', '', '', '', '', '', '', '', '' ); $popuptext_sanitized = preg_replace($sanitize_popuptext_from, $sanitize_popuptext_to, stripslashes(preg_replace( '/(\015\012)|(\015)|(\012)/','
', $popuptext))); //info: strip evil scripts if ($lmm_options['wp_kses_status'] == 'enabled') { $popuptext_sanitized = wp_kses($popuptext_sanitized, array_merge($allowedposttags, $additionaltags)); } wp_editor( $popuptext_sanitized, 'popuptext', $settings); ?> ( )
' . sprintf( esc_attr__('Note: if you add an image, the following CSS definition will be applied: %1$s','lmm'), '' . htmlspecialchars($lmm_options['defaults_marker_popups_image_css']) . ''); if (current_user_can('activate_plugins')) { echo ' (' . __('Settings','lmm') . ')'; } ?>

(' . __('Settings','lmm') . ')'; } ?>

 
'; } if ( (isset($lmm_options[ 'wms_wms2_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms2_available' ] == 1 ) ) { echo ' 
'; } if ( (isset($lmm_options[ 'wms_wms3_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms3_available' ] == 1 ) ) { echo ' 
'; } if ( (isset($lmm_options[ 'wms_wms4_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms4_available' ] == 1 ) ) { echo ' 
'; } if ( (isset($lmm_options[ 'wms_wms5_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms5_available' ] == 1 ) ) { echo ' 
'; } if ( (isset($lmm_options[ 'wms_wms6_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms6_available' ] == 1 ) ) { echo ' 
'; } if ( (isset($lmm_options[ 'wms_wms7_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms7_available' ] == 1 ) ) { echo ' 
'; } if ( (isset($lmm_options[ 'wms_wms8_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms8_available' ] == 1 ) ) { echo ' 
'; } if ( (isset($lmm_options[ 'wms_wms9_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms9_available' ] == 1 ) ) { echo ' 
'; } if ( (isset($lmm_options[ 'wms_wms10_available' ] ) == TRUE ) && ( $lmm_options[ 'wms_wms10_available' ] == 1 ) ) { echo '  '; } ?>



  

'; echo '
'; echo ''; echo '
'; ?>