www.mapsmarker.com"); } include('inc' . DIRECTORY_SEPARATOR . 'admin-header.php'); global $wpdb, $allowedtags, $locale, $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 global $wp_version; $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 = ''; } $table_name_markers = $wpdb->prefix.'leafletmapsmarker_markers'; $table_name_layers = $wpdb->prefix.'leafletmapsmarker_layers'; $layerlist = $wpdb->get_results('SELECT l.id as lid,l.name as lname FROM `'.$table_name_layers.'` as l WHERE l.multi_layer_map = 0 and l.id != 0 ORDER BY l.id ASC', ARRAY_A); $action = isset($_POST['action']) ? $_POST['action'] : (isset($_GET['action']) ? $_GET['action'] : ''); $oid = isset($_POST['id']) ? intval($_POST['id']) : (isset($_GET['id']) ? intval($_GET['id']) : ''); $lat_check = isset($_POST['layerviewlat']) ? $_POST['layerviewlat'] : (isset($_GET['layerviewlat']) ? $_GET['layerviewlat'] : ''); $lon_check = isset($_POST['layerviewlon']) ? $_POST['layerviewlon'] : (isset($_GET['layerviewlon']) ? $_GET['layerviewlon'] : ''); $layerid = isset($_GET['layerid']) ? intval($_GET['layerid']) : ''; //info: for switcheditor-js-forward if (!empty($action)) { $layernonce = isset($_POST['_wpnonce']) ? $_POST['_wpnonce'] : (isset($_GET['_wpnonce']) ? $_GET['_wpnonce'] : ''); if (! wp_verify_nonce($layernonce, 'layer-nonce') ) { die('
'.__('Security check failed - please call this function from the according admin page!','lmm').''); }; 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'; $panel_checkbox = isset($_POST['panel']) ? '1' : '0'; $layername_quotes = str_replace("\\\\","/", str_replace("\"","'", sanitize_text_field($_POST['name']))); //info: backslash and double quotes break geojson $address = preg_replace("/(\\\\)(?!')/","/", preg_replace("/\t/", " ", sanitize_text_field($_POST['address']))); //info: tabs break geojson $multi_layer_map_checkbox = isset($_POST['multi_layer_map']) ? '1' : '0'; $mlm_checked_imploded = isset($_POST['mlm-all']) ? 'all' : ''; $clustering = '1'; //info: added for compat $gpx_url = ''; //info: added for compat $gpx_panel_checkbox = '0'; //info: added for compat if ($mlm_checked_imploded != 'all') { $mlm_checked_temp = ''; foreach ($layerlist as $mlmrow){ $mlm_checked{$mlmrow['lid']} = isset($_POST['mlm-'.$mlmrow['lid'].'']) ? $mlmrow['lid'].',' : ''; $mlm_checked_temp .= $mlm_checked{$mlmrow['lid']}; } $mlm_checked_imploded = substr($mlm_checked_temp, 0, -1); } $result = $wpdb->prepare( "INSERT INTO `$table_name_layers` (`name`, `basemap`, `layerzoom`, `mapwidth`, `mapwidthunit`, `mapheight`, `panel`, `layerviewlat`, `layerviewlon`, `createdby`, `createdon`, `updatedby`, `updatedon`, `controlbox`, `overlays_custom`, `overlays_custom2`, `overlays_custom3`, `overlays_custom4`, `wms`, `wms2`, `wms3`, `wms4`, `wms5`, `wms6`, `wms7`, `wms8`, `wms9`, `wms10`, `listmarkers`, `multi_layer_map`, `multi_layer_map_list`, `address`, `clustering`, `gpx_url`, `gpx_panel` ) VALUES (%s, %s, %d, %d, %s, %d, %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %s, %s, %d, %s, %d)", $layername_quotes, $_POST['basemap'], $_POST['layerzoom'], $_POST['mapwidth'], $_POST['mapwidthunit'], $_POST['mapheight'], $panel_checkbox, str_replace(',', '.', floatval($_POST['layerviewlat'])), str_replace(',', '.', floatval($_POST['layerviewlon'])), $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, $_POST['listmarkers'], $multi_layer_map_checkbox, $mlm_checked_imploded, $address, $clustering, $gpx_url, $gpx_panel_checkbox ); $wpdb->query( $result ); $wpdb->query( "OPTIMIZE TABLE `$table_name_layers`" ); 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'; $panel_checkbox = isset($_POST['panel']) ? '1' : '0'; $layername_quotes = str_replace("\\\\","/", str_replace("\"","'", $_POST['name'])); //info: backslash and double quotes break geojson $address = preg_replace("/(\\\\)(?!')/","/", preg_replace("/\t/", " ", $_POST['address'])); //info: tabs break geojson $multi_layer_map_checkbox = isset($_POST['multi_layer_map']) ? '1' : '0'; $mlm_checked_imploded = isset($_POST['mlm-all']) ? 'all' : ''; $clustering = '1'; //info: added for compat $gpx_url = ''; //info: added for compat $gpx_panel_checkbox = '0'; //info: added for compat if ($mlm_checked_imploded != 'all') { $mlm_checked_temp = ''; foreach ($layerlist as $mlmrow){ $mlm_checked{$mlmrow['lid']} = isset($_POST['mlm-'.$mlmrow['lid'].'']) ? $mlmrow['lid'].',' : ''; $mlm_checked_temp .= $mlm_checked{$mlmrow['lid']}; } $mlm_checked_imploded = substr($mlm_checked_temp, 0, -1); } $result = $wpdb->prepare( "UPDATE `$table_name_layers` SET `name` = %s, `basemap` = %s, `layerzoom` = %d, `mapwidth` = %d, `mapwidthunit` = %s, `mapheight` = %d, `panel` = %d, `layerviewlat` = %s, `layerviewlon` = %s, `updatedby` = %s, `updatedon` = %s, `controlbox` = %d, `overlays_custom` = %d, `overlays_custom2` = %d, `overlays_custom3` = %d, `overlays_custom4` = %d, `wms` = %d, `wms2` = %d, `wms3` = %d, `wms4` = %d, `wms5` = %d, `wms6` = %d, `wms7` = %d, `wms8` = %d, `wms9` = %d, `wms10` = %d, `listmarkers` = %d, `multi_layer_map` = %d, `multi_layer_map_list` = %s, `address` = %s, `clustering` = %d, `gpx_url` = %s, `gpx_panel` = %d WHERE `id` = %d", $layername_quotes, $_POST['basemap'], $_POST['layerzoom'], $_POST['mapwidth'], $_POST['mapwidthunit'], $_POST['mapheight'], $panel_checkbox, str_replace(',', '.', $_POST['layerviewlat']), str_replace(',', '.', $_POST['layerviewlon']), $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, $_POST['listmarkers'], $multi_layer_map_checkbox, $mlm_checked_imploded, $address, $clustering, $gpx_url, $gpx_panel_checkbox, $oid ); $wpdb->query( $result ); $wpdb->query( "OPTIMIZE TABLE `$table_name_layers`" ); echo ' '; } else { echo '

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

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

'; } } elseif ($action == 'deleteboth') { $result = $wpdb->prepare( "DELETE FROM `$table_name_markers` WHERE `layer` = %d", $oid ); $wpdb->query( $result ); $result2 = $wpdb->prepare( "DELETE FROM `$table_name_layers` WHERE `id` = %d", $oid ); $wpdb->query( $result2 ); $wpdb->query( "OPTIMIZE TABLE `$table_name_layers`" ); echo '

' . __('Layer and assigned markers have been successfully deleted','lmm') . '
' . __('list all layers','lmm') . '   ' . __('add new layer','lmm') . '

'; } elseif ($action == 'delete') { $result = $wpdb->prepare( "UPDATE `$table_name_markers` SET `layer` = 0 WHERE `layer` = %d", $oid ); $wpdb->query( $result ); $result2 = $wpdb->prepare( "DELETE FROM `$table_name_layers` WHERE `id` = %d", $oid ); $wpdb->query( $result2 ); $wpdb->query( "OPTIMIZE TABLE `$table_name_layers`" ); echo '
' . __('Layer has been successfully deleted (assigned markers have not been deleted)','lmm') . '

' . __('list all layers','lmm') . '   ' . __('add new layer','lmm') . '

'; } elseif ($action == 'switcheditor') { if ($new_editor == 'advanced') { update_option( 'leafletmapsmarker_editor', $new_editor ); if ( $layerid != NULL ) { echo ' '; } else { echo ' '; } } else if ($new_editor == 'simplified') { update_option( 'leafletmapsmarker_editor', $new_editor ); if ( $layerid != NULL ) { echo ' '; } else { echo ' '; } } } } else { global $current_user; wp_get_current_user(); $id = ''; $name = ''; $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'; } $layerviewlat = str_replace(',', '.', floatval($lmm_options[ 'defaults_layer_lat' ])); $layerviewlon = str_replace(',', '.', floatval($lmm_options[ 'defaults_layer_lon' ])); $layerzoom = intval($lmm_options[ 'defaults_layer_zoom' ]); $mapwidth = intval($lmm_options[ 'defaults_layer_mapwidth' ]); $mapwidthunit = $lmm_options[ 'defaults_layer_mapwidthunit' ]; $mapheight = intval($lmm_options[ 'defaults_layer_mapheight' ]); $panel = $lmm_options[ 'defaults_layer_panel' ]; $lcreatedby = ''; $lcreatedon = ''; $lupdatedby = ''; $lupdatedon = ''; $lcontrolbox = $lmm_options[ 'defaults_layer_controlbox' ]; $loverlays_custom = ( (isset($lmm_options[ 'defaults_layer_overlays_custom_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_overlays_custom_active' ] == 1 ) ) ? '1' : '0'; $loverlays_custom2 = ( (isset($lmm_options[ 'defaults_layer_overlays_custom2_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_overlays_custom2_active' ] == 1 ) ) ? '1' : '0'; $loverlays_custom3 = ( (isset($lmm_options[ 'defaults_layer_overlays_custom3_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_overlays_custom3_active' ] == 1 ) ) ? '1' : '0'; $loverlays_custom4 = ( (isset($lmm_options[ 'defaults_layer_overlays_custom4_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_overlays_custom4_active' ] == 1 ) ) ? '1' : '0'; $wms = ( (isset($lmm_options[ 'defaults_layer_wms_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms_active' ] == 1 ) ) ? '1' : '0'; $wms2 = ( (isset($lmm_options[ 'defaults_layer_wms2_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms2_active' ] == 1 ) ) ? '1' : '0'; $wms3 = ( (isset($lmm_options[ 'defaults_layer_wms3_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms3_active' ] == 1 ) ) ? '1' : '0'; $wms4 = ( (isset($lmm_options[ 'defaults_layer_wms4_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms4_active' ] == 1 ) ) ? '1' : '0'; $wms5 = ( (isset($lmm_options[ 'defaults_layer_wms5_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms5_active' ] == 1 ) ) ? '1' : '0'; $wms6 = ( (isset($lmm_options[ 'defaults_layer_wms6_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms6_active' ] == 1 ) ) ? '1' : '0'; $wms7 = ( (isset($lmm_options[ 'defaults_layer_wms7_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms7_active' ] == 1 ) ) ? '1' : '0'; $wms8 = ( (isset($lmm_options[ 'defaults_layer_wms8_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms8_active' ] == 1 ) ) ? '1' : '0'; $wms9 = ( (isset($lmm_options[ 'defaults_layer_wms9_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms9_active' ] == 1 ) ) ? '1' : '0'; $wms10 = ( (isset($lmm_options[ 'defaults_layer_wms10_active' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_wms10_active' ] == 1 ) ) ? '1' : '0'; $llistmarkers = $lmm_options[ 'defaults_layer_listmarkers' ]; $multi_layer_map = 0; $multi_layer_map_list = array(); $multi_layer_map_list_exploded = array(); $laddress = ''; $markercount = 0; $isedit = isset($_GET['id']); if ($isedit) { $id = intval($_GET['id']); $row = $wpdb->get_row('SELECT l.id as lid, l.name as lname, l.basemap as lbasemap, l.layerzoom as llayerzoom, l.mapwidth as lmapwidth, l.mapwidthunit as lmapwidthunit, l.mapheight as lmapheight, l.panel as lpanel, l.layerviewlat as llayerviewlat, l.layerviewlon as llayerviewlon, l.createdby as lcreatedby, l.createdon as lcreatedon, l.updatedby as lupdatedby, l.updatedon as lupdatedon, l.controlbox as lcontrolbox, l.overlays_custom as loverlays_custom, l.overlays_custom2 as loverlays_custom2, l.overlays_custom3 as loverlays_custom3, l.overlays_custom4 as loverlays_custom4,l.wms as lwms, l.wms2 as lwms2, l.wms3 as lwms3, l.wms4 as lwms4, l.wms5 as lwms5, l.wms6 as lwms6, l.wms7 as lwms7, l.wms8 as lwms8, l.wms9 as lwms9, l.wms10 as lwms10, l.listmarkers as llistmarkers, l.multi_layer_map as lmulti_layer_map, l.address as laddress, m.id as markerid, m.markername as markername, m.lat as mlat, m.lon as mlon, m.icon as micon, m.popuptext as mpopuptext, m.zoom as mzoom, m.mapwidth as mmapwidth, m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight, m.address as maddress FROM `'.$table_name_layers.'` as l LEFT OUTER JOIN `'.$table_name_markers.'` AS m ON l.id=m.layer WHERE l.id='.$id, ARRAY_A); $name = htmlspecialchars($row['lname']); $basemap = $row['lbasemap']; //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'; } $layerzoom = $row['llayerzoom']; $mapwidth = $row['lmapwidth']; $mapwidthunit = $row['lmapwidthunit']; $mapheight = $row['lmapheight']; $layerviewlat = $row['llayerviewlat']; $layerviewlon = $row['llayerviewlon']; $markerid = $row['markerid']; $markername = htmlspecialchars($row['markername']); $mlat = $row['mlat']; $mlon = $row['mlon']; $coords = $mlat.', '.$mlon; $micon = $row['micon']; $popuptext = $row['mpopuptext']; $markerzoom = $row['mzoom']; $markermapwidth = $row['mmapwidth']; $markermapwidthunit = $row['mmapwidthunit']; $markermapheight = $row['mmapheight']; $panel = $row['lpanel']; $lcreatedby = esc_html($row['lcreatedby']); $lcreatedon = $row['lcreatedon']; $lupdatedby = esc_html($row['lupdatedby']); $lupdatedon = $row['lupdatedon']; $lcontrolbox = $row['lcontrolbox']; $loverlays_custom = $row['loverlays_custom']; $loverlays_custom2 = $row['loverlays_custom2']; $loverlays_custom3 = $row['loverlays_custom3']; $loverlays_custom4 = $row['loverlays_custom4']; $wms = $row['lwms']; $wms2 = $row['lwms2']; $wms3 = $row['lwms3']; $wms4 = $row['lwms4']; $wms5 = $row['lwms5']; $wms6 = $row['lwms6']; $wms7 = $row['lwms7']; $wms8 = $row['lwms8']; $wms9 = $row['lwms9']; $wms10 = $row['lwms10']; $llistmarkers = $row['llistmarkers']; $multi_layer_map = $row['lmulti_layer_map']; $multi_layer_map_list = $wpdb->get_var('SELECT l.multi_layer_map_list FROM `'.$table_name_layers.'` as l WHERE l.id='.$id); $multi_layer_map_list_exploded = explode(",", $wpdb->get_var('SELECT l.multi_layer_map_list FROM `'.$table_name_layers.'` as l WHERE l.id='.$id)); $laddress = htmlspecialchars($row['laddress']); //info: markercount if ($multi_layer_map == 0) { $markercount = $wpdb->get_var('SELECT count(*) FROM `'.$table_name_layers.'` as l INNER JOIN `'.$table_name_markers.'` AS m ON l.id=m.layer WHERE l.id='.$id); } else if ( ($multi_layer_map == 1) && ( $multi_layer_map_list == 'all' ) ) { $markercount = intval($wpdb->get_var('SELECT COUNT(*) FROM '.$table_name_markers)); } else if ( ($multi_layer_map == 1) && ( $multi_layer_map_list != NULL ) && ($multi_layer_map_list != 'all') ) { foreach ($multi_layer_map_list_exploded as $mlmrowcount){ $mlm_count_temp{$mlmrowcount} = $wpdb->get_var('SELECT count(*) FROM `'.$table_name_layers.'` as l INNER JOIN `'.$table_name_markers.'` AS m ON l.id=m.layer WHERE l.id='.$mlmrowcount); } $markercount = array_sum($mlm_count_temp); } else if ( ($multi_layer_map == 1) && ( $multi_layer_map_list == NULL ) ) { $markercount = 0; } } //info: sqls for singe and multi-layer-maps if ($id == NULL) { //info: no mysql-query on new layer creation $layer_marker_list = NULL; $layer_marker_list_table = NULL; } else if ($multi_layer_map == 0) { //info: overwrite where statement for new layer maps (otherwise debug error sql statements $layer_marker_list and $layer_marker_list_table if ($id == '') { $sql_where = ''; } else { $sql_where = 'WHERE l.id=' . $id; } $layer_marker_list = $wpdb->get_results('SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `'.$table_name_layers.'` as l INNER JOIN `'.$table_name_markers.'` AS m ON l.id=m.layer ' . $sql_where . ' ORDER BY ' . $lmm_options[ 'defaults_layer_listmarkers_order_by' ] . ' ' . $lmm_options[ 'defaults_layer_listmarkers_sort_order' ] . ' LIMIT ' . intval($lmm_options[ 'defaults_layer_listmarkers_limit' ]), ARRAY_A); $layer_marker_list_table = $wpdb->get_results('SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `'.$table_name_layers.'` as l INNER JOIN `'.$table_name_markers.'` AS m ON l.id=m.layer ' . $sql_where . ' ORDER BY ' . $lmm_options[ 'defaults_layer_listmarkers_order_by' ] . ' ' . $lmm_options[ 'defaults_layer_listmarkers_sort_order' ] . ' LIMIT ' . intval($lmm_options[ 'defaults_layer_listmarkers_limit' ]), ARRAY_A); } else if ($multi_layer_map == 1) { //info: set sort order for multi-layer-maps based on list-marker-setting if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.id') { $sort_order_mlm = 'markerid'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.markername') { $sort_order_mlm = 'markername'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.popuptext') { $sort_order_mlm = 'mpopuptext'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.icon') { $sort_order_mlm = 'micon'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.createdby') { $sort_order_mlm = 'mcreatedby'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.createdon') { $sort_order_mlm = 'mcreatedon'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.updatedby') { $sort_order_mlm = 'mupdatedby'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.updatedon') { $sort_order_mlm = 'mupdatedon'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.layer') { $sort_order_mlm = 'mlayer'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.address') { $sort_order_mlm = 'maddress'; } else if ( $lmm_options['defaults_layer_listmarkers_order_by'] == 'm.kml_timestamp') { $sort_order_mlm = 'mkml_timestamp'; } if ( (count($multi_layer_map_list_exploded) == 1) && ($multi_layer_map_list != 'all') && ($multi_layer_map_list != NULL) ) { //info: only 1 layer selected $mlm_query = "SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $multi_layer_map_list . "' ORDER BY " . $sort_order_mlm . " " . $lmm_options[ 'defaults_layer_listmarkers_sort_order' ] . " LIMIT " . intval($lmm_options[ 'defaults_layer_listmarkers_limit' ]); $layer_marker_list = $wpdb->get_results($mlm_query, ARRAY_A); $mlm_query_table = "(SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM " . $table_name_layers . " as l INNER JOIN " . $table_name_markers . " AS m ON l.id=m.layer WHERE l.id='" . $multi_layer_map_list . "')"; $mlm_query_table .= " ORDER BY " . $sort_order_mlm . " " . $lmm_options['defaults_layer_listmarkers_sort_order'] . " LIMIT " . intval($lmm_options['defaults_layer_listmarkers_limit']) . ""; $layer_marker_list_table = $wpdb->get_results($mlm_query_table, ARRAY_A); } //info: end (count($multi_layer_map_list_exploded) == 1) && ($multi_layer_map_list != 'all') && ($multi_layer_map_list != NULL) else if ( (count($multi_layer_map_list_exploded) > 1 ) && ($multi_layer_map_list != 'all') ) { $first_mlm_id = $multi_layer_map_list_exploded[0]; $other_mlm_ids = array_slice($multi_layer_map_list_exploded,1); $mlm_query = "(SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $first_mlm_id . "')"; foreach ($other_mlm_ids as $row) { $mlm_query .= " UNION (SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $row . "')"; } $mlm_query .= " ORDER BY " . $sort_order_mlm . " " . $lmm_options['defaults_layer_listmarkers_sort_order'] . " LIMIT " . intval($lmm_options['defaults_layer_listmarkers_limit']) . ""; $layer_marker_list = $wpdb->get_results($mlm_query, ARRAY_A); $mlm_query_table = "(SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $first_mlm_id . "')"; foreach ($other_mlm_ids as $row) { $mlm_query_table .= " UNION (SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $row . "')"; } $mlm_query_table .= " ORDER BY " . $sort_order_mlm . " " . $lmm_options['defaults_layer_listmarkers_sort_order'] . " LIMIT " . intval($lmm_options['defaults_layer_listmarkers_limit']) . ""; $layer_marker_list_table = $wpdb->get_results($mlm_query_table, ARRAY_A); } //info: end else if ( (count($multi_layer_map_list_exploded) > 1 ) && ($multi_layer_map_list != 'all') else if ($multi_layer_map_list == 'all') { $first_mlm_id = '0'; $mlm_all_layers = $wpdb->get_results( "SELECT `id` FROM `$table_name_layers`", ARRAY_A ); $other_mlm_ids = array_slice($mlm_all_layers,1); $mlm_query = "(SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $first_mlm_id . "')"; foreach ($other_mlm_ids as $row) { $mlm_query .= " UNION (SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $row['id'] . "')"; } $mlm_query .= " ORDER BY " . $sort_order_mlm . " " . $lmm_options['defaults_layer_listmarkers_sort_order'] . " LIMIT " . intval($lmm_options['defaults_layer_listmarkers_limit']) . ""; $layer_marker_list = $wpdb->get_results($mlm_query, ARRAY_A); $mlm_query_table = "(SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $first_mlm_id . "')"; foreach ($other_mlm_ids as $row) { $mlm_query_table .= " UNION (SELECT l.id as lid,l.name as lname,l.mapwidth as lmapwidth,l.mapheight as lmapheight,l.mapwidthunit as lmapwidthunit,l.layerzoom as llayerzoom,l.layerviewlat as llayerviewlat,l.layerviewlon as llayerviewlon, l.address as laddress, m.lon as mlon, m.lat as mlat, m.icon as micon, m.popuptext as mpopuptext,m.markername as markername,m.id as markerid,m.mapwidth as mmapwidth,m.mapwidthunit as mmapwidthunit,m.mapheight as mmapheight,m.zoom as mzoom,m.openpopup as mopenpopup, m.basemap as mbasemap, m.controlbox as mcontrolbox, m.createdby as mcreatedby, m.createdon as mcreatedon, m.updatedby as mupdatedby, m.updatedon as mupdatedon, m.address as maddress, m.layer as mlayer, m.kml_timestamp as mkml_timestamp FROM `" . $table_name_layers . "` as l INNER JOIN `" . $table_name_markers . "` AS m ON l.id=m.layer WHERE l.id='" . $row['id'] . "')"; } $mlm_query_table .= " ORDER BY " . $sort_order_mlm . " " . $lmm_options['defaults_layer_listmarkers_sort_order'] . " LIMIT " . intval($lmm_options['defaults_layer_listmarkers_limit']) . ""; $layer_marker_list_table = $wpdb->get_results($mlm_query_table, ARRAY_A); } //info: end else if ($multi_layer_map_list == 'all') else { //info: if ($multi_layer_map == 1) but no layers selected $layer_marker_list_table = array(); } } //info: end main - else if ($multi_layer_map == 1) //info: check if layer exists - part 1 if ($layerviewlat === NULL) { $error_layer_not_exists = sprintf( esc_attr__('Error: a layer with the ID %1$s does not exist!','lmm'), htmlspecialchars($_GET['id'])); echo '

' . $error_layer_not_exists . '

'; echo '

' . __('list all layers','lmm') . '   ' . __('add new layer','lmm') . '

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

' . __('Layer 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 ''; } ?>

' . __('add new marker to this layer','lmm') . '' : ''; echo $multi_layer_map_edit_button; ?>
>>>

style="width:206px;background:#f3efef;" type="text" value="[ 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 ''; ?> ( )
: :


>    >
px


 
' . __('Global maximum zoom level','lmm') . ': ' . __('pro version only','lmm') . ''; ?>

>
>


'; _e('Max. number of markers to display:','lmm'); echo ' ' . intval($lmm_options[ 'defaults_layer_listmarkers_limit' ]); if (current_user_can('activate_plugins')) { echo ' (' . __('Settings','lmm') . ')'; } echo ''; ?>
   (' . __('Settings','lmm') . ')'; } ?>

  


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


:
>
>
>
  >
'.PHP_EOL; //info: panel for layer name and API URLs $panel_state = ($panel == 1) ? 'block' : 'none'; echo '
'.PHP_EOL; echo '
'; if ( (isset($lmm_options[ 'defaults_layer_panel_kml' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_kml' ] == 1 ) ) { echo 'KML-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_fullscreen' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_fullscreen' ] == 1 ) ) { echo 'Fullscreen-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_qr_code' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_qr_code' ] == 1 ) ) { echo 'QR-code-logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_geojson' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_geojson' ] == 1 ) ) { if ($multi_layer_map == 0 ) { $geojson_api_link = $id; } else { $geojson_api_link = $multi_layer_map_list; } echo 'GeoJSON-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_panel_georss' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_panel_georss' ] == 1 ) ) { echo 'GeoRSS-Logo'; } echo '
'.PHP_EOL; echo '
' . (($name == NULL) ? __('if set, layername will be displayed here','lmm') : stripslashes($name)) . '
'.PHP_EOL; ?>
'.PHP_EOL; //info: set list markers width to be 100% of maps width if ($mapwidthunit == '%') { $layer_marker_list_width = '100%'; } else { $layer_marker_list_width = $mapwidth.$mapwidthunit; } echo ''; if ($markercount == 0) { echo ''; echo ''; } else { if ($layer_marker_list != NULL) { //info: to prevent PHP errors foreach ($layer_marker_list as $row){ if ( (isset($lmm_options[ 'defaults_layer_listmarkers_show_icon' ]) == TRUE ) && ($lmm_options[ 'defaults_layer_listmarkers_show_icon' ] == 1 ) ) { echo ''; } //info: end foreach } //info: end ($layer_marker_list != NULL) } //info: end $isedit //info: adding info if more markers are available than listed in markers list if ($markercount > $lmm_options[ 'defaults_layer_listmarkers_limit' ]) { $asc_desc = ($lmm_options['defaults_layer_listmarkers_sort_order'] == 'ASC') ? __('ascending','lmm') : __('descending','lmm'); if ($lmm_options['defaults_layer_listmarkers_order_by'] == 'm.id') { $orderby = 'ID'; } else if ($lmm_options['defaults_layer_listmarkers_order_by'] == 'm.markername') { $orderby = __('marker name','lmm'); } else if ($lmm_options['defaults_layer_listmarkers_order_by'] == 'm.createdon') { $orderby = __('created on','lmm'); } else if ($lmm_options['defaults_layer_listmarkers_order_by'] == 'm.updatedon') { $orderby = __('updated on','lmm'); } else if ($lmm_options['defaults_layer_listmarkers_order_by'] == 'm.layer') { $orderby = __('layer ID','lmm'); } else if ($lmm_options['defaults_layer_listmarkers_order_by'] == 'm.address') { $orderby = __('address','lmm'); } echo ''; } ?>
  
'.__('Markers assigned to this layer will be listed here', 'lmm').'
'; if ($row['micon'] != null) { echo ''; } else { echo ''; }; } else { echo '
'; } echo '
'; if ( (isset($lmm_options[ 'defaults_layer_listmarkers_api_directions' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_listmarkers_api_directions' ] == 1 ) ) { 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 ( $row['maddress'] != NULL ) { $google_from = urlencode($row['maddress']); } else { $google_from = $row['mlat'] . ',' . $row['mlat']; } $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' : ''; //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']; } 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 ( $row['maddress'] != NULL ) { $bing_to = '_' . urlencode($row['maddress']); } else { $bing_to = ''; } echo ''; } } if ( (isset($lmm_options[ 'defaults_layer_listmarkers_api_fullscreen' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_listmarkers_api_fullscreen' ] == 1 ) ) { echo ' Fullscreen-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_listmarkers_api_kml' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_listmarkers_api_kml' ] == 1 ) ) { echo ' KML-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_listmarkers_api_qr_code' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_listmarkers_api_qr_code' ] == 1 ) ) { echo ' QR-code-logo'; } if ( (isset($lmm_options[ 'defaults_layer_listmarkers_api_geojson' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_listmarkers_api_geojson' ] == 1 ) ) { echo ' GeoJSON-Logo'; } if ( (isset($lmm_options[ 'defaults_layer_listmarkers_api_georss' ] ) == TRUE ) && ( $lmm_options[ 'defaults_layer_listmarkers_api_georss' ] == 1 ) ) { echo ' GeoRSS-Logo'; } echo '
'; if ( (isset($lmm_options[ 'defaults_layer_listmarkers_show_markername' ]) == TRUE ) && ($lmm_options[ 'defaults_layer_listmarkers_show_markername' ] == 1 ) ) { echo '' . stripslashes(htmlspecialchars($row['markername'])) . ' (' . __('edit','lmm') . ')'; } if ( (isset($lmm_options[ 'defaults_layer_listmarkers_show_popuptext' ]) == TRUE ) && ($lmm_options[ 'defaults_layer_listmarkers_show_popuptext' ] == 1 ) ) { $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)/','
', $row['mpopuptext']))); //info: strip evil scripts if ($lmm_options['wp_kses_status'] == 'enabled') { $popuptext_sanitized = wp_kses($popuptext_sanitized, array_merge($allowedposttags, $additionaltags)); } echo '
' . $popuptext_sanitized . ''; } if ( (isset($lmm_options[ 'defaults_layer_listmarkers_show_address' ]) == TRUE ) && ($lmm_options[ 'defaults_layer_listmarkers_show_address' ] == 1 ) ) { if ( $row['mpopuptext'] == NULL ) { echo stripslashes(htmlspecialchars($row['maddress'])); } else if ( ($row['mpopuptext'] != NULL) && ($row['maddress'] != NULL) ) { echo '
' . stripslashes(htmlspecialchars($row['maddress'])) . '
'; } } echo '
' . sprintf(__('The table above is listing %1s out of %2s markers (sorted by %3s %4s)','lmm'), intval($lmm_options[ 'defaults_layer_listmarkers_limit' ]), $markercount, $orderby, $asc_desc) . '

  >





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

'.PHP_EOL; echo __('Please select the layers, whose markers you would like to display on this multi layer map.','lmm') . ' ' . __('The following features are not supported for multi layer maps: adding markers directly and dynamic preview on backend.','lmm') . ' ' . __('Please do not change an existing layer map with assigned markers into a multi layer map, as those assigned markers will not be displayed on the multi layer map!','lmm').PHP_EOL; $mlm_checked_all = ( in_array('all', $multi_layer_map_list_exploded) ) ? ' checked="checked"' : ''; echo '



' . __('Display markers from selected layers only','lmm') . '
'; $pro_feature_banner_inline = ' '; echo ''; if ($layerlist == NULL) { echo ''; } else { foreach ($layerlist as $mlmrow){ $mlm_markercount = $wpdb->get_var('SELECT count(*) FROM `'.$table_name_layers.'` as l INNER JOIN '.$table_name_markers.' AS m ON l.id=m.layer WHERE l.id='.$mlmrow['lid']); if ( in_array($mlmrow['lid'], $multi_layer_map_list_exploded) ) { $mlm_checked{$mlmrow['lid']} = ' checked="checked"'; } else { $mlm_checked{$mlmrow['lid']} = ''; } if ( ($id != $mlmrow['lid']) || ($mlm_markercount != 0) ) { //info: make current layer selectable for MLM if has markers only echo ''; } } }; echo '
ID ' . __('layer name','lmm') . ' ' . __('marker count','lmm') . ' ' . __('add layer to filter controlbox?','lmm') . '' . $pro_feature_banner_inline . ' ' . __('icon url for filter controlbox','lmm') . '' . $pro_feature_banner_inline . ' ' . __('name for filter controlbox','lmm') . '' . $pro_feature_banner_inline . '
' . __('No layer has been created yet','lmm') . '
' . $mlmrow['lid'] . ' ' . stripslashes(htmlspecialchars($mlmrow['lname'])) . ' ' . $mlm_markercount . '
'; echo ''.PHP_EOL; ?>

(' . __('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 '  '; } ?>
  

:
' . __('add new marker to this layer','lmm') . '' : ''; echo $multi_layer_map_edit_button; ?>
>>>

:

" . __('add new marker to this layer','lmm') . ""; } ?>

' . __('delete','lmm') . ''; } else { $delete_link_marker = ''; } if (count($layer_marker_list_table) < 1) echo ''; else foreach ($layer_marker_list_table as $row){ //info: set column display variables - need for for-each $column_layer_name = ''; $column_address = ((isset($lmm_options[ 'misc_marker_listing_columns_address' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_address' ] == 1 )) ? '' : ''; $column_openpopup = ((isset($lmm_options[ 'misc_marker_listing_columns_openpopup' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_openpopup' ] == 1 )) ? '' : ''; $column_coordinates = ((isset($lmm_options[ 'misc_marker_listing_columns_coordinates' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_coordinates' ] == 1 )) ? '' : ''; $column_mapsize = ((isset($lmm_options[ 'misc_marker_listing_columns_mapsize' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_mapsize' ] == 1 )) ? '' : ''; $column_zoom = ((isset($lmm_options[ 'misc_marker_listing_columns_zoom' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_zoom' ] == 1 )) ? '' : ''; $column_controlbox = ((isset($lmm_options[ 'misc_marker_listing_columns_controlbox' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_controlbox' ] == 1 )) ? '' : ''; $column_shortcode = ((isset($lmm_options[ 'misc_marker_listing_columns_shortcode' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_shortcode' ] == 1 )) ? '' : ''; $column_kml = ((isset($lmm_options[ 'misc_marker_listing_columns_kml' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_kml' ] == 1 )) ? '' : ''; $column_fullscreen = ((isset($lmm_options[ 'misc_marker_listing_columns_fullscreen' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_fullscreen' ] == 1 )) ? '' : ''; $column_qr_code = ((isset($lmm_options[ 'misc_marker_listing_columns_qr_code' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_qr_code' ] == 1 )) ? '' : ''; $column_geojson = ((isset($lmm_options[ 'misc_marker_listing_columns_geojson' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_geojson' ] == 1 )) ? '' : ''; $column_georss = ((isset($lmm_options[ 'misc_marker_listing_columns_georss' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_georss' ] == 1 )) ? '' : ''; $column_basemap = ((isset($lmm_options[ 'misc_marker_listing_columns_basemap' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_basemap' ] == 1 )) ? '' : ''; $column_createdby = ((isset($lmm_options[ 'misc_marker_listing_columns_createdby' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_createdby' ] == 1 )) ? '' : ''; $column_createdon = ((isset($lmm_options[ 'misc_marker_listing_columns_createdon' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_createdon' ] == 1 )) ? '' : ''; $column_updatedby = ((isset($lmm_options[ 'misc_marker_listing_columns_updatedby' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_updatedby' ] == 1 )) ? '' : ''; $column_updatedon = ((isset($lmm_options[ 'misc_marker_listing_columns_updatedon' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_updatedon' ] == 1 )) ? '' : ''; $openpopupstatus = ($row['mopenpopup'] == 1) ? __('open','lmm') : __('closed','lmm'); $popuptextabstract = (strlen($row['mpopuptext']) >= 90) ? "...": ""; $column_popuptext = ((isset($lmm_options[ 'misc_marker_listing_columns_popuptext' ] ) == TRUE ) && ( $lmm_options[ 'misc_marker_listing_columns_popuptext' ] == 1 )) ? '' : ''; echo ' ' . $column_address . ' ' . $column_popuptext . ' ' . $column_layer_name . ' ' . $column_openpopup . ' ' . $column_coordinates . ' ' . $column_mapsize . ' ' . $column_zoom . ' ' . $column_basemap . ' ' . $column_createdby . ' ' . $column_createdon . ' ' . $column_updatedby . ' ' . $column_updatedon . ' ' . $column_controlbox . ' ' . $column_shortcode . ' ' . $column_kml . ' ' . $column_fullscreen . ' ' . $column_qr_code . ' ' . $column_geojson . ' ' . $column_georss . ' '; }//info: end foreach ?>
ID KML      GeoJSON  GeoRSS 
ID KML      GeoJSON  GeoRSS 
'.__('No marker assigned to this layer', 'lmm').'
' . $row['lname'] . '' . stripslashes(htmlspecialchars($row['maddress'])) . '' . $row['mopenpopup'] . 'Lat: ' . $row['mlat'] . '
Lon: ' . $row['mlon'] . '
' . __('Width','lmm') . ': '.$row['mmapwidth'].$row['mmapwidthunit'].'
' . __('Height','lmm') . ': '.$row['mmapheight'].'px
' . $row['mzoom'] . ''.$row['mcontrolbox'].'KML-Logo
KML
Fullscreen-Logo
' . __('Fullscreen','lmm') . '
QR-code-logo
' . __('QR code','lmm') . '
GeoJSON-logo
GeoJSON
GeoRSS-logo
GeoRSS
' . $row['mbasemap'] . '' . esc_html($row['mcreatedby']) . '' . $row['mcreatedon'] . '' . esc_html($row['mupdatedby']) . '' . $row['mupdatedon'] . '' . mb_substr(strip_tags(stripslashes($row['mpopuptext'])), 0, 90) . $popuptextabstract . '

" . __('add new marker to this layer','lmm') . ""; } ?>