/** * gmw_shortcode * * GEO my WP's main shortcode * @param unknown_type $atts */ function gmw_shortcode($atts) { //abort if no attributes found if (empty($atts)) { return; } //get the first attribute of the shortcode. //the first attribute must be the element ( form, search_form, map or search_results ). $element = key($atts); //get the form ID $formId = $atts[$element]; //make sure the element is lagit if (empty($formId) || !in_array($element, array('search_form', 'map', 'search_results', 'form'))) { return; } /** * GEO my WP URL parameteres prefix * * This is the prefix used for the URL paramaters that GEO my WP * uses with submitted form. IT can modified if needed * * @var string */ $gmw_prefix = gmw_get_option('general_settings', 'url_px', 'gmw_'); //modify the URL parameters $_GET = apply_filters('gmw_modify_get_args', $_GET); //if this is results page we get the formId from URL if ($formId == 'results') { if (empty($_GET['action']) || $_GET['action'] != $gmw_prefix . 'post' || empty($_GET[$gmw_prefix . 'form'])) { return; } $formId = absint($_GET[$gmw_prefix . 'form']); $element = 'results_page'; } else { $formId = absint($atts[$element]); } //get the forms from database $forms = get_option('gmw_forms'); //look for the form based on the form ID. Abort if no form was found if (empty($forms[$formId])) { return; } //get the current form $form = $forms[$formId]; //make sure the add-on of the form is activated if (!GEO_my_WP::gmw_check_addon($form['addon'])) { return; } $form['element_triggered'] = $element; $form['params'] = $atts; $form['url_px'] = $gmw_prefix; $form_output = new GMW_Form_Init($form); ob_start(); $form_output->display(); $output_string = ob_get_contents(); ob_end_clean(); return $output_string; }
/** * Get results template fiels * @return multitype:string NULL */ public static function search_results_templates($prefix) { if (GEO_my_WP::gmw_check_addon('posts') != false) { $folder['pt'] = array(GMW_PT_PATH . '/search-results/', 'posts/search-results/'); } if (GEO_my_WP::gmw_check_addon('friends') != false && class_exists('BuddyPress')) { $folder['fl'] = array(GMW_FL_PATH . '/search-results/', 'friends/search-results/'); } $folder = apply_filters('gmw_admin_results_templates_folder', $folder); if (!array_key_exists($prefix, $folder)) { return array(); } $themes = array(); foreach (glob($folder[$prefix][0] . '*', GLOB_ONLYDIR) as $dir) { $themes[basename($dir)] = basename($dir); } $custom_templates = glob(STYLESHEETPATH . '/geo-my-wp/' . $folder[$prefix][1] . '*', GLOB_ONLYDIR); if (!empty($custom_templates)) { foreach ($custom_templates as $dir) { $themes['custom_' . basename($dir)] = 'Custom: ' . basename($dir); } } return $themes; }
} ?> </select> </p> <p> <input type="checkbox" value="1" name="<?php echo $this->get_field_name('scrollwheel'); ?> " <?php if (isset($instance["scrollwheel"])) { echo 'checked="checked"'; } ?> class="checkbox" /> <label><?php echo esc_attr(__('ScrollWheel Enabled', 'GMW')); ?> </label> <em style="font-size:12px;color:#777;display:block;margin:5px 0px;"> <?php _e("When enabled the map will zoom in/out using the mouse scrollwheel.", 'GMW'); ?> </em> </p> <?php } } if (!GEO_my_WP::gmw_check_addon('current_location')) { add_action('widgets_init', create_function('', 'return register_widget( "GMW_Current_Location_Widget_Dep" );')); }
/** * Include core add-ons if needed */ private function core_addons() { //load current_location add-on if (GEO_my_WP::gmw_check_addon('current_location')) { include 'plugins/current-location/loader.php'; } //load single_location add-on if (GEO_my_WP::gmw_check_addon('single_location')) { include 'plugins/single-location/loader.php'; } //load Posts Types locator add-on if (GEO_my_WP::gmw_check_addon('posts')) { include 'plugins/posts/loader.php'; } //load friends locator add-on if (GEO_my_WP::gmw_check_addon('friends')) { include 'plugins/friends/loader.php'; } //load Sweetdate Theme locator add-on if (GEO_my_WP::gmw_check_addon('sweetdate_geolocation')) { include 'plugins/sweetdate-geolocation/loader.php'; } }
/** * Export/Import tab output * * @access public * @since 2.5 * @author Eyal Fitoussi */ function gmw_output_import_export_tab() { ?> <div class="gmw-tabs-table"> <div class="gmw-tabs-table gmw-edit-form-page-nav-tabs gmw-nav-tab-wrapper"> <?php $ei_tabs = array('ei_data' => __('GEO my WP Data', 'GMW')); if (GEO_my_WP::gmw_check_addon('posts')) { $ei_tabs['ei_pt_locations'] = __('Post Types Locations', 'GMW'); $ei_tabs['plugins_importer'] = __('Other Plugins Importer', 'GMW'); } $ei_tabs = apply_filters('gmw_tools_page_import_export_tabs', $ei_tabs); foreach ($ei_tabs as $key => $title) { echo '<span><a href="#settings-' . sanitize_title($key) . '" id="' . sanitize_title($key) . '" title="' . esc_html($title) . '" class="gmw-nav-tab gmw-nav-trigger">' . esc_html($title) . '</a></span>'; } ?> </div> </div> <div id="gmw-import-export-tab-content" class="gmw-tools-tab-content"> <div id="settings-ei_data" class="gmw-settings-panel gmw-import-export-page-tab-wrapper"> <?php do_action('gmw_export_import_top'); ?> <?php do_action('gmw_export_import_before_ei_data'); ?> <!-- Export Settings box --> <div class="postbox"> <div class="inside-top"> <h3> <span><?php _e('Export/Import Data', 'GMW'); ?> </span> </h3> <div class="inside"> <p> <?php _e("Use the Export and Import data forms below to create a back-up file ( .json ) of GEO my WP's data; the settings of GEO my WP and its add-ons, the forms you created and license keys you might have activated.", "GMW"); ?> <br /> <?php _e("You can use the back-up file to restore the data on this site in case that something goes wrong or you could import it into a different site.", "GMW"); ?> <br /> </p> <p> <?php _e("Please follow the steps of each form below for a complete process of exporting and importing your data.", "GMW"); ?> <br /> <br /> <span class="description"> <?php _e("*Note, the license keys should only be imported back to the same site it was exported from. If you need to activate your license keys on a different site you should first deactivate them on this site then activate them back on the other site.", "GMW"); ?> </span> </p> </div> </div> <div class="inside-middle"> <h3> <span><?php _e('Export Data', 'GMW'); ?> </span> </h3> <div class="inside"> <p> <?php _e('To export your data please check the checkboxes of the items that you would like to export then click the "Export" button to create a .json file.', 'GMW'); ?> </p> </strong> <form method="post" action="<?php echo admin_url('admin.php?page=gmw-tools&tab=import_export'); ?> "> <p> <span> <input type="checkbox" class="cb-export-item" name="export_item[]" value="settings" checked="checked" /><?php _e('Settings', 'GMW'); ?> <em class="description"><?php _e('( GEO my WP and its add-ons )', 'GMW'); ?> </em> </span> <span><input type="checkbox" class="cb-export-item" name="export_item[]" value="forms" checked="checked" /><?php _e('Forms', 'GMW'); ?> </span> <span> <input type="checkbox" class="cb-export-item" name="export_item[]" value="licenses" checked="checked" /><?php _e('License Keys', 'GMW'); ?> <em class="description"><?php _e('( exported license keys should only be imported back to this site. )', 'GMW'); ?> </em> </span> </p> <p> <input type="hidden" name="gmw_action" value="export_data" /> <?php wp_nonce_field('gmw_export_data_nonce', 'gmw_export_data_nonce'); ?> <?php submit_button(__('Export', 'GMW'), 'secondary', 'submit', false, array('onclick' => "if ( !jQuery('.cb-export-item').is(':checked') ) { alert('You must check at least one item that you\\'d like to export.'); return false; }")); ?> </p> </form> </div> </div> <!-- .inside --> <div class="inside-bottom"> <h3> <span><?php _e('Import Data', 'GMW'); ?> </span> </h3> <div class="inside"> <p> <?php _e('Import GEO my WP data from a .json file. The file can be created using the export form above.', 'GMW'); ?> </p> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=gmw-tools&tab=import_export'); ?> "> <p> <?php _e("To import data first choose the .json file you would like to use. Then check the checkboxes of the items that you would like to import and click the \"Import\" button.", "GMW"); ?> </p> <p> <input type="file" name="import_file" /> </p> <p> <span><input type="checkbox" class="cb-import-item" name="import_item[]" value="settings" checked="checked" /><?php _e('Settings', 'GMW'); ?> </span> <span><input type="checkbox" class="cb-import-item" name="import_item[]" value="forms" checked="checked" /><?php _e('Forms', 'GMW'); ?> </span> <span><input type="checkbox" class="cb-import-item" name="import_item[]" value="licenses" checked="checked" /> <?php _e('License Keys', 'GMW'); ?> </span> </p> <p> <input type="hidden" name="gmw_action" value="import_data" /> <?php wp_nonce_field('gmw_import_nonce', 'gmw_import_nonce'); ?> <?php submit_button(__('Import', 'GMW'), 'secondary', 'submit', false, array('onclick' => "if ( !jQuery('.cb-import-item').is(':checked') ) { alert('You must check at least one item that you\\'d like to import.'); return false; }")); ?> </p> </form> </div> </div> </div> <!-- .postbox --> <?php do_action('gmw_export_import_after_ei_data'); ?> </div> <div id="settings-ei_pt_locations" class="gmw-settings-panel gmw-import-export-page-tab-wrapper"> <?php do_action('gmw_export_import_before_pt_locations_to_post_meta'); ?> <!-- make sure Post types locator add-on is activated --> <?php if (GEO_my_WP::gmw_check_addon('posts')) { ?> <!-- Import settings box --> <div class="postbox"> <div class="inside-top"> <h3> <span><?php _e("Export/Import Posts Types Locations using GEO my WP's post_meta", "GMW"); ?> </span> </h3> <div class="inside"> <p> <?php _e("The forms below will help you in the process of exporting the post types locations created on this site and importing them into a different site.", "GMW"); ?> <br /> <?php printf(__("The export/import forms below need to be used together with the native <a href=\"%s\" target=\"blank\"> WordPress export system*</a> and <a href=\"%s\" target\"_blank\">WordPress importer*</a> for a complete process.", "GMW"), admin_url('export.php'), admin_url('import.php')); ?> <br /> </p> <p class="description"> <?php _e("*You can use other plugins ( other than the WordPress native plugins mentioned above ) to export/import your WordPress posts. However, the plugins you chose to use must export and import the custom fields of these posts in order to import/export the locations.", "GMW"); ?> </p> <p> <?php _e("Please follow the steps of each form below for a complete process of exporting and importing your post types locations.", "GMW"); ?> <br /> </p> </div> </div> <div class="inside-middle"> <h3> <span><?php _e("Export Posts Types Locations To GEO my WP's post_meta", "GMW"); ?> </span> </h3> <div class="inside"> <ol> <?php global $wpdb; ?> <li> <?php printf(__("Click on the \"Export\" button below. By doing so the plugin will duplicate each post type location created on this site from GEO my WP's custom table ( %splaces_locator ) into a custom field of the post it belongs to.", "GMW"), $wpdb->prefix); ?> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=gmw-tools&tab=import_export'); ?> "> <p> <input type="hidden" name="gmw_action" value="pt_locations_post_meta_export" /> <?php wp_nonce_field('gmw_pt_locations_post_meta_export_nonce', 'gmw_pt_locations_post_meta_export_nonce'); ?> <?php submit_button(__('Export', 'GMW'), 'secondary', 'submit', false); ?> </p> </form> </li> <li><?php printf(__("The next step will be to export your posts using the native <a href=\"%s\" target=\"blank\"> WordPress export system</a>.", "GMW"), admin_url('export.php')); ?> </li> </ol> </div> </div> <!-- .inside --> <div class="inside-bottom"> <h3> <span><?php _e("Import Posts Types Locations From GEO my WP's post_meta", "GMW"); ?> </span> </h3> <div class="inside"> <ol> <li><?php _e("Before importing your locations into this site make sure you used the \"Export\" form above on the original site in order to export your locations.", "GMW"); ?> </li> <li><?php printf(__("Import your posts using <a href=\"%s\" target\"_blank\">WordPress importer</a>. After done so come back to this page to complete step 3.", "GMW"), admin_url('import.php')); ?> </li> <li><?php printf(__("Click on the \"Import\" button. By doing so the plugin will duplicate each post type location from the custom field of the post it belongs to into GEO my WP's custom table in database ( %splaces_locator ).", "GMW"), $wpdb->prefix); ?> </li> </ol> <?php //get all custom fields with gmw location from database $check_pm_locations = $wpdb->get_results("\n\t\t\t\t\t\t\t\tSELECT *\n\t\t\t\t\t\t\t\tFROM `{$wpdb->prefix}postmeta`\n\t\t\t\t\t\t\t\tWHERE `meta_key` = 'gmw_pt_location'", ARRAY_A); //abort if no locations found $check_pm_locations = !empty($check_pm_locations) ? true : false; ?> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=gmw-tools&tab=import_export'); ?> "> <p> <input type="hidden" name="gmw_action" value="pt_locations_post_meta_import" /> <?php wp_nonce_field('gmw_pt_locations_post_meta_import_nonce', 'gmw_pt_locations_post_meta_import_nonce'); ?> <input type="submit" class="button-secondary" value="<?php _e("Import", "GMW"); ?> " <?php if (!$check_pm_locations) { echo 'disabled="disabled"'; } ?> /> <?php echo $check_pm_locations ? '<em style="color:green">' . __('Locations are avalible for import.', "GMW") . '</em>' : '<em style="color:red">' . __('No locations are avalible for import.', "GMW") . '</em>'; ?> </p> </form> </div> </div> </div> <!-- .postbox --> <?php do_action('gmw_export_import_after_pt_locations_to_post_meta'); ?> <?php do_action('gmw_export_import_before_pt_locations_to_custom_post_meta'); ?> <!-- Import settings box --> <div class="postbox"> <div class="inside-top"> <h3> <span><?php _e('Import Posts Types Locations Using Custom post_meta', 'GMW'); ?> </span> </h3> <div class="inside"> <p> <?php _e("Using this form you can import locations to GEO my WP using the custom fields of your choice. This can be helpful when you want to import locations created by other plugin and its location data is being saved in custom fields.", "GMW"); ?> <br /> </p> <p> <?php _e("To import the locations click on the \"Set custom field\" link to see the fields. You can choose a custom field from the dropdown menus for each location component that exists in GEO my WP database table.", "GMW"); ?> <br /> <?php _e("Note that the latitude and longitude fields are mandatory as without both of the fields GEO my WP cannot perform the search query.", "GMW"); ?> <br /> <?php _e("Other than the lat/long fields the rest of the fields are optional and search can be performed without them. However, certain fields might be needed for certain features. ", "GMW"); ?> <br /> </p> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=gmw-tools&tab=import_export'); ?> "> <?php $gmw_settings = get_option('gmw_options'); $saved_field = !empty($gmw_settings['tools_page_options']['gmw_pt_import_custom_post_meta']) ? $gmw_settings['tools_page_options']['gmw_pt_import_custom_post_meta'] : array(); global $wpdb; //get custom fields $cFields = $wpdb->get_col("\n\t\t\t\t\t \tSELECT meta_key\n\t\t\t\t\t \tFROM {$wpdb->postmeta}\n\t\t\t\t\t \tGROUP BY meta_key\n\t\t\t\t\t \tORDER BY meta_id DESC"); if ($cFields) { natcasesort($cFields); } $fieldsArray = array('lat' => __('Latitude ( mandatory )', 'GMW'), 'long' => __('Longitude ( mandatory )', 'GMW'), 'street' => __('Street', 'GMW'), 'apt' => __('Apt', 'GMW'), 'city' => __('City', 'GMW'), 'state' => __('State Short Name ( ex. FL )', 'GMW'), 'state_long' => __('State Long name ( ex. Florida )', 'GMW'), 'zipcode' => __('zipcode', 'GMW'), 'country' => __('Country Short Name ( ex. US )', 'GMW'), 'country_long' => __('Country Long Name ( ex. United States )', 'GMW'), 'address' => __('Address ( address field the way the user enteres )', 'GMW'), 'formatted_address' => __('Formatted Address ( formatted address returned from Google after geocoding )', 'GMW'), 'phone' => __('Phone', 'GMW'), 'fax' => __('Fax', 'GMW'), 'email' => __('Email', 'GMW'), 'website' => __('Website', 'GMW'), 'map_icon' => __('Map Icon', 'GMW')); ?> <a href="#" id="post-meta-fields-toggle" onclick="event.preventDefault(); jQuery('#post-meta-wrapper').slideToggle();"><?php _e('Set Custom Fields', 'GMW'); ?> </a> <div id="post-meta-wrapper" style="display:none"> <?php foreach ($fieldsArray as $name => $title) { ?> <p> <label><?php echo $title; ?> : </label><br /> <select id="gmw-import-custom-field-<?php echo $name; ?> " class="gmw-import-custom-field" name="gmw_post_meta[<?php echo $name; ?> ]"> <option value="" selected="selected"><?php _e('N/A', 'GMW'); ?> <?php foreach ($cFields as $cField) { ?> <option <?php if (!empty($saved_field[$name])) { selected($saved_field[$name], $cField); } ?> value="<?php echo $cField; ?> "><?php echo $cField; ?> </option> <?php } ?> </select> </p> <?php } ?> </div> <p> <input type="hidden" name="gmw_action" value="pt_locations_custom_post_meta_import" /> <?php wp_nonce_field('gmw_pt_locations_custom_post_meta_import_nonce', 'gmw_pt_locations_custom_post_meta_import_nonce'); ?> <input type="submit" id="import-custom-post-meta-submit" class="button-secondary" value="<?php _e("Import", "GMW"); ?> " /> <script> jQuery(document).ready(function($) { $('#import-custom-post-meta-submit').click(function() { if ( $('#gmw-import-custom-field-lat').val() == '' || $('#gmw-import-custom-field-long').val() == '' ) { alert( 'You must have both Latitude and longitude field to be able to import locations' ); return false; }; }); }); </script> </p> </form> </div> </div> </div> <!-- .postbox --> <?php do_action('gmw_export_import_after_pt_locations_to_custom_post_meta'); ?> <?php do_action('gmw_export_import_before_pt_locations_to_csv'); ?> <div class="postbox"> <div class="inside-top"> <h3> <?php _e('Export/Import Post Type Locations using CSV File', 'GMW'); ?> </h3> <div class="inside"> <p> <?php _e("Export/Import locations using CSV file should be used for backup purposes only. The best method for export/import post types locations between different sites is by using the post_meta export/import forms above. ", "GMW"); ?> <br /> <?php _e("Export/import locations between different sites using CSV file can only be done when the posts and thier post ID are equal on both the original site and the target site.", "GMW"); ?> <br /> <?php printf(__("By exporting the locations to CSV file the plugin simply backup GEO my WP's custom database table ( %splaces_locator ) when each location has the post ID it belongs to.", "GMW"), $wpdb->prefix); ?> <br /> <?php _e("And so, when importing the location back from the CSV file the posts from the original site must exists with thier original post ID in the target site. ", "GMW"); ?> <br /> <p> </div> </div> <div class="inside-middle"> <h3> <?php _e('Export Post Type Locations to CSV File', 'GMW'); ?> </h3> <div class="inside"> <p><?php _e("Click the \"Generate CSV\" button to created a CSV back file of the post types locations created on this site.", "GMW"); ?> </p> <p> <form method="post" id="gmw_csv_export_pt_locations"> <input type="hidden" name="gmw_action" value="pt_locations_csv_export"/> <input type="submit" value="<?php _e('Generate CSV', 'GMW'); ?> " class="button-secondary"/> </form> </p> </div><!-- .inside --> </div> <div class="inside-bottom"> <h3> <span><?php _e('Import Post Type Locations From CSV File', 'GMW'); ?> </span> </h3> <div class="inside"> <p> <?php _e("Choose the CSV file you would like to import and click the \"Import\" button to import the locations into GEO my WP's database table.", "GMW"); ?> </p> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=gmw-tools&tab=import_export'); ?> "> <p> <input type="file" name="import_csv_file" /> </p> <p> <input type="hidden" name="gmw_action" value="pt_locations_csv_import" /> <?php wp_nonce_field('gmw_pt_locations_csv_import_nonce', 'gmw_pt_locations_csv_import_nonce'); ?> <?php submit_button(__('Import', 'GMW'), 'secondary', 'submit', false); ?> </p> </form> </div> </div> </div> <?php do_action('gmw_export_import_after_pt_locations_to_csv'); ?> </div> <?php /* ?> <div id="settings-ei_users_locations" class="gmw-settings-panel gmw-import-export-page-tab-wrapper"> <?php do_action( 'gmw_export_import_before_fl_locations_to_csv' ); ?> <div class="postbox"> <div class="inside-top"> <h3> <?php _e('Export/Import Users Locations using CSV File', 'GMW'); ?> </h3> <div class="inside"> <p> <?php _e( "Export/Import locations using CSV file should be used for backup purposes only. The best method for export/import post types locations between different sites is by using the post_meta export/import forms above. ", "GMW" ); ?><br /> <?php _e( "Export/import locations between different sites using CSV file can only be done when the posts and thier post ID are equal on both the original site and the target site.", "GMW" ); ?><br /> <?php printf( __( "By exporting the locations to CSV file the plugin simply backup GEO my WP's custom database table ( %splaces_locator ) when each location has the post ID it belongs to.", "GMW" ), $wpdb->prefix ); ?><br /> <?php _e( "And so, when importing the location back from the CSV file the posts from the original site must exists with thier original post ID in the target site. ", "GMW" ); ?><br /> <p> </div> </div> <div class="inside-middle"> <h3> <?php _e('Export User Locations to CSV File', 'GMW'); ?> </h3> <div class="inside"> <p><?php _e( "Click the \"Generate CSV\" button to created a CSV back file of the post types locations created on this site.", "GMW" ); ?></p> <p> <form method="post" id="gmw_csv_export_pt_locations"> <input type="hidden" name="gmw_action" value="pt_locations_csv_export"/> <input type="submit" value="<?php _e( 'Generate CSV', 'GMW' ); ?>" class="button-secondary"/> </form> </p> </div><!-- .inside --> </div> <div class="inside-bottom"> <h3> <span><?php _e( 'Import User Locations From CSV File', 'GMW' ); ?> </span> </h3> <div class="inside"> <p> <?php _e( "Choose the CSV file you would like to import and click the \"Import\" button to import the locations into GEO my WP's database table.", "GMW" ); ?> </p> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url( 'admin.php?page=gmw-tools&tab=import_export' ); ?>"> <p> <input type="file" name="import_csv_file" /> </p> <p> <input type="hidden" name="gmw_action" value="pt_locations_csv_import" /> <?php wp_nonce_field( 'gmw_pt_locations_csv_import_nonce', 'gmw_pt_locations_csv_import_nonce' ); ?> <?php submit_button( __( 'Import', 'GMW' ), 'secondary', 'submit', false ); ?> </p> </form> </div> </div> </div> <?php do_action( 'gmw_export_import_after_pt_locations_to_csv' ); ?> </div> */ ?> <div id="settings-plugins_importer" class="gmw-settings-panel gmw-import-export-page-tab-wrapper"> <?php do_action('gmw_export_import_before_other_plugins_import'); ?> <div class="postbox"> <div class="inside-top"> <h3> <?php _e('Import Locations From Other Plugins', 'GMW'); ?> </h3> <div class="inside"> <p> <?php _e("Use the forms below to import locations created by different plugins into GEO my WP.", "GMW"); ?> <br /> <p> </div> </div> <div class="inside-middle"> <?php $store_locator_status = is_plugin_active('store-locator/store-locator.php') ? 'active' : 'inactive'; ?> <h3> <?php printf(__('Store Locator Plugin %s', 'GMW'), $store_locator_status == 'inactive' ? ' - <em style="color:red;font-size:12px;">Plugin Inactive</em>' : ''); ?> </h3> <div class="inside"> <p> <?php _e("Use this form to import locations created by <a href=\"https://wordpress.org/plugins/store-locator/\" target=\"_blank\">Store Locator plugin</a>.", "GMW"); ?> <br /> <?php _e("Because Store Locator plugin doesn't use post type with its locations new post will need to be created for each location being imported.", "GMW"); ?> <br /> <?php _e("To import the locations from Store Locator plugin first choose from the drop-down menu the post type you would like be used when importing the locations then click the \"Import\" button.", "GMW"); ?> <br /> </p> <p> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=gmw-tools&tab=import_export'); ?> "> <p> <?php _e("Choose a post type:", "GMW"); ?> </p> <select id="post-type-selector" name="post_type" <?php if ($store_locator_status == 'inactive') { echo 'disabled="disabled"'; } ?> > <?php foreach (get_post_types() as $post_type) { ?> <option value="<?php echo $post_type; ?> "><?php echo $post_type; ?> </option> <?php } ?> </select> <p> <input type="hidden" name="gmw_action" value="store_locator_import" /> <?php wp_nonce_field('gmw_store_locator_import_nonce', 'gmw_store_locator_import_nonce'); ?> <input type="submit" class="button-secondary" <?php if ($store_locator_status == 'inactive') { echo 'disabled="disabled"'; } ?> value="<?php _e('Import', 'GMW'); ?> " /> </p> </form> </p> </div><!-- .inside --> </div> <div class="inside-middle"> <?php $mappress_status = is_plugin_active('mappress-google-maps-for-wordpress/mappress.php') ? 'active' : 'inactive'; ?> <h3> <?php printf(__('Map-Press Plugin %s', 'GMW'), $mappress_status == 'inactive' ? ' - <em style="color:red;font-size:12px;">Plugin Inactive</em>' : ''); ?> </h3> <div class="inside"> <p> <?php _e("Use this form to import locations created by <a href=\"https://wordpress.org/plugins/mappress-google-maps-for-wordpress/\" target=\"_blank\">MapPress Easy Google Maps</a> plugin.", "GMW"); ?> <br /> <br /> <span class="description"> <?php _e("*MapPress allows to creates multiple locations per post where GEO my WP does not have this capability yet. For this reason at the moment GEO my WP will only import the first location of each post. ", "GMW"); ?> <br /> <?php _e("And so, if your posts have multiple locations they will be ignored except for the first one that will be imported. ", "GMW"); ?> <br /> <?php _e("This issue might be improved in the future.", "GMW"); ?> </span> <p> <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=gmw-tools&tab=import_export'); ?> "> <p> <input type="hidden" name="gmw_action" value="mappress_import" /> <?php wp_nonce_field('gmw_mappress_import_nonce', 'gmw_mappress_import_nonce'); ?> <input type="submit" class="button-secondary" <?php if ($mappress_status == 'inactive') { echo 'disabled="disabled"'; } ?> value="<?php _e('Import', 'GMW'); ?> " /> </p> </form> </p> </div><!-- .inside --> </div> </div> </div> <!-- end of addon check --> <?php } ?> <?php do_action('gmw_export_import_bottom'); ?> <?php $current_tab = isset($_COOKIE['gmw_admin_tab']) ? $_COOKIE['gmw_admin_tab'] : false; ?> </div> <script type="text/javascript"> jQuery(document).ready(function($) { if ( '<?php echo $current_tab; ?> ' != false ) { jQuery('#<?php echo $current_tab; ?> ').click(); } }); </script> <?php }