ank-google-map plugin.')); } if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } /* * Empty option array */ $agm_options=array(); /* * Fetch settings from database once */ $agm_options = get_option('ank_google_map'); if (isset($_POST['save_agm_form'])) { /* * WP inbuilt form security check */ check_admin_referer('agm_form','_wpnonce-agm_form'); /* * Begin sanitize inputs */ $agm_options['plugin_ver'] = esc_attr(AGM_PLUGIN_VERSION); $agm_options['div_width'] = sanitize_text_field($_POST['div_width']); $agm_options['div_height'] = sanitize_text_field($_POST['div_height']); $agm_options['div_width_unit'] = intval(sanitize_text_field($_POST['div_width_unit'])); $agm_options['div_border_color'] = sanitize_text_field($_POST['div_border_color']); $agm_options['map_Lat'] = sanitize_text_field($_POST['map_Lat']); $agm_options['map_Lng'] = sanitize_text_field($_POST['map_Lng']); $agm_options['map_zoom'] = intval($_POST['map_zoom']); $agm_options['map_control_1']=(isset($_POST['map_control_1']))?'1':'0'; $agm_options['map_control_2']=(isset($_POST['map_control_2']))?'1':'0'; $agm_options['map_control_3']=(isset($_POST['map_control_3']))?'1':'0'; $agm_options['map_control_4']=(isset($_POST['map_control_4']))?'1':'0'; $agm_options['map_control_5']=(isset($_POST['map_control_5']))?'1':'0'; $agm_options['map_lang_code'] = sanitize_text_field($_POST['map_lang_code']); $agm_options['map_type'] = intval($_POST['map_type']); $agm_options['marker_on']=(isset($_POST['marker_on']))?'1':'0'; $agm_options['marker_title'] = sanitize_text_field($_POST['marker_title']); $agm_options['marker_anim'] = intval($_POST['marker_anim']); $agm_options['marker_color'] = intval($_POST['marker_color']); $agm_options['info_on']=(isset($_POST['info_on']))?'1':'0'; $agm_options['info_state']=(isset($_POST['info_state']))?'1':'0'; /* * Lets allow some html in info window * This is same as like we make a new post */ $agm_options['info_text'] = balanceTags(wp_kses_post($_POST['info_text']),true); /* * @Regx => http://stackoverflow.com/questions/7549669/php-validate-latitude-longitude-strings-in-decimal-format */ if (!preg_match("/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/", $agm_options['map_Lat'])) { echo "
Nothing saved, Invalid Latitude Value.
"; } elseif (!preg_match("/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/", $agm_options['map_Lng'])) { echo "
Nothing saved, Invalid Longitude Value.
"; } elseif (strlen($agm_options['info_text']) > 1000) { echo "
Nothing saved, Info Window Text should not exceed 1000 characters . Current Length is: " . strlen($agm_options['info_text']) . "
"; } else { /* Save posted data back to database */ update_option('ank_google_map', $agm_options); echo "

Your settings has been saved. You can always use [ank_google_map] shortcode.

"; /*create/update a file that contains js code*/ if($this->agm_create_js()===false){ echo "
Unable to create JS file in plugin directory. Please make this plugin's folder writable.
"; } } /* * Detect if cache is enabled and warn user to flush cache */ if(WP_CACHE){ echo "
It seems that a caching/performance plugin is active on this site. Please manually invalidate/flush that plugin cache to reflect the settings you saved here.
"; } }/*if isset post ends*/ /* * * Display notice if current wp installation does not support color picker */ if(version_compare($GLOBALS['wp_version'],'3.5','<')){ echo "
Color Picker won't work here. Please upgrade your WordPress to latest (v3.5+).
"; } ?>

Ank Google Map Settings

Map Canvas Options

Map Canvas Width: Choose % (percent) to make it responsive
Map Canvas Height: Height will be in px
Border Color: Border will be 1px solid.

Configure Map Options

Latitude:
Quick Tip: Right click on this map to set new Latitude and Longitude values.
You can also drag marker to your desired location to set that point as the new center of map.
Longitude:
Zoom Level:
Disable Controls: type="checkbox" name="map_control_1" id="map_control_1">
type="checkbox" name="map_control_2" id="map_control_2">
type="checkbox" name="map_control_3" id="map_control_3">
type="checkbox" name="map_control_4" id="map_control_4">
type="checkbox" name="map_control_5" id="map_control_5">
Language Code:
Map Type:

Marker Options

Enable marker: type="checkbox" name="marker_on" id="agm_mark_on">
Marker Title: Don't use html tags here (max 200 characters)
Marker Animation:
Marker Color:

Info Window Options

Enable Info Window: type="checkbox" name="info_on" id="agm_info_on">
Info Window State: type="checkbox" name="info_state" id="agm_info_state">
Info Window Text: agm_get_editor(stripslashes($agm_options['info_text']),$agm_options['te_meta_1'],$agm_options['te_meta_2'],$agm_options['te_meta_3']);?> HTML tags are allowed, Max 1000 characters.

Created with ♥ by Ankur Kumar | View on GitHub | View on WordPress.org

Showing Debugging Info:
'; var_dump($agm_options); echo '


'; }?>