WP Store Locator - Version 2.0

Version Description

  • New: Moved away from a custom db table, the store locations are now registered as custom post types.
  • Note: The upgrade procedure will ask you to convert the current store locations to custom post types. This takes around 1 minute for every 1000 store locations.
  • New: The option to enable/disable permalinks for the stores, and set a custom slug from the settings page.
  • New: Three new shortcodes: [wpsl_map], [wpsl_hours] and [wpsl_address].
  • New: A template attribute for the wpsl shortcode, via Damien Carbery.
  • New: Supports WPML and qTranslate X.
  • New: A textarea on the settings page where you can paste JSON code to create a custom map style.
  • New: The option to hide the search radius dropdown on the frontend.
  • New: A wpsl_geolocation_timeout filter.
  • New: The option to choose between different address formats, and a filter to add custom ones.
  • New: The option to use the InfoBox library to style the info window.
  • New: The option to choose between two different effects when a user hovers over the result list.
  • New: Set the opening hours through dropdowns instead of a textarea.
  • New: Filters that make it possible to add custom store data, and change the HTML structure of the info window and store listing template.
  • New: The option to define a max location load if the auto loading of locations is enabled.
  • New: The option to enable/disable scroll wheel zooming and the map type control on the map.
  • New: Added 'Email' and 'Url' to the labels on the settings page.
  • New: Added a general settings and documentation link to the plugin action links.
  • New: The option to set a max auto zoom level to prevent the auto zoom from zooming to far.
  • New: The option to set a different map type for the location preview.
  • New: A check to see if the SCRIPT_DEBUG constant is set, if this is the case the full scripts are loaded, otherwise the minified scripts are used.
  • New: A wpsl_thumb_size filter that enables you to set the thumb size on the frontend without editing CSS files.
  • New: The option to hide the distance in the store listing.
  • New: Added JS code that prevents a grey map when the store locator is placed in a tab. This does require the use of a #wpsl-map-tab anchor.
  • New: Portuguese translation via Rben Martins.
  • Changed: Better error handling for the Geolocation API.
  • Changed: Regardless of the selected template, the store map is always placed before the store list on smaller screens.
  • Changed: The wp-content/languages folder is checked for translations before using the translations in the plugin folder.
  • Changed: The 'reset map' button now uses an icon font, and is placed in right bottom corner together with a new 'current location' icon.
  • Changed: The cluster marker image will use HTTPS when available.
  • Changed: Increased the default Geolocation timeout from 3000 to 5000 ms.
  • Changed: The geocode requests to the Google Maps API will always use HTTPS.
  • Changed: Instead of curl or file_get_contents the Google Maps API request will now use wp_remote_get.
  • Changed: Replaced the 'wpsl_capability' filter with a 'Store Locator Manager' role.
  • Changed: Added an extra check in JS to prevent the search radius or max results value being set to NaN.
  • Changed: The wpsl_templates filter now expects an id field to be present in the array.
  • Changed: Renamed the 'wpsl_gmap_api_attributes' filter to wpsl_gmap_api_params.
  • Changed: Added the 'enableHighAccuracy' parameter to the Geolocation request to make it more accurate on mobile devices.
  • Fixed: An issue that prevented the settings page from saving the changes on servers that used the mod_security module.
  • Fixed: The pan control option not working on the frontend if it was enabled on the settings page.
  • Fixed: Prevented an empty comma from appearing in the direction URL if the zip code didn't exist.
  • Fixed: Modified the CSS to prevent themes hiding the map images.
  • Fixed: Dragging the store location marker in the store editor would sometimes return the incorrect coordinates.
  • Fixed: The 'Back' button appeared multiple times after the user clicked on the 'Directions' link from different info windows.
  • Fixed: The dropdown fields not being restored to the default values after the 'reset map' button was clicked.
  • Note: Requires at least WP 3.7 instead of WP 3.5.
Download this release

Release Info

Developer tijmensmit
Plugin Icon 128x128 WP Store Locator
Version 2.0
Comparing to
See all releases

Code changes from version 1.2.25 to 2.0

Files changed (52) hide show
  1. admin/class-admin.php +282 -1492
  2. admin/class-geocode.php +217 -0
  3. admin/class-metaboxes.php +871 -0
  4. admin/class-notices.php +89 -0
  5. admin/class-settings.php +1030 -0
  6. admin/css/style-3.8.css +11 -10
  7. admin/css/style-3.8.min.css +1 -0
  8. admin/css/style.css +445 -75
  9. admin/css/style.min.css +1 -0
  10. admin/font/fontello.eot +0 -0
  11. admin/font/fontello.svg +5 -2
  12. admin/font/fontello.ttf +0 -0
  13. admin/font/fontello.woff +0 -0
  14. admin/js/ajax-queue.min.js +1 -0
  15. admin/js/retina.js +182 -0
  16. admin/js/retina.min.js +10 -0
  17. admin/js/wpsl-admin.js +595 -247
  18. admin/js/wpsl-admin.min.js +1 -0
  19. admin/js/wpsl-cpt-upgrade.js +112 -0
  20. admin/roles.php +133 -0
  21. admin/templates/map-settings.php +318 -167
  22. admin/upgrade.php +631 -0
  23. css/styles.css +436 -186
  24. css/styles.min.css +1 -0
  25. font/fontello.eot +0 -0
  26. font/fontello.svg +13 -0
  27. font/fontello.ttf +0 -0
  28. font/fontello.woff +0 -0
  29. frontend/class-frontend.php +1236 -122
  30. frontend/templates/default.php +52 -51
  31. frontend/templates/store-listings-below.php +56 -49
  32. frontend/underscore-functions.php +223 -0
  33. inc/class-i18n.php +173 -0
  34. inc/class-post-types.php +260 -0
  35. inc/install.php +65 -0
  36. inc/wpsl-functions.php +405 -0
  37. js/infobox.js +817 -0
  38. js/infobox.min.js +1 -0
  39. js/markerclusterer.js +1 -1
  40. js/markerclusterer.min.js +1 -1
  41. js/wpsl-gmap.js +1066 -615
  42. js/wpsl-gmap.min.js +1 -0
  43. languages/wpsl-nl_NL.mo +0 -0
  44. languages/wpsl-nl_NL.po +1691 -926
  45. languages/wpsl-pt_PT.mo +0 -0
  46. languages/wpsl-pt_PT.po +2412 -0
  47. languages/wpsl.mo +0 -0
  48. languages/wpsl.pot +1137 -640
  49. readme.txt +100 -24
  50. uninstall.php +49 -3
  51. wp-store-locator.php +38 -243
  52. wpml-config.xml +28 -0
admin/class-admin.php CHANGED
@@ -2,645 +2,127 @@
2
  /**
3
  * Admin class
4
  *
5
- * @package WP_Store_locator
6
- * @subpackage Classes/Admin
7
- * @copyright Copyright (c) 2013, Tijmen Smit
8
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since 1.0
10
- */
11
 
12
- if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  if ( !class_exists( 'WPSL_Admin' ) ) {
 
15
  /**
16
  * Handle the backend of the store locator
17
  *
18
  * @since 1.0
19
  */
20
- class WPSL_Admin extends WP_Store_locator {
21
-
22
- /**
23
- * Holds the store data
24
- *
25
- * @var array
26
- * @since 1.0
27
- */
28
- public $store_data;
29
-
30
- /**
31
- * Class constructor
32
- */
33
- function __construct() {
34
- add_action( 'init', array( $this, 'output_buffer' ) );
35
-
36
- $this->settings = $this->get_settings();
37
-
38
- add_action( 'admin_init', array( $this, 'admin_init' ) );
39
- add_action( 'wp_loaded', array( $this, 'init' ) );
40
- add_action( 'wp_ajax_delete_store', array( $this, 'delete_store_ajax' ) );
41
- }
42
-
43
- public function output_buffer() {
44
- ob_start();
45
- }
46
-
47
- /**
48
- * Register a callback function for the settings page and check if we need to show the "missing start point" warning.
49
- *
50
- * @since 1.0
51
- * @return void
52
- */
53
- public function admin_init() {
54
-
55
- global $current_user;
56
-
57
- $this->check_upgrade();
58
-
59
- if ( ( current_user_can( 'install_plugins' ) ) && is_admin() ) {
60
- if ( ( empty( $this->settings['zoom_latlng'] ) && !get_user_meta( $current_user->ID, 'wpsl_disable_location_warning' ) ) ) {
61
- add_action( 'wp_ajax_disable_location_warning', array( $this, 'disable_location_warning_ajax' ) );
62
- add_action( 'admin_footer', array( $this, 'show_location_warning' ) );
63
- }
64
- }
65
-
66
- register_setting( 'wpsl_settings', 'wpsl_settings', array( $this, 'sanitize_settings' ) );
67
- }
68
-
69
- /**
70
- * If the db doesn't hold the current version, run the upgrade procedure
71
- *
72
- * @since 1.2
73
- * @return void
74
- */
75
- public function check_upgrade() {
76
-
77
- $current_version = get_option( 'wpsl_version' );
78
-
79
- if ( version_compare( $current_version, WPSL_VERSION_NUM, '===' ) )
80
- return;
81
-
82
- if ( version_compare( $current_version, '1.1', '<' ) ) {
83
- if ( is_array( $this->settings ) ) {
84
- /* Add the default value for the reset map option */
85
- if ( empty( $this->settings['reset_map'] ) ) {
86
- $this->settings['reset_map'] = 0;
87
- }
88
-
89
- /* Add the default value for the way the store listings are shown, either below or next to the map */
90
- if ( empty( $this->settings['auto_load'] ) ) {
91
- $this->settings['auto_load'] = 1;
92
- }
93
-
94
- /* Add the default value for the route redirect */
95
- if ( empty( $this->settings['new_window'] ) ) {
96
- $this->settings['new_window'] = 0;
97
- }
98
-
99
- update_option( 'wpsl_settings', $this->settings );
100
- }
101
- }
102
-
103
- if ( version_compare( $current_version, '1.2', '<' ) ) {
104
- if ( is_array( $this->settings ) ) {
105
- /* Add the default value for the way the store listings are shown, either below or next to the map */
106
- if ( empty( $this->settings['store_below'] ) ) {
107
- $this->settings['store_below'] = 0;
108
- }
109
-
110
- /* Add the default value for the route redirect */
111
- if ( empty( $this->settings['direction_redirect'] ) ) {
112
- $this->settings['direction_redirect'] = 0;
113
- }
114
-
115
- update_option( 'wpsl_settings', $this->settings );
116
- }
117
- }
118
-
119
- if ( version_compare( $current_version, '1.2.11', '<' ) ) {
120
- if ( is_array( $this->settings ) ) {
121
- /* Add the default value for the 'more info' link option */
122
- if ( empty( $this->settings['more_info'] ) ) {
123
- $this->settings['more_info'] = 0;
124
- }
125
-
126
- /* Add the default value for the 'more info' label */
127
- if ( empty( $this->settings['more_label'] ) ) {
128
- $this->settings['more_label'] = __( 'More info', 'wpsl' );
129
- }
130
-
131
- /* Add the default value mouse focus option */
132
- if ( empty( $this->settings['mouse_focus'] ) ) {
133
- $this->settings['mouse_focus'] = 1;
134
- }
135
-
136
- update_option( 'wpsl_settings', $this->settings );
137
- }
138
- }
139
-
140
- if ( version_compare( $current_version, '1.2.12', '<' ) ) {
141
- if ( is_array( $this->settings ) ) {
142
- /* Add the default value for the 'more info link' link option */
143
- if ( empty( $this->settings['more_info_location'] ) ) {
144
- $this->settings['more_info_location'] = __( 'info window', 'wpsl' );
145
- }
146
-
147
- /* Add the default value for the back label */
148
- if ( empty( $this->settings['back_label'] ) ) {
149
- $this->settings['back_label'] = __( 'Back', 'wpsl' );
150
- }
151
-
152
- /* Add the default value for the reset label */
153
- if ( empty( $this->settings['reset_label'] ) ) {
154
- $this->settings['reset_label'] = __( 'Reset', 'wpsl' );
155
- }
156
-
157
- /* Add the default value for removing the scroll bar when the store listing is shown below the map */
158
- if ( empty( $this->settings['store_below_scroll'] ) ) {
159
- $this->settings['store_below_scroll'] = 0;
160
- }
161
-
162
- update_option( 'wpsl_settings', $this->settings );
163
- }
164
- }
165
-
166
- if ( version_compare( $current_version, '1.2.20', '<' ) ) {
167
-
168
- global $wpdb;
169
-
170
- /* Rename the street field to address */
171
- $wpdb->query( "ALTER TABLE $wpdb->wpsl_stores CHANGE street address VARCHAR(255)" );
172
-
173
- /* Add the second address field */
174
- $wpdb->query( "ALTER TABLE $wpdb->wpsl_stores ADD address2 VARCHAR(255) NULL AFTER address" );
175
-
176
- if ( is_array( $this->settings ) ) {
177
- if ( empty( $this->settings['store_url'] ) ) {
178
- $this->settings['store_url'] = 0;
179
- }
180
-
181
- if ( empty( $this->settings['phone_url'] ) ) {
182
- $this->settings['phone_url'] = 0;
183
- }
184
-
185
- if ( empty( $this->settings['marker_clusters'] ) ) {
186
- $this->settings['marker_clusters'] = 0;
187
- }
188
-
189
- if ( empty( $this->settings['cluster_zoom'] ) ) {
190
- $this->settings['cluster_zoom'] = 0;
191
- }
192
-
193
- if ( empty( $this->settings['cluster_size'] ) ) {
194
- $this->settings['cluster_size'] = 0;
195
- }
196
-
197
- if ( empty( $this->settings['template_id'] ) ) {
198
- $this->settings['template_id'] = ( $this->settings['store_below'] ) ? 1 : 0;
199
- unset( $this->settings['store_below'] );
200
- }
201
-
202
- if ( empty( $this->settings['marker_streetview'] ) ) {
203
- $this->settings['marker_streetview'] = 0;
204
- }
205
-
206
- if ( empty( $this->settings['marker_zoom_to'] ) ) {
207
- $this->settings['marker_zoom_to'] = 0;
208
- }
209
-
210
- if ( !isset( $this->settings['editor_country'] ) ) {
211
- $this->settings['editor_country'] = '';
212
- }
213
-
214
- if ( empty( $this->settings['street_view_label'] ) ) {
215
- $this->settings['street_view_label'] = __( 'Street view', 'wpsl' );
216
- }
217
-
218
- if ( empty( $this->settings['zoom_here_label'] ) ) {
219
- $this->settings['zoom_here_label'] = __( 'Zoom here', 'wpsl' );
220
- }
221
-
222
- if ( empty( $this->settings['no_directions_label'] ) ) {
223
- $this->settings['no_directions_label'] = __( 'No route could be found between the origin and destination', 'wpsl' );
224
- }
225
-
226
- update_option( 'wpsl_settings', $this->settings );
227
- }
228
- }
229
-
230
- update_option( 'wpsl_version', WPSL_VERSION_NUM );
231
- }
232
-
233
- /**
234
- * Add the admin menu and enqueue the admin scripts
235
- *
236
- * @since 1.0
237
- * @return void
238
- */
239
- public function init() {
240
- add_action( 'admin_menu', array( $this, 'create_admin_menu' ) );
241
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
242
- }
243
-
244
- /**
245
- * Add the menu pages
246
- *
247
- * @since 1.0
248
- * @return void
249
- */
250
- public function create_admin_menu() {
251
- $hook = add_menu_page( 'Store Locator', __( 'Store Locator', 'wpsl' ), apply_filters( 'wpsl_capability', 'manage_options' ), 'wpsl_store_editor', array( $this, 'manage_stores' ), plugins_url( 'img/store-locator-icon.png', dirname( __FILE__ ) ), apply_filters( 'wpsl_menu_position', null ) );
252
- add_submenu_page( 'wpsl_store_editor', __( 'Manage Stores', 'wpsl' ), __( 'Manage Stores', 'wpsl' ), apply_filters( 'wpsl_capability', 'manage_options' ), 'wpsl_store_editor', array( $this, 'manage_stores' ) );
253
- add_submenu_page( 'wpsl_store_editor', __( 'Add Store', 'wpsl' ), __( 'Add Store', 'wpsl' ), apply_filters( 'wpsl_capability', 'manage_options' ), 'wpsl_add_store', array( $this, 'add_store' ) );
254
- add_submenu_page( 'wpsl_store_editor', __( 'Settings', 'wpsl' ), __( 'Settings', 'wpsl' ), 'manage_options', 'wpsl_settings', array( $this, 'show_settings' ) );
255
- add_submenu_page( 'wpsl_store_editor', __( 'FAQ', 'wpsl' ), __( 'FAQ', 'wpsl' ), apply_filters( 'wpsl_capability', 'manage_options' ), 'wpsl_faq', array( $this, 'show_faq' ) );
256
-
257
- add_action( "load-$hook", array( $this, 'add_screen_options' ) );
258
- }
259
-
260
- /**
261
- * Add the screen options to the store overview page
262
- *
263
- * Users can define the amount of visible stores
264
- *
265
- * @since 1.2.20
266
- * @return void
267
- */
268
- function add_screen_options() {
269
- $option = 'per_page';
270
- $args = array(
271
- 'label' => __( 'Stores', 'wpsl' ),
272
- 'default' => 20,
273
- 'option' => 'wpsl_stores_per_page'
274
- );
275
-
276
- add_screen_option( $option, $args );
277
- }
278
-
279
- /**
280
- * Load the add store template
281
- *
282
- * @since 1.0
283
- * @return void
284
- */
285
- public function add_store() {
286
- $this->store_actions();
287
- require_once( WPSL_PLUGIN_DIR . 'admin/templates/add-store.php' );
288
- }
289
-
290
- /**
291
- * If a store form is submitted, process the store data
292
- *
293
- * @since 1.0
294
- * @return void
295
- */
296
- public function store_actions() {
297
- if ( isset( $_REQUEST['wpsl_actions'] ) ) {
298
- $this->handle_store_data();
299
- }
300
- }
301
 
302
  /**
303
- * Handle the different actions for the store.
304
- *
305
- * Based on the action value, either show the store overview list or the edit store template
306
- *
307
- * @since 1.0
308
- * @return void
309
- */
310
- public function manage_stores() {
311
-
312
- $this->store_actions();
313
-
314
- $actions = ( isset( $_GET['action'] ) ) ? $_GET['action'] : '';
315
-
316
- /* Check which store template to show */
317
- switch ( $actions ) {
318
- case 'edit_store':
319
- require_once( WPSL_PLUGIN_DIR . 'admin/templates/edit-store.php' );
320
- break;
321
- default:
322
- require_once( WPSL_PLUGIN_DIR . 'admin/templates/stores-overview.php' );
323
- break;
324
- }
325
- }
326
-
327
- /**
328
- * Process new store data
329
- *
330
- * @since 1.0
331
- * @return void
332
  */
333
- public function handle_store_data() {
334
-
335
- global $wpdb;
336
-
337
- if ( !current_user_can( apply_filters( 'wpsl_capability', 'manage_options' ) ) )
338
- die( '-1' );
339
-
340
- check_admin_referer( 'wpsl_' . $_POST['wpsl_actions'] );
341
-
342
- $this->store_data = $this->validate_store_data();
343
-
344
- if ( $this->store_data ) {
345
- $latlng = $this->validate_latlng( $this->store_data['lat'], $this->store_data['lng'] );
346
-
347
- /* If we don't have a valid latlng value, we geocode the supplied address to get one */
348
- if ( !$latlng ) {
349
- $reponse = $this->geocode_location();
350
- $this->store_data['country'] = $reponse['country']['long_name'];
351
- $this->store_data['country-iso'] = $reponse['country']['short_name'];
352
- $this->store_data['latlng'] = $reponse['latlng'];
353
- } else {
354
- $this->store_data['country-iso'] = $_POST['wpsl']['country-iso'];
355
- $this->store_data['latlng'] = $latlng;
356
- }
357
-
358
- $store_action = ( isset( $_POST['wpsl_actions'] ) ) ? $_POST['wpsl_actions'] : '';
359
-
360
- switch ( $store_action ) {
361
- case 'add_new_store':
362
- $this->add_new_store();
363
- break;
364
- case 'update_store':
365
- $this->update_store();
366
- break;
367
- };
368
- }
369
- }
370
 
371
  /**
372
- * Delete a single store
373
- *
374
- * This is called from the store overview page when a user clicks the delete button
375
- *
376
- * @since 1.0
377
- * @return json Either fail or success
378
- */
379
- public function delete_store_ajax() {
380
-
381
- global $wpdb;
382
-
383
- $store_id = absint( $_POST['store_id'] );
384
-
385
- if ( !current_user_can( apply_filters( 'wpsl_capability', 'manage_options' ) ) )
386
- die( '-1' );
387
-
388
- check_ajax_referer( 'wpsl_delete_nonce_'.$store_id );
389
-
390
- $result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wpsl_stores WHERE wpsl_id = %d", $store_id ) );
391
-
392
- if ( $result === false ) {
393
- wp_send_json_error();
394
- } else {
395
- wp_send_json_success();
396
- }
397
- }
398
-
399
- /**
400
- * Update store details
401
- *
402
- * @since 1.0
403
- * @param array $store_data The updated store data
404
- * @return void
405
  */
406
- public function update_store() {
407
-
408
- global $wpdb;
409
-
410
- $result = $wpdb->query(
411
- $wpdb->prepare(
412
- "
413
- UPDATE $wpdb->wpsl_stores
414
- SET store = %s, address = %s, address2 = %s, city = %s, state = %s, zip = %s, country = %s, country_iso = %s, lat = %s, lng = %s, description = %s, phone = %s, fax = %s, url = %s, email = %s, hours = %s, thumb_id = %d, active = %d
415
- WHERE wpsl_id = %d",
416
- $this->store_data['store'],
417
- $this->store_data['address'],
418
- $this->store_data['address2'],
419
- $this->store_data['city'],
420
- $this->store_data['state'],
421
- strtoupper( $this->store_data['zip'] ),
422
- $this->store_data['country'],
423
- $this->store_data['country-iso'],
424
- $this->store_data['latlng']['lat'],
425
- $this->store_data['latlng']['lng'],
426
- $this->store_data['desc'],
427
- $this->store_data['phone'],
428
- $this->store_data['fax'],
429
- $this->store_data['url'],
430
- $this->store_data['email'],
431
- $this->store_data['hours'],
432
- $this->store_data['thumb-id'],
433
- $this->store_data['active'],
434
- $_GET['store_id']
435
- )
436
- );
437
-
438
- if ( $result === false ) {
439
- $state = 'error';
440
- $msg = __( 'There was a problem updating the store details, please try again.', 'wpsl' );
441
- } else {
442
- $_POST = array();
443
- $state = 'updated';
444
- $msg = __( 'Store details updated.', 'wpsl' );
445
- }
446
-
447
- add_settings_error ( 'update-store', esc_attr( 'update-store' ), $msg, $state );
448
- }
449
-
450
  /**
451
- * Add a new store to the db
452
- *
453
- * @since 1.0
454
- * @param array $store_data The submitted store data
455
- * @return void
456
  */
457
- public function add_new_store() {
458
 
459
- global $wpdb;
460
-
461
- $result = $wpdb->query(
462
- $wpdb->prepare(
463
- "
464
- INSERT INTO $wpdb->wpsl_stores
465
- (store, address, address2, city, state, zip, country, country_iso, lat, lng, description, phone, fax, url, email, hours, thumb_id)
466
- VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d)
467
- ",
468
- $this->store_data['store'],
469
- $this->store_data['address'],
470
- $this->store_data['address2'],
471
- $this->store_data['city'],
472
- $this->store_data['state'],
473
- strtoupper ( $this->store_data['zip'] ),
474
- $this->store_data['country'],
475
- $this->store_data['country-iso'],
476
- $this->store_data['latlng']['lat'],
477
- $this->store_data['latlng']['lng'],
478
- $this->store_data['desc'],
479
- $this->store_data['phone'],
480
- $this->store_data['fax'],
481
- $this->store_data['url'],
482
- $this->store_data['email'],
483
- $this->store_data['hours'],
484
- $this->store_data['thumb-id']
485
- )
486
- );
487
-
488
- if ( $result === false ) {
489
- $state = 'error';
490
- $msg = __( 'There was a problem saving the new store details, please try again.', 'wpsl' );
491
- } else {
492
- $_POST = array();
493
- $state = 'updated';
494
- $msg = __( 'Store succesfully added.', 'wpsl' );
495
- }
496
-
497
- add_settings_error ( 'add-store', esc_attr( 'add-store' ), $msg, $state );
498
- }
499
-
500
  /**
501
- * Get a single value from the default settings
502
- *
503
- * @since 1.0
504
- * @param string $setting The value that should be restored
505
- * @return string the default setting value
506
  */
507
- public function get_default_setting( $setting ) {
508
-
509
- global $wpsl;
510
-
511
- return $wpsl->default_settings[$setting];
512
- }
513
 
514
  /**
515
- * Validate the submitted store data
516
- *
517
- * @since 1.0
518
- * @return mixed array|void $store_data the submitted store data if not empty, otherwise nothing
519
  */
520
- public function validate_store_data() {
521
 
522
- $store_data = $_POST['wpsl'];
523
-
524
- if ( empty( $store_data['store'] ) || ( empty( $store_data['address'] ) ) || ( empty( $store_data['city'] ) ) || ( empty( $store_data['country'] ) ) ) {
525
- add_settings_error ( 'validate-store', esc_attr( 'validate-store' ), __( 'Please fill in all the required fields.', 'wpsl' ), 'error' );
526
- } else {
527
- return $store_data;
528
- }
 
 
 
 
 
529
  }
530
 
531
  /**
532
- * Get the data for a single store
533
- *
534
- * @since 1.0
535
- * @param string $store_id The id for a single store
536
- * @return array $result The store details
537
- */
538
- public function get_store_data( $store_id ) {
539
-
540
- global $wpdb;
541
-
542
- $result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wpsl_stores WHERE wpsl_id = %d", $store_id ), ARRAY_A );
543
-
544
- return $result;
545
- }
546
-
547
- /**
548
- * Show the settings template
549
  *
550
- * @since 1.0
551
  * @return void
552
  */
553
- public function show_settings() {
554
- $this->deregister_other_gmaps();
555
- require 'templates/map-settings.php';
 
 
 
556
  }
557
 
558
  /**
559
- * Show the faq template
560
  *
561
- * @since 1.0
562
  * @return void
563
  */
564
- public function show_faq() {
565
- require 'templates/faq.php';
566
- }
567
-
568
- /**
569
- * Create the nav menu shown on store locator pages
570
- *
571
- * @since 1.2.20
572
- * @return string $menu_nav The content of the menu
573
- */
574
- public function create_menu() {
575
-
576
- $menu_items = array(
577
- 'wpsl_store_editor' => __( 'Current Stores', 'wpsl' ),
578
- 'wpsl_add_store' => __( 'Add Store', 'wpsl' ),
579
- 'wpsl_settings' => __( 'Settings', 'wpsl' )
580
- );
581
-
582
- $menu_nav = '<ul id="wpsl-mainnav" class="nav-tab-wrapper">';
583
-
584
- foreach ( $menu_items as $index => $item ) {
585
- if ( ( array_key_exists( $_GET['page'], $menu_items ) ) && ( $_GET['page'] == $index ) ) {
586
- $active_tab = 'nav-tab-active';
587
- } else {
588
- $active_tab = '';
589
- }
590
-
591
- /* Make sure the settings page isn't added to the menu if the user can't 'manage_options' */
592
- if ( ( $index == 'wpsl_settings' ) && ( !current_user_can( 'manage_options' ) ) )
593
- break;
594
 
595
- $menu_nav .= '<li><a class="nav-tab ' . $active_tab . '" href="'. admin_url( 'admin.php?page=' . $index . '' ) .'">'. $item .'</a></li>';
596
- }
597
-
598
- $menu_nav .= '</ul>';
599
-
600
- return $menu_nav;
601
- }
602
-
603
  /**
604
- * Handle the different validation errors for the plugin settings
605
- *
 
606
  * @since 1.0
607
- * @param string $error_type Contains the type of validation error that occured
608
  * @return void
609
  */
610
- private function settings_error( $error_type ) {
611
 
612
- switch ( $error_type ) {
613
- case 'max_results':
614
- $error_msg = __( 'The max results field cannot be empty, the default value has been restored.', 'wpsl' );
615
- break;
616
- case 'search_radius':
617
- $error_msg = __( 'The search radius field cannot be empty, the default value has been restored.', 'wpsl' );
618
- break;
619
- case 'label_missing':
620
- $error_msg = __( 'One of the label fields was left empty, the default value for that field has been restored.', 'wpsl' );
621
- break;
622
- case 'start_point':
623
- $error_msg = __( 'Please provide the name of a city or country that can be used as a starting point under "Map Settings". This will only be used if auto-locating the user fails, or the option itself is disabled.', 'wpsl' );
624
- break;
625
- }
626
-
627
- add_settings_error ( 'setting-errors', esc_attr( 'settings_fail' ), $error_msg, 'error' );
628
- }
629
 
630
  /**
631
- * Display an error message when no start location is defined, and the warning hasn't been disabled
632
  *
633
  * @since 1.2
634
  * @return void
635
  */
636
- public function show_location_warning() {
637
- if ( isset( $_GET['page'] ) && $_GET['page'] !== 'wpsl_settings' ) {
638
- echo "<div id='message' class='error'><p><strong>" . sprintf( __( "Before adding the [wpsl] shortcode to a page, please don't forget to define a start point on the %ssettings%s page.", "wpsl" ), "<a href='" . admin_url( 'admin.php?page=wpsl_settings' ) . "'>", "</a>" ) . " <a class='wpsl-dismiss' data-nonce='" . wp_create_nonce( 'wpsl-dismiss' ) . "' href='#'>" . __( "Dismiss", "wpsl" ) . "</a></p></div>";
639
- }
 
 
 
640
  }
641
 
642
  /**
643
- * Disable the missing start location warning
644
  *
645
  * @since 1.2
646
  * @return void
@@ -649,999 +131,307 @@ if ( !class_exists( 'WPSL_Admin' ) ) {
649
 
650
  global $current_user;
651
 
652
- if ( !current_user_can( apply_filters( 'wpsl_capability', 'manage_options' ) ) )
653
  die( '-1' );
654
  check_ajax_referer( 'wpsl-dismiss' );
655
 
656
- $update_id = add_user_meta( $current_user->ID, 'wpsl_disable_location_warning', 'true', true );
657
 
658
  die();
659
  }
660
-
661
- /**
662
- * Sanitize the submitted plugin settings
663
- *
664
  * @since 1.0
665
- * @return array $output The setting values
666
  */
667
- public function sanitize_settings() {
668
-
669
- $map_types = array( 'roadmap', 'satellite', 'hybrid', 'terrain' );
670
- $distance_units = array( 'km', 'mi' );
671
- $more_info_locations = array( 'store listings', 'info window' );
672
-
673
- $output['api_key'] = sanitize_text_field( $_POST['wpsl_api']['key'] );
674
- $output['api_language'] = wp_filter_nohtml_kses( $_POST['wpsl_api']['language'] );
675
- $output['api_region'] = wp_filter_nohtml_kses( $_POST['wpsl_api']['region'] );
676
-
677
- if ( in_array( $_POST['wpsl_search']['distance_unit'], $distance_units ) ) {
678
- $output['distance_unit'] = $_POST['wpsl_search']['distance_unit'];
679
- } else {
680
- $output['distance_unit'] = $this->get_default_setting( 'distance_unit' );
681
- }
682
-
683
- /* Check for a valid max results value, otherwise we use the default */
684
- if ( !empty( $_POST['wpsl_search']['max_results'] ) ) {
685
- $output['max_results'] = sanitize_text_field( $_POST['wpsl_search']['max_results'] );
686
- } else {
687
- $this->settings_error( 'max_results' );
688
- $output['max_results'] = $this->get_default_setting( 'max_results' );
689
- }
690
-
691
- /* See if a search radius value exist, otherwise we use the default */
692
- if ( !empty( $_POST['wpsl_search']['radius'] ) ) {
693
- $output['search_radius'] = sanitize_text_field( $_POST['wpsl_search']['radius'] );
694
- } else {
695
- $this->settings_error( 'search_radius' );
696
- $output['search_radius'] = $this->get_default_setting( 'search_radius' );
697
- }
698
-
699
- $output['marker_bounce'] = isset( $_POST['wpsl_map']['marker_bounce'] ) ? 1 : 0;
700
-
701
- /* Check if we have a valid zoom level, it has to be between 1 or 12. If not set it to the default of 3 */
702
- if ( $_POST['wpsl_map']['zoom_level'] >= 1 || $_POST['wpsl_map']['zoom_level'] <= 12 ) {
703
- $output['zoom_level'] = $_POST['wpsl_map']['zoom_level'];
704
- } else {
705
- $output['zoom_level'] = $this->get_default_setting( 'zoom_level' );
706
- }
707
-
708
- $output['zoom_name'] = sanitize_text_field( $_POST['wpsl_map']['zoom_name'] );
709
-
710
- /* If no location name is set to zoom to we also empty the latlng values from the hidden input field */
711
- if ( empty( $output['zoom_name'] ) ) {
712
- $this->settings_error( 'start_point' );
713
- $output['zoom_latlng'] = '';
714
- } else {
715
- $output['zoom_latlng'] = sanitize_text_field( $_POST['wpsl_map']['zoom_latlng'] );
716
- }
717
-
718
- /* Check if we have a valid map type */
719
- if ( in_array( $_POST['wpsl_map']['type'], $map_types ) ) {
720
- $output['map_type'] = $_POST['wpsl_map']['type'];
721
- } else {
722
- $output['map_type'] = $this->get_default_setting( 'map_type' );
723
- }
724
-
725
- $output['auto_locate'] = isset( $_POST['wpsl_map']['auto_locate'] ) ? 1 : 0;
726
- $output['auto_load'] = isset( $_POST['wpsl_map']['auto_load'] ) ? 1 : 0;
727
- $output['streetview'] = isset( $_POST['wpsl_map']['streetview'] ) ? 1 : 0;
728
- $output['pan_controls'] = isset( $_POST['wpsl_map']['pan_controls'] ) ? 1 : 0;
729
- $output['control_position'] = ( $_POST['wpsl_map']['control_position'] == 'left' ) ? 'left' : 'right';
730
- $output['control_style'] = ( $_POST['wpsl_map']['control_style'] == 'small' ) ? 'small' : 'large';
731
- $output['marker_clusters'] = isset( $_POST['wpsl_map']['marker_clusters'] ) ? 1 : 0;
732
-
733
- /* Check for a valid cluster zoom value */
734
- if ( in_array( $_POST['wpsl_map']['cluster_zoom'], $this->get_default_cluster_option( 'cluster_zoom' ) ) ) {
735
- $output['cluster_zoom'] = $_POST['wpsl_map']['cluster_zoom'];
736
- } else {
737
- $output['cluster_zoom'] = $this->get_default_setting( 'cluster_zoom' );
738
- }
739
-
740
- /* Check for a valid cluster size value */
741
- if ( in_array( $_POST['wpsl_map']['cluster_size'], $this->get_default_cluster_option( 'cluster_size' ) ) ) {
742
- $output['cluster_size'] = $_POST['wpsl_map']['cluster_size'];
743
- } else {
744
- $output['cluster_size'] = $this->get_default_setting( 'cluster_size' );
745
- }
746
-
747
- /* Check the height value of the map */
748
- if ( absint( $_POST['wpsl_design']['height_value'] ) ) {
749
- $output['height'] = $_POST['wpsl_design']['height_value'];
750
- } else {
751
- $output['height'] = $this->get_default_setting( 'height' );
752
- }
753
-
754
- /* Check the max-width of the infowindow */
755
- if ( absint( $_POST['wpsl_design']['infowindow_width'] ) ) {
756
- $output['infowindow_width'] = $_POST['wpsl_design']['infowindow_width'];
757
- } else {
758
- $output['infowindow_width'] = $this->get_default_setting( 'infowindow_width' );
759
- }
760
-
761
- /* Check the width for the search field */
762
- if ( absint( $_POST['wpsl_design']['search_width'] ) ) {
763
- $output['search_width'] = $_POST['wpsl_design']['search_width'];
764
- } else {
765
- $output['search_width'] = $this->get_default_setting( 'search_width' );
766
- }
767
-
768
- /* Check the width for labels */
769
- if ( absint( $_POST['wpsl_design']['label_width'] ) ) {
770
- $output['label_width'] = $_POST['wpsl_design']['label_width'];
771
- } else {
772
- $output['label_width'] = $this->get_default_setting( 'label_width' );
773
- }
774
-
775
- /* Make sure we have a valid template ID */
776
- if ( absint( $_POST['wpsl_design']['template'] ) ) {
777
- $output['template_id'] = $_POST['wpsl_design']['template'];
778
- } else {
779
- $output['template_id'] = $this->get_default_setting( 'template_id' );
780
- }
781
-
782
- $output['results_dropdown'] = isset( $_POST['wpsl_design']['design_results'] ) ? 1 : 0;
783
- $output['new_window'] = isset( $_POST['wpsl_design']['new_window'] ) ? 1 : 0;
784
- $output['reset_map'] = isset( $_POST['wpsl_design']['reset_map'] ) ? 1 : 0;
785
- $output['store_below_scroll'] = isset( $_POST['wpsl_design']['store_below_scroll'] ) ? 1 : 0;
786
- $output['direction_redirect'] = isset( $_POST['wpsl_design']['direction_redirect'] ) ? 1 : 0;
787
- $output['more_info'] = isset( $_POST['wpsl_design']['more_info'] ) ? 1 : 0;
788
- $output['store_url'] = isset( $_POST['wpsl_design']['store_url'] ) ? 1 : 0;
789
- $output['phone_url'] = isset( $_POST['wpsl_design']['phone_url'] ) ? 1 : 0;
790
- $output['marker_streetview'] = isset( $_POST['wpsl_design']['marker_streetview'] ) ? 1 : 0;
791
- $output['marker_zoom_to'] = isset( $_POST['wpsl_design']['marker_zoom_to'] ) ? 1 : 0;
792
-
793
- /* Check if we have a valid 'more info' location */
794
- if ( in_array( $_POST['wpsl_design']['more_info_location'], $more_info_locations ) ) {
795
- $output['more_info_location'] = $_POST['wpsl_design']['more_info_location'];
796
- } else {
797
- $output['more_info_location'] = $this->get_default_setting( 'more_info_location' );
798
- }
799
-
800
- $output['mouse_focus'] = isset( $_POST['wpsl_design']['mouse_focus'] ) ? 1 : 0;
801
- $output['start_marker'] = wp_filter_nohtml_kses( $_POST['wpsl_map']['start_marker'] );
802
- $output['store_marker'] = wp_filter_nohtml_kses( $_POST['wpsl_map']['store_marker'] );
803
- $output['editor_country'] = sanitize_text_field( $_POST['wpsl_editor']['default_country'] );
804
-
805
- $missing_labels = false;
806
- $required_labels = array(
807
- 'search',
808
- 'search_btn',
809
- 'preloader',
810
- 'radius',
811
- 'no_results',
812
- 'results',
813
- 'more',
814
- 'directions',
815
- 'no_directions',
816
- 'back',
817
- 'reset',
818
- 'street_view',
819
- 'zoom_here',
820
- 'error',
821
- 'phone',
822
- 'fax',
823
- 'hours',
824
- 'start',
825
- 'limit'
826
- );
827
-
828
- /**
829
- * Labels can never be empty, so we make sure they always contain data.
830
- * If they are empty, we use the default value. Otherwise we sanitize the text field
831
- */
832
- foreach ( $required_labels as $k => $label ) {
833
- if ( !empty( $_POST['wpsl_label'][$label] ) ) {
834
- $output[$label.'_label'] = sanitize_text_field( $_POST['wpsl_label'][$label] );
835
- } else {
836
- $output[$label.'_label'] = $this->get_default_setting( $label.'_label' );
837
- $missing_labels = true;
838
- }
839
- }
840
-
841
- if ( $missing_labels ) {
842
- $this->settings_error( 'label_missing' );
843
- }
844
-
845
- return $output;
846
- }
847
-
848
- /**
849
- * Validate the latlng values
850
- *
851
  * @since 1.0
852
- * @param string $lat The latitude value
853
- * @param string $lng The longitude value
854
- * @return array|boolean $latlng The validated latlng values or false if it fails
855
  */
856
- public function validate_latlng( $lat, $lng ) {
 
 
857
 
858
- if ( is_numeric( $lat ) || ( is_numeric( $lng ) ) ) {
859
- $latlng = array(
860
- "lat" => $lat,
861
- "lng" => $lng
862
- );
863
-
864
- return $latlng;
865
- } else {
866
- return false;
867
- }
868
- }
869
-
870
- /**
871
- * Geocode the store location
872
  *
873
- * @since 1.0
874
- * @return array|void $response Contains the country name in the selected language, and the latlng values
875
- */
876
- public function geocode_location() {
877
-
878
- $geocode_response = $this->get_latlng();
879
-
880
- switch ( $geocode_response['status'] ) {
881
- case 'OK':
882
- $response = array (
883
- "country" => $this->filter_country_name( $geocode_response ),
884
- "latlng" => $geocode_response['results'][0]['geometry']['location']
885
- );
886
-
887
- return $response;
888
- case 'ZERO_RESULTS':
889
- $msg = __( 'The Google Geocoding API returned no results for the store location. Please change the location and try again.', 'wpsl' );
890
- break;
891
- case 'OVER_QUERY_LIMIT':
892
- $msg = sprintf( __( 'You have reached the daily allowed geocoding limit, you can read more <a href="%s">here</a>.', 'wpsl' ), 'https://developers.google.com/maps/documentation/geocoding/#Limits' );
893
- break;
894
- default:
895
- $msg = __( 'The Google Geocoding API failed to return valid data, please try again later.', 'wpsl' );
896
- break;
897
- }
898
-
899
- if ( !empty( $msg ) ) {
900
- add_settings_error ( 'geocode', esc_attr( 'geocode' ), $msg, 'error' );
901
- }
902
- }
903
-
904
- /**
905
- * Make the API call to Google to geocode the address
906
  *
907
- * @since 1.0
908
- * @return array $response The geocode response
909
  */
910
- public function get_latlng() {
911
-
912
- $address = $this->store_data["address"].','.$this->store_data["city"].','.$this->store_data["zip"].','.$this->store_data["country"];
913
- $url = "http://maps.googleapis.com/maps/api/geocode/json?address=".urlencode( $address )."&sensor=false&language=".$this->settings['api_language'];
914
-
915
- if ( extension_loaded( "curl" ) && function_exists( "curl_init" ) ) {
916
- $ch = curl_init();
917
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
918
- curl_setopt( $ch, CURLOPT_URL, $url ) ;
919
- $result = curl_exec( $ch );
920
- curl_close( $ch );
921
- } else {
922
- $result = file_get_contents( $url );
923
- }
924
-
925
- $response = json_decode( $result, true );
926
 
927
- return $response;
928
- }
929
-
930
- /**
931
- * Filter out the country names from the geocode response
932
- *
933
- * Take out both the full country name, and the short country code (2 letters)
934
- *
935
- * @since 1.0
936
- * @param array $response The fulle API geocode response
937
- * @return array $country_name Both the full and short country names
938
- */
939
- public function filter_country_name( $response ) {
940
-
941
- $length = count( $response['results'][0]['address_components'] );
942
 
943
- /* Loop over the address components untill we find the country,political part */
944
- for ( $i = 0; $i < $length; $i++ ) {
945
- $address_component = $response['results'][0]['address_components'][$i]['types'];
946
-
947
- if ( $address_component[0] == 'country' && $address_component[1] == 'political' ) {
948
- $country_name['long_name'] = $response['results'][0]['address_components'][$i]['long_name'];
949
- $country_name['short_name'] = $response['results'][0]['address_components'][$i]['short_name'];
950
-
951
- break;
952
- }
953
  }
954
-
955
- return $country_name;
956
  }
957
 
958
  /**
959
- * Show the options of the start and store markers
960
- *
961
- * @since 1.0
962
- * @return string $marker_list The complete list of available and selected markers
 
 
 
 
 
 
 
 
 
 
 
 
963
  */
964
- public function show_marker_options() {
965
 
966
- $marker_list = '';
967
- $marker_images = $this->get_available_markers();
968
- $marker_locations = array(
969
- "start",
970
- "store"
971
- );
972
-
973
- foreach ( $marker_locations as $location ) {
974
- if ( $location == 'start' ) {
975
- $marker_list .= __( 'Start location marker:', 'wpsl' );
976
- } else {
977
- $marker_list .= __( 'Store location marker:', 'wpsl' );
978
- }
979
-
980
- if ( !empty( $marker_images ) ) {
981
- $marker_list .= '<ul class="wpsl-marker-list">';
982
 
983
- foreach ( $marker_images as $marker_img ) {
984
- $marker_list .= $this->create_marker_html( $marker_img, $location );
985
- }
986
 
987
- $marker_list .= '</ul>';
988
  }
989
  }
990
-
991
- return $marker_list;
992
  }
993
 
994
  /**
995
- * Load the markers that can be used on the map
 
 
996
  *
997
  * @since 1.0
998
- * @return array $marker_images A list of all the available markers
999
  */
1000
- public function get_available_markers() {
1001
-
1002
- $dir = WPSL_PLUGIN_DIR . 'img/markers/';
1003
-
1004
- if ( is_dir( $dir ) ) {
1005
- if ( $dh = opendir( $dir ) ) {
1006
- while ( false !== ( $file = readdir( $dh ) ) ) {
1007
- if ( $file == '.' || $file == '..' || ( strpos( $file, '@2x' ) !== false ) ) continue;
1008
- $marker_images[] = $file;
1009
- }
1010
 
1011
- closedir( $dh );
1012
- }
1013
- }
1014
-
1015
- return $marker_images;
1016
  }
1017
 
1018
  /**
1019
- * Create the html output for the marker list that is shown on the settings page
1020
  *
1021
- * There are two markers lists, one where the user can set the marker for the start point
1022
- * and one where a marker can be set for the store. We also check if the marker img is identical
1023
- * to the name in the option field. If so we set it to checked
1024
- *
1025
- * @since 1.0
1026
- * @param string $marker_img The filename of the marker
1027
- * @param string $location Eiter contains "start" or "store"
1028
- * @return string $marker_list A list of all the available markers
1029
  */
1030
- public function create_marker_html( $marker_img, $location ) {
1031
-
1032
- $marker_list = '';
1033
-
1034
- if ( $this->settings[$location.'_marker'] == $marker_img ) {
1035
- $checked = 'checked="checked"';
1036
- $css_class = 'class="wpsl-active-marker"';
1037
- } else {
1038
- $checked = '';
1039
- $css_class = '';
1040
- }
1041
 
1042
- $marker_list .= '<li ' . $css_class . '>';
1043
- $marker_list .= '<img src="' . WPSL_URL . 'img/markers/' . $marker_img . '" />';
1044
- $marker_list .= '<input ' . $checked . ' type="radio" name="wpsl_map[' . $location . '_marker]" value="' . $marker_img . '" />';
1045
- $marker_list .= '</li>';
1046
-
1047
- return $marker_list;
1048
  }
1049
-
1050
- /**
1051
- * Create a dropdown where users can select the distance unit (km or miles),
1052
- * and set the active value to selected.
1053
- *
1054
- * @since 1.0
1055
- * @todo generic dropdown function
1056
- * @return string $dropdown The html for the distance option list
1057
- */
1058
- public function show_distance_units() {
1059
-
1060
- $items = array(
1061
- 'km',
1062
- 'mi'
1063
- );
1064
- $dropdown = '<select id="wpsl-distance-unit" name="wpsl_search[distance_unit]">';
1065
-
1066
- foreach ( $items as $item => $value ) {
1067
- $selected = ( $this->settings['distance_unit'] == $value ) ? 'selected="selected"' : '';
1068
- $dropdown .= "<option value='$value' $selected>" . $value . "</option>";
1069
- }
1070
-
1071
- $dropdown .= "</select>";
1072
-
1073
- return $dropdown;
1074
- }
1075
-
1076
  /**
1077
- * Create the default values for the marker clusters dropdown options
1078
  *
1079
  * @since 1.2.20
1080
- * @param string $type The cluster option type
1081
- * @return string $dropdown The default dropdown values
1082
  */
1083
- public function get_default_cluster_option( $type ) {
1084
 
1085
- $cluster_values = array(
1086
- 'cluster_zoom' => array(
1087
- '7',
1088
- '8',
1089
- '9',
1090
- '10',
1091
- '11',
1092
- '12',
1093
- '13'
1094
- ),
1095
- 'cluster_size' => array(
1096
- '40',
1097
- '50',
1098
- '60',
1099
- '70',
1100
- '80'
1101
- ),
1102
  );
1103
 
1104
- return $cluster_values[$type];
1105
  }
1106
 
1107
  /**
1108
- * Create a dropdown for the marker cluster options,
1109
  *
1110
- * @since 1.2.20
1111
- * @todo move to generic dropdown function
1112
- * @param string $type The cluster option type
1113
- * @return string $dropdown The html for the distance option list
1114
  */
1115
- public function show_cluster_options( $type ) {
1116
 
1117
- $cluster_options = array(
1118
- 'cluster_zoom' => array(
1119
- 'id' => 'wpsl-marker-zoom',
1120
- 'name' => 'cluster_zoom',
1121
- 'options' => $this->get_default_cluster_option( $type )
1122
- ),
1123
- 'cluster_size' => array(
1124
- 'id' => 'wpsl-marker-cluster-size',
1125
- 'name' => 'cluster_size',
1126
- 'options' => $this->get_default_cluster_option( $type )
1127
- ),
1128
- );
1129
 
1130
- $dropdown = '<select id="' . $cluster_options[$type]['id'] . '" name="wpsl_map[' . $cluster_options[$type]['name'] . ']">';
1131
-
1132
- $i = 0;
1133
- foreach ( $cluster_options[$type]['options'] as $item => $value ) {
1134
- $selected = ( $this->settings[$type] == $value ) ? 'selected="selected"' : '';
1135
-
1136
- if ( $i == 0 ) {
1137
- $dropdown .= "<option value='0' $selected>" . __( 'Default', 'wpsl' ) . "</option>";
1138
- } else {
1139
- $dropdown .= "<option value='$value' $selected>" . $value . "</option>";
1140
- }
1141
-
1142
- $i++;
1143
- }
1144
-
1145
- $dropdown .= "</select>";
1146
-
1147
- return $dropdown;
1148
- }
1149
-
1150
- /**
1151
- * Show a list of available templates
1152
- *
1153
- * @since 1.2.20
1154
- * @todo move to generic dropdown function
1155
- * @return string $dropdown The html for the template option list
1156
- */
1157
- public function show_template_options() {
1158
-
1159
- $dropdown = '<select id="wpsl-store-template" name="wpsl_design[template]">';
1160
- $i = 0;
1161
 
1162
- foreach ( $this->get_templates() as $template ) {
1163
- $selected = ( $this->settings['template_id'] == $i ) ? ' selected="selected"' : '';
1164
- $dropdown .= "<option value='" . $i . "' $selected>" . esc_attr( $template['name'] ) . "</option>";
1165
- $i++;
1166
- }
1167
-
1168
- $dropdown .= "</select>";
1169
-
1170
- return $dropdown;
1171
  }
1172
-
1173
- /**
1174
- * Create a dropdown where users can select the used map type
1175
- *
1176
- * @since 1.0
1177
- * @todo move to generic dropdown function
1178
- * @return string $dropdown The html for the map option list
1179
- */
1180
- public function show_map_types() {
1181
-
1182
- $items = array(
1183
- 'roadmap',
1184
- 'satellite',
1185
- 'hybrid',
1186
- 'terrain'
1187
- );
1188
- $dropdown = '<select id="wpsl-map-type" name="wpsl_map[type]">';
1189
-
1190
- foreach ( $items as $item => $value ) {
1191
- $selected = ( $this->settings['map_type'] == $value ) ? 'selected="selected"' : '';
1192
- $dropdown .= "<option value='$value' $selected>" . ucfirst( $value ) . "</option>";
1193
- }
1194
-
1195
- $dropdown .= "</select>";
1196
-
1197
- return $dropdown;
1198
- }
1199
 
1200
  /**
1201
- * Create the dropdown to select the zoom level
1202
  *
1203
  * @since 1.0
1204
- * @return string $dropdown The html for the zoom level list
1205
  */
1206
- public function show_zoom_levels() {
 
 
1207
 
1208
- $dropdown = '<select id="wpsl-zoom-level" name="wpsl_map[zoom_level]">';
1209
-
1210
- for ( $i = 1; $i < 13; $i++ ) {
1211
- $selected = ( $this->settings['zoom_level'] == $i ) ? 'selected="selected"' : '';
1212
-
1213
- switch ( $i ) {
1214
- case '1':
1215
- $zoom_desc = '- World view';
1216
- break;
1217
- case '3':
1218
- $zoom_desc = '- Default';
1219
- break;
1220
- case '12':
1221
- $zoom_desc = '- Roadmap view';
1222
- break;
1223
- default:
1224
- $zoom_desc = '';
1225
- }
1226
-
1227
- $dropdown .= "<option value='$i' $selected>$i $zoom_desc</option>";
1228
- }
1229
-
1230
- $dropdown .= "</select>";
1231
-
1232
- return $dropdown;
1233
- }
1234
-
1235
- /**
1236
- * Create a dropdown where users can select location where the 'more info' data is shown
1237
- *
1238
- * @since 1.2.12
1239
- * @todo generic dropdown function
1240
- * @return string $dropdown The html for the more info options list
1241
- */
1242
- public function show_more_info_options() {
1243
 
1244
- $items = array(
1245
- 'store listings' => __( 'In the store listings', 'wpsl' ),
1246
- 'info window' => __( 'In the info window on the map', 'wpsl' )
1247
- );
1248
- $dropdown = '<select id="wpsl-more-info-list" name="wpsl_design[more_info_location]">';
1249
-
1250
- foreach ( $items as $item => $value ) {
1251
- $selected = ( $this->settings['more_info_location'] == $item ) ? 'selected="selected"' : '';
1252
- $dropdown .= "<option value='$item' $selected>" . $value . "</option>";
1253
- }
1254
-
1255
- $dropdown .= "</select>";
1256
-
1257
- return $dropdown;
1258
- }
1259
-
1260
- /**
1261
- * Options for the language and region list
1262
- *
1263
- * @since 1.0
1264
- * @param string $list The request list type
1265
- * @return string|void $option_list The html for the selected list, or nothing if the $list contains invalud values
1266
- */
1267
- public function get_api_option_list( $list ) {
1268
-
1269
- switch ( $list ) {
1270
- case 'language':
1271
- $api_option_list = array (
1272
- __('Select your language', 'wpsl') => '',
1273
- __('English', 'wpsl') => 'en',
1274
- __('Arabic', 'wpsl') => 'ar',
1275
- __('Basque', 'wpsl') => 'eu',
1276
- __('Bulgarian', 'wpsl') => 'bg',
1277
- __('Bengali', 'wpsl') => 'bn',
1278
- __('Catalan', 'wpsl') => 'ca',
1279
- __('Czech', 'wpsl') => 'cs',
1280
- __('Danish', 'wpsl') => 'da',
1281
- __('German', 'wpsl') => 'de',
1282
- __('Greek', 'wpsl') => 'el',
1283
- __('English (Australian)', 'wpsl') => 'en-AU',
1284
- __('English (Great Britain)', 'wpsl') => 'en-GB',
1285
- __('Spanish', 'wpsl') => 'es',
1286
- __('Farsi', 'wpsl') => 'fa',
1287
- __('Finnish', 'wpsl') => 'fi',
1288
- __('Filipino', 'wpsl') => 'fil',
1289
- __('French', 'wpsl') => 'fr',
1290
- __('Galician', 'wpsl') => 'gl',
1291
- __('Gujarati', 'wpsl') => 'gu',
1292
- __('Hindi', 'wpsl') => 'hi',
1293
- __('Croatian', 'wpsl') => 'hr',
1294
- __('Hungarian', 'wpsl') => 'hu',
1295
- __('Indonesian', 'wpsl') => 'id',
1296
- __('Italian', 'wpsl') => 'it',
1297
- __('Hebrew', 'wpsl') => 'iw',
1298
- __('Japanese', 'wpsl') => 'ja',
1299
- __('Kannada', 'wpsl') => 'kn',
1300
- __('Korean', 'wpsl') => 'ko',
1301
- __('Lithuanian', 'wpsl') => 'lt',
1302
- __('Latvian', 'wpsl') => 'lv',
1303
- __('Malayalam', 'wpsl') => 'ml',
1304
- __('Marathi', 'wpsl') => 'mr',
1305
- __('Dutch', 'wpsl') => 'nl',
1306
- __('Norwegian', 'wpsl') => 'no',
1307
- __('Norwegian Nynorsk', 'wpsl') => 'nn',
1308
- __('Polish', 'wpsl') => 'pl',
1309
- __('Portuguese', 'wpsl') => 'pt',
1310
- __('Portuguese (Brazil)', 'wpsl') => 'pt-BR',
1311
- __('Portuguese (Portugal)', 'wpsl') => 'pt-PT',
1312
- __('Romanian', 'wpsl') => 'ro',
1313
- __('Russian', 'wpsl') => 'ru',
1314
- __('Slovak', 'wpsl') => 'sk',
1315
- __('Slovenian', 'wpsl') => 'sl',
1316
- __('Serbian', 'wpsl') => 'sr',
1317
- __('Swedish', 'wpsl') => 'sv',
1318
- __('Tagalog', 'wpsl') => 'tl',
1319
- __('Tamil', 'wpsl') => 'ta',
1320
- __('Telugu', 'wpsl') => 'te',
1321
- __('Thai', 'wpsl') => 'th',
1322
- __('Turkish', 'wpsl') => 'tr',
1323
- __('Ukrainian', 'wpsl') => 'uk',
1324
- __('Vietnamese', 'wpsl') => 'vi',
1325
- __('Chinese (Simplified)', 'wpsl') => 'zh-CN',
1326
- __('Chinese (Traditional)' ,'wpsl') => 'zh-TW'
1327
- );
1328
- break;
1329
- case 'region':
1330
- $api_option_list = array (
1331
- __('Select your region', 'wpsl') => '',
1332
- __('Afghanistan', 'wpsl') => 'af',
1333
- __('Albania', 'wpsl') => 'al',
1334
- __('Algeria', 'wpsl') => 'dz',
1335
- __('American Samoa', 'wpsl') => 'as',
1336
- __('Andorra', 'wpsl') => 'ad',
1337
- __('Anguilla', 'wpsl') => 'ai',
1338
- __('Angola', 'wpsl') => 'ao',
1339
- __('Antigua and Barbuda', 'wpsl') => 'ag',
1340
- __('Argentina', 'wpsl') => 'ar',
1341
- __('Armenia', 'wpsl') => 'am',
1342
- __('Aruba', 'wpsl') => 'aw',
1343
- __('Australia', 'wpsl') => 'au',
1344
- __('Austria', 'wpsl') => 'at',
1345
- __('Azerbaijan', 'wpsl') => 'az',
1346
- __('Bahamas', 'wpsl') => 'bs',
1347
- __('Bahrain', 'wpsl') => 'bh',
1348
- __('Bangladesh', 'wpsl') => 'bd',
1349
- __('Barbados', 'wpsl') => 'bb',
1350
- __('Belarus', 'wpsl') => 'by',
1351
- __('Belgium', 'wpsl') => 'be',
1352
- __('Belize', 'wpsl') => 'bz',
1353
- __('Benin', 'wpsl') => 'bj',
1354
- __('Bermuda', 'wpsl') => 'bm',
1355
- __('Bhutan', 'wpsl') => 'bt',
1356
- __('Bolivia', 'wpsl') => 'bo',
1357
- __('Bosnia and Herzegovina', 'wpsl') => 'ba',
1358
- __('Botswana', 'wpsl') => 'bw',
1359
- __('Brazil', 'wpsl') => 'br',
1360
- __('British Indian Ocean Territory', 'wpsl') => 'io',
1361
- __('Brunei', 'wpsl') => 'bn',
1362
- __('Bulgaria', 'wpsl') => 'bg',
1363
- __('Burkina Faso', 'wpsl') => 'bf',
1364
- __('Burundi', 'wpsl') => 'bi',
1365
- __('Cambodia', 'wpsl') => 'kh',
1366
- __('Cameroon', 'wpsl') => 'cm',
1367
- __('Canada', 'wpsl') => 'ca',
1368
- __('Cape Verde', 'wpsl') => 'cv',
1369
- __('Cayman Islands', 'wpsl') => 'ky',
1370
- __('Central African Republic', 'wpsl') => 'cf',
1371
- __('Chad', 'wpsl') => 'td',
1372
- __('Chile', 'wpsl') => 'cl',
1373
- __('China', 'wpsl') => 'cn',
1374
- __('Christmas Island', 'wpsl') => 'cx',
1375
- __('Cocos Islands', 'wpsl') => 'cc',
1376
- __('Colombia', 'wpsl') => 'co',
1377
- __('Comoros', 'wpsl') => 'km',
1378
- __('Congo', 'wpsl') => 'cg',
1379
- __('Costa Rica', 'wpsl') => 'cr',
1380
- __('Côte d\'Ivoire', 'wpsl') => 'ci',
1381
- __('Croatia', 'wpsl') => 'hr',
1382
- __('Cuba', 'wpsl') => 'cu',
1383
- __('Czech Republic', 'wpsl') => 'cz',
1384
- __('Denmark', 'wpsl') => 'dk',
1385
- __('Djibouti', 'wpsl') => 'dj',
1386
- __('Democratic Republic of the Congo', 'wpsl') => 'cd',
1387
- __('Dominica', 'wpsl') => 'dm',
1388
- __('Dominican Republic', 'wpsl') => 'do',
1389
- __('Ecuador', 'wpsl') => 'ec',
1390
- __('Egypt', 'wpsl') => 'eg',
1391
- __('El Salvador', 'wpsl') => 'sv',
1392
- __('Equatorial Guinea', 'wpsl') => 'gq',
1393
- __('Eritrea', 'wpsl') => 'er',
1394
- __('Estonia', 'wpsl') => 'ee',
1395
- __('Ethiopia', 'wpsl') => 'et',
1396
- __('Fiji', 'wpsl') => 'fj',
1397
- __('Finland', 'wpsl') => 'fi',
1398
- __('France', 'wpsl') => 'fr',
1399
- __('French Guiana', 'wpsl') => 'gf',
1400
- __('Gabon', 'wpsl') => 'ga',
1401
- __('Gambia', 'wpsl') => 'gm',
1402
- __('Germany', 'wpsl') => 'de',
1403
- __('Ghana', 'wpsl') => 'gh',
1404
- __('Greenland', 'wpsl') => 'gl',
1405
- __('Greece', 'wpsl') => 'gr',
1406
- __('Grenada', 'wpsl') => 'gd',
1407
- __('Guam', 'wpsl') => 'gu',
1408
- __('Guadeloupe', 'wpsl') => 'gp',
1409
- __('Guatemala', 'wpsl') => 'gt',
1410
- __('Guinea', 'wpsl') => 'gn',
1411
- __('Guinea-Bissau', 'wpsl') => 'gw',
1412
- __('Haiti', 'wpsl') => 'ht',
1413
- __('Honduras', 'wpsl') => 'hn',
1414
- __('Hong Kong', 'wpsl') => 'hk',
1415
- __('Hungary', 'wpsl') => 'hu',
1416
- __('Iceland', 'wpsl') => 'is',
1417
- __('India', 'wpsl') => 'in',
1418
- __('Indonesia', 'wpsl') => 'id',
1419
- __('Iran', 'wpsl') => 'ir',
1420
- __('Iraq', 'wpsl') => 'iq',
1421
- __('Ireland', 'wpsl') => 'ie',
1422
- __('Israel', 'wpsl') => 'il',
1423
- __('Italy', 'wpsl') => 'it',
1424
- __('Jamaica', 'wpsl') => 'jm',
1425
- __('Japan', 'wpsl') => 'jp',
1426
- __('Jordan', 'wpsl') => 'jo',
1427
- __('Kazakhstan', 'wpsl') => 'kz',
1428
- __('Kenya', 'wpsl') => 'ke',
1429
- __('Kuwait', 'wpsl') => 'kw',
1430
- __('Kyrgyzstan', 'wpsl') => 'kg',
1431
- __('Laos', 'wpsl') => 'la',
1432
- __('Latvia', 'wpsl') => 'lv',
1433
- __('Lebanon', 'wpsl') => 'lb',
1434
- __('Lesotho', 'wpsl') => 'ls',
1435
- __('Liberia', 'wpsl') => 'lr',
1436
- __('Libya', 'wpsl') => 'ly',
1437
- __('Liechtenstein', 'wpsl') => 'li',
1438
- __('Lithuania', 'wpsl') => 'lt',
1439
- __('Luxembourg', 'wpsl') => 'lu',
1440
- __('Macau', 'wpsl') => 'mo',
1441
- __('Macedonia', 'wpsl') => 'mk',
1442
- __('Madagascar', 'wpsl') => 'mg',
1443
- __('Malawi', 'wpsl') => 'mw',
1444
- __('Malaysia ', 'wpsl') => 'my',
1445
- __('Mali', 'wpsl') => 'ml',
1446
- __('Marshall Islands', 'wpsl') => 'mh',
1447
- __('Martinique', 'wpsl') => 'il',
1448
- __('Mauritania', 'wpsl') => 'mr',
1449
- __('Mauritius', 'wpsl') => 'mu',
1450
- __('Mexico', 'wpsl') => 'mx',
1451
- __('Micronesia', 'wpsl') => 'fm',
1452
- __('Moldova', 'wpsl') => 'md',
1453
- __('Monaco' ,'wpsl') => 'mc',
1454
- __('Mongolia', 'wpsl') => 'mn',
1455
- __('Montenegro', 'wpsl') => 'me',
1456
- __('Montserrat', 'wpsl') => 'ms',
1457
- __('Morocco', 'wpsl') => 'ma',
1458
- __('Mozambique', 'wpsl') => 'mz',
1459
- __('Myanmar', 'wpsl') => 'mm',
1460
- __('Namibia', 'wpsl') => 'na',
1461
- __('Nauru', 'wpsl') => 'nr',
1462
- __('Nepal', 'wpsl') => 'np',
1463
- __('Netherlands', 'wpsl') => 'nl',
1464
- __('Netherlands Antilles', 'wpsl') => 'an',
1465
- __('New Zealand', 'wpsl') => 'nz',
1466
- __('Nicaragua', 'wpsl') => 'ni',
1467
- __('Niger', 'wpsl') => 'ne',
1468
- __('Nigeria', 'wpsl') => 'ng',
1469
- __('Niue', 'wpsl') => 'nu',
1470
- __('Northern Mariana Islands', 'wpsl') => 'mp',
1471
- __('Norway', 'wpsl') => 'no',
1472
- __('Oman', 'wpsl') => 'om',
1473
- __('Pakistan', 'wpsl') => 'pk',
1474
- __('Panama' ,'wpsl') => 'pa',
1475
- __('Papua New Guinea', 'wpsl') => 'pg',
1476
- __('Paraguay' ,'wpsl') => 'py',
1477
- __('Peru', 'wpsl') => 'pe',
1478
- __('Philippines', 'wpsl') => 'ph',
1479
- __('Pitcairn Islands', 'wpsl') => 'pn',
1480
- __('Poland', 'wpsl') => 'pl',
1481
- __('Portugal', 'wpsl') => 'pt',
1482
- __('Qatar', 'wpsl') => 'qa',
1483
- __('Reunion', 'wpsl') => 're',
1484
- __('Romania', 'wpsl') => 'ro',
1485
- __('Russia', 'wpsl') => 'ru',
1486
- __('Rwanda', 'wpsl') => 'rw',
1487
- __('Saint Helena', 'wpsl') => 'sh',
1488
- __('Saint Kitts and Nevis', 'wpsl') => 'kn',
1489
- __('Saint Vincent and the Grenadines', 'wpsl') => 'vc',
1490
- __('Saint Lucia', 'wpsl') => 'lc',
1491
- __('Samoa', 'wpsl') => 'ws',
1492
- __('San Marino', 'wpsl') => 'sm',
1493
- __('São Tomé and Príncipe', 'wpsl') => 'st',
1494
- __('Saudi Arabia', 'wpsl') => 'sa',
1495
- __('Senegal', 'wpsl') => 'sn',
1496
- __('Serbia', 'wpsl') => 'rs',
1497
- __('Seychelles', 'wpsl') => 'sc',
1498
- __('Sierra Leone', 'wpsl') => 'sl',
1499
- __('Singapore', 'wpsl') => 'sg',
1500
- __('Slovakia', 'wpsl') => 'si',
1501
- __('Solomon Islands', 'wpsl') => 'sb',
1502
- __('Somalia', 'wpsl') => 'so',
1503
- __('South Africa', 'wpsl') => 'za',
1504
- __('South Korea', 'wpsl') => 'kr',
1505
- __('Spain', 'wpsl') => 'es',
1506
- __('Sri Lanka', 'wpsl') => 'lk',
1507
- __('Sudan', 'wpsl') => 'sd',
1508
- __('Swaziland', 'wpsl') => 'sz',
1509
- __('Sweden', 'wpsl') => 'se',
1510
- __('Switzerland', 'wpsl') => 'ch',
1511
- __('Syria', 'wpsl') => 'sy',
1512
- __('Taiwan', 'wpsl') => 'tw',
1513
- __('Tajikistan', 'wpsl') => 'tj',
1514
- __('Tanzania', 'wpsl') => 'tz',
1515
- __('Thailand', 'wpsl') => 'th',
1516
- __('Timor-Leste', 'wpsl') => 'tl',
1517
- __('Tokelau' ,'wpsl') => 'tk',
1518
- __('Togo', 'wpsl') => 'tg',
1519
- __('Tonga', 'wpsl') => 'to',
1520
- __('Trinidad and Tobago', 'wpsl') => 'tt',
1521
- __('Tunisia', 'wpsl') => 'tn',
1522
- __('Turkey', 'wpsl') => 'tr',
1523
- __('Turkmenistan', 'wpsl') => 'tm',
1524
- __('Tuvalu', 'wpsl') => 'tv',
1525
- __('Uganda', 'wpsl') => 'ug',
1526
- __('Ukraine', 'wpsl') => 'ua',
1527
- __('United Arab Emirates', 'wpsl') => 'ae',
1528
- __('United Kingdom', 'wpsl') => 'gb',
1529
- __('United States', 'wpsl') => 'us',
1530
- __('Uruguay', 'wpsl') => 'uy',
1531
- __('Uzbekistan', 'wpsl') => 'uz',
1532
- __('Wallis Futuna', 'wpsl') => 'wf',
1533
- __('Venezuela', 'wpsl') => 've',
1534
- __('Vietnam', 'wpsl') => 'vn',
1535
- __('Yemen', 'wpsl') => 'ye',
1536
- __('Zambia' ,'wpsl') => 'zm',
1537
- __('Zimbabwe', 'wpsl') => 'zw'
1538
- );
1539
- }
1540
-
1541
- /* Make sure we have a array with a value */
1542
- if ( !empty( $api_option_list ) && ( is_array( $api_option_list ) ) ) {
1543
- $option_list = '';
1544
- $i = 0;
1545
-
1546
- foreach ( $api_option_list as $api_option_key => $api_option_value ) {
1547
-
1548
- /* If no option value exist, set the first one as the selected */
1549
- if ( ( $i == 0 ) && ( empty( $this->settings['api_'.$list] ) ) ) {
1550
- $selected = 'selected="selected"';
1551
- } else {
1552
- $selected = ( $this->settings['api_'.$list] == $api_option_value ) ? 'selected="selected"' : '';
1553
- }
1554
-
1555
- $option_list .= '<option value="' . esc_attr( $api_option_value ) . '" ' . $selected . '> ' . esc_html( $api_option_key ) . '</option>';
1556
- $i++;
1557
- }
1558
-
1559
- return $option_list;
1560
- }
1561
 
1562
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1563
 
1564
  /**
1565
- * Check if we can use a font for the plugin icon
1566
  *
1567
- * @since 1.0
1568
- * @param $location The location
1569
  * @return void
1570
  */
1571
- private function check_icon_font_usage() {
1572
-
1573
- global $wp_version;
1574
-
1575
- if ( ( version_compare( $wp_version, '3.8', '>=' ) == TRUE ) ) {
1576
- wp_enqueue_style( 'wpsl-admin-css-38', plugins_url( '/css/style-3.8.css', __FILE__ ), false );
 
 
 
 
1577
  }
1578
  }
1579
 
1580
  /**
1581
- * Deregister other Google Maps scripts
1582
- *
1583
- * If plugins / themes also include the Google Maps library, and it is loaded after the
1584
- * one from the Store Locator. It can break the autocomplete on the settings page.
1585
- * To make sure this doesn't happen we look for other Google Maps scripts,
1586
- * and if they exists we deregister them on the settings page.
1587
- *
1588
- * @since 1.2.20
1589
  * @return void
1590
  */
1591
- public function deregister_other_gmaps() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1592
 
1593
- global $wp_scripts;
 
 
 
 
 
 
 
 
 
1594
 
1595
- foreach ( $wp_scripts->registered as $index => $script ) {
1596
- if ( ( strpos( $script->src, 'maps.google.com' ) !== false ) && ( $script->handle !== 'wpsl-gmap' ) ) {
1597
- wp_deregister_script( $script->handle );
1598
- }
1599
- }
1600
- }
1601
-
1602
  /**
1603
- * The warning messages used in wpsl-admin.js
1604
  *
1605
- * @since 1.2.20
1606
- * @return array $admin_js_l10n The texts used in the wpsl-admin.js
 
 
1607
  */
1608
- public function admin_js_l10n() {
1609
- $admin_js_l10n = array(
1610
- 'noAddress' => __( 'Cannot determine the address at this location.', 'wpsl' ),
1611
- 'geocodeFail' => __( 'Geocode was not successful for the following reason: ', 'wpsl' ),
1612
- 'securityFail' => __( 'Security check failed, reload the page and try again.', 'wpsl' )
1613
- );
1614
 
1615
- return $admin_js_l10n;
 
 
 
 
 
 
 
 
1616
  }
1617
 
1618
  /**
1619
- * Add the required admin script
1620
  *
1621
- * @since 1.0
1622
- * @return void
 
1623
  */
1624
- public function admin_scripts() {
1625
 
1626
- $screen = get_current_screen();
1627
 
1628
- wp_enqueue_script( 'wpsl-admin-js', plugins_url( '/js/wpsl-admin.js', __FILE__ ), array( 'jquery' ), false );
1629
-
1630
- /* Only enqueue the styles and scripts if we are on a page that belongs to the store locator */
1631
- if ( strpos( $screen->id, 'wpsl_' ) !== false ) {
1632
- wp_enqueue_media();
1633
- wp_enqueue_script( 'jquery-ui-dialog' );
1634
- wp_enqueue_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css' );
1635
- wp_enqueue_style( 'wpsl-admin-css', plugins_url( '/css/style.css', __FILE__ ), false );
1636
- wp_enqueue_script( 'wpsl-gmap', ( "//maps.google.com/maps/api/js?sensor=false&libraries=places&language=" . $this->settings['api_language'] ), false, '', true ); // we set the language here to make sure the geocode response returns the country name in the correct language
1637
- wp_enqueue_script( 'wpsl-queue', plugins_url( '/js/ajax-queue.js', __FILE__ ), array( 'jquery' ), false );
1638
- wp_enqueue_script( 'wpsl-retina', plugins_url( '/js/retina-1.1.0.js', __FILE__ ), array( 'jquery' ), false );
1639
- wp_localize_script( 'wpsl-admin-js', 'wpslL10n', $this->admin_js_l10n() );
1640
  }
1641
 
1642
- $this->check_icon_font_usage();
1643
  }
1644
- }
1645
 
1646
- new WPSL_Admin;
1647
  }
2
  /**
3
  * Admin class
4
  *
5
+ * @package WP_Store_locator
6
+ * @since 1.0
7
+ */
 
 
 
8
 
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
 
11
  if ( !class_exists( 'WPSL_Admin' ) ) {
12
+
13
  /**
14
  * Handle the backend of the store locator
15
  *
16
  * @since 1.0
17
  */
18
+ class WPSL_Admin {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  /**
21
+ * @since 2.0
22
+ * @var WPSL_Metaboxes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  */
24
+ public $metaboxes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  /**
27
+ * @since 2.0
28
+ * @var WPSL_Geocode
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  */
30
+ public $geocode;
31
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  /**
33
+ * @since 2.0
34
+ * @var WPSL_Notices
 
 
 
35
  */
36
+ public $notices;
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /**
39
+ * @since 2.0
40
+ * @var WPSL_Settings
 
 
 
41
  */
42
+ public $settings_page;
 
 
 
 
 
43
 
44
  /**
45
+ * Class constructor
 
 
 
46
  */
47
+ function __construct() {
48
 
49
+ $this->includes();
50
+
51
+ add_action( 'init', array( $this, 'init' ) );
52
+ add_action( 'admin_menu', array( $this, 'create_admin_menu' ) );
53
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
54
+ add_action( 'delete_post', array( $this, 'maybe_delete_autoload_transient' ) );
55
+ add_action( 'wp_trash_post', array( $this, 'maybe_delete_autoload_transient' ) );
56
+ add_action( 'untrash_post', array( $this, 'maybe_delete_autoload_transient' ) );
57
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
58
+
59
+ add_filter( 'plugin_action_links_' . WPSL_BASENAME, array( $this, 'add_action_links' ), 10, 2 );
60
+ add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
61
  }
62
 
63
  /**
64
+ * Include all the required files.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  *
66
+ * @since 2.0
67
  * @return void
68
  */
69
+ public function includes() {
70
+ require_once( WPSL_PLUGIN_DIR . 'admin/class-notices.php' );
71
+ require_once( WPSL_PLUGIN_DIR . 'admin/class-metaboxes.php' );
72
+ require_once( WPSL_PLUGIN_DIR . 'admin/class-geocode.php' );
73
+ require_once( WPSL_PLUGIN_DIR . 'admin/class-settings.php' );
74
+ require_once( WPSL_PLUGIN_DIR . 'admin/upgrade.php' );
75
  }
76
 
77
  /**
78
+ * Init the classes.
79
  *
80
+ * @since 2.0
81
  * @return void
82
  */
83
+ public function init() {
84
+ $this->notices = new WPSL_Notices();
85
+ $this->metaboxes = new WPSL_Metaboxes();
86
+ $this->geocode = new WPSL_Geocode();
87
+ $this->settings_page = new WPSL_Settings();
88
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
 
 
 
 
 
 
 
 
90
  /**
91
+ * Register a callback function for the settings page
92
+ * and check if we need to show the "missing start point" warning.
93
+ *
94
  * @since 1.0
 
95
  * @return void
96
  */
97
+ public function admin_init() {
98
 
99
+ global $current_user, $wpsl_settings;
100
+
101
+ if ( ( current_user_can( 'install_plugins' ) ) && is_admin() ) {
102
+ if ( ( empty( $wpsl_settings['zoom_latlng'] ) && !get_user_meta( $current_user->ID, 'wpsl_disable_location_warning' ) ) ) {
103
+ add_action( 'wp_ajax_disable_location_warning', array( $this, 'disable_location_warning_ajax' ) );
104
+ add_action( 'admin_footer', array( $this, 'show_location_warning' ) );
105
+ }
106
+ }
107
+ }
 
 
 
 
 
 
 
 
108
 
109
  /**
110
+ * Display an error message when no start location is defined.
111
  *
112
  * @since 1.2
113
  * @return void
114
  */
115
+ public function show_location_warning() {
116
+
117
+ if ( isset( $_GET['page'] ) && ( $_GET['page'] == 'wpsl_settings' ) ) {
118
+ echo "<div id='message' class='error'><p>" . sprintf( __( "Before adding the [wpsl] shortcode to a page, please don't forget to define a %sstart point%s. %sDismiss%s", "wpsl" ), "<a href='#wpsl-auto-locate'>", "</a>", "<a class='wpsl-dismiss' data-nonce='" . wp_create_nonce( 'wpsl-dismiss' ) . "' href='#'>", "</a>" ). "</p></div>";
119
+ } else {
120
+ echo "<div id='message' class='error'><p>" . sprintf( __( "Before adding the [wpsl] shortcode to a page, please don't forget to define a start point on the %ssettings%s page. %sDismiss%s", "wpsl" ), "<a href='" . admin_url( 'edit.php?post_type=wpsl_stores&page=wpsl_settings' ) . "'>", "</a>", "<a class='wpsl-dismiss' data-nonce='" . wp_create_nonce( 'wpsl-dismiss' ) . "' href='#'>", "</a>" ). "</p></div>";
121
+ }
122
  }
123
 
124
  /**
125
+ * Disable the missing start location warning.
126
  *
127
  * @since 1.2
128
  * @return void
131
 
132
  global $current_user;
133
 
134
+ if ( !current_user_can( 'manage_wpsl_settings' ) )
135
  die( '-1' );
136
  check_ajax_referer( 'wpsl-dismiss' );
137
 
138
+ add_user_meta( $current_user->ID, 'wpsl_disable_location_warning', 'true', true );
139
 
140
  die();
141
  }
142
+
143
+ /**
144
+ * Add the menu pages.
145
+ *
146
  * @since 1.0
147
+ * @return void
148
  */
149
+ public function create_admin_menu() {
150
+ add_submenu_page( 'edit.php?post_type=wpsl_stores', __( 'Settings', 'wpsl' ), __( 'Settings', 'wpsl' ), 'manage_wpsl_settings', 'wpsl_settings', array( $this, 'show_settings' ) );
151
+ }
152
+
153
+ /**
154
+ * Show the settings page.
155
+ *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  * @since 1.0
157
+ * @return void
 
 
158
  */
159
+ public function show_settings() {
160
+ require 'templates/map-settings.php';
161
+ }
162
 
163
+ /**
164
+ * Check if we need to delete the autoload transient.
 
 
 
 
 
 
 
 
 
 
 
 
165
  *
166
+ * This is called when a post it saved, deleted, trashed or untrashed.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  *
168
+ * @since 2.0
169
+ * @return void
170
  */
171
+ public function maybe_delete_autoload_transient( $post_id ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
173
+ global $wpsl_settings;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
 
175
+ if ( isset( $wpsl_settings['autoload'] ) && $wpsl_settings['autoload'] && get_post_type( $post_id ) == 'wpsl_stores' ) {
176
+ $this->delete_autoload_transient();
 
 
 
 
 
 
 
 
177
  }
 
 
178
  }
179
 
180
  /**
181
+ * Delete the transients that are used on the front-end
182
+ * if the autoload option is enabled.
183
+ *
184
+ * The transient names used by the store locator are partly dynamic.
185
+ * They always start with wpsl_autoload_, followed by the number of
186
+ * stores to load and ends with the language code.
187
+ *
188
+ * So you get wpsl_autoload_20_de if the language is set to German
189
+ * and 20 stores are set to show on page load.
190
+ *
191
+ * The language code has to be included in case a multilingual plugin is used.
192
+ * Otherwise it can happen the user switches to Spanish,
193
+ * but ends up seeing the store data in the wrong language.
194
+ *
195
+ * @since 2.0
196
+ * @return void
197
  */
198
+ public function delete_autoload_transient() {
199
 
200
+ global $wpdb;
201
+
202
+ $option_names = $wpdb->get_results( "SELECT option_name AS transient_name FROM " . $wpdb->options . " WHERE option_name LIKE ('\_transient\_wpsl\_autoload\_%')" );
 
 
 
 
 
 
 
 
 
 
 
 
 
203
 
204
+ if ( $option_names ) {
205
+ foreach ( $option_names as $option_name ) {
206
+ $transient_name = str_replace( "_transient_", "", $option_name->transient_name );
207
 
208
+ delete_transient( $transient_name );
209
  }
210
  }
 
 
211
  }
212
 
213
  /**
214
+ * Check if we can use a font for the plugin icon.
215
+ *
216
+ * This is supported by WP 3.8 or higher
217
  *
218
  * @since 1.0
219
+ * @return void
220
  */
221
+ private function check_icon_font_usage() {
222
+
223
+ global $wp_version;
 
 
 
 
 
 
 
224
 
225
+ if ( ( version_compare( $wp_version, '3.8', '>=' ) == TRUE ) ) {
226
+ $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
227
+
228
+ wp_enqueue_style( 'wpsl-admin-38', plugins_url( '/css/style-3.8'. $min .'.css', __FILE__ ), false );
229
+ }
230
  }
231
 
232
  /**
233
+ * Deregister other Google Maps scripts.
234
  *
235
+ * If plugins / themes also include the Google Maps library, and it is loaded after the
236
+ * one from the Store Locator. It can break the autocomplete on the settings page.
237
+ *
238
+ * To make sure this doesn't happen we look for other Google Maps scripts,
239
+ * and if they exists we deregister them one pages that are used by the store locator.
240
+ *
241
+ * @since 1.2.20
242
+ * @return void
243
  */
244
+ public function deregister_other_gmaps() {
245
+
246
+ global $wp_scripts;
 
 
 
 
 
 
 
 
247
 
248
+ foreach ( $wp_scripts->registered as $index => $script ) {
249
+ if ( ( strpos( $script->src, 'maps.google.com' ) !== false ) || ( strpos( $script->src, 'maps.googleapis.com' ) !== false ) && ( $script->handle !== 'wpsl-gmap' ) ) {
250
+ wp_deregister_script( $script->handle );
251
+ }
252
+ }
 
253
  }
254
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  /**
256
+ * The text messages used in wpsl-admin.js.
257
  *
258
  * @since 1.2.20
259
+ * @return array $admin_js_l10n The texts used in the wpsl-admin.js
 
260
  */
261
+ public function admin_js_l10n() {
262
 
263
+ $admin_js_l10n = array(
264
+ 'noAddress' => __( 'Cannot determine the address at this location.', 'wpsl' ),
265
+ 'geocodeFail' => __( 'Geocode was not successful for the following reason', 'wpsl' ),
266
+ 'securityFail' => __( 'Security check failed, reload the page and try again.', 'wpsl' ),
267
+ 'requiredFields' => __( 'Please fill in all the required store details.', 'wpsl' ),
268
+ 'missingGeoData' => __( 'The map preview requires all the location details.', 'wpsl' ),
269
+ 'closedDate' => __( 'Closed', 'wpsl' ),
270
+ 'styleError' => __( 'The code for the map style is invalid.', 'wpsl' )
 
 
 
 
 
 
 
 
 
271
  );
272
 
273
+ return $admin_js_l10n;
274
  }
275
 
276
  /**
277
+ * Plugin settings that are used in the wpsl-admin.js.
278
  *
279
+ * @since 2.0
280
+ * @return array $settings_js The settings used in the wpsl-admin.js
 
 
281
  */
282
+ public function js_settings() {
283
 
284
+ global $wpsl_settings;
 
 
 
 
 
 
 
 
 
 
 
285
 
286
+ $js_settings = array(
287
+ 'hourFormat' => $wpsl_settings['editor_hour_format'],
288
+ 'defaultLatLng' => '52.378153,4.899363',
289
+ 'defaultZoom' => 6,
290
+ 'mapType' => $wpsl_settings['editor_map_type']
291
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
 
293
+ return apply_filters( 'wpsl_admin_js_settings', $js_settings );
 
 
 
 
 
 
 
 
294
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
 
296
  /**
297
+ * Add the required admin script.
298
  *
299
  * @since 1.0
300
+ * @return void
301
  */
302
+ public function admin_scripts() {
303
+
304
+ global $wpsl_settings;
305
 
306
+ $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
 
308
+ /* Always load the main js admin file to make sure the "dismiss" link in the location notice works. */
309
+ wp_enqueue_script( 'wpsl-admin-js', plugins_url( '/js/wpsl-admin'. $min .'.js', __FILE__ ), array( 'jquery' ), WPSL_VERSION_NUM, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
+ $this->maybe_show_pointer();
312
+ $this->check_icon_font_usage();
313
+
314
+ /* Only enqueue the rest of the css/js files if we are on a page that belongs to the store locator */
315
+ if ( ( get_post_type() == 'wpsl_stores' ) || ( isset( $_GET['post_type'] ) && ( $_GET['post_type'] == 'wpsl_stores' ) ) ) {
316
+
317
+ /* Make sure no other Google Map scripts can interfere with the one from the store locator */
318
+ $this->deregister_other_gmaps();
319
+
320
+ wp_enqueue_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css' );
321
+ wp_enqueue_style( 'wpsl-admin-css', plugins_url( '/css/style'. $min .'.css', __FILE__ ), false );
322
+
323
+ wp_enqueue_media();
324
+ wp_enqueue_script( 'jquery-ui-dialog' );
325
+ wp_enqueue_script( 'wpsl-gmap', ( '//maps.google.com/maps/api/js?sensor=false&libraries=places&language=' . $wpsl_settings['api_language'] ), false, '', true ); // we set the language here to make sure the geocode response returns the country name in the correct language
326
+ wp_enqueue_script( 'wpsl-queue', plugins_url( '/js/ajax-queue'. $min .'.js', __FILE__ ), array( 'jquery' ), WPSL_VERSION_NUM, true );
327
+ wp_enqueue_script( 'wpsl-retina', plugins_url( '/js/retina'. $min .'.js', __FILE__ ), array( 'jquery' ), WPSL_VERSION_NUM, true );
328
+
329
+ wp_localize_script( 'wpsl-admin-js', 'wpslL10n', $this->admin_js_l10n() );
330
+ wp_localize_script( 'wpsl-admin-js', 'wpslSettings', $this->js_settings() );
331
+ }
332
+ }
333
 
334
  /**
335
+ * Check if we need to show the wpsl pointer.
336
  *
337
+ * @since 2.0
 
338
  * @return void
339
  */
340
+ public function maybe_show_pointer() {
341
+
342
+ $dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
343
+
344
+ /* If the user hasn't dismissed the wpsl pointer, enqueue the script and style, and call the action hook. */
345
+ if ( !in_array( 'wpsl_signup_pointer', $dismissed_pointers ) ) {
346
+ wp_enqueue_style( 'wp-pointer' );
347
+ wp_enqueue_script( 'wp-pointer' );
348
+
349
+ add_action( 'admin_print_footer_scripts', array( $this, 'welcome_pointer_script' ) );
350
  }
351
  }
352
 
353
  /**
354
+ * Add the script for the welcome pointer.
355
+ *
356
+ * @since 2.0
 
 
 
 
 
357
  * @return void
358
  */
359
+ public function welcome_pointer_script() {
360
+
361
+ $pointer_content = '<h3>' . __( 'Welcome to WP Store Locator', 'wpsl' ) . '</h3>';
362
+ $pointer_content .= '<p>' . __( 'Sign up for the latest plugin updates and announcements.', 'wpsl' ) . '</p>';
363
+ $pointer_content .= '<div id="mc_embed_signup" class="wpsl-mc-wrap" style="padding:0 15px; margin-bottom:13px;"><form action="//wpstorelocator.us10.list-manage.com/subscribe/post?u=34e4c75c3dc990d14002e19f6&amp;id=4be03427d7" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate><div id="mc_embed_signup_scroll"><input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required style="margin-right:5px;width:230px;"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"><div style="position: absolute; left: -5000px;"><input type="text" name="b_34e4c75c3dc990d14002e19f6_4be03427d7" tabindex="-1" value=""></div></div></form></div>';
364
+ ?>
365
+
366
+ <script type="text/javascript">
367
+ //<![CDATA[
368
+ jQuery( document ).ready( function( $ ) {
369
+ $( '#menu-posts-wpsl_stores' ).pointer({
370
+ content: '<?php echo $pointer_content; ?>',
371
+ position: {
372
+ edge: 'left',
373
+ align: 'center'
374
+ },
375
+ pointerWidth: 350,
376
+ close: function () {
377
+ $.post( ajaxurl, {
378
+ pointer: 'wpsl_signup_pointer',
379
+ action: 'dismiss-wp-pointer'
380
+ });
381
+ }
382
+ }).pointer( 'open' );
383
 
384
+ /* If a user clicked the "subscribe" button trigger the close button for the pointer. */
385
+ $( ".wpsl-mc-wrap #mc-embedded-subscribe" ).on( "click", function() {
386
+ $( ".wp-pointer .close" ).trigger( "click" );
387
+ });
388
+ });
389
+ //]]>
390
+ </script>
391
+
392
+ <?php
393
+ }
394
 
 
 
 
 
 
 
 
395
  /**
396
+ * Add action links to the plugin row.
397
  *
398
+ * @since 2.0
399
+ * @param array $links The existing action links
400
+ * @param string $file The file path of the current plugin
401
+ * @return array $links The modified links
402
  */
403
+ public function add_action_links( $links, $file ) {
 
 
 
 
 
404
 
405
+ if ( strpos( $file, 'wp-store-locator.php' ) !== false ) {
406
+ $documentation = '<a href="http://wpstorelocator.co/documentation" target="_blank">'. __( 'Documentation', 'wpsl' ).'</a>';
407
+ array_unshift( $links, $documentation );
408
+
409
+ $settings_link = '<a href="' . admin_url( 'edit.php?post_type=wpsl_stores&page=wpsl_settings' ) . '">' . __( 'General Settings', 'wpsl' ) . '</a>';
410
+ array_unshift( $links, $settings_link );
411
+ }
412
+
413
+ return $links;
414
  }
415
 
416
  /**
417
+ * Change the footer text on the settings page.
418
  *
419
+ * @since 2.0
420
+ * @param string $text The current footer text
421
+ * @return string $text Either the original or modified footer text
422
  */
423
+ public function admin_footer_text( $text ) {
424
 
425
+ $current_screen = get_current_screen();
426
 
427
+ /* Only modify the footer text if we are on the settings page of the wp store locator. */
428
+ if ( isset( $current_screen->id ) && $current_screen->id == 'wpsl_stores_page_wpsl_settings' ) {
429
+ $text = sprintf( __( 'If you like this plugin please leave us a %s5 star%s rating.', 'wpsl' ), '<a href="https://wordpress.org/support/view/plugin-reviews/wp-store-locator?filter=5#postform" target="_blank"><strong>', '</strong></a>' );
 
 
 
 
 
 
 
 
 
430
  }
431
 
432
+ return $text;
433
  }
434
+ }
435
 
436
+ $GLOBALS['wpsl_admin'] = new WPSL_Admin();
437
  }
admin/class-geocode.php ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Geocode store locations
4
+ *
5
+ * @package WP_Store_locator
6
+ * @since 2.0
7
+ */
8
+
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
+
11
+ if ( !class_exists( 'WPSL_Geocode' ) ) {
12
+
13
+ class WPSL_Geocode {
14
+
15
+ /**
16
+ * Check if we need to run a geocode request or use the current location data.
17
+ *
18
+ * The latlng value is only present if the user provided it himself, or used the preview
19
+ * on the map. Otherwise the latlng will be missing and we need to geocode the supplied address.
20
+ *
21
+ * @since 2.0
22
+ * @param integer $post_id Store post ID
23
+ * @param array $store_data The store data
24
+ * @return void
25
+ */
26
+ public function check_geocode_data( $post_id, $store_data ) {
27
+
28
+ $location_data = array();
29
+
30
+ /* Check if the latlng data is valid */
31
+ $latlng = $this->validate_latlng( $store_data['lat'], $store_data['lng'] );
32
+
33
+ /* If we don't have a valid latlng value, we geocode the supplied address to get one */
34
+ if ( !$latlng ) {
35
+ $response = $this->geocode_location( $post_id, $store_data );
36
+ $location_data['country_iso'] = $response['country_iso'];
37
+ $location_data['latlng'] = $response['latlng'];
38
+ } else {
39
+ $location_data['latlng'] = $latlng;
40
+ }
41
+
42
+ /* Restrict the latlng to a max of 6 decimals */
43
+ $location_data['latlng'] = $this->format_latlng( $location_data['latlng'] );
44
+
45
+ $location_data['lat'] = $location_data['latlng']['lat'];
46
+ $location_data['lng'] = $location_data['latlng']['lng'];
47
+
48
+ $this->save_store_location( $post_id, $location_data );
49
+ }
50
+
51
+ /**
52
+ * Geocode the store location.
53
+ *
54
+ * @since 1.0
55
+ * @param integer $post_id Store post ID
56
+ * @param array $store_data The submitted store data ( address, city, country etc )
57
+ * @return void
58
+ */
59
+ public function geocode_location( $post_id, $store_data ) {
60
+
61
+ $geocode_response = $this->get_latlng( $post_id, $store_data );
62
+
63
+ if ( isset( $geocode_response['status'] ) ) {
64
+ switch ( $geocode_response['status'] ) {
65
+ case 'OK':
66
+ $location_data = array (
67
+ 'country_iso' => $this->filter_country_name( $geocode_response ),
68
+ 'latlng' => $this->format_latlng( $geocode_response['results'][0]['geometry']['location'] )
69
+ );
70
+
71
+ return $location_data;
72
+ case 'ZERO_RESULTS':
73
+ $msg = __( 'The Google Geocoding API returned no results for the supplied address. Please change the address and try again.', 'wpsl' );
74
+ break;
75
+ case 'OVER_QUERY_LIMIT':
76
+ $msg = sprintf( __( 'You have reached the daily allowed geocoding limit, you can read more %shere%s.', 'wpsl' ), '<a target="_blank" href="https://developers.google.com/maps/documentation/geocoding/#Limits">', '</a>' );
77
+ break;
78
+ default:
79
+ $msg = __( 'The Google Geocoding API failed to return valid data, please try again later.', 'wpsl' );
80
+ break;
81
+ }
82
+ }
83
+
84
+ /* Handle the geocode code errors messages */
85
+ if ( !empty( $msg ) ) {
86
+ $this->geocode_failed( $msg, $post_id );
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Make the API call to Google to geocode the address.
92
+ *
93
+ * @since 1.0
94
+ * @param integer $post_id store post ID
95
+ * @param array $store_data The store data
96
+ * @return void|array $geo_data The geocoded response
97
+ */
98
+ public function get_latlng( $post_id, $store_data ) {
99
+
100
+ $address = $store_data['address'].','.$store_data['city'].','.$store_data['zip'].','.$store_data['country'];
101
+ $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode( $address ) . '&sensor=false' . wpsl_get_gmap_api_params();
102
+ $response = wp_remote_get( $url );
103
+
104
+ if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 || empty( $response['body'] ) ) {
105
+ $msg = __( 'The Google Geocoding API failed to return valid data, please try again later.', 'wpsl' );
106
+ $this->geocode_failed( $msg, $post_id );
107
+ } else {
108
+ $geo_data = json_decode( $response['body'], true );
109
+
110
+ return $geo_data;
111
+ }
112
+ }
113
+
114
+ /**
115
+ * If there is a problem with the geocoding then we save the notice and change the post status to pending.
116
+ *
117
+ * @since 2.0
118
+ * @param string $msg The geocode error message
119
+ * @param integer $post_id Store post ID
120
+ * @return void
121
+ */
122
+ public function geocode_failed( $msg, $post_id ) {
123
+
124
+ global $wpsl_admin;
125
+
126
+ $wpsl_admin->notices->save( 'error', $msg );
127
+ $wpsl_admin->metaboxes->set_post_pending( $post_id );
128
+ }
129
+
130
+ /**
131
+ * Save the store location data.
132
+ *
133
+ * @since 2.0
134
+ * @param integer $post_id Store post ID
135
+ * @param array $location_data The country code and latlng
136
+ * @return void
137
+ */
138
+ public function save_store_location( $post_id, $location_data ) {
139
+
140
+ if ( isset( $location_data['country_iso'] ) && ( !empty( $location_data['country_iso'] ) ) ) {
141
+ update_post_meta( $post_id, 'wpsl_country_iso', $location_data['country_iso'] );
142
+ }
143
+
144
+ update_post_meta( $post_id, 'wpsl_lat', $location_data['latlng']['lat'] );
145
+ update_post_meta( $post_id, 'wpsl_lng', $location_data['latlng']['lng'] );
146
+ }
147
+
148
+ /**
149
+ * Make sure the latlng value has a max of 6 decimals.
150
+ *
151
+ * @since 2.0
152
+ * @param array $latlng The latlng data
153
+ * @return array $latlng The formatted latlng
154
+ */
155
+ public function format_latlng( $latlng ) {
156
+
157
+ foreach ( $latlng as $key => $value ) {
158
+ if ( strlen( substr( strrchr( $value, '.' ), 1 ) ) > 6 ) {
159
+ $latlng[$key] = round( $value, 6 );
160
+ }
161
+ }
162
+
163
+ return $latlng;
164
+ }
165
+
166
+ /**
167
+ * Filter out the two letter country code from the api respsonse.
168
+ *
169
+ * @since 1.0
170
+ * @param array $response The full API geocode response
171
+ * @return string $country_name The country code
172
+ */
173
+ public function filter_country_name( $response ) {
174
+
175
+ $length = count( $response['results'][0]['address_components'] );
176
+
177
+ /* Loop over the address components untill we find the country,political part */
178
+ for ( $i = 0; $i < $length; $i++ ) {
179
+ $address_component = $response['results'][0]['address_components'][$i]['types'];
180
+
181
+ if ( $address_component[0] == 'country' && $address_component[1] == 'political' ) {
182
+ $country_name = $response['results'][0]['address_components'][$i]['short_name'];
183
+
184
+ break;
185
+ }
186
+ }
187
+
188
+ return $country_name;
189
+ }
190
+
191
+ /**
192
+ * Validate the latlng values.
193
+ *
194
+ * @since 1.0
195
+ * @param string $lat The latitude value
196
+ * @param string $lng The longitude value
197
+ * @return boolean|array $latlng The validated latlng values or false if it fails
198
+ */
199
+ public function validate_latlng( $lat, $lng ) {
200
+
201
+ if ( !is_numeric( $lat ) || ( $lat > 90 ) || ( $lat < -90 ) ) {
202
+ return false;
203
+ }
204
+
205
+ if ( !is_numeric( $lng ) || ( $lng > 180 ) || ( $lng < -180 ) ) {
206
+ return false;
207
+ }
208
+
209
+ $latlng = array(
210
+ 'lat' => $lat,
211
+ 'lng' => $lng
212
+ );
213
+
214
+ return $latlng;
215
+ }
216
+ }
217
+ }
admin/class-metaboxes.php ADDED
@@ -0,0 +1,871 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handle the metaboxes
4
+ *
5
+ * @package WP_Store_locator
6
+ * @since 2.0
7
+ */
8
+
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
+
11
+ if ( !class_exists( 'WPSL_Metaboxes' ) ) {
12
+
13
+ /**
14
+ * Handle the meta boxes
15
+ *
16
+ * @since 2.0
17
+ */
18
+ class WPSL_Metaboxes {
19
+
20
+ public function __construct() {
21
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
22
+ add_action( 'save_post', array( $this, 'save_post' ) );
23
+ add_action( 'post_updated_messages', array( $this, 'store_update_messages' ) );
24
+ }
25
+
26
+ /**
27
+ * Add the meta boxes.
28
+ *
29
+ * @since 2.0
30
+ * @return void
31
+ */
32
+ public function add_meta_boxes() {
33
+ add_meta_box( 'wpsl-store-details', __( 'Store Details', 'wpsl' ), array( $this, 'create_meta_fields' ), 'wpsl_stores', 'normal', 'high' );
34
+ add_meta_box( 'wpsl-map-preview', __( 'Store Map', 'wpsl' ), array( $this, 'map_preview' ), 'wpsl_stores', 'side' );
35
+ }
36
+
37
+ /**
38
+ * The store locator meta box fields.
39
+ *
40
+ * @since 2.0
41
+ * @return array $meta_fields The meta box fields used for the store details
42
+ */
43
+ public function meta_box_fields() {
44
+
45
+ global $wpsl_settings;
46
+
47
+ $meta_fields = array(
48
+ __( 'Location', 'wpsl' ) => array(
49
+ 'address' => array(
50
+ 'label' => __( 'Address', 'wpsl' ),
51
+ 'required' => true
52
+ ),
53
+ 'address2' => array(
54
+ 'label' => __( 'Address 2', 'wpsl' )
55
+ ),
56
+ 'city' => array(
57
+ 'label' => __( 'City', 'wpsl' ),
58
+ 'required' => true
59
+ ),
60
+ 'state' => array(
61
+ 'label' => __( 'State', 'wpsl' )
62
+ ),
63
+ 'zip' => array(
64
+ 'label' => __( 'Zip Code', 'wpsl' )
65
+ ),
66
+ 'country' => array(
67
+ 'label' => __( 'Country', 'wpsl' ),
68
+ 'required' => true
69
+ ),
70
+ 'country_iso' => array(
71
+ 'type' => 'hidden'
72
+ ),
73
+ 'lat' => array(
74
+ 'label' => __( 'Latitude', 'wpsl' )
75
+ ),
76
+ 'lng' => array(
77
+ 'label' => __( 'Longitude', 'wpsl' )
78
+ )
79
+ ),
80
+ __( 'Opening Hours', 'wpsl' ) => array(
81
+ 'hours' => array(
82
+ 'label' => __( 'Hours', 'wpsl' ),
83
+ 'type' => $wpsl_settings['editor_hour_input'] //Either set to textarea or dropdown. This is defined through the 'Opening hours input format: ' option on the settings page
84
+ )
85
+ ),
86
+ __( 'Additional Information', 'wpsl' ) => array(
87
+ 'phone' => array(
88
+ 'label' => __( 'Tel', 'wpsl' )
89
+ ),
90
+ 'fax' => array(
91
+ 'label' => __( 'Fax', 'wpsl' )
92
+ ),
93
+ 'email' => array(
94
+ 'label' => __( 'Email', 'wpsl' )
95
+ ),
96
+ 'url' => array(
97
+ 'label' => __( 'Url', 'wpsl' )
98
+ )
99
+ )
100
+ );
101
+
102
+ return apply_filters( 'wpsl_meta_box_fields', $meta_fields );
103
+ }
104
+
105
+ /**
106
+ * Create the store locator metabox input fields.
107
+ *
108
+ * @since 2.0
109
+ * @return void
110
+ */
111
+ function create_meta_fields() {
112
+
113
+ global $wpsl_settings, $wp_version;
114
+
115
+ $i = 0;
116
+ $j = 0;
117
+ $tab_items = '';
118
+
119
+ wp_nonce_field( 'save_store_meta', 'wpsl_meta_nonce' );
120
+ ?>
121
+
122
+ <div class="wpsl-store-meta <?php if ( floatval( $wp_version ) < 3.8 ) { echo 'wpsl-pre-38'; } // Fix CSS issue with < 3.8 versions ?>">
123
+ <?php
124
+
125
+ /* Create the tab navigation for the meta boxes */
126
+ foreach ( $this->meta_box_fields() as $tab => $meta_fields ) {
127
+ $active_class = ( $i == 0 ) ? ' wpsl-active' : '';
128
+
129
+ if ( $wpsl_settings['hide_hours'] && $tab == __( 'Opening Hours', 'wpsl' ) ) {
130
+ continue;
131
+ } else {
132
+ $tab_items .= $this->meta_field_nav( $tab, $active_class );
133
+ }
134
+
135
+ $i++;
136
+ }
137
+
138
+ echo '<ul id="wpsl-meta-nav">' . $tab_items . '</ul>';
139
+
140
+ /* Create the input fields for the meta boxes */
141
+ foreach ( $this->meta_box_fields() as $tab => $meta_fields ) {
142
+ $active_class = ( $j == 0 ) ? ' wpsl-active' : '';
143
+
144
+ if ( $wpsl_settings['hide_hours'] && $tab == __( 'Opening Hours', 'wpsl' ) ) {
145
+ continue;
146
+ } else {
147
+ echo '<div class="wpsl-tab wpsl-' . esc_attr( strtolower( str_replace( ' ', '-', $tab ) ) ) . $active_class . '">';
148
+
149
+ foreach ( $meta_fields as $field_key => $field_data ) {
150
+
151
+ /* If no specific field type is set, we set it to text */
152
+ $field_type = ( empty( $field_data['type'] ) ) ? 'text' : $field_data['type'];
153
+ $args = array(
154
+ 'key' => $field_key,
155
+ 'data' => $field_data
156
+ );
157
+
158
+ /* Check for a class method, otherwise enable a plugin hook */
159
+ if ( method_exists( $this, $field_type . '_input' ) ) {
160
+ call_user_func( array( $this, $field_type . '_input' ), $args );
161
+ } else {
162
+ do_action( 'wpsl_metabox_' . $field_type . '_input', $args );
163
+ }
164
+ }
165
+
166
+ echo '</div>';
167
+ }
168
+
169
+ $j++;
170
+ }
171
+ ?>
172
+ </div>
173
+ <?php
174
+ }
175
+
176
+ /**
177
+ * Create the li elements that are used in the tabs above the store meta fields.
178
+ *
179
+ * @since 2.0
180
+ * @param string $tab The name of the tab
181
+ * @param string $active_class Either the class name or empty
182
+ * @return string $nav_item The HTML for the nav list
183
+ */
184
+ public function meta_field_nav( $tab, $active_class ) {
185
+
186
+ $tab_lower = strtolower( str_replace( ' ', '-', $tab ) );
187
+ $nav_item = '<li class="wpsl-' . esc_attr( $tab_lower ) . '-tab ' . $active_class . '"><a href="#wpsl-' . esc_attr( $tab_lower ) . '">' . esc_html( $tab ) . '</a></li>';
188
+
189
+ return $nav_item;
190
+ }
191
+
192
+ /**
193
+ * Set the CSS class that tells JS it's an required input field.
194
+ *
195
+ * @since 2.0
196
+ * @param array $args The css classes
197
+ * @param string $single Whether to return just the class name, or also include the class=""
198
+ * @return string|void $response The required CSS class or nothing
199
+ */
200
+ public function set_required_class( $args, $single = false ) {
201
+
202
+ if ( isset( $args['required'] ) && ( $args['required'] ) ) {
203
+ if ( !$single ) {
204
+ $response = 'class="wpsl-required"';
205
+ } else {
206
+ $response = 'wpsl-required';
207
+ }
208
+
209
+ return $response;
210
+ }
211
+ }
212
+
213
+ /**
214
+ * Check if the current field is required.
215
+ *
216
+ * @since 2.0
217
+ * @param array $args The CSS classes
218
+ * @return string|void The HTML for the required element or nothing
219
+ */
220
+ public function is_required_field( $args ) {
221
+
222
+ if ( isset( $args['required'] ) && ( $args['required'] ) ) {
223
+ $response = '<span class="wpsl-star"> *</span>';
224
+
225
+ return $response;
226
+ }
227
+ }
228
+
229
+ /**
230
+ * Get the prefilled field data.
231
+ *
232
+ * @since 2.0
233
+ * @param string $field_name The name of the field to get the data for
234
+ * @return string $field_data The field data
235
+ */
236
+ public function get_prefilled_field_data( $field_name ) {
237
+
238
+ global $wpsl_settings, $pagenow;
239
+
240
+ $field_data = '';
241
+
242
+ /* Prefilled values are only used for new pages, not when a user edits an existing page. */
243
+ if ( $pagenow == 'post.php' && isset( $_GET['action'] ) && $_GET['action'] == 'edit' ) {
244
+ return;
245
+ }
246
+
247
+ $prefilled_fields = array(
248
+ 'country',
249
+ 'hours'
250
+ );
251
+
252
+ if ( in_array( $field_name, $prefilled_fields ) ) {
253
+ $field_data = $wpsl_settings['editor_' . $field_name];
254
+ }
255
+
256
+ return $field_data;
257
+ }
258
+
259
+ /**
260
+ * Create a text input field.
261
+ *
262
+ * @since 2.0
263
+ * @param array $args The input name and label
264
+ * @return void
265
+ */
266
+ public function text_input( $args ) {
267
+
268
+ $saved_value = $this->get_store_meta( $args['key'] );
269
+
270
+ /* If there is no existing meta value, check if a prefilled value exists for the input field */
271
+ if ( !$saved_value ) {
272
+ $saved_value = $this->get_prefilled_field_data( $args['key'] );
273
+ }
274
+ ?>
275
+
276
+ <p>
277
+ <label for="wpsl-<?php echo esc_attr( $args['key'] ); ?>"><?php echo esc_html( $args['data']['label'] ) . ': ' . $this->is_required_field( $args['data'] ); ?></label>
278
+ <input id="wpsl-<?php echo esc_attr( $args['key'] ); ?>" <?php echo $this->set_required_class( $args['data'] ); ?> type="text" name="wpsl[<?php echo esc_attr( $args['key'] ); ?>]" value="<?php echo esc_attr( $saved_value ); ?>" />
279
+ </p>
280
+
281
+ <?php
282
+ }
283
+
284
+ /**
285
+ * Create a hidden input field.
286
+ *
287
+ * @since 2.0
288
+ * @param array $args The name of the meta value
289
+ * @return void
290
+ */
291
+ public function hidden_input( $args ) {
292
+
293
+ $saved_value = $this->get_store_meta( $args['key'] );
294
+ ?>
295
+
296
+ <input id="wpsl-<?php echo esc_attr( $args['key'] ); ?>" type="hidden" name="wpsl[<?php echo esc_attr( $args['key'] ); ?>]" value="<?php echo esc_attr( $saved_value ); ?>" />
297
+
298
+ <?php
299
+ }
300
+
301
+ /**
302
+ * Create a textarea field.
303
+ *
304
+ * @since 2.0
305
+ * @param array $args The textarea name and label
306
+ * @return void
307
+ */
308
+ public function textarea_input( $args ) {
309
+
310
+ $saved_value = $this->get_store_meta( $args['key'] );
311
+
312
+ if ( $args['key'] == 'hours' && gettype( $saved_value ) !== 'string' ) {
313
+ $saved_value = '';
314
+ }
315
+
316
+ /* If there is no existing meta value, check if a prefilled value exists for the textarea. */
317
+ if ( !$saved_value ) {
318
+ $prefilled_value = $this->get_prefilled_field_data( $args['key'] );
319
+
320
+ if ( isset( $prefilled_value['textarea'] ) ) {
321
+ $saved_value = $prefilled_value['textarea'];
322
+ }
323
+ }
324
+ ?>
325
+
326
+ <p>
327
+ <label for="wpsl-<?php echo esc_attr( $args['key'] ); ?>"><?php echo esc_html( $args['data']['label'] ) . ': ' . $this->is_required_field( $args['data'] ); ?></label>
328
+ <textarea id="wpsl-<?php echo esc_attr( $args['key'] ); ?>" <?php echo $this->set_required_class( $args['data'] ); ?> name="wpsl[<?php echo esc_attr( $args['key'] ); ?>]" cols="5" rows="5"><?php echo esc_html( $saved_value ); ?></textarea>
329
+ </p>
330
+
331
+ <?php
332
+ }
333
+
334
+ /**
335
+ * Create a checkbox field.
336
+ *
337
+ * @since 2.0
338
+ * @param array $args The checkbox name and label
339
+ * @return void
340
+ */
341
+ public function checkbox_input( $args ) {
342
+
343
+ $saved_value = $this->get_store_meta( $args['key'] );
344
+ ?>
345
+
346
+ <p>
347
+ <label for="wpsl-<?php echo esc_attr( $args['key'] ); ?>"><?php echo esc_html( $args['data']['label'] ) . ': ' . $this->is_required_field( $args['data'] ); ?></label>
348
+ <input id="wpsl-<?php echo esc_attr( $args['key'] ); ?>" <?php echo $this->set_required_class( $args['data'] ); ?> type="checkbox" name="wpsl[<?php echo esc_attr( $args['key'] ); ?>]" <?php checked( $saved_value, true ); ?> value="1" />
349
+ </p>
350
+
351
+ <?php
352
+ }
353
+
354
+ /**
355
+ * Create a dropdown field.
356
+ *
357
+ * @since 2.0
358
+ * @param array $args The dropdown name and label
359
+ * @return void
360
+ */
361
+ public function dropdown_input( $args ) {
362
+
363
+ /* The hour dropdown requires a different structure with multiple dropdowns */
364
+ if ( $args['key'] == 'hours' ) {
365
+ $this->opening_hours();
366
+ } else {
367
+ $option_list = $args['data']['options'];
368
+ $saved_value = $this->get_store_meta( $args['key'] );
369
+ ?>
370
+
371
+ <p>
372
+ <label for="wpsl-<?php echo esc_attr( $args['key'] ); ?>"><?php echo esc_html( $args['data']['label'] ) . ': ' . $this->is_required_field( $args['data'] ); ?></label>
373
+ <select id="wpsl-<?php echo esc_attr( $args['key'] ); ?>" <?php echo $this->set_required_class( $args['data'] ); ?> name="wpsl[<?php echo esc_attr( $args['key'] ); ?>]" autocomplete="off" />
374
+ <?php foreach ( $option_list as $key => $option ) { ?>
375
+ <option value="<?php echo esc_attr( $key ); ?>" <?php if ( isset( $saved_value ) ) { selected( $saved_value, $key ); } ?>><?php echo esc_html( $option ); ?></option>
376
+ <?php } ?>
377
+ </select>
378
+ </p>
379
+
380
+ <?php
381
+ }
382
+ }
383
+
384
+ /**
385
+ * Create the openings hours table with the hours as dropdowns.
386
+ *
387
+ * @since 2.0
388
+ * @param string $location The location were the opening hours are shown.
389
+ * @return void
390
+ */
391
+ public function opening_hours( $location = 'store_page' ) {
392
+
393
+ global $wpsl_settings, $wpsl_admin, $post;
394
+
395
+ $name = ( $location == 'settings' ) ? 'wpsl_editor[dropdown]' : 'wpsl[hours]'; // the name of the input or select field
396
+ $opening_days = wpsl_get_weekdays();
397
+ $opening_hours = '';
398
+ $hours = '';
399
+
400
+ if ( $location == 'store_page' ) {
401
+ $opening_hours = get_post_meta( $post->ID, 'wpsl_hours' );
402
+ }
403
+
404
+ /* If we don't have any opening hours, we use the defaults */
405
+ if ( !isset( $opening_hours[0]['monday'] ) ) {
406
+ $opening_hours = $wpsl_settings['editor_hours']['dropdown'];
407
+ } else {
408
+ $opening_hours = $opening_hours[0];
409
+ }
410
+
411
+ /* Find out whether we have a 12 or 24hr format */
412
+ $hour_format = $this->find_hour_format( $opening_hours );
413
+
414
+ if ( $hour_format == 24 ) {
415
+ $hour_class = 'wpsl-twentyfour-format';
416
+ } else {
417
+ $hour_class = 'wpsl-twelve-format';
418
+ }
419
+
420
+ /* Only include the 12 / 24hr dropdown switch if we are on store page,
421
+ * otherwise just show the table with the opening hour dropdowns.
422
+ */
423
+ if ( $location == 'store_page' ) {
424
+ ?>
425
+ <p class="wpsl-hours-dropdown">
426
+ <label for="wpsl-editor-hour-input"><?php _e( 'Hour format', 'wpsl' ); ?>:</label>
427
+ <?php echo $wpsl_admin->settings_page->show_opening_hours_format( $hour_format ); ?>
428
+ </p>
429
+ <?php } ?>
430
+
431
+ <table id="wpsl-store-hours" class="<?php echo $hour_class; ?>">
432
+ <tr>
433
+ <th><?php _e( 'Days', 'wpsl' ); ?></th>
434
+ <th><?php _e( 'Opening Periods', 'wpsl' ); ?></th>
435
+ <th></th>
436
+ </tr>
437
+ <?php
438
+ foreach ( $opening_days as $index => $day ) {
439
+ $i = 0;
440
+ $hour_count = count( $opening_hours[$index] );
441
+ ?>
442
+ <tr>
443
+ <td class="wpsl-opening-day"><?php echo esc_html( $day ); ?></td>
444
+ <td id="wpsl-hours-<?php echo esc_attr( $index ); ?>" class="wpsl-opening-hours" data-day="<?php echo esc_attr( $index ); ?>">
445
+ <?php
446
+ if ( $hour_count > 0 ) {
447
+ /* Loop over the opening periods */
448
+ while ( $i < $hour_count ) {
449
+ if ( isset( $opening_hours[$index][$i] ) ) {
450
+ $hours = explode( ',', $opening_hours[$index][$i] );
451
+ } else {
452
+ $hours = '';
453
+ }
454
+
455
+ /* If we don't have two parts or one of them is empty, then we set the store to closed */
456
+ if ( ( count( $hours ) == 2 ) && ( !empty( $hours[0] ) ) && ( !empty( $hours[1] ) ) ) {
457
+ $args = array(
458
+ 'day' => $index,
459
+ 'name' => $name,
460
+ 'hour_format' => $hour_format,
461
+ 'hours' => $hours
462
+ );
463
+ ?>
464
+ <div class="wpsl-current-period <?php if ( $i > 0 ) { echo 'wpsl-multiple-periods'; } ?>">
465
+ <?php echo $this->opening_hours_dropdown( $args, 'open' ); ?>
466
+ <span> - </span>
467
+ <?php echo $this->opening_hours_dropdown( $args, 'close' ); ?>
468
+ <div class="wpsl-icon-cancel-circled"></div>
469
+ </div>
470
+ <?php
471
+ } else {
472
+ $this->show_store_closed( $name, $index );
473
+ }
474
+
475
+ $i++;
476
+ }
477
+ } else {
478
+ $this->show_store_closed( $name, $index );
479
+ }
480
+ ?>
481
+ </td>
482
+ <td>
483
+ <div class="wpsl-add-period">
484
+ <div class="wpsl-icon-plus-circled"></div>
485
+ </div>
486
+ </td>
487
+ </tr>
488
+ <?php
489
+ }
490
+ ?>
491
+ </table>
492
+ <?php
493
+ }
494
+
495
+ /**
496
+ * Show the 'store closed' message.
497
+ *
498
+ * @since 2.0
499
+ * @param string $name The name for the input field
500
+ * @param string $day The day the store is closed
501
+ * @return void
502
+ */
503
+ public function show_store_closed( $name, $day ) {
504
+ echo '<p class="wpsl-store-closed">' . __( 'Closed', 'wpsl' ) . '<input type="hidden" name="' . esc_attr( $name ) . '[' . esc_attr( $day ) . ']" value="closed"></p>';
505
+ }
506
+
507
+ /**
508
+ * Find out whether the opening hours are set in the 12 or 24hr format.
509
+ *
510
+ * We use this to determine the selected value for the dropdown in the store editor.
511
+ * So a user can decide to change the opening hour format.
512
+ *
513
+ * @since 2.0
514
+ * @param array $opening_hours The opening hours for the whole week
515
+ * @return string The hour format used in the opening hours
516
+ */
517
+ public function find_hour_format( $opening_hours ) {
518
+
519
+ $week_days = wpsl_get_weekdays();
520
+
521
+ foreach ( $week_days as $key => $day ) {
522
+ if ( isset( $opening_hours[$key][0] ) ) {
523
+ $time = $opening_hours[$key][0];
524
+
525
+ if ( ( strpos( $time, 'AM' ) !== false ) || ( strpos( $time, 'PM' ) !== false ) ) {
526
+ return '12';
527
+ } else {
528
+ return '24';
529
+ }
530
+ }
531
+ }
532
+ }
533
+
534
+ /**
535
+ * Create the opening hours dropdown.
536
+ *
537
+ * @since 2.0
538
+ * @param array $args The data to create the opening hours dropdown
539
+ * @param string $period Either set to open or close
540
+ * @return string $select The html for the dropdown
541
+ */
542
+ public function opening_hours_dropdown( $args, $period ) {
543
+
544
+ $select_index = ( $period == 'open' ) ? 0 : 1;
545
+ $selected_time = $args['hours'][$select_index];
546
+ $select_name = $args['name'] . '[' . strtolower( $args['day'] ) . '_' . $period . ']';
547
+ $open = strtotime( '12:00am' );
548
+ $close = strtotime( '11:59pm' );
549
+ $hour_interval = 900;
550
+
551
+ if ( $args['hour_format'] == 12 ) {
552
+ $format = 'g:i A';
553
+ } else {
554
+ $format = 'H:i';
555
+ }
556
+
557
+ $select = '<select class="wpsl-' . esc_attr( $period ) . '-hour" name="' . esc_attr( $select_name ) . '[]" autocomplete="off">';
558
+
559
+ for ( $i = $open; $i <= $close; $i += $hour_interval ) {
560
+
561
+ /* If the selected time matches the current time then we set it to active */
562
+ if ( $selected_time == date( $format, $i ) ) {
563
+ $selected = 'selected="selected"';
564
+ } else {
565
+ $selected = '';
566
+ }
567
+
568
+ $select .= "<option value='" . date( $format, $i ) . "' $selected>" . date( $format, $i ) . "</option>";
569
+ }
570
+
571
+ $select .= '</select>';
572
+
573
+ return $select;
574
+ }
575
+
576
+ /**
577
+ * Get the store post meta.
578
+ *
579
+ * @since 2.0
580
+ * @param string $key The name of the meta value
581
+ * @return mixed|void $store_meta Meta value for the store field
582
+ */
583
+ public function get_store_meta( $key ) {
584
+
585
+ global $post;
586
+
587
+ $store_meta = get_post_meta( $post->ID, 'wpsl_' . $key, true );
588
+
589
+ if ( $store_meta ) {
590
+ return $store_meta;
591
+ } else {
592
+ return;
593
+ }
594
+ }
595
+
596
+ /**
597
+ * Save the custom post data.
598
+ *
599
+ * @since 2.0
600
+ * @param integer $post_id store post ID
601
+ * @return void
602
+ */
603
+ public function save_post( $post_id ) {
604
+
605
+ global $wpsl_admin;
606
+
607
+ if ( empty( $_POST['wpsl_meta_nonce'] ) || !wp_verify_nonce( $_POST['wpsl_meta_nonce'], 'save_store_meta' ) )
608
+ return;
609
+
610
+ if ( !isset( $_POST['post_type'] ) || 'wpsl_stores' !== $_POST['post_type'] )
611
+ return;
612
+
613
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
614
+ return;
615
+
616
+ if ( is_int( wp_is_post_revision( $post_id ) ) )
617
+ return;
618
+
619
+ if ( !current_user_can( 'edit_post', $post_id ) )
620
+ return;
621
+
622
+ $this->store_data = $_POST['wpsl'];
623
+
624
+ /* Check if the hours are set through dropdowns */
625
+ if ( isset( $this->store_data['hours'] ) && is_array( $this->store_data['hours'] ) && ( !empty( $this->store_data['hours'] ) ) ) {
626
+ $this->store_data['hours'] = $this->format_opening_hours();
627
+ }
628
+
629
+ /* Loop over the meta fields defined in the meta_box_fields and update the post meta data */
630
+ foreach ( $this->meta_box_fields() as $tab => $meta_fields ) {
631
+ foreach ( $meta_fields as $field_key => $field_data ) {
632
+
633
+ /* Either update or delete the post meta */
634
+ if ( isset( $this->store_data[ $field_key ] ) && ( $this->store_data[ $field_key ] != "" ) ) {
635
+ if ( isset( $field_data['type'] ) && $field_data['type'] ) {
636
+ $field_type = $field_data['type'];
637
+ } else {
638
+ $field_type = '';
639
+ }
640
+
641
+ switch ( $field_type ) {
642
+ case 'thumbnail':
643
+ update_post_meta( $post_id, 'wpsl_' . $field_key, absint( $this->store_data[ $field_key ] ) );
644
+ break;
645
+ case 'checkbox':
646
+ $checkbox_val = ( isset( $this->store_data[ $field_key ] ) ) ? 1 : 0;
647
+ update_post_meta( $post_id, 'wpsl_' . $field_key, $checkbox_val );
648
+ break;
649
+ case 'textarea':
650
+ update_post_meta( $post_id, 'wpsl_' . $field_key, wp_kses_post( trim( stripslashes( $this->store_data[ $field_key ] ) ) ) );
651
+ break;
652
+ default:
653
+ if ( is_array( $this->store_data[ $field_key ] ) ) {
654
+ if ( wpsl_is_multi_array( $this->store_data[ $field_key ] ) ) {
655
+ array_walk_recursive( $this->store_data[ $field_key ], 'wpsl_sanitize_multi_array' );
656
+ update_post_meta( $post_id, 'wpsl_' . $field_key, $this->store_data[ $field_key ] );
657
+ } else {
658
+ update_post_meta( $post_id, 'wpsl_' . $field_key, array_map( 'sanitize_text_field', $this->store_data[ $field_key ] ) );
659
+ }
660
+ } else {
661
+ update_post_meta( $post_id, 'wpsl_' . $field_key, sanitize_text_field( $this->store_data[ $field_key ] ) );
662
+ }
663
+ break;
664
+ }
665
+ } else {
666
+ delete_post_meta( $post_id, 'wpsl_' . $field_key );
667
+ }
668
+ }
669
+ }
670
+
671
+ /* If all the required fields contain data. Then check if we need to
672
+ * geocode the address or if we already have valid latlng data,
673
+ * and if we should delete the autoload transient.
674
+ *
675
+ * Otherwise show a notice for 'missing data' and set the post status to pending.
676
+ */
677
+ if ( !$this->check_missing_meta_data( $post_id ) ) {
678
+ $wpsl_admin->geocode->check_geocode_data( $post_id, $this->store_data );
679
+ $wpsl_admin->maybe_delete_autoload_transient( $post_id );
680
+ } else {
681
+ $wpsl_admin->notices->save( 'error', __( 'Failed to publish the store. Please fill in the required store details.', 'wpsl' ) );
682
+ $this->set_post_pending( $post_id );
683
+ }
684
+ }
685
+
686
+ /**
687
+ * Loop through the opening hours and structure the data in a new array.
688
+ *
689
+ * @since 2.0
690
+ * @return array $opening_hours The formatted opening hours
691
+ */
692
+ public function format_opening_hours() {
693
+
694
+ $week_days = wpsl_get_weekdays();
695
+
696
+ /* Use the opening hours from the editor page or the add/edit store page */
697
+ if ( isset( $_POST['wpsl_editor']['dropdown'] ) ) {
698
+ $store_hours = $_POST['wpsl_editor']['dropdown'];
699
+ } else if ( isset( $this->store_data['hours'] ) ) {
700
+ $store_hours = $this->store_data['hours'];
701
+ }
702
+
703
+ foreach ( $week_days as $day => $value ) {
704
+ $i = 0;
705
+ $periods = array();
706
+
707
+ if ( isset( $store_hours[$day . '_open'] ) && $store_hours[$day . '_open'] ) {
708
+ foreach ( $store_hours[$day . '_open'] as $opening_hour ) {
709
+ $hours = $this->validate_hour( $store_hours[$day.'_open'][$i] ) . ',' . $this->validate_hour( $store_hours[$day.'_close'][$i] );
710
+ $periods[] = $hours;
711
+ $i++;
712
+ }
713
+ }
714
+
715
+ $opening_hours[$day] = $periods;
716
+ }
717
+
718
+ return $opening_hours;
719
+ }
720
+
721
+ /*
722
+ * Validate the 12 or 24 hr time format.
723
+ *
724
+ * @since 2.0
725
+ * @param string $hour The opening hour
726
+ * @return boolean true if the $hour format is valid
727
+ */
728
+ public function validate_hour( $hour ) {
729
+
730
+ global $wpsl_settings;
731
+
732
+ /* On the add/edit store we can always use the $wpsl_settings value.
733
+ * But if validate_hour is called from the settings page then we
734
+ * should use the $_POST value to make sure we have the correct value.
735
+ */
736
+ if ( isset( $_POST['wpsl_editor']['hour_format'] ) ) {
737
+ $hour_format = ( $_POST['wpsl_editor']['hour_format'] == 12 ) ? 12 : 24;
738
+ } else {
739
+ $hour_format = $wpsl_settings['editor_hour_format'];
740
+ }
741
+
742
+ if ( $hour_format == 12 ) {
743
+ $format = 'g:i A';
744
+ } else {
745
+ $format = 'H:i';
746
+ }
747
+
748
+ if ( date( $format, strtotime( $hour ) ) == $hour ) {
749
+ return $hour;
750
+ }
751
+ }
752
+
753
+ /**
754
+ * Set the post status to pending instead of publish.
755
+ *
756
+ * @since 2.0
757
+ * @param integer $post_id store post ID
758
+ * @return void
759
+ */
760
+ public function set_post_pending( $post_id ) {
761
+
762
+ global $wpdb;
763
+
764
+ $wpdb->update( $wpdb->posts, array( 'post_status' => 'pending' ), array( 'ID' => $post_id ) );
765
+
766
+ add_filter( 'redirect_post_location', array( $this, 'remove_message_arg' ) );
767
+ }
768
+
769
+ /**
770
+ * Remove the message query arg.
771
+ *
772
+ * If one or more of the required fields are empty, we show a custom msg.
773
+ * So no need for the normal post update messages arg.
774
+ *
775
+ * @since 2.0
776
+ * @param string $location The destination url
777
+ * @return void
778
+ */
779
+ public function remove_message_arg( $location ) {
780
+ return remove_query_arg( 'message', $location );
781
+ }
782
+
783
+ /**
784
+ * Make sure all the required post meta fields contain data.
785
+ *
786
+ * @since 2.0
787
+ * @param integer $post_id store post ID
788
+ * @return boolean
789
+ */
790
+ public function check_missing_meta_data( $post_id ) {
791
+
792
+ foreach ( $this->meta_box_fields() as $tab => $meta_fields ) {
793
+ foreach ( $meta_fields as $field_key => $field_data ) {
794
+
795
+ if ( isset( $field_data['required'] ) && $field_data['required'] ) {
796
+ $post_meta = get_post_meta( $post_id, 'wpsl_' . $field_key, true );
797
+
798
+ if ( empty( $post_meta ) ) {
799
+ return true;
800
+ }
801
+ }
802
+ }
803
+ }
804
+ }
805
+
806
+ /**
807
+ * The html for the map preview in the sidebar.
808
+ *
809
+ * @since 2.0
810
+ * @return void
811
+ */
812
+ public function map_preview() {
813
+ ?>
814
+ <div id="wpsl-gmap-wrap"></div>
815
+ <p class="wpsl-submit-wrap">
816
+ <a id="wpsl-lookup-location" class="button-primary" href="#wpsl-meta-nav"><?php _e( 'Preview Location', 'wpsl' ); ?></a>
817
+ <span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'The map preview is based on the provided address, city and country details. %s It will ignore any custom latitude or longitude values.', 'wpsl' ), '<br><br>' ); ?></span></span>
818
+ <em class="wpsl-desc"><?php _e( 'You can drag the marker to adjust the exact location of the marker.', 'wpsl' ); ?></em>
819
+ </p>
820
+ <?php
821
+ }
822
+
823
+ /**
824
+ * Store update messages.
825
+ *
826
+ * @since 2.0
827
+ * @param array $messages Existing post update messages.
828
+ * @return array $messages Amended post update messages with new CPT update messages.
829
+ */
830
+ function store_update_messages( $messages ) {
831
+
832
+ $post = get_post();
833
+ $post_type = get_post_type( $post );
834
+ $post_type_object = get_post_type_object( $post_type );
835
+
836
+ $messages['wpsl_stores'] = array(
837
+ 0 => '', // Unused. Messages start at index 1.
838
+ 1 => __( 'Store updated.', 'wpsl' ),
839
+ 2 => __( 'Custom field updated.', 'wpsl' ),
840
+ 3 => __( 'Custom field deleted.', 'wpsl' ),
841
+ 4 => __( 'Store updated.', 'wpsl' ),
842
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Store restored to revision from %s', 'wpsl' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
843
+ 6 => __( 'Store published.', 'wpsl' ),
844
+ 7 => __( 'Store saved.', 'wpsl' ),
845
+ 8 => __( 'Store submitted.', 'wpsl' ),
846
+ 9 => sprintf(
847
+ __( 'Store scheduled for: <strong>%1$s</strong>.', 'wpsl' ),
848
+ date_i18n( __( 'M j, Y @ G:i', 'wpsl' ), strtotime( $post->post_date ) )
849
+ ),
850
+ 10 => __( 'Store draft updated.', 'wpsl' )
851
+ );
852
+
853
+ if ( ( 'wpsl_stores' == $post_type ) && ( $post_type_object->publicly_queryable ) ) {
854
+ $permalink = get_permalink( $post->ID );
855
+
856
+ $view_link = sprintf( ' <a href="%s">%s</a>', esc_url( $permalink ), __( 'View store', 'wpsl' ) );
857
+ $messages[ $post_type ][1] .= $view_link;
858
+ $messages[ $post_type ][6] .= $view_link;
859
+ $messages[ $post_type ][9] .= $view_link;
860
+
861
+ $preview_permalink = add_query_arg( 'preview', 'true', $permalink );
862
+ $preview_link = sprintf( ' <a target="_blank" href="%s">%s</a>', esc_url( $preview_permalink ), __( 'Preview store', 'wpsl' ) );
863
+ $messages[ $post_type ][8] .= $preview_link;
864
+ $messages[ $post_type ][10] .= $preview_link;
865
+ }
866
+
867
+ return $messages;
868
+ }
869
+
870
+ }
871
+ }
admin/class-notices.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin Notices
4
+ *
5
+ * @package WP_Store_locator
6
+ * @since 2.0
7
+ */
8
+
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
+
11
+ if ( !class_exists( 'WPSL_Notices' ) ) {
12
+
13
+ /**
14
+ * Handle the meta boxes
15
+ *
16
+ * @since 2.0
17
+ */
18
+ class WPSL_Notices {
19
+
20
+ /**
21
+ * Holds the notices
22
+ * @since 2.0
23
+ * @var array
24
+ */
25
+ private $notices = array();
26
+
27
+ public function __construct() {
28
+
29
+ $this->notices = get_option( 'wpsl_notices' );
30
+
31
+ add_action( 'admin_notices', array( $this, 'show' ) );
32
+ }
33
+
34
+ /**
35
+ * Show the notice
36
+ *
37
+ * @since 2.0
38
+ * @return void
39
+ */
40
+ public function show() {
41
+
42
+ if ( !empty( $this->notices ) ) {
43
+ $class = ( 'update' == $this->notices['type'] ) ? 'updated' : 'error';
44
+ $allowed_html = array(
45
+ 'a' => array(
46
+ 'href' => array(),
47
+ 'id' => array(),
48
+ 'class' => array(),
49
+ 'data-nonce' => array(),
50
+ 'title' => array(),
51
+ 'target' => array()
52
+ ),
53
+ 'br' => array(),
54
+ 'em' => array(),
55
+ 'strong' => array(
56
+ 'class' => array()
57
+ ),
58
+ 'span' => array(
59
+ 'class' => array()
60
+ )
61
+ );
62
+
63
+ echo '<div class="' . esc_attr( $class ) . '"><p>' . wp_kses( $this->notices['message'], $allowed_html ) . '</p></div>';
64
+
65
+ /* Empty the notices */
66
+ $this->notices = array();
67
+ update_option( 'wpsl_notices', $this->notices );
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Save the notice
73
+ *
74
+ * @since 2.0
75
+ * @param string $type The type of notice, either 'update' or 'error'
76
+ * @param string $message The user message
77
+ * @return void
78
+ */
79
+ public function save( $type, $message ) {
80
+
81
+ $this->notices = array(
82
+ 'type' => $type,
83
+ 'message' => $message
84
+ );
85
+
86
+ update_option( 'wpsl_notices', $this->notices );
87
+ }
88
+ }
89
+ }
admin/class-settings.php ADDED
@@ -0,0 +1,1030 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handle the plugin settings
4
+ *
5
+ * @package WP_Store_locator
6
+ * @since 2.0
7
+ */
8
+
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
+
11
+ if ( !class_exists( 'WPSL_Settings' ) ) {
12
+
13
+ class WPSL_Settings {
14
+
15
+ public function __construct() {
16
+
17
+ $this->manually_clear_transient();
18
+
19
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
20
+ add_action( 'admin_init', array( $this, 'maybe_flush_rewrite_and_transient' ) );
21
+ }
22
+
23
+ /**
24
+ * Determine if we need to clear the autoload transient.
25
+ *
26
+ * User can do this manually from the 'Tools' section on the settings page.
27
+ *
28
+ * @since 2.0
29
+ * @return void
30
+ */
31
+ public function manually_clear_transient() {
32
+
33
+ global $wpsl_admin;
34
+
35
+ if ( isset( $_GET['action'] ) && $_GET['action'] == 'clear_wpsl_transients' && isset( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'clear_transients' ) ) {
36
+ $wpsl_admin->delete_autoload_transient();
37
+
38
+ $msg = __( 'WP Store Locator Transients Cleared', 'wpsl' );
39
+ $wpsl_admin->notices->save( 'update', $msg );
40
+
41
+ /* Make sure the &action=clear_wpsl_transients param is removed from the url.
42
+ *
43
+ * Otherwise if the user later clicks the 'Save Changes' button,
44
+ * and the &action=clear_wpsl_transients param is still there it
45
+ * will show two notices 'WP Store Locator Transients Cleared' and 'Settings Saved'.
46
+ */
47
+ wp_redirect( admin_url( 'edit.php?post_type=wpsl_stores&page=wpsl_settings' ) );
48
+ exit;
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Register the settings.
54
+ *
55
+ * @since 2.0
56
+ * @return void
57
+ */
58
+ public function register_settings() {
59
+ register_setting( 'wpsl_settings', 'wpsl_settings', array( $this, 'sanitize_settings' ) );
60
+ }
61
+
62
+ /**
63
+ * Sanitize the submitted plugin settings.
64
+ *
65
+ * @since 1.0
66
+ * @return array $output The setting values
67
+ */
68
+ public function sanitize_settings() {
69
+
70
+ global $wpsl_settings, $wpsl_admin;
71
+
72
+ $ux_absints = array(
73
+ 'height',
74
+ 'infowindow_width',
75
+ 'search_width',
76
+ 'label_width'
77
+ );
78
+
79
+ $marker_effects = array(
80
+ 'bounce',
81
+ 'info_window',
82
+ 'ignore'
83
+ );
84
+
85
+ $ux_checkboxes = array(
86
+ 'new_window',
87
+ 'reset_map',
88
+ 'listing_below_no_scroll',
89
+ 'direction_redirect',
90
+ 'more_info',
91
+ 'store_url',
92
+ 'phone_url',
93
+ 'marker_streetview',
94
+ 'marker_zoom_to',
95
+ 'mouse_focus',
96
+ 'reset_map',
97
+ 'hide_distance'
98
+ );
99
+
100
+ $output['api_key'] = sanitize_text_field( $_POST['wpsl_api']['key'] );
101
+ $output['api_language'] = wp_filter_nohtml_kses( $_POST['wpsl_api']['language'] );
102
+ $output['api_region'] = wp_filter_nohtml_kses( $_POST['wpsl_api']['region'] );
103
+
104
+ /* Do we need to show the dropdown filters? */
105
+ $output['results_dropdown'] = isset( $_POST['wpsl_search']['results_dropdown'] ) ? 1 : 0;
106
+ $output['radius_dropdown'] = isset( $_POST['wpsl_search']['radius_dropdown'] ) ? 1 : 0;
107
+ $output['category_dropdown'] = isset( $_POST['wpsl_search']['category_dropdown'] ) ? 1 : 0;
108
+
109
+ $output['distance_unit'] = ( $_POST['wpsl_search']['distance_unit'] == 'km' ) ? 'km' : 'mi';
110
+
111
+ /* Check for a valid max results value, otherwise we use the default */
112
+ if ( !empty( $_POST['wpsl_search']['max_results'] ) ) {
113
+ $output['max_results'] = sanitize_text_field( $_POST['wpsl_search']['max_results'] );
114
+ } else {
115
+ $this->settings_error( 'max_results' );
116
+ $output['max_results'] = wpsl_get_default_setting( 'max_results' );
117
+ }
118
+
119
+ /* See if a search radius value exist, otherwise we use the default */
120
+ if ( !empty( $_POST['wpsl_search']['radius'] ) ) {
121
+ $output['search_radius'] = sanitize_text_field( $_POST['wpsl_search']['radius'] );
122
+ } else {
123
+ $this->settings_error( 'search_radius' );
124
+ $output['search_radius'] = wpsl_get_default_setting( 'search_radius' );
125
+ }
126
+
127
+ /* Check if we have a valid zoom level, it has to be between 1 or 12. If not set it to the default of 3 */
128
+ $output['zoom_level'] = wpsl_valid_zoom_level( $_POST['wpsl_map']['zoom_level'] );
129
+ $output['zoom_name'] = sanitize_text_field( $_POST['wpsl_map']['zoom_name'] );
130
+
131
+ /* Check for a valid max auto zoom level */
132
+ $max_zoom_levels = wpsl_get_max_zoom_levels();
133
+
134
+ if ( in_array( absint( $_POST['wpsl_map']['max_auto_zoom'] ), $max_zoom_levels ) ) {
135
+ $output['auto_zoom_level'] = $_POST['wpsl_map']['max_auto_zoom'];
136
+ } else {
137
+ $output['auto_zoom_level'] = wpsl_get_default_setting( 'auto_zoom_level' );
138
+ }
139
+
140
+ /* If no location name is set to zoom to we also empty the latlng values from the hidden input field */
141
+ if ( empty( $output['zoom_name'] ) ) {
142
+ $this->settings_error( 'start_point' );
143
+ $output['zoom_latlng'] = '';
144
+ } else {
145
+ $output['zoom_latlng'] = sanitize_text_field( $_POST['wpsl_map']['zoom_latlng'] );
146
+ }
147
+
148
+ /* Check if we have a valid map type */
149
+ $output['map_type'] = wpsl_valid_map_type( $_POST['wpsl_map']['type'] );
150
+ $output['auto_locate'] = isset( $_POST['wpsl_map']['auto_locate'] ) ? 1 : 0;
151
+ $output['autoload'] = isset( $_POST['wpsl_map']['autoload'] ) ? 1 : 0;
152
+
153
+ /* Make sure the auto load limit is either empty or an int */
154
+ if ( empty( $_POST['wpsl_map']['autoload_limit'] ) ) {
155
+ $output['autoload_limit'] = '';
156
+ } else {
157
+ $output['autoload_limit'] = absint( $_POST['wpsl_map']['autoload_limit'] );
158
+ }
159
+
160
+ $output['streetview'] = isset( $_POST['wpsl_map']['streetview'] ) ? 1 : 0;
161
+ $output['pan_controls'] = isset( $_POST['wpsl_map']['pan_controls'] ) ? 1 : 0;
162
+ $output['type_control'] = isset( $_POST['wpsl_map']['type_control'] ) ? 1 : 0;
163
+ $output['scrollwheel'] = isset( $_POST['wpsl_map']['scrollwheel'] ) ? 1 : 0;
164
+ $output['control_position'] = ( $_POST['wpsl_map']['control_position'] == 'left' ) ? 'left' : 'right';
165
+ $output['control_style'] = ( $_POST['wpsl_map']['control_style'] == 'small' ) ? 'small' : 'large';
166
+
167
+ $output['map_style'] = json_encode( strip_tags( trim( $_POST['wpsl_map']['map_style'] ) ) );
168
+
169
+ /* Make sure we have a valid template ID */
170
+ if ( isset( $_POST['wpsl_ux']['template_id'] ) && ( $_POST['wpsl_ux']['template_id'] ) ) {
171
+ $output['template_id'] = sanitize_text_field( $_POST['wpsl_ux']['template_id'] );
172
+ } else {
173
+ $output['template_id'] = wpsl_get_default_setting( 'template_id' );
174
+ }
175
+
176
+ $output['marker_clusters'] = isset( $_POST['wpsl_map']['marker_clusters'] ) ? 1 : 0;
177
+
178
+ /* Check for a valid cluster zoom value */
179
+ if ( in_array( $_POST['wpsl_map']['cluster_zoom'], $this->get_default_cluster_option( 'cluster_zoom' ) ) ) {
180
+ $output['cluster_zoom'] = $_POST['wpsl_map']['cluster_zoom'];
181
+ } else {
182
+ $output['cluster_zoom'] = wpsl_get_default_setting( 'cluster_zoom' );
183
+ }
184
+
185
+ /* Check for a valid cluster size value */
186
+ if ( in_array( $_POST['wpsl_map']['cluster_size'], $this->get_default_cluster_option( 'cluster_size' ) ) ) {
187
+ $output['cluster_size'] = $_POST['wpsl_map']['cluster_size'];
188
+ } else {
189
+ $output['cluster_size'] = wpsl_get_default_setting( 'cluster_size' );
190
+ }
191
+
192
+ /* Make sure all the ux related fields that should contain an int, actually are an int.
193
+ * Otherwise we use the default value.
194
+ */
195
+ foreach ( $ux_absints as $ux_key ) {
196
+ if ( absint( $_POST['wpsl_ux'][$ux_key] ) ) {
197
+ $output[$ux_key] = $_POST['wpsl_ux'][$ux_key];
198
+ } else {
199
+ $output[$ux_key] = wpsl_get_default_setting( $ux_key );
200
+ }
201
+ }
202
+
203
+ /* Check if the ux checkboxes are checked */
204
+ foreach ( $ux_checkboxes as $ux_key ) {
205
+ $output[$ux_key] = isset( $_POST['wpsl_ux'][$ux_key] ) ? 1 : 0;
206
+ }
207
+
208
+ /* Check if we have a valid marker effect */
209
+ if ( in_array( $_POST['wpsl_ux']['marker_effect'], $marker_effects ) ) {
210
+ $output['marker_effect'] = $_POST['wpsl_ux']['marker_effect'];
211
+ } else {
212
+ $output['marker_effect'] = wpsl_get_default_setting( 'marker_effect' );
213
+ }
214
+
215
+ /* Check if we have a valid address format */
216
+ if ( array_key_exists( $_POST['wpsl_ux']['address_format'], wpsl_get_address_formats() ) ) {
217
+ $output['address_format'] = $_POST['wpsl_ux']['address_format'];
218
+ } else {
219
+ $output['address_format'] = wpsl_get_default_setting( 'address_format' );
220
+ }
221
+
222
+ $output['more_info_location'] = ( $_POST['wpsl_ux']['more_info_location'] == 'store listings' ) ? 'store listings' : 'info window';
223
+ $output['infowindow_style'] = isset( $_POST['wpsl_ux']['infowindow_style'] ) ? 'default' : 'infobox';
224
+ $output['start_marker'] = wp_filter_nohtml_kses( $_POST['wpsl_map']['start_marker'] );
225
+ $output['store_marker'] = wp_filter_nohtml_kses( $_POST['wpsl_map']['store_marker'] );
226
+ $output['editor_country'] = sanitize_text_field( $_POST['wpsl_editor']['default_country'] );
227
+ $output['editor_map_type'] = wpsl_valid_map_type( $_POST['wpsl_editor']['map_type'] );
228
+ $output['hide_hours'] = isset( $_POST['wpsl_editor']['hide_hours'] ) ? 1 : 0;
229
+
230
+ if ( isset( $_POST['wpsl_editor']['hour_input'] ) ) {
231
+ $output['editor_hour_input'] = ( $_POST['wpsl_editor']['hour_input'] == 'textarea' ) ? 'textarea' : 'dropdown';
232
+ } else {
233
+ $output['editor_hour_input'] = 'dropdown';
234
+ }
235
+
236
+ $output['editor_hour_format'] = ( $_POST['wpsl_editor']['hour_format'] == 12 ) ? 12 : 24;
237
+
238
+ /* The default opening hours */
239
+ if ( isset( $_POST['wpsl_editor']['textarea'] ) ) {
240
+ $output['editor_hours']['textarea'] = wp_kses_post( trim( stripslashes( $_POST['wpsl_editor']['textarea'] ) ) );
241
+ }
242
+
243
+ $output['editor_hours']['dropdown'] = $wpsl_admin->metaboxes->format_opening_hours();
244
+ array_walk_recursive( $output['editor_hours']['dropdown'], 'wpsl_sanitize_multi_array' );
245
+
246
+ /* Permalink and taxonomy slug */
247
+ $output['permalinks'] = isset( $_POST['wpsl_permalinks']['active'] ) ? 1 : 0;
248
+
249
+ if ( !empty( $_POST['wpsl_permalinks']['slug'] ) ) {
250
+ $output['permalink_slug'] = sanitize_text_field( $_POST['wpsl_permalinks']['slug'] );
251
+ } else {
252
+ $output['permalink_slug'] = wpsl_get_default_setting( 'permalink_slug' );
253
+ }
254
+
255
+ if ( !empty( $_POST['wpsl_permalinks']['category_slug'] ) ) {
256
+ $output['category_slug'] = sanitize_text_field( $_POST['wpsl_permalinks']['category_slug'] );
257
+ } else {
258
+ $output['category_slug'] = wpsl_get_default_setting( 'category_slug' );
259
+ }
260
+
261
+ $required_labels = wpsl_labels();
262
+
263
+ /* Sanitize the labels */
264
+ foreach ( $required_labels as $label ) {
265
+ $output[$label.'_label'] = sanitize_text_field( $_POST['wpsl_label'][$label] );
266
+ }
267
+
268
+ $output['show_credits'] = isset( $_POST['wpsl_credits'] ) ? 1 : 0;
269
+ $output['debug'] = isset( $_POST['wpsl_tools']['debug'] ) ? 1 : 0;
270
+
271
+ /* Check if we need to flush the permalinks */
272
+ $this->set_flush_rewrite_option( $output );
273
+
274
+ /* Check if there is a reason to delete the autoload transient */
275
+ if ( $wpsl_settings['autoload'] ) {
276
+ $this->set_delete_transient_option( $output );
277
+ }
278
+
279
+ return $output;
280
+ }
281
+
282
+ /**
283
+ * Check if we need set the option that will be used to determine
284
+ * if we need to flush the permalinks once the setting page reloads.
285
+ *
286
+ * @since 2.0
287
+ * @param array $new_settings The submitted plugin settings
288
+ * @return void
289
+ */
290
+ public function set_flush_rewrite_option( $new_settings ) {
291
+
292
+ global $wpsl_settings;
293
+
294
+ if ( ( $wpsl_settings['permalinks'] != $new_settings['permalinks'] ) || ( $wpsl_settings['permalink_slug'] != $new_settings['permalink_slug'] ) || ( $wpsl_settings['category_slug'] != $new_settings['category_slug'] ) ) {
295
+ update_option( 'wpsl_flush_rewrite', 1 );
296
+ }
297
+ }
298
+
299
+ /**
300
+ * Check if we need set the option that is used to determine
301
+ * if we need to delete the autoload transient once the settings page reloads.
302
+ *
303
+ * @since 2.0
304
+ * @param array $new_settings The submitted plugin settings
305
+ * @return void
306
+ */
307
+ public function set_delete_transient_option( $new_settings ) {
308
+
309
+ global $wpsl_settings;
310
+
311
+ /* The options we need to check for changes */
312
+ $options = array(
313
+ 'debug',
314
+ 'autoload',
315
+ 'autoload_limit',
316
+ 'more_info',
317
+ 'more_info_location',
318
+ 'hide_hours',
319
+ 'hide_distance'
320
+ );
321
+
322
+ foreach ( $options as $option_name ) {
323
+ if ( $wpsl_settings[$option_name] != $new_settings[$option_name] ) {
324
+ update_option( 'wpsl_delete_transient', 1 );
325
+ break;
326
+ }
327
+ }
328
+ }
329
+
330
+ /**
331
+ * Check if the permalinks settings changed.
332
+ *
333
+ * @since 2.0
334
+ * @return void
335
+ */
336
+ public function maybe_flush_rewrite_and_transient() {
337
+
338
+ global $wpsl_admin;
339
+
340
+ if ( isset( $_GET['page'] ) && ( $_GET['page'] == 'wpsl_settings' ) ) {
341
+ $flush_rewrite = get_option( 'wpsl_flush_rewrite' );
342
+ $delete_transient = get_option( 'wpsl_delete_transient' );
343
+
344
+ if ( $flush_rewrite ) {
345
+ flush_rewrite_rules();
346
+ update_option( 'wpsl_flush_rewrite', 0 );
347
+ }
348
+
349
+ if ( $delete_transient ) {
350
+ update_option( 'wpsl_delete_transient', 0 );
351
+ }
352
+
353
+ if ( $flush_rewrite || $delete_transient ) {
354
+ $wpsl_admin->delete_autoload_transient();
355
+ }
356
+ }
357
+ }
358
+
359
+ /**
360
+ * Handle the different validation errors for the plugin settings.
361
+ *
362
+ * @since 1.0
363
+ * @param string $error_type Contains the type of validation error that occured
364
+ * @return void
365
+ */
366
+ private function settings_error( $error_type ) {
367
+
368
+ switch ( $error_type ) {
369
+ case 'max_results':
370
+ $error_msg = __( 'The max results field cannot be empty, the default value has been restored.', 'wpsl' );
371
+ break;
372
+ case 'search_radius':
373
+ $error_msg = __( 'The search radius field cannot be empty, the default value has been restored.', 'wpsl' );
374
+ break;
375
+ case 'start_point':
376
+ $error_msg = sprintf( __( 'Please provide the name of a city or country that can be used as a starting point under "Map Settings". %s This will only be used if auto-locating the user fails, or the option itself is disabled.', 'wpsl' ), '<br><br>' );
377
+ break;
378
+ }
379
+
380
+ add_settings_error( 'setting-errors', esc_attr( 'settings_fail' ), $error_msg, 'error' );
381
+ }
382
+
383
+ /**
384
+ * Options for the language and region list.
385
+ *
386
+ * @since 1.0
387
+ * @param string $list The request list type
388
+ * @return string|void $option_list The html for the selected list, or nothing if the $list contains invalud values
389
+ */
390
+ public function get_api_option_list( $list ) {
391
+
392
+ global $wpsl_settings;
393
+
394
+ switch ( $list ) {
395
+ case 'language':
396
+ $api_option_list = array (
397
+ __('Select your language', 'wpsl') => '',
398
+ __('English', 'wpsl') => 'en',
399
+ __('Arabic', 'wpsl') => 'ar',
400
+ __('Basque', 'wpsl') => 'eu',
401
+ __('Bulgarian', 'wpsl') => 'bg',
402
+ __('Bengali', 'wpsl') => 'bn',
403
+ __('Catalan', 'wpsl') => 'ca',
404
+ __('Czech', 'wpsl') => 'cs',
405
+ __('Danish', 'wpsl') => 'da',
406
+ __('German', 'wpsl') => 'de',
407
+ __('Greek', 'wpsl') => 'el',
408
+ __('English (Australian)', 'wpsl') => 'en-AU',
409
+ __('English (Great Britain)', 'wpsl') => 'en-GB',
410
+ __('Spanish', 'wpsl') => 'es',
411
+ __('Farsi', 'wpsl') => 'fa',
412
+ __('Finnish', 'wpsl') => 'fi',
413
+ __('Filipino', 'wpsl') => 'fil',
414
+ __('French', 'wpsl') => 'fr',
415
+ __('Galician', 'wpsl') => 'gl',
416
+ __('Gujarati', 'wpsl') => 'gu',
417
+ __('Hindi', 'wpsl') => 'hi',
418
+ __('Croatian', 'wpsl') => 'hr',
419
+ __('Hungarian', 'wpsl') => 'hu',
420
+ __('Indonesian', 'wpsl') => 'id',
421
+ __('Italian', 'wpsl') => 'it',
422
+ __('Hebrew', 'wpsl') => 'iw',
423
+ __('Japanese', 'wpsl') => 'ja',
424
+ __('Kannada', 'wpsl') => 'kn',
425
+ __('Korean', 'wpsl') => 'ko',
426
+ __('Lithuanian', 'wpsl') => 'lt',
427
+ __('Latvian', 'wpsl') => 'lv',
428
+ __('Malayalam', 'wpsl') => 'ml',
429
+ __('Marathi', 'wpsl') => 'mr',
430
+ __('Dutch', 'wpsl') => 'nl',
431
+ __('Norwegian', 'wpsl') => 'no',
432
+ __('Norwegian Nynorsk', 'wpsl') => 'nn',
433
+ __('Polish', 'wpsl') => 'pl',
434
+ __('Portuguese', 'wpsl') => 'pt',
435
+ __('Portuguese (Brazil)', 'wpsl') => 'pt-BR',
436
+ __('Portuguese (Portugal)', 'wpsl') => 'pt-PT',
437
+ __('Romanian', 'wpsl') => 'ro',
438
+ __('Russian', 'wpsl') => 'ru',
439
+ __('Slovak', 'wpsl') => 'sk',
440
+ __('Slovenian', 'wpsl') => 'sl',
441
+ __('Serbian', 'wpsl') => 'sr',
442
+ __('Swedish', 'wpsl') => 'sv',
443
+ __('Tagalog', 'wpsl') => 'tl',
444
+ __('Tamil', 'wpsl') => 'ta',
445
+ __('Telugu', 'wpsl') => 'te',
446
+ __('Thai', 'wpsl') => 'th',
447
+ __('Turkish', 'wpsl') => 'tr',
448
+ __('Ukrainian', 'wpsl') => 'uk',
449
+ __('Vietnamese', 'wpsl') => 'vi',
450
+ __('Chinese (Simplified)', 'wpsl') => 'zh-CN',
451
+ __('Chinese (Traditional)' ,'wpsl') => 'zh-TW'
452
+ );
453
+ break;
454
+ case 'region':
455
+ $api_option_list = array (
456
+ __('Select your region', 'wpsl') => '',
457
+ __('Afghanistan', 'wpsl') => 'af',
458
+ __('Albania', 'wpsl') => 'al',
459
+ __('Algeria', 'wpsl') => 'dz',
460
+ __('American Samoa', 'wpsl') => 'as',
461
+ __('Andorra', 'wpsl') => 'ad',
462
+ __('Anguilla', 'wpsl') => 'ai',
463
+ __('Angola', 'wpsl') => 'ao',
464
+ __('Antigua and Barbuda', 'wpsl') => 'ag',
465
+ __('Argentina', 'wpsl') => 'ar',
466
+ __('Armenia', 'wpsl') => 'am',
467
+ __('Aruba', 'wpsl') => 'aw',
468
+ __('Australia', 'wpsl') => 'au',
469
+ __('Austria', 'wpsl') => 'at',
470
+ __('Azerbaijan', 'wpsl') => 'az',
471
+ __('Bahamas', 'wpsl') => 'bs',
472
+ __('Bahrain', 'wpsl') => 'bh',
473
+ __('Bangladesh', 'wpsl') => 'bd',
474
+ __('Barbados', 'wpsl') => 'bb',
475
+ __('Belarus', 'wpsl') => 'by',
476
+ __('Belgium', 'wpsl') => 'be',
477
+ __('Belize', 'wpsl') => 'bz',
478
+ __('Benin', 'wpsl') => 'bj',
479
+ __('Bermuda', 'wpsl') => 'bm',
480
+ __('Bhutan', 'wpsl') => 'bt',
481
+ __('Bolivia', 'wpsl') => 'bo',
482
+ __('Bosnia and Herzegovina', 'wpsl') => 'ba',
483
+ __('Botswana', 'wpsl') => 'bw',
484
+ __('Brazil', 'wpsl') => 'br',
485
+ __('British Indian Ocean Territory', 'wpsl') => 'io',
486
+ __('Brunei', 'wpsl') => 'bn',
487
+ __('Bulgaria', 'wpsl') => 'bg',
488
+ __('Burkina Faso', 'wpsl') => 'bf',
489
+ __('Burundi', 'wpsl') => 'bi',
490
+ __('Cambodia', 'wpsl') => 'kh',
491
+ __('Cameroon', 'wpsl') => 'cm',
492
+ __('Canada', 'wpsl') => 'ca',
493
+ __('Cape Verde', 'wpsl') => 'cv',
494
+ __('Cayman Islands', 'wpsl') => 'ky',
495
+ __('Central African Republic', 'wpsl') => 'cf',
496
+ __('Chad', 'wpsl') => 'td',
497
+ __('Chile', 'wpsl') => 'cl',
498
+ __('China', 'wpsl') => 'cn',
499
+ __('Christmas Island', 'wpsl') => 'cx',
500
+ __('Cocos Islands', 'wpsl') => 'cc',
501
+ __('Colombia', 'wpsl') => 'co',
502
+ __('Comoros', 'wpsl') => 'km',
503
+ __('Congo', 'wpsl') => 'cg',
504
+ __('Costa Rica', 'wpsl') => 'cr',
505
+ __('Côte d\'Ivoire', 'wpsl') => 'ci',
506
+ __('Croatia', 'wpsl') => 'hr',
507
+ __('Cuba', 'wpsl') => 'cu',
508
+ __('Czech Republic', 'wpsl') => 'cz',
509
+ __('Denmark', 'wpsl') => 'dk',
510
+ __('Djibouti', 'wpsl') => 'dj',
511
+ __('Democratic Republic of the Congo', 'wpsl') => 'cd',
512
+ __('Dominica', 'wpsl') => 'dm',
513
+ __('Dominican Republic', 'wpsl') => 'do',
514
+ __('Ecuador', 'wpsl') => 'ec',
515
+ __('Egypt', 'wpsl') => 'eg',
516
+ __('El Salvador', 'wpsl') => 'sv',
517
+ __('Equatorial Guinea', 'wpsl') => 'gq',
518
+ __('Eritrea', 'wpsl') => 'er',
519
+ __('Estonia', 'wpsl') => 'ee',
520
+ __('Ethiopia', 'wpsl') => 'et',
521
+ __('Fiji', 'wpsl') => 'fj',
522
+ __('Finland', 'wpsl') => 'fi',
523
+ __('France', 'wpsl') => 'fr',
524
+ __('French Guiana', 'wpsl') => 'gf',
525
+ __('Gabon', 'wpsl') => 'ga',
526
+ __('Gambia', 'wpsl') => 'gm',
527
+ __('Germany', 'wpsl') => 'de',
528
+ __('Ghana', 'wpsl') => 'gh',
529
+ __('Greenland', 'wpsl') => 'gl',
530
+ __('Greece', 'wpsl') => 'gr',
531
+ __('Grenada', 'wpsl') => 'gd',
532
+ __('Guam', 'wpsl') => 'gu',
533
+ __('Guadeloupe', 'wpsl') => 'gp',
534
+ __('Guatemala', 'wpsl') => 'gt',
535
+ __('Guinea', 'wpsl') => 'gn',
536
+ __('Guinea-Bissau', 'wpsl') => 'gw',
537
+ __('Haiti', 'wpsl') => 'ht',
538
+ __('Honduras', 'wpsl') => 'hn',
539
+ __('Hong Kong', 'wpsl') => 'hk',
540
+ __('Hungary', 'wpsl') => 'hu',
541
+ __('Iceland', 'wpsl') => 'is',
542
+ __('India', 'wpsl') => 'in',
543
+ __('Indonesia', 'wpsl') => 'id',
544
+ __('Iran', 'wpsl') => 'ir',
545
+ __('Iraq', 'wpsl') => 'iq',
546
+ __('Ireland', 'wpsl') => 'ie',
547
+ __('Israel', 'wpsl') => 'il',
548
+ __('Italy', 'wpsl') => 'it',
549
+ __('Jamaica', 'wpsl') => 'jm',
550
+ __('Japan', 'wpsl') => 'jp',
551
+ __('Jordan', 'wpsl') => 'jo',
552
+ __('Kazakhstan', 'wpsl') => 'kz',
553
+ __('Kenya', 'wpsl') => 'ke',
554
+ __('Kuwait', 'wpsl') => 'kw',
555
+ __('Kyrgyzstan', 'wpsl') => 'kg',
556
+ __('Laos', 'wpsl') => 'la',
557
+ __('Latvia', 'wpsl') => 'lv',
558
+ __('Lebanon', 'wpsl') => 'lb',
559
+ __('Lesotho', 'wpsl') => 'ls',
560
+ __('Liberia', 'wpsl') => 'lr',
561
+ __('Libya', 'wpsl') => 'ly',
562
+ __('Liechtenstein', 'wpsl') => 'li',
563
+ __('Lithuania', 'wpsl') => 'lt',
564
+ __('Luxembourg', 'wpsl') => 'lu',
565
+ __('Macau', 'wpsl') => 'mo',
566
+ __('Macedonia', 'wpsl') => 'mk',
567
+ __('Madagascar', 'wpsl') => 'mg',
568
+ __('Malawi', 'wpsl') => 'mw',
569
+ __('Malaysia ', 'wpsl') => 'my',
570
+ __('Mali', 'wpsl') => 'ml',
571
+ __('Marshall Islands', 'wpsl') => 'mh',
572
+ __('Martinique', 'wpsl') => 'il',
573
+ __('Mauritania', 'wpsl') => 'mr',
574
+ __('Mauritius', 'wpsl') => 'mu',
575
+ __('Mexico', 'wpsl') => 'mx',
576
+ __('Micronesia', 'wpsl') => 'fm',
577
+ __('Moldova', 'wpsl') => 'md',
578
+ __('Monaco' ,'wpsl') => 'mc',
579
+ __('Mongolia', 'wpsl') => 'mn',
580
+ __('Montenegro', 'wpsl') => 'me',
581
+ __('Montserrat', 'wpsl') => 'ms',
582
+ __('Morocco', 'wpsl') => 'ma',
583
+ __('Mozambique', 'wpsl') => 'mz',
584
+ __('Myanmar', 'wpsl') => 'mm',
585
+ __('Namibia', 'wpsl') => 'na',
586
+ __('Nauru', 'wpsl') => 'nr',
587
+ __('Nepal', 'wpsl') => 'np',
588
+ __('Netherlands', 'wpsl') => 'nl',
589
+ __('Netherlands Antilles', 'wpsl') => 'an',
590
+ __('New Zealand', 'wpsl') => 'nz',
591
+ __('Nicaragua', 'wpsl') => 'ni',
592
+ __('Niger', 'wpsl') => 'ne',
593
+ __('Nigeria', 'wpsl') => 'ng',
594
+ __('Niue', 'wpsl') => 'nu',
595
+ __('Northern Mariana Islands', 'wpsl') => 'mp',
596
+ __('Norway', 'wpsl') => 'no',
597
+ __('Oman', 'wpsl') => 'om',
598
+ __('Pakistan', 'wpsl') => 'pk',
599
+ __('Panama' ,'wpsl') => 'pa',
600
+ __('Papua New Guinea', 'wpsl') => 'pg',
601
+ __('Paraguay' ,'wpsl') => 'py',
602
+ __('Peru', 'wpsl') => 'pe',
603
+ __('Philippines', 'wpsl') => 'ph',
604
+ __('Pitcairn Islands', 'wpsl') => 'pn',
605
+ __('Poland', 'wpsl') => 'pl',
606
+ __('Portugal', 'wpsl') => 'pt',
607
+ __('Qatar', 'wpsl') => 'qa',
608
+ __('Reunion', 'wpsl') => 're',
609
+ __('Romania', 'wpsl') => 'ro',
610
+ __('Russia', 'wpsl') => 'ru',
611
+ __('Rwanda', 'wpsl') => 'rw',
612
+ __('Saint Helena', 'wpsl') => 'sh',
613
+ __('Saint Kitts and Nevis', 'wpsl') => 'kn',
614
+ __('Saint Vincent and the Grenadines', 'wpsl') => 'vc',
615
+ __('Saint Lucia', 'wpsl') => 'lc',
616
+ __('Samoa', 'wpsl') => 'ws',
617
+ __('San Marino', 'wpsl') => 'sm',
618
+ __('São Tomé and Príncipe', 'wpsl') => 'st',
619
+ __('Saudi Arabia', 'wpsl') => 'sa',
620
+ __('Senegal', 'wpsl') => 'sn',
621
+ __('Serbia', 'wpsl') => 'rs',
622
+ __('Seychelles', 'wpsl') => 'sc',
623
+ __('Sierra Leone', 'wpsl') => 'sl',
624
+ __('Singapore', 'wpsl') => 'sg',
625
+ __('Slovakia', 'wpsl') => 'si',
626
+ __('Solomon Islands', 'wpsl') => 'sb',
627
+ __('Somalia', 'wpsl') => 'so',
628
+ __('South Africa', 'wpsl') => 'za',
629
+ __('South Korea', 'wpsl') => 'kr',
630
+ __('Spain', 'wpsl') => 'es',
631
+ __('Sri Lanka', 'wpsl') => 'lk',
632
+ __('Sudan', 'wpsl') => 'sd',
633
+ __('Swaziland', 'wpsl') => 'sz',
634
+ __('Sweden', 'wpsl') => 'se',
635
+ __('Switzerland', 'wpsl') => 'ch',
636
+ __('Syria', 'wpsl') => 'sy',
637
+ __('Taiwan', 'wpsl') => 'tw',
638
+ __('Tajikistan', 'wpsl') => 'tj',
639
+ __('Tanzania', 'wpsl') => 'tz',
640
+ __('Thailand', 'wpsl') => 'th',
641
+ __('Timor-Leste', 'wpsl') => 'tl',
642
+ __('Tokelau' ,'wpsl') => 'tk',
643
+ __('Togo', 'wpsl') => 'tg',
644
+ __('Tonga', 'wpsl') => 'to',
645
+ __('Trinidad and Tobago', 'wpsl') => 'tt',
646
+ __('Tunisia', 'wpsl') => 'tn',
647
+ __('Turkey', 'wpsl') => 'tr',
648
+ __('Turkmenistan', 'wpsl') => 'tm',
649
+ __('Tuvalu', 'wpsl') => 'tv',
650
+ __('Uganda', 'wpsl') => 'ug',
651
+ __('Ukraine', 'wpsl') => 'ua',
652
+ __('United Arab Emirates', 'wpsl') => 'ae',
653
+ __('United Kingdom', 'wpsl') => 'gb',
654
+ __('United States', 'wpsl') => 'us',
655
+ __('Uruguay', 'wpsl') => 'uy',
656
+ __('Uzbekistan', 'wpsl') => 'uz',
657
+ __('Wallis Futuna', 'wpsl') => 'wf',
658
+ __('Venezuela', 'wpsl') => 've',
659
+ __('Vietnam', 'wpsl') => 'vn',
660
+ __('Yemen', 'wpsl') => 'ye',
661
+ __('Zambia' ,'wpsl') => 'zm',
662
+ __('Zimbabwe', 'wpsl') => 'zw'
663
+ );
664
+ }
665
+
666
+ /* Make sure we have an array with a value */
667
+ if ( !empty( $api_option_list ) && ( is_array( $api_option_list ) ) ) {
668
+ $option_list = '';
669
+ $i = 0;
670
+
671
+ foreach ( $api_option_list as $api_option_key => $api_option_value ) {
672
+
673
+ /* If no option value exist, set the first one as selected */
674
+ if ( ( $i == 0 ) && ( empty( $wpsl_settings['api_'.$list] ) ) ) {
675
+ $selected = 'selected="selected"';
676
+ } else {
677
+ $selected = ( $wpsl_settings['api_'.$list] == $api_option_value ) ? 'selected="selected"' : '';
678
+ }
679
+
680
+ $option_list .= '<option value="' . esc_attr( $api_option_value ) . '" ' . $selected . '> ' . esc_html( $api_option_key ) . '</option>';
681
+ $i++;
682
+ }
683
+
684
+ return $option_list;
685
+ }
686
+ }
687
+
688
+ /**
689
+ * Create the dropdown to select the zoom level.
690
+ *
691
+ * @since 1.0
692
+ * @return string $dropdown The html for the zoom level list
693
+ */
694
+ public function show_zoom_levels() {
695
+
696
+ global $wpsl_settings;
697
+
698
+ $dropdown = '<select id="wpsl-zoom-level" name="wpsl_map[zoom_level]" autocomplete="off">';
699
+
700
+ for ( $i = 1; $i < 13; $i++ ) {
701
+ $selected = ( $wpsl_settings['zoom_level'] == $i ) ? 'selected="selected"' : '';
702
+
703
+ switch ( $i ) {
704
+ case 1:
705
+ $zoom_desc = ' - ' . __( 'World view', 'wpsl' );
706
+ break;
707
+ case 3:
708
+ $zoom_desc = ' - ' . __( 'Default', 'wpsl' );
709
+ break;
710
+ case 12:
711
+ $zoom_desc = ' - ' . __( 'Roadmap', 'wpsl' );
712
+ break;
713
+ default:
714
+ $zoom_desc = '';
715
+ }
716
+
717
+ $dropdown .= "<option value='$i' $selected>". $i . esc_html( $zoom_desc ) . "</option>";
718
+ }
719
+
720
+ $dropdown .= "</select>";
721
+
722
+ return $dropdown;
723
+ }
724
+
725
+ /**
726
+ * Create the html output for the marker list that is shown on the settings page.
727
+ *
728
+ * There are two markers lists, one were the user can set the marker for the start point
729
+ * and one were a marker can be set for the store. We also check if the marker img is identical
730
+ * to the name in the option field. If so we set it to checked.
731
+ *
732
+ * @since 1.0
733
+ * @param string $marker_img The filename of the marker
734
+ * @param string $location Either contains "start" or "store"
735
+ * @return string $marker_list A list of all the available markers
736
+ */
737
+ public function create_marker_html( $marker_img, $location ) {
738
+
739
+ global $wpsl_settings;
740
+
741
+ $marker_list = '';
742
+
743
+ if ( $wpsl_settings[$location.'_marker'] == $marker_img ) {
744
+ $checked = 'checked="checked"';
745
+ $css_class = 'class="wpsl-active-marker"';
746
+ } else {
747
+ $checked = '';
748
+ $css_class = '';
749
+ }
750
+
751
+ $marker_list .= '<li ' . $css_class . '>';
752
+ $marker_list .= '<img src="' . WPSL_URL . 'img/markers/' . $marker_img . '" />';
753
+ $marker_list .= '<input ' . $checked . ' type="radio" name="wpsl_map[' . $location . '_marker]" value="' . $marker_img . '" />';
754
+ $marker_list .= '</li>';
755
+
756
+ return $marker_list;
757
+ }
758
+
759
+ /**
760
+ * Get the default values for the marker clusters dropdown options.
761
+ *
762
+ * @since 1.2.20
763
+ * @param string $type The cluster option type
764
+ * @return string $cluster_values The default cluster options
765
+ */
766
+ public function get_default_cluster_option( $type ) {
767
+
768
+ $cluster_values = array(
769
+ 'cluster_zoom' => array(
770
+ '7',
771
+ '8',
772
+ '9',
773
+ '10',
774
+ '11',
775
+ '12',
776
+ '13'
777
+ ),
778
+ 'cluster_size' => array(
779
+ '40',
780
+ '50',
781
+ '60',
782
+ '70',
783
+ '80'
784
+ ),
785
+ );
786
+
787
+ return $cluster_values[$type];
788
+ }
789
+
790
+ /**
791
+ * Create a dropdown for the marker cluster options.
792
+ *
793
+ * @since 1.2.20
794
+ * @param string $type The cluster option type
795
+ * @return string $dropdown The html for the distance option list
796
+ */
797
+ public function show_cluster_options( $type ) {
798
+
799
+ global $wpsl_settings;
800
+
801
+ $cluster_options = array(
802
+ 'cluster_zoom' => array(
803
+ 'id' => 'wpsl-marker-zoom',
804
+ 'name' => 'cluster_zoom',
805
+ 'options' => $this->get_default_cluster_option( $type )
806
+ ),
807
+ 'cluster_size' => array(
808
+ 'id' => 'wpsl-marker-cluster-size',
809
+ 'name' => 'cluster_size',
810
+ 'options' => $this->get_default_cluster_option( $type )
811
+ ),
812
+ );
813
+
814
+ $dropdown = '<select id="' . esc_attr( $cluster_options[$type]['id'] ) . '" name="wpsl_map[' . esc_attr( $cluster_options[$type]['name'] ) . ']" autocomplete="off">';
815
+
816
+ $i = 0;
817
+ foreach ( $cluster_options[$type]['options'] as $item => $value ) {
818
+ $selected = ( $wpsl_settings[$type] == $value ) ? 'selected="selected"' : '';
819
+
820
+ if ( $i == 0 ) {
821
+ $dropdown .= "<option value='0' $selected>" . __( 'Default', 'wpsl' ) . "</option>";
822
+ } else {
823
+ $dropdown .= "<option value=". absint( $value ) . " $selected>" . absint( $value ) . "</option>";
824
+ }
825
+
826
+ $i++;
827
+ }
828
+
829
+ $dropdown .= "</select>";
830
+
831
+ return $dropdown;
832
+ }
833
+
834
+ /**
835
+ * Show the options of the start and store markers.
836
+ *
837
+ * @since 1.0
838
+ * @return string $marker_list The complete list of available and selected markers
839
+ */
840
+ public function show_marker_options() {
841
+
842
+ $marker_list = '';
843
+ $marker_images = $this->get_available_markers();
844
+ $marker_locations = array(
845
+ 'start',
846
+ 'store'
847
+ );
848
+
849
+ foreach ( $marker_locations as $location ) {
850
+ if ( $location == 'start' ) {
851
+ $marker_list .= __( 'Start location marker', 'wpsl' ) . ':';
852
+ } else {
853
+ $marker_list .= __( 'Store location marker', 'wpsl' ) . ':';
854
+ }
855
+
856
+ if ( !empty( $marker_images ) ) {
857
+ $marker_list .= '<ul class="wpsl-marker-list">';
858
+
859
+ foreach ( $marker_images as $marker_img ) {
860
+ $marker_list .= $this->create_marker_html( $marker_img, $location );
861
+ }
862
+
863
+ $marker_list .= '</ul>';
864
+ }
865
+ }
866
+
867
+ return $marker_list;
868
+ }
869
+
870
+ /**
871
+ * Load the markers that can be used on the map.
872
+ *
873
+ * @since 1.0
874
+ * @return array $marker_images A list of all the available markers
875
+ */
876
+ public function get_available_markers() {
877
+
878
+ $dir = WPSL_PLUGIN_DIR . 'img/markers/';
879
+
880
+ if ( is_dir( $dir ) ) {
881
+ if ( $dh = opendir( $dir ) ) {
882
+ while ( false !== ( $file = readdir( $dh ) ) ) {
883
+ if ( $file == '.' || $file == '..' || ( strpos( $file, '@2x' ) !== false ) ) continue;
884
+ $marker_images[] = $file;
885
+ }
886
+
887
+ closedir( $dh );
888
+ }
889
+ }
890
+
891
+ return $marker_images;
892
+ }
893
+
894
+ /**
895
+ * Show a list of available templates.
896
+ *
897
+ * @since 1.2.20
898
+ * @return string $dropdown The html for the template option list
899
+ */
900
+ public function show_template_options() {
901
+
902
+ global $wpsl_settings;
903
+
904
+ $dropdown = '<select id="wpsl-store-template" name="wpsl_ux[template_id]" autocomplete="off">';
905
+ $i = 0;
906
+
907
+ foreach ( wpsl_get_templates() as $template ) {
908
+ $template_id = ( isset( $template['id'] ) ) ? $template['id'] : '';
909
+
910
+ $selected = ( $wpsl_settings['template_id'] == $template_id ) ? ' selected="selected"' : '';
911
+ $dropdown .= "<option value='" . esc_attr( $template_id ) . "' $selected>" . esc_html( $template['name'] ) . "</option>";
912
+ $i++;
913
+ }
914
+
915
+ $dropdown .= '</select>';
916
+
917
+ return $dropdown;
918
+ }
919
+
920
+ /**
921
+ * Create dropdown lists.
922
+ *
923
+ * @since 2.0
924
+ * @param string $type The type of dropdown
925
+ * @return string $dropdown The html output for the dropdown
926
+ */
927
+ public function create_dropdown( $type ) {
928
+
929
+ global $wpsl_settings;
930
+
931
+ $dropdown_lists = array(
932
+ 'hour_input' => array(
933
+ 'values' => array(
934
+ 'textarea' => __( 'Textarea', 'wpsl' ),
935
+ 'dropdown' => __( 'Dropdowns (recommended)', 'wpsl' )
936
+ ),
937
+ 'id' => 'wpsl-editor-hour-input',
938
+ 'name' => 'wpsl_editor[hour_input]',
939
+ 'selected' => $wpsl_settings['editor_hour_input']
940
+ ),
941
+ 'marker_effects' => array(
942
+ 'values' => array(
943
+ 'bounce' => __( 'Bounces up and down', 'wpsl' ),
944
+ 'info_window' => __( 'Will open the info window', 'wpsl' ),
945
+ 'ignore' => __( 'Does not respond', 'wpsl' )
946
+ ),
947
+ 'id' => 'wpsl-marker-effect',
948
+ 'name' => 'wpsl_ux[marker_effect]',
949
+ 'selected' => $wpsl_settings['marker_effect']
950
+ ),
951
+ 'more_info' => array(
952
+ 'values' => array(
953
+ 'store listings' => __( 'In the store listings', 'wpsl' ),
954
+ 'info window' => __( 'In the info window on the map', 'wpsl' )
955
+ ),
956
+ 'id' => 'wpsl-more-info-list',
957
+ 'name' => 'wpsl_ux[more_info_location]',
958
+ 'selected' => $wpsl_settings['more_info_location']
959
+ ),
960
+ 'map_types' => array(
961
+ 'values' => wpsl_get_map_types(),
962
+ 'id' => 'wpsl-map-type',
963
+ 'name' => 'wpsl_map[type]',
964
+ 'selected' => $wpsl_settings['map_type']
965
+ ),
966
+ 'editor_map_types' => array(
967
+ 'values' => wpsl_get_map_types(),
968
+ 'id' => 'wpsl-editor-map-type',
969
+ 'name' => 'wpsl_editor[map_type]',
970
+ 'selected' => $wpsl_settings['editor_map_type']
971
+ ),
972
+ 'max_zoom_level' => array(
973
+ 'values' => wpsl_get_max_zoom_levels(),
974
+ 'id' => 'wpsl-max-auto-zoom',
975
+ 'name' => 'wpsl_map[max_auto_zoom]',
976
+ 'selected' => $wpsl_settings['auto_zoom_level']
977
+ ),
978
+ 'address_format' => array(
979
+ 'values' => wpsl_get_address_formats(),
980
+ 'id' => 'wpsl-address-format',
981
+ 'name' => 'wpsl_ux[address_format]',
982
+ 'selected' => $wpsl_settings['address_format']
983
+ )
984
+ );
985
+
986
+ $dropdown = '<select id="' . esc_attr( $dropdown_lists[$type]['id'] ) . '" name="' . esc_attr( $dropdown_lists[$type]['name'] ) . '" autocomplete="off">';
987
+
988
+ foreach ( $dropdown_lists[$type]['values'] as $key => $value ) {
989
+ $selected = ( $key == $dropdown_lists[$type]['selected'] ) ? 'selected="selected"' : '';
990
+ $dropdown .= "<option value='" . esc_attr( $key ) . "' $selected>" . esc_html( $value ) . "</option>";
991
+ }
992
+
993
+ $dropdown .= '</select>';
994
+
995
+ return $dropdown;
996
+ }
997
+
998
+ /**
999
+ * Create a dropdown for the 12/24 opening hours format.
1000
+ *
1001
+ * @since 2.0
1002
+ * @param string $hour_format The hour format that should be set to selected
1003
+ * @return string $dropdown The html for the dropdown
1004
+ */
1005
+ public function show_opening_hours_format( $hour_format = '' ) {
1006
+
1007
+ global $wpsl_settings;
1008
+
1009
+ $items = array(
1010
+ '12' => __( '12 Hours', 'wpsl' ),
1011
+ '24' => __( '24 Hours', 'wpsl' )
1012
+ );
1013
+
1014
+ if ( !absint( $hour_format ) ) {
1015
+ $hour_format = $wpsl_settings['editor_hour_format'];
1016
+ }
1017
+
1018
+ $dropdown = '<select id="wpsl-editor-hour-format" name="wpsl_editor[hour_format]" autocomplete="off">';
1019
+
1020
+ foreach ( $items as $key => $value ) {
1021
+ $selected = ( $hour_format == $key ) ? 'selected="selected"' : '';
1022
+ $dropdown .= "<option value='$key' $selected>" . esc_html( $value ) . "</option>";
1023
+ }
1024
+
1025
+ $dropdown .= '</select>';
1026
+
1027
+ return $dropdown;
1028
+ }
1029
+ }
1030
+ }
admin/css/style-3.8.css CHANGED
@@ -1,21 +1,22 @@
1
  @font-face {
2
  font-family: 'fontello';
3
- src: url('../font/fontello.eot?92013519');
4
- src: url('../font/fontello.eot?92013519#iefix') format('embedded-opentype'),
5
- url('../font/fontello.woff?92013519') format('woff'),
6
- url('../font/fontello.ttf?92013519') format('truetype'),
7
- url('../font/fontello.svg?92013519#fontello') format('svg');
8
  font-weight: normal;
9
  font-style: normal;
10
  }
11
 
12
- #adminmenu #toplevel_page_wpsl_store_editor .wp-menu-image:before {
13
- content: '\e800';
14
  display: inline-block;
15
  font-family: "fontello" !important;
16
  font-style: normal;
17
  font-variant: normal;
18
  font-weight: 400;
 
19
  line-height: 1em;
20
  text-align: center;
21
  text-decoration: inherit;
@@ -24,10 +25,10 @@
24
  }
25
 
26
  /* Hide the pre 3.8 menu icon */
27
- #adminmenu #toplevel_page_wpsl_store_editor .wp-menu-image img {
28
- display:none;
29
  }
30
 
31
  #wpsl-store-overview .widefat td.thumb {
32
- padding-top:8px;
33
  }
1
  @font-face {
2
  font-family: 'fontello';
3
+ src: url('../font/fontello.eot?54620740');
4
+ src: url('../font/fontello.eot?54620740#iefix') format('embedded-opentype'),
5
+ url('../font/fontello.woff?54620740') format('woff'),
6
+ url('../font/fontello.ttf?54620740') format('truetype'),
7
+ url('../font/fontello.svg?54620740#fontello') format('svg');
8
  font-weight: normal;
9
  font-style: normal;
10
  }
11
 
12
+ #adminmenu #menu-posts-wpsl_stores .wp-menu-image:before {
13
+ content: '\e801';
14
  display: inline-block;
15
  font-family: "fontello" !important;
16
  font-style: normal;
17
  font-variant: normal;
18
  font-weight: 400;
19
+ font-size: 22px;
20
  line-height: 1em;
21
  text-align: center;
22
  text-decoration: inherit;
25
  }
26
 
27
  /* Hide the pre 3.8 menu icon */
28
+ #adminmenu #menu-posts-wpsl_stores .wp-menu-image img {
29
+ display: none;
30
  }
31
 
32
  #wpsl-store-overview .widefat td.thumb {
33
+ padding-top: 8px;
34
  }
admin/css/style-3.8.min.css ADDED
@@ -0,0 +1 @@
 
1
+ @font-face{font-family:fontello;src:url(../font/fontello.eot?54620740);src:url(../font/fontello.eot?54620740#iefix) format('embedded-opentype'),url(../font/fontello.woff?54620740) format('woff'),url(../font/fontello.ttf?54620740) format('truetype'),url(../font/fontello.svg?54620740#fontello) format('svg');font-weight:400;font-style:normal}#adminmenu #menu-posts-wpsl_stores .wp-menu-image:before{content:'\e801';display:inline-block;font-family:fontello!important;font-style:normal;font-variant:normal;font-weight:400;font-size:22px;line-height:1em;text-align:center;text-decoration:inherit;text-transform:none;width:1em}#adminmenu #menu-posts-wpsl_stores .wp-menu-image img{display:none}#wpsl-store-overview .widefat td.thumb{padding-top:8px}
admin/css/style.css CHANGED
@@ -1,31 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
1
  #wpsl-store-overview .widefat td,
2
  #wpsl-wrap .widefat td {
3
- padding:12px 7px;
4
  }
5
 
6
- #wpsl-store-overview .column-action a {
7
- float:left;
8
- margin-right:5px;
9
  }
10
 
11
- #wpsl-store-overview .widefat td.thumb {
12
- padding:9px 0 0 8px;
 
13
  }
14
 
15
- #wpsl-store-overview .thumb img {
16
- border-radius:3px;
 
17
  }
18
 
19
  #wpsl-store-overview p.search-box {
20
- margin:0 0 1em 0;
21
  }
22
 
23
  .column-action {
24
  width:130px;
25
  }
26
- #wpsl-delete-confirmation {
 
 
27
  display:none;
28
  }
 
29
  .wpsl-preloader {
30
  float:right;
31
  margin:4px 0 0 4px;
@@ -56,10 +71,6 @@
56
  margin-top:6px;
57
  }
58
 
59
- .wpsl-radioboxes {
60
- float:left;
61
- margin:5px 0 6px 1px;
62
- }
63
  #wpsl-wrap.wpsl-add-stores label {
64
  float:left;
65
  }
@@ -71,28 +82,45 @@
71
  margin-right:10px;
72
  }
73
 
74
- #wpsl-wrap em {
75
- display:block;
76
- }
77
  #wpsl-wrap textarea {
78
- width:340px;
79
  resize:none;
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  .wpsl-curve {
83
- border-radius:3px;
 
84
  }
85
 
86
- #wpsl-wrap .wpsl-error {
87
  border:1px solid #c01313;
88
  }
89
 
90
- .wpsl-submit-wrap,
91
- #wpsl-thumb-wrap div {
92
- margin-left:85px;
93
- }
94
  #wpsl-lookup-location {
95
- margin-bottom:2px;
96
  }
97
 
98
  #wpsl-wrap input[type=text],
@@ -124,80 +152,157 @@
124
  margin-bottom:12px;
125
  }
126
 
127
- #wpsl-thumb-wrap {
128
- width:100%;
129
- overflow:hidden;
130
  }
131
 
132
- #wpsl-thumb-wrap p {
133
- margin-top:0;
134
  }
135
 
136
- #wpsl-thumb-wrap div {
137
- float:left;
138
- clear:both;
 
 
 
 
139
  }
140
- .wpsl-thumb-placeholder {
141
- background: none repeat scroll 0 0 #FFFFFF;
142
- border: 1px dashed #CCCCCC;
143
- border-radius: 3px 3px 3px 3px;
144
- float: left;
145
- height: 85px;
146
- width: 85px;
147
- margin-bottom:10px;
148
  }
149
 
150
- #wpsl-wrap.wpsl-settings .metabox-holder {
151
- width:100%;
 
 
 
152
  }
153
- #wpsl-wrap.wpsl-settings .metabox-holder h3:hover {
154
- cursor: auto;
155
- }
156
- #wpsl-gmap-wrap {
157
- float:left;
158
- width:451px;
159
- height:250px;
160
- border-radius:3px;
161
- margin-top:0;
162
- margin-bottom:20px;
163
- clear:both;
164
  }
165
 
166
  /* Markers */
167
  .wpsl-marker-list {
168
- overflow:hidden;
169
  }
170
  .wpsl-marker-list li {
171
- float:left;
172
- padding:10px;
173
- margin-right:5px;
174
- text-align:center;
175
  }
176
  .wpsl-marker-list li input[type="radio"] {
177
- margin-right:0;
178
  }
179
  .wpsl-marker-list img {
180
- display:block;
181
- margin-bottom:7px;
182
  }
183
  .wpsl-marker-list li:hover,
184
  .wpsl-active-marker {
185
- background:#E4E4E4;
186
  border-radius:5px;
187
  cursor: pointer;
188
  }
189
 
190
  /* Settings page */
191
  #wpsl-settings-form .postbox-container {
192
- width:535px;
193
- clear:both;
194
  }
195
  #wpsl-wrap .metabox-holder {
196
- padding-top:0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  }
198
 
199
  #wpsl-settings-form label {
200
- position:relative;
201
  display: inline-block;
202
  font-weight: normal;
203
  margin: 0 10px 0 0;
@@ -205,19 +310,19 @@
205
  }
206
 
207
  #wpsl-save-settings {
208
- float:left;
209
- clear:both;
210
  }
211
- #wpsl-settings-form .wpsl_radioboxes label {
212
- float:none;
213
  margin-right: 10px;
214
  width: auto;
215
  }
216
 
217
  #wpsl-faq dt {
218
- margin-bottom:4px;
219
- font-weight:bold;
220
- font-size:110%;
221
  }
222
 
223
  #wpsl-faq dd {
@@ -230,5 +335,270 @@
230
 
231
  /* Overview page */
232
  .wp-list-table .column-action .button {
233
- margin:3px 5px 3px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  }
1
+ @font-face {
2
+ font-family: 'fontello';
3
+ src: url('../font/fontello.eot?54620740');
4
+ src: url('../font/fontello.eot?54620740#iefix') format('embedded-opentype'),
5
+ url('../font/fontello.woff?54620740') format('woff'),
6
+ url('../font/fontello.ttf?54620740') format('truetype'),
7
+ url('../font/fontello.svg?54620740#fontello') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
  #wpsl-store-overview .widefat td,
13
  #wpsl-wrap .widefat td {
14
+ padding: 12px 7px;
15
  }
16
 
17
+ #wpsl-wrap.wpsl-settings h2 {
18
+ margin-bottom: 15px;
 
19
  }
20
 
21
+ #wpsl-wrap .submit {
22
+ padding: 0!important;
23
+ margin-bottom: -10px !important;
24
  }
25
 
26
+ #wpsl-store-overview .column-action a {
27
+ float: left;
28
+ margin-right: 5px;
29
  }
30
 
31
  #wpsl-store-overview p.search-box {
32
+ margin: 0 0 1em 0;
33
  }
34
 
35
  .column-action {
36
  width:130px;
37
  }
38
+
39
+ #wpsl-delete-confirmation,
40
+ .wpsl-hide {
41
  display:none;
42
  }
43
+
44
  .wpsl-preloader {
45
  float:right;
46
  margin:4px 0 0 4px;
71
  margin-top:6px;
72
  }
73
 
 
 
 
 
74
  #wpsl-wrap.wpsl-add-stores label {
75
  float:left;
76
  }
82
  margin-right:10px;
83
  }
84
 
 
 
 
85
  #wpsl-wrap textarea {
86
+ width:489px;
87
  resize:none;
88
  }
89
 
90
+ .wpsl-tab #wpsl-hours, #wpsl-wrap textarea {
91
+ height: 185px;
92
+ }
93
+
94
+ /* Todo uitzoeken voor textarea width */
95
+ #wpsl-wrap .wpsl-style-input textarea {
96
+ width: 509px;
97
+ resize: none;
98
+ margin-bottom: 12px;
99
+ height: 165px;
100
+ }
101
+
102
+ #wpsl-style-preview {
103
+ float: left;
104
+ margin-bottom: 12px;
105
+ }
106
+
107
+ .wpsl-style-preview-error {
108
+ float: left;
109
+ margin: 6px 0 0 10px;
110
+ color: #b91111;
111
+ }
112
+
113
  .wpsl-curve {
114
+ float: left;
115
+ border-radius: 3px;
116
  }
117
 
118
+ .wpsl-store-meta .wpsl-error {
119
  border:1px solid #c01313;
120
  }
121
 
 
 
 
 
122
  #wpsl-lookup-location {
123
+ margin-bottom: 7px;
124
  }
125
 
126
  #wpsl-wrap input[type=text],
152
  margin-bottom:12px;
153
  }
154
 
155
+ #wpsl-wrap.wpsl-settings .metabox-holder {
156
+ width:100%;
 
157
  }
158
 
159
+ #wpsl-wrap.wpsl-settings .metabox-holder h3:hover {
160
+ cursor: auto;
161
  }
162
 
163
+ #wpsl-gmap-wrap {
164
+ float: left;
165
+ width: 100%;
166
+ height: 250px;
167
+ border-radius: 3px;
168
+ margin-top: 0;
169
+ margin-bottom: 20px;
170
  }
171
+
172
+ #wpsl-map-preview #wpsl-gmap-wrap {
173
+ margin: 6px 0 12px 0;
 
 
 
 
 
174
  }
175
 
176
+ #wpsl-gmap-wrap.wpsl-styles-preview {
177
+ float: none;
178
+ margin: 0;
179
+ border-radius: 0;
180
+ clear: both;
181
  }
182
+
183
+ #wpsl-style-url {
184
+ display: none;
185
+ margin: 20px 0 0 0;
 
 
 
 
 
 
 
186
  }
187
 
188
  /* Markers */
189
  .wpsl-marker-list {
190
+ overflow: hidden;
191
  }
192
  .wpsl-marker-list li {
193
+ float: left;
194
+ padding: 10px;
195
+ margin-right: 5px;
196
+ text-align: center;
197
  }
198
  .wpsl-marker-list li input[type="radio"] {
199
+ margin-right: 0;
200
  }
201
  .wpsl-marker-list img {
202
+ display: block;
203
+ margin-bottom: 7px;
204
  }
205
  .wpsl-marker-list li:hover,
206
  .wpsl-active-marker {
207
+ background: #E4E4E4;
208
  border-radius:5px;
209
  cursor: pointer;
210
  }
211
 
212
  /* Settings page */
213
  #wpsl-settings-form .postbox-container {
214
+ width: 535px;
215
+ clear: both;
216
  }
217
  #wpsl-wrap .metabox-holder {
218
+ padding-top: 0;
219
+ }
220
+
221
+ /* Tooltip */
222
+ .wpsl-info {
223
+ position: relative;
224
+ margin-left: 3px;
225
+ }
226
+
227
+ .wpsl-info:before {
228
+ content: '\e802';
229
+ font-size: 14px;
230
+ font-family: "fontello";
231
+ font-style: normal;
232
+ font-weight: normal;
233
+ speak: none;
234
+ display: inline-block;
235
+ text-decoration: inherit;
236
+ width: 1em;
237
+ margin-right: .2em;
238
+ text-align: center;
239
+ font-variant: normal;
240
+ text-transform: none;
241
+ line-height: 1em;
242
+ margin-left: .2em;
243
+ }
244
+
245
+ .wpsl-info:hover {
246
+ cursor: pointer;
247
+ }
248
+
249
+ .wpsl-info.wpsl-required-setting:before {
250
+ color: #b91111;
251
+ }
252
+
253
+ .wpsl-info-text {
254
+ position: absolute;
255
+ padding: 10px;
256
+ left: -29px;
257
+ bottom: 28px;
258
+ color: #eee;
259
+ min-width: 200px;
260
+ background: #222;
261
+ border-radius: 3px;
262
+ }
263
+
264
+ #wpsl-map-preview .wpsl-info-text {
265
+ width: 175px;
266
+ min-width: 0;
267
+ left: -88px;
268
+ }
269
+
270
+ #wpsl-map-preview .wpsl-info-text::after {
271
+ left: auto;
272
+ right: 87px;
273
+ }
274
+
275
+ #wpsl-map-preview .wpsl-info {
276
+ position: absolute;
277
+ margin-left: 5px;
278
+ top: 5px;
279
+ }
280
+
281
+ .wpsl-submit-wrap {
282
+ position: relative;
283
+ clear: both;
284
+ }
285
+
286
+ .wpsl-search-settings .wpsl-info-text {
287
+ white-space: nowrap;
288
+ }
289
+
290
+ .wpsl-info-text:after {
291
+ position: absolute;
292
+ border-left: 11px solid transparent;
293
+ border-right: 11px solid transparent;
294
+ border-top: 11px solid #222;
295
+ content: "";
296
+ left: 27px;
297
+ bottom: -10px;
298
+ }
299
+
300
+ .wpsl-info-text a {
301
+ color: #fff;
302
  }
303
 
304
  #wpsl-settings-form label {
305
+ position: relative;
306
  display: inline-block;
307
  font-weight: normal;
308
  margin: 0 10px 0 0;
310
  }
311
 
312
  #wpsl-save-settings {
313
+ float: left;
314
+ clear: both;
315
  }
316
+ #wpsl-settings-form .wpsl-radioboxes label {
317
+ float: none;
318
  margin-right: 10px;
319
  width: auto;
320
  }
321
 
322
  #wpsl-faq dt {
323
+ margin-bottom: 4px;
324
+ font-weight: bold;
325
+ font-size: 110%;
326
  }
327
 
328
  #wpsl-faq dd {
335
 
336
  /* Overview page */
337
  .wp-list-table .column-action .button {
338
+ margin: 3px 5px 3px 0;
339
+ }
340
+
341
+ /* Custom post type */
342
+ .wpsl-store-meta p {
343
+ overflow: hidden;
344
+ }
345
+
346
+ .wpsl-store-meta label {
347
+ float: left;
348
+ width: 95px;
349
+ margin-top: 3px;
350
+ }
351
+
352
+ .wpsl-store-meta textarea,
353
+ .wpsl-store-meta input[type="text"],
354
+ .wpsl-store-meta input[type="email"],
355
+ .wpsl-store-meta input[type="url"] {
356
+ width: 340px;
357
+ }
358
+
359
+ .wpsl-store-meta textarea {
360
+ resize: none;
361
+ }
362
+
363
+ #wpsl-map-preview em,
364
+ #wpsl-settings-form em,
365
+ .wpsl-store-meta em {
366
+ display: block;
367
+ }
368
+
369
+ #wpsl-settings-form .wpsl-info em {
370
+ display: inline;
371
+ }
372
+
373
+ #wpsl-meta-nav {
374
+ margin: 19px 0 6px 0;
375
+ }
376
+
377
+ #wpsl-meta-nav li {
378
+ display:inline;
379
+ margin-right:5px;
380
+ }
381
+
382
+ #wpsl-meta-nav li:hover {
383
+ cursor: pointer;
384
+ }
385
+
386
+ #wpsl-meta-nav li a {
387
+ padding:6px 9px;
388
+ border-radius:3px 3px 0 0;
389
+ border-bottom: none;
390
+ text-decoration: none;
391
+ outline:none;
392
+ }
393
+
394
+ .wpsl-tab {
395
+ padding:5px 15px;
396
+ display:none;
397
+ border: 1px solid #eee;
398
+ border-radius:0px 3px 3px 3px;
399
+ }
400
+
401
+ div.wpsl-active {
402
+ display:block;
403
+ background: #fdfdfd;
404
+ }
405
+
406
+ #wpsl-meta-nav .wpsl-active a {
407
+ border:1px solid #eee;
408
+ border-bottom:1px solid #fdfdfd;
409
+ background: #fdfdfd;
410
+ color:#444;
411
+ }
412
+
413
+ .wpsl-star {
414
+ color:#c01313;
415
+ }
416
+
417
+ /* Opening Hours */
418
+ #wpsl-store-hours {
419
+ border-collapse: collapse;
420
+ margin: 5px 0 20px 0;
421
+ }
422
+
423
+ #wpsl-settings-form #wpsl-store-hours {
424
+ width: 100%;
425
+ }
426
+
427
+ #wpsl-store-hours div {
428
+ margin: 0;
429
+ padding: 3px;
430
+ background: #eee;
431
+ border: 1px solid #eee;
432
+ border-radius: 3px;
433
+ white-space: nowrap;
434
+ }
435
+
436
+ #wpsl-store-hours .wpsl-store-closed {
437
+ border: none;
438
+ background: none;
439
+ margin-top: 9px;
440
+ margin-bottom: 0;
441
+ }
442
+
443
+ .wpsl-current-period,
444
+ .wpsl-add-period {
445
+ float: left;
446
+ }
447
+
448
+ #wpsl-store-hours .wpsl-multiple-periods {
449
+ float: left;
450
+ clear: both;
451
+ margin-top: 8px;
452
+ }
453
+
454
+ .wpsl-add-period span,
455
+ .wpsl-current-period span {
456
+ float:left;
457
+ margin:6px 7px 0;
458
+ }
459
+
460
+ .wpsl-add-period span {
461
+ margin:6px 0 0 7px;
462
+ }
463
+
464
+ #wpsl-store-hours .wpsl-remove-period {
465
+ background:#999;
466
+ border-radius: 9px;
467
+ }
468
+
469
+ .wpsl-add-period {
470
+ border:none;
471
+ background:#eee;
472
+ border-radius: 3px;
473
+ font-size: 13px;
474
+ padding: 3px 10px;
475
+ }
476
+
477
+ .wpsl-default-hours {
478
+ margin-top:25px;
479
+ }
480
+
481
+ #wpsl-store-hours select {
482
+ float:left;
483
+ }
484
+
485
+ #wpsl-store-hours th {
486
+ text-align:left;
487
+ padding:8px 10px 8px 0;
488
+ border-bottom:1px solid #eee;
489
+ }
490
+
491
+ #wpsl-settings-form #wpsl-store-hours th {
492
+ text-align: left;
493
+ }
494
+
495
+ #wpsl-store-hours td {
496
+ border-bottom:1px solid #eee;
497
+ padding:7px 10px 7px 0;
498
+ vertical-align: top;
499
+ }
500
+
501
+ #wpsl-store-hours .wpsl-opening-day {
502
+ min-width:80px;
503
+ padding:17px 17px 0 0;
504
+ text-align:left;
505
+ vertical-align:top;
506
+ }
507
+
508
+ .wpsl-twentyfour-format .wpsl-opening-hours {
509
+ width: 197px;
510
+ }
511
+
512
+ .wpsl-twelve-format .wpsl-opening-hours {
513
+ width: 245px;
514
+ }
515
+
516
+ #wpsl-settings-form #wpsl-store-hours .wpsl-opening-day {
517
+ width: 150px;
518
+ }
519
+
520
+ #wpsl-settings-form #wpsl-store-hours td p {
521
+ padding: 10px 0 0 0;
522
+ margin: 0;
523
+ text-align: left;
524
+ }
525
+
526
+ #wpsl-store-hours .wpsl-add-period {
527
+ height: 30px;
528
+ }
529
+
530
+ .wpsl-pre-38 .wpsl-add-period {
531
+ height: 27px;
532
+ }
533
+
534
+ #wpsl-store-hours .dashicons:hover,
535
+ .wpsl-add-period:hover {
536
+ cursor:pointer;
537
+ }
538
+
539
+ #wpsl-store-hours .dashicons {
540
+ color: #999;
541
+ margin: 0 3px;
542
+ }
543
+
544
+ #wpsl-store-hours .wpsl-add-period:hover .dashicons,
545
+ #wpsl-store-hours .dashicons:hover {
546
+ color: #444;
547
+ }
548
+
549
+ /* Fix the bottom spacing on the submit buttons */
550
+ #wpsl-wrap.wpsl-pre-38 .submit {
551
+ margin-bottom: 0 !important;
552
+ }
553
+
554
+ /* Fontello fonts */
555
+ [class^="wpsl-icon-"]:before, [class*=" wpsl-icon-"]:before {
556
+ font-family: "fontello";
557
+ font-style: normal;
558
+ font-weight: normal;
559
+ speak: none;
560
+ display: inline-block;
561
+ text-decoration: inherit;
562
+ width: 1em;
563
+ margin-right: .2em;
564
+ text-align: center;
565
+ font-variant: normal;
566
+ text-transform: none;
567
+ line-height: 1em;
568
+ margin-left: .2em;
569
+ -webkit-font-smoothing: antialiased;
570
+ -moz-osx-font-smoothing: grayscale;
571
+ }
572
+
573
+ [class^="wpsl-icon-"]:hover, [class*=" wpsl-icon-"]:hover {
574
+ cursor: pointer;
575
+ }
576
+
577
+ .wpsl-icon-location:before {
578
+ content: '\e801';
579
+ }
580
+
581
+ .wpsl-icon-attention-circled:before {
582
+ content: '\e802';
583
+ }
584
+
585
+ .wpsl-icon-cancel-circled:before {
586
+ content: '\e803';
587
+ }
588
+
589
+ .wpsl-icon-plus-circled:before {
590
+ content: '\e805';
591
+ }
592
+
593
+ #wpsl-store-hours .wpsl-icon-plus-circled,
594
+ #wpsl-store-hours .wpsl-icon-cancel-circled {
595
+ margin-top: 1px;
596
+ font-size: 18px;
597
+ display: inline-block;
598
+ color: #999;
599
+ }
600
+
601
+ #wpsl-store-hours .wpsl-icon-plus-circled:hover,
602
+ #wpsl-store-hours .wpsl-icon-cancel-circled:hover {
603
+ color: #444;
604
  }
admin/css/style.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #wpsl-wrap.wpsl-add-stores p,.wpsl-marker-list,.wpsl-store-meta p{overflow:hidden}.wpsl-info:before,[class*=" wpsl-icon-"]:before,[class^=wpsl-icon-]:before{font-family:fontello;font-style:normal;speak:none;font-variant:normal;text-transform:none;line-height:1em}@font-face{font-family:fontello;src:url(../font/fontello.eot?54620740);src:url(../font/fontello.eot?54620740#iefix) format('embedded-opentype'),url(../font/fontello.woff?54620740) format('woff'),url(../font/fontello.ttf?54620740) format('truetype'),url(../font/fontello.svg?54620740#fontello) format('svg');font-weight:400;font-style:normal}#wpsl-store-overview .widefat td,#wpsl-wrap .widefat td{padding:12px 7px}#wpsl-wrap.wpsl-settings h2{margin-bottom:15px}#wpsl-wrap .submit{padding:0!important;margin-bottom:-10px!important}#wpsl-store-overview .column-action a{float:left;margin-right:5px}#wpsl-store-overview p.search-box{margin:0 0 1em}.column-action{width:130px}#wpsl-delete-confirmation,.wpsl-hide{display:none}.wpsl-preloader{float:right;margin:4px 0 0 4px}#wpsl-mainnav{border-bottom:1px solid #CCC;float:left;margin-bottom:15px;padding-left:7px;width:99.4%}#wpsl-mainnav li a{display:block;padding:9px 12px;text-decoration:none}#wpsl-mainnav li{float:left;margin:0}#wpsl-wrap label,#wpsl-wrap.wpsl-add-stores label{width:85px;margin-top:6px}#wpsl-wrap.wpsl-add-stores label{float:left}#wpsl-wrap.wpsl-add-stores .wpsl-radioboxes label{float:none;margin-right:10px}#wpsl-wrap textarea{width:489px;resize:none}#wpsl-wrap textarea,.wpsl-tab #wpsl-hours{height:185px}#wpsl-wrap .wpsl-style-input textarea{width:509px;resize:none;margin-bottom:12px;height:165px}#wpsl-style-preview{float:left;margin-bottom:12px}.wpsl-style-preview-error{float:left;margin:6px 0 0 10px;color:#b91111}.wpsl-curve{float:left;border-radius:3px}.wpsl-store-meta .wpsl-error{border:1px solid #c01313}#wpsl-lookup-location{margin-bottom:7px}#wpsl-wrap input[type=email],#wpsl-wrap input[type=text],#wpsl-wrap input[type=url]{width:340px}#wpsl-wrap.wpsl-settings input[type=text].textinput{width:255px}.wpsl-add-store{float:left;width:100%;clear:both}#wpsl-wrap .metabox-holder{float:left;margin-right:20px}#wpsl-wrap .metabox-holder.wpsl-wide{width:100%;padding-top:0}#wpsl-wrap .wpsl-edit-header{margin-bottom:12px}#wpsl-wrap.wpsl-settings .metabox-holder{width:100%}#wpsl-wrap.wpsl-settings .metabox-holder h3:hover{cursor:auto}#wpsl-meta-nav li:hover,#wpsl-store-hours .dashicons:hover,.wpsl-add-period:hover,.wpsl-info:hover,[class*=" wpsl-icon-"]:hover,[class^=wpsl-icon-]:hover{cursor:pointer}#wpsl-gmap-wrap{float:left;width:100%;height:250px;border-radius:3px;margin-top:0;margin-bottom:20px}#wpsl-map-preview #wpsl-gmap-wrap{margin:6px 0 12px}#wpsl-gmap-wrap.wpsl-styles-preview{float:none;margin:0;border-radius:0;clear:both}#wpsl-style-url{display:none;margin:20px 0 0}.wpsl-marker-list li{float:left;padding:10px;margin-right:5px;text-align:center}.wpsl-marker-list li input[type=radio]{margin-right:0}.wpsl-marker-list img{display:block;margin-bottom:7px}.wpsl-active-marker,.wpsl-marker-list li:hover{background:#E4E4E4;border-radius:5px;cursor:pointer}#wpsl-settings-form .postbox-container{width:535px;clear:both}#wpsl-wrap .metabox-holder{padding-top:0}.wpsl-info{position:relative;margin-left:3px}.wpsl-info:before{content:'\e802';font-size:14px;font-weight:400;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;margin-left:.2em}.wpsl-info.wpsl-required-setting:before{color:#b91111}.wpsl-info-text{position:absolute;padding:10px;left:-29px;bottom:28px;color:#eee;min-width:200px;background:#222;border-radius:3px}#wpsl-map-preview .wpsl-info-text{width:175px;min-width:0;left:-88px}#wpsl-map-preview .wpsl-info-text::after{left:auto;right:87px}#wpsl-map-preview .wpsl-info{position:absolute;margin-left:5px;top:5px}.wpsl-submit-wrap{position:relative;clear:both}.wpsl-search-settings .wpsl-info-text{white-space:nowrap}.wpsl-info-text:after{position:absolute;border-left:11px solid transparent;border-right:11px solid transparent;border-top:11px solid #222;content:"";left:27px;bottom:-10px}.wpsl-info-text a{color:#fff}#wpsl-settings-form label{position:relative;display:inline-block;font-weight:400;margin:0 10px 0 0;width:220px}#wpsl-save-settings{float:left;clear:both}#wpsl-settings-form .wpsl-radioboxes label{float:none;margin-right:10px;width:auto}#wpsl-faq dt{margin-bottom:4px;font-weight:700;font-size:110%}#wpsl-faq dd{margin-left:0}#wpsl-faq dl{margin-bottom:25px}.wp-list-table .column-action .button{margin:3px 5px 3px 0}.wpsl-store-meta label{float:left;width:95px;margin-top:3px}.wpsl-store-meta input[type=email],.wpsl-store-meta input[type=url],.wpsl-store-meta input[type=text],.wpsl-store-meta textarea{width:340px}.wpsl-store-meta textarea{resize:none}#wpsl-map-preview em,#wpsl-settings-form em,.wpsl-store-meta em{display:block}#wpsl-settings-form .wpsl-info em{display:inline}#wpsl-meta-nav{margin:19px 0 6px}#wpsl-meta-nav li{display:inline;margin-right:5px}#wpsl-meta-nav li a{padding:6px 9px;border-radius:3px 3px 0 0;border-bottom:none;text-decoration:none;outline:0}.wpsl-tab{padding:5px 15px;display:none;border:1px solid #eee;border-radius:0 3px 3px}div.wpsl-active{display:block;background:#fdfdfd}#wpsl-meta-nav .wpsl-active a{border:1px solid #eee;border-bottom:1px solid #fdfdfd;background:#fdfdfd;color:#444}.wpsl-star{color:#c01313}#wpsl-store-hours{border-collapse:collapse;margin:5px 0 20px}#wpsl-settings-form #wpsl-store-hours{width:100%}#wpsl-store-hours div{margin:0;padding:3px;background:#eee;border:1px solid #eee;border-radius:3px;white-space:nowrap}#wpsl-store-hours .wpsl-store-closed{border:none;background:0 0;margin-top:9px;margin-bottom:0}.wpsl-add-period,.wpsl-current-period{float:left}#wpsl-store-hours .wpsl-multiple-periods{float:left;clear:both;margin-top:8px}.wpsl-add-period span,.wpsl-current-period span{float:left;margin:6px 7px 0}.wpsl-add-period span{margin:6px 0 0 7px}#wpsl-store-hours .wpsl-remove-period{background:#999;border-radius:9px}.wpsl-add-period{border:none;background:#eee;border-radius:3px;font-size:13px;padding:3px 10px}.wpsl-default-hours{margin-top:25px}#wpsl-store-hours select{float:left}#wpsl-store-hours th{text-align:left;padding:8px 10px 8px 0;border-bottom:1px solid #eee}#wpsl-settings-form #wpsl-store-hours th{text-align:left}#wpsl-store-hours td{border-bottom:1px solid #eee;padding:7px 10px 7px 0;vertical-align:top}#wpsl-store-hours .wpsl-opening-day{min-width:80px;padding:17px 17px 0 0;text-align:left;vertical-align:top}.wpsl-twentyfour-format .wpsl-opening-hours{width:197px}.wpsl-twelve-format .wpsl-opening-hours{width:245px}#wpsl-settings-form #wpsl-store-hours .wpsl-opening-day{width:150px}#wpsl-settings-form #wpsl-store-hours td p{padding:10px 0 0;margin:0;text-align:left}#wpsl-store-hours .wpsl-add-period{height:30px}.wpsl-pre-38 .wpsl-add-period{height:27px}#wpsl-store-hours .dashicons{color:#999;margin:0 3px}#wpsl-store-hours .dashicons:hover,#wpsl-store-hours .wpsl-add-period:hover .dashicons{color:#444}#wpsl-wrap.wpsl-pre-38 .submit{margin-bottom:0!important}[class*=" wpsl-icon-"]:before,[class^=wpsl-icon-]:before{font-weight:400;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wpsl-icon-location:before{content:'\e801'}.wpsl-icon-attention-circled:before{content:'\e802'}.wpsl-icon-cancel-circled:before{content:'\e803'}.wpsl-icon-plus-circled:before{content:'\e805'}#wpsl-store-hours .wpsl-icon-cancel-circled,#wpsl-store-hours .wpsl-icon-plus-circled{margin-top:1px;font-size:18px;display:inline-block;color:#999}#wpsl-store-hours .wpsl-icon-cancel-circled:hover,#wpsl-store-hours .wpsl-icon-plus-circled:hover{color:#444}
admin/font/fontello.eot CHANGED
Binary file
admin/font/fontello.svg CHANGED
@@ -1,12 +1,15 @@
1
  <?xml version="1.0" standalone="no"?>
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2013 by original authors @ fontello.com</metadata>
5
  <defs>
6
  <font id="fontello" horiz-adv-x="1000" >
7
  <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
  <missing-glyph horiz-adv-x="1000" />
9
- <glyph glyph-name="location" unicode="&#xe800;" d="m429 493q0 59-42 101t-101 42t-101-42t-42-101t42-101t101-42t101 42t42 101z m142 0q0-61-18-100l-203-432q-9-18-27-29t-37-11t-38 11t-26 29l-204 432q-18 39-18 100q0 118 84 202t202 84t202-84t83-202z" horiz-adv-x="571.4" />
 
 
 
10
  </font>
11
  </defs>
12
  </svg>
1
  <?xml version="1.0" standalone="no"?>
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2015 by original authors @ fontello.com</metadata>
5
  <defs>
6
  <font id="fontello" horiz-adv-x="1000" >
7
  <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
  <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="location" unicode="&#xe801;" d="m429 493q0 59-42 101t-101 42-101-42-42-101 42-101 101-42 101 42 42 101z m142 0q0-61-18-100l-203-432q-9-18-27-29t-37-11-38 11-26 29l-204 432q-18 39-18 100 0 118 84 202t202 84 202-84 83-202z" horiz-adv-x="571.4" />
10
+ <glyph glyph-name="attention-circled" unicode="&#xe802;" d="m429 779q116 0 215-58t156-156 57-215-57-215-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58z m71-696v106q0 8-5 13t-12 5h-107q-8 0-13-5t-6-13v-106q0-8 6-13t13-6h107q7 0 12 6t5 13z m-1 192l10 346q0 7-6 10-5 5-13 5h-123q-8 0-13-5-6-3-6-10l10-346q0-6 5-10t14-4h103q8 0 13 4t6 10z" horiz-adv-x="857.1" />
11
+ <glyph glyph-name="cancel-circle" unicode="&#xe803;" d="m1000 349q0-136-67-251t-182-182-251-67-251 67-182 182-67 251 67 251 182 182 251 67 251-67 182-182 67-251z m-339-232l71 71-161 161 161 161-71 71-161-161-161 161-71-71 161-161-161-161 71-71 161 161z" horiz-adv-x="1000" />
12
+ <glyph glyph-name="plus-circle" unicode="&#xe805;" d="m1000 349q0-136-67-251t-182-182-251-67-251 67-182 182-67 251 67 251 182 182 251 67 251-67 182-182 67-251z m-440-58h235v118h-235v235h-118v-235h-236v-118h236v-236h118v236z" horiz-adv-x="1000" />
13
  </font>
14
  </defs>
15
  </svg>
admin/font/fontello.ttf CHANGED
Binary file
admin/font/fontello.woff CHANGED
Binary file
admin/js/ajax-queue.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function($){var ajaxQueue=$({});$.ajaxQueue=function(ajaxOpts){var jqXHR,dfd=$.Deferred(),promise=dfd.promise();function doRequest(next){jqXHR=$.ajax(ajaxOpts);jqXHR.done(dfd.resolve).fail(dfd.reject).then(next,next)}ajaxQueue.queue(doRequest);promise.abort=function(statusText){if(jqXHR){return jqXHR.abort(statusText)}var queue=ajaxQueue.queue(),index=$.inArray(doRequest,queue);if(index>-1){queue.splice(index,1)}dfd.rejectWith(ajaxOpts.context||ajaxOpts,[promise,statusText,""]);return promise};return promise}})(jQuery);
admin/js/retina.js ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Retina.js v1.3.0
3
+ *
4
+ * Copyright 2014 Imulus, LLC
5
+ * Released under the MIT license
6
+ *
7
+ * Retina.js is an open source script that makes it easy to serve
8
+ * high-resolution images to devices with retina displays.
9
+ */
10
+
11
+ (function() {
12
+ var root = (typeof exports === 'undefined' ? window : exports);
13
+ var config = {
14
+ // An option to choose a suffix for 2x images
15
+ retinaImageSuffix : '@2x',
16
+
17
+ // Ensure Content-Type is an image before trying to load @2x image
18
+ // https://github.com/imulus/retinajs/pull/45)
19
+ check_mime_type: true,
20
+
21
+ // Resize high-resolution images to original image's pixel dimensions
22
+ // https://github.com/imulus/retinajs/issues/8
23
+ force_original_dimensions: true
24
+ };
25
+
26
+ function Retina() {}
27
+
28
+ root.Retina = Retina;
29
+
30
+ Retina.configure = function(options) {
31
+ if (options === null) {
32
+ options = {};
33
+ }
34
+
35
+ for (var prop in options) {
36
+ if (options.hasOwnProperty(prop)) {
37
+ config[prop] = options[prop];
38
+ }
39
+ }
40
+ };
41
+
42
+ Retina.init = function(context) {
43
+ if (context === null) {
44
+ context = root;
45
+ }
46
+
47
+ var existing_onload = context.onload || function(){};
48
+
49
+ context.onload = function() {
50
+ var images = document.getElementsByTagName('img'), retinaImages = [], i, image;
51
+ for (i = 0; i < images.length; i += 1) {
52
+ image = images[i];
53
+ if (!!!image.getAttributeNode('data-no-retina')) {
54
+ retinaImages.push(new RetinaImage(image));
55
+ }
56
+ }
57
+ existing_onload();
58
+ };
59
+ };
60
+
61
+ Retina.isRetina = function(){
62
+ var mediaQuery = '(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)';
63
+
64
+ if (root.devicePixelRatio > 1) {
65
+ return true;
66
+ }
67
+
68
+ if (root.matchMedia && root.matchMedia(mediaQuery).matches) {
69
+ return true;
70
+ }
71
+
72
+ return false;
73
+ };
74
+
75
+
76
+ var regexMatch = /\.\w+$/;
77
+ function suffixReplace (match) {
78
+ return config.retinaImageSuffix + match;
79
+ }
80
+
81
+ function RetinaImagePath(path, at_2x_path) {
82
+ this.path = path || '';
83
+ if (typeof at_2x_path !== 'undefined' && at_2x_path !== null) {
84
+ this.at_2x_path = at_2x_path;
85
+ this.perform_check = false;
86
+ } else {
87
+ if (undefined !== document.createElement) {
88
+ var locationObject = document.createElement('a');
89
+ locationObject.href = this.path;
90
+ locationObject.pathname = locationObject.pathname.replace(regexMatch, suffixReplace);
91
+ this.at_2x_path = locationObject.href;
92
+ } else {
93
+ var parts = this.path.split('?');
94
+ parts[0] = parts[0].replace(regexMatch, suffixReplace);
95
+ this.at_2x_path = parts.join('?');
96
+ }
97
+ this.perform_check = true;
98
+ }
99
+ }
100
+
101
+ root.RetinaImagePath = RetinaImagePath;
102
+
103
+ RetinaImagePath.confirmed_paths = [];
104
+
105
+ RetinaImagePath.prototype.is_external = function() {
106
+ return !!(this.path.match(/^https?\:/i) && !this.path.match('//' + document.domain) );
107
+ };
108
+
109
+ RetinaImagePath.prototype.check_2x_variant = function(callback) {
110
+ var http, that = this;
111
+ if (this.is_external()) {
112
+ return callback(false);
113
+ } else if (!this.perform_check && typeof this.at_2x_path !== 'undefined' && this.at_2x_path !== null) {
114
+ return callback(true);
115
+ } else if (this.at_2x_path in RetinaImagePath.confirmed_paths) {
116
+ return callback(true);
117
+ } else {
118
+ http = new XMLHttpRequest();
119
+ http.open('HEAD', this.at_2x_path);
120
+ http.onreadystatechange = function() {
121
+ if (http.readyState !== 4) {
122
+ return callback(false);
123
+ }
124
+
125
+ if (http.status >= 200 && http.status <= 399) {
126
+ if (config.check_mime_type) {
127
+ var type = http.getResponseHeader('Content-Type');
128
+ if (type === null || !type.match(/^image/i)) {
129
+ return callback(false);
130
+ }
131
+ }
132
+
133
+ RetinaImagePath.confirmed_paths.push(that.at_2x_path);
134
+ return callback(true);
135
+ } else {
136
+ return callback(false);
137
+ }
138
+ };
139
+ http.send();
140
+ }
141
+ };
142
+
143
+
144
+ function RetinaImage(el) {
145
+ this.el = el;
146
+ this.path = new RetinaImagePath(this.el.getAttribute('src'), this.el.getAttribute('data-at2x'));
147
+ var that = this;
148
+ this.path.check_2x_variant(function(hasVariant) {
149
+ if (hasVariant) {
150
+ that.swap();
151
+ }
152
+ });
153
+ }
154
+
155
+ root.RetinaImage = RetinaImage;
156
+
157
+ RetinaImage.prototype.swap = function(path) {
158
+ if (typeof path === 'undefined') {
159
+ path = this.path.at_2x_path;
160
+ }
161
+
162
+ var that = this;
163
+ function load() {
164
+ if (! that.el.complete) {
165
+ setTimeout(load, 5);
166
+ } else {
167
+ if (config.force_original_dimensions) {
168
+ that.el.setAttribute('width', that.el.offsetWidth);
169
+ that.el.setAttribute('height', that.el.offsetHeight);
170
+ }
171
+
172
+ that.el.setAttribute('src', path);
173
+ }
174
+ }
175
+ load();
176
+ };
177
+
178
+
179
+ if (Retina.isRetina()) {
180
+ Retina.init(root);
181
+ }
182
+ })();
admin/js/retina.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Retina.js v1.3.0
3
+ *
4
+ * Copyright 2014 Imulus, LLC
5
+ * Released under the MIT license
6
+ *
7
+ * Retina.js is an open source script that makes it easy to serve
8
+ * high-resolution images to devices with retina displays.
9
+ */
10
+ !function(){function a(){}function b(a){return f.retinaImageSuffix+a}function c(a,c){if(this.path=a||"","undefined"!=typeof c&&null!==c)this.at_2x_path=c,this.perform_check=!1;else{if(void 0!==document.createElement){var d=document.createElement("a");d.href=this.path,d.pathname=d.pathname.replace(g,b),this.at_2x_path=d.href}else{var e=this.path.split("?");e[0]=e[0].replace(g,b),this.at_2x_path=e.join("?")}this.perform_check=!0}}function d(a){this.el=a,this.path=new c(this.el.getAttribute("src"),this.el.getAttribute("data-at2x"));var b=this;this.path.check_2x_variant(function(a){a&&b.swap()})}var e="undefined"==typeof exports?window:exports,f={retinaImageSuffix:"@2x",check_mime_type:!0,force_original_dimensions:!0};e.Retina=a,a.configure=function(a){null===a&&(a={});for(var b in a)a.hasOwnProperty(b)&&(f[b]=a[b])},a.init=function(a){null===a&&(a=e);var b=a.onload||function(){};a.onload=function(){var a,c,e=document.getElementsByTagName("img"),f=[];for(a=0;a<e.length;a+=1)c=e[a],c.getAttributeNode("data-no-retina")||f.push(new d(c));b()}},a.isRetina=function(){var a="(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";return e.devicePixelRatio>1?!0:e.matchMedia&&e.matchMedia(a).matches?!0:!1};var g=/\.\w+$/;e.RetinaImagePath=c,c.confirmed_paths=[],c.prototype.is_external=function(){return!(!this.path.match(/^https?\:/i)||this.path.match("//"+document.domain))},c.prototype.check_2x_variant=function(a){var b,d=this;return this.is_external()?a(!1):this.perform_check||"undefined"==typeof this.at_2x_path||null===this.at_2x_path?this.at_2x_path in c.confirmed_paths?a(!0):(b=new XMLHttpRequest,b.open("HEAD",this.at_2x_path),b.onreadystatechange=function(){if(4!==b.readyState)return a(!1);if(b.status>=200&&b.status<=399){if(f.check_mime_type){var e=b.getResponseHeader("Content-Type");if(null===e||!e.match(/^image/i))return a(!1)}return c.confirmed_paths.push(d.at_2x_path),a(!0)}return a(!1)},b.send(),void 0):a(!0)},e.RetinaImage=d,d.prototype.swap=function(a){function b(){c.el.complete?(f.force_original_dimensions&&(c.el.setAttribute("width",c.el.offsetWidth),c.el.setAttribute("height",c.el.offsetHeight)),c.el.setAttribute("src",a)):setTimeout(b,5)}"undefined"==typeof a&&(a=this.path.at_2x_path);var c=this;b()},a.isRetina()&&a.init(e)}();
admin/js/wpsl-admin.js CHANGED
@@ -1,37 +1,51 @@
1
  jQuery( document ).ready( function( $ ) {
2
- var map, geocoder, uploadFrame,
3
- markersArray = [];
 
 
 
4
 
5
  /**
6
- * Initialize the map with the correct settings
7
  *
8
  * @since 1.0
9
  * @returns {void}
10
  */
11
  function initializeGmap() {
12
- var myOptions = {
13
- zoom: 2,
14
- center: new google.maps.LatLng( "52.378153", "4.899363" ),
15
- mapTypeId: google.maps.MapTypeId.ROADMAP,
16
- streetViewControl: false
17
- };
 
 
 
 
 
 
 
 
18
 
19
  geocoder = new google.maps.Geocoder();
20
- map = new google.maps.Map( document.getElementById( "wpsl-gmap-wrap" ), myOptions );
21
-
22
  checkEditStoreMarker();
23
  }
24
 
25
  /**
26
- * If we have an existing latlng value, add a marker to the map. This can only happen on the edit store page
 
 
 
27
  *
28
  * @since 1.0
29
  * @returns {void}
30
  */
31
  function checkEditStoreMarker() {
32
  var location,
33
- lat = $( "#wpsl-store-lat" ).val(),
34
- lng = $( "#wpsl-store-lng" ).val();
35
 
36
  if ( ( lat ) && ( lng ) ) {
37
  location = new google.maps.LatLng( lat, lng );
@@ -48,7 +62,7 @@ if ( $( "#wpsl-zoom-name" ).length ) {
48
  }
49
 
50
  /**
51
- * Activate the autocomplete function for the city/country field
52
  *
53
  * @since 1.0
54
  * @returns {void}
@@ -68,10 +82,10 @@ function activateAutoComplete() {
68
  }
69
 
70
  /**
71
- * Add a new marker to the map based on the provided location (latlng)
72
  *
73
  * @since 1.0
74
- * @param {object} location The latlng value
75
  * @returns {void}
76
  */
77
  function addMarker( location ) {
@@ -83,48 +97,51 @@ function addMarker( location ) {
83
 
84
  markersArray.push( marker );
85
 
 
86
  google.maps.event.addListener( marker, "dragend", function() {
87
- geocodeDraggedPosition( marker.getPosition() );
88
  });
89
  }
90
 
 
 
 
 
 
 
91
  /**
92
- * Lookup the location where the marker is dropped
93
  *
94
  * @since 1.0
95
- * @param {object} pos The latlng value
 
96
  * @returns {void}
97
  */
98
- function geocodeDraggedPosition( pos ) {
99
- geocoder.geocode({
100
- latLng: pos
101
- }, function ( response ) {
102
- if ( response && response.length > 0 ) {
103
- setLatlng( response[0].geometry.location, "store" );
104
- } else {
105
- alert( wpslL10n.noAddress );
106
- }
107
- });
108
- }
109
 
110
- /* Lookup the provided location name with the Google Maps API */
111
- $( "#wpsl-lookup-location" ).on( "click", function() {
112
- codeAddress();
113
- return false;
114
- });
 
 
115
 
116
  /**
117
- * Geocode the user input
118
  *
119
  * @since 1.0
120
  * @returns {void}
121
  */
122
  function codeAddress() {
123
  var filteredResponse, fullAddress,
124
- address = $( "#wpsl-store-address" ).val(),
125
- city = $( "#wpsl-store-city" ).val(),
126
- zip = $( "#wpsl-store-zip" ).val(),
127
- country = $( "#wpsl-store-country" ).val();
128
 
129
  if ( zip ) {
130
  fullAddress = address + ',' + city + ',' + zip + ',' + country;
@@ -132,6 +149,8 @@ function codeAddress() {
132
  fullAddress = address + ',' + city + ',' + country;
133
  }
134
 
 
 
135
  /* Check we have all the requird data before attempting to geocode the address */
136
  if ( !validatePreviewFields( address, city, country ) ) {
137
  geocoder.geocode( { 'address': fullAddress }, function( response, status ) {
@@ -152,54 +171,68 @@ function codeAddress() {
152
  setLatlng( response[0].geometry.location, "store" );
153
 
154
  filteredResponse = filterApiResponse( response );
155
- $( "#wpsl-store-country" ).val( filteredResponse.country.long_name );
156
- $( "#wpsl-country-iso" ).val( filteredResponse.country.short_name );
157
  } else {
158
- alert( wpslL10n.geocodeFail + ' ' + status );
159
  }
160
  });
 
 
 
 
 
 
 
 
161
  }
162
  }
163
 
164
  /**
165
- * Check that all required fields for the preview to work are there
166
  *
167
  * @since 1.0
168
- * @param {string} address The store address
169
- * @param {string} city The store city
170
- * @param {string} country The store country
171
- * @returns {boolean} error Whether a field validated or not
172
  */
173
  function validatePreviewFields( address, city, country ) {
174
  var error = false;
175
 
176
- $( "#wpsl-wrap input" ).removeClass( "wpsl-error" );
177
 
178
  if ( !address ) {
179
- $( "#wpsl-store-address" ).addClass( "wpsl-error" );
180
  error = true;
181
  }
182
 
183
  if ( !city ) {
184
- $( "#wpsl-store-city" ).addClass( "wpsl-error" );
185
  error = true;
186
  }
187
 
188
  if ( !country ) {
189
- $( "#wpsl-store-country" ).addClass( "wpsl-error" );
190
  error = true;
191
  }
192
 
193
  return error;
194
  }
195
 
196
- /* Filter out the zipcode from the Google Maps API response */
 
 
 
 
 
 
197
  function filterApiResponse( response ) {
198
- var responseType,
199
- country = {},
200
  collectedData = {},
201
  addressLength = response[0].address_components.length;
202
-
203
  /* Loop over the API response */
204
  for ( i = 0; i < addressLength; i++ ){
205
  responseType = response[0].address_components[i].types;
@@ -207,197 +240,67 @@ function filterApiResponse( response ) {
207
  /* filter out the country name */
208
  if ( /^country,political$/.test( responseType ) ) {
209
  country = {
210
- long_name : response[0].address_components[i].long_name,
211
- short_name : response[0].address_components[i].short_name
212
  };
213
  }
214
  }
215
 
216
  collectedData = {
217
- country : country
218
  };
219
 
220
  return collectedData;
221
  }
222
 
223
- /* Update the hidden input field with the current lat/long values. */
224
- function setLatlng( latlng, target ) {
225
- var coordinates = stripCoordinates( latlng ),
226
- lat = roundLatlng( coordinates[0], 6 ),
227
- lng = roundLatlng( coordinates[1], 6 );
228
-
229
- if ( target == "store" ) {
230
- $( "#wpsl-store-lat" ).val( lat );
231
- $( "#wpsl-store-lng" ).val( lng );
232
- } else if ( target == "zoom" ) {
233
- $( "#wpsl-latlng" ).val( lat + ',' + lng);
234
- }
235
- }
236
-
237
- /* Round the latlng to 6 digits after the comma */
238
- function roundLatlng( num, decimals ) {
239
- return Math.round( num * Math.pow( 10, decimals ) ) / Math.pow( 10, decimals );
240
- }
241
-
242
- /* strip the '(' and ')' from the captured coordinates, and split them */
243
- function stripCoordinates( coordinates ) {
244
- var latlng = [],
245
- selected = coordinates.toString(),
246
- latlngStr = selected.split( ",",2 );
247
 
248
- latlng[0] = latlngStr[0].replace( '(', '' );
249
- latlng[1] = latlngStr[1].replace( ')', '' );
250
-
251
- return latlng;
252
- }
253
-
254
- /* Handle the selection of custom thumbnails */
255
- $( "#wpsl-thumb-wrap" ).on( "click", "#wpsl-media-upload", function( e ) {
256
- e.preventDefault();
257
-
258
- if ( uploadFrame ) {
259
- uploadFrame.open();
260
- return;
261
- }
262
-
263
- uploadFrame = wp.media.frames.uploadFrame = wp.media({
264
- title: "Set store image",
265
- frame: "select",
266
- multiple: false,
267
- library: {
268
- type: "image"
269
- },
270
- button: {
271
- text: "upload"
272
- }
273
- });
274
-
275
- uploadFrame.on( "select", function() {
276
- var thumbUrl,
277
- media_attachment = uploadFrame.state().get( "selection" ).first().toJSON();
278
-
279
- if ( typeof( media_attachment.sizes.thumbnail ) !== 'undefined' ) {
280
- thumbUrl = media_attachment.sizes.thumbnail.url;
281
- } else if ( typeof( media_attachment.sizes.medium ) !== 'undefined' ) {
282
- thumbUrl = media_attachment.sizes.medium.url;
283
- } else if ( typeof( media_attachment.sizes.full ) !== 'undefined' ) {
284
- thumbUrl = media_attachment.sizes.full.url;
285
- }
286
-
287
- setLocationThumb( thumbUrl, media_attachment.id );
288
- });
289
-
290
- uploadFrame.open();
291
- });
292
-
293
- /* Replace the thumnail with the placeholder */
294
- $( "#wpsl-thumb-wrap" ).on( "click", "#wpsl-remove-thumb", function( e ) {
295
- e.preventDefault();
296
-
297
- $( "#wpsl-thumb-wrap img" ).replaceWith( "<span class='wpsl-thumb-placeholder'></span>" );
298
- $( "#wpsl-thumb-id" ).val('');
299
- });
300
-
301
- /* Show the selected thumb */
302
- function setLocationThumb( thumbUrl, thumbId ) {
303
- var img;
304
 
305
- if ( $( "#wpsl-thumb-wrap img" ).length ) {
306
- $( "#wpsl-thumb-wrap img" ).attr({ 'src' : thumbUrl, 'data-img-id' : thumbId });
307
- $( "#wpsl-thumb-id" ).val( thumbId );
308
- } else {
309
- img = "<img class='wpsl-curve' src='" + thumbUrl + "' width='85' height='85' />";
310
- $( "#wpsl-thumb-wrap span" ).replaceWith( img );
311
- $( "#wpsl-thumb-id" ).val( thumbId );
312
- }
313
  }
314
 
315
- $( ".wpsl-delete-store-btn" ).removeAttr( "disabled" );
316
-
317
- $( "#wpsl-store-overview" ).on( "click", ".wpsl-delete-store-btn", function() {
318
- var elem = $(this),
319
- dialogBox = $( "#wpsl-delete-confirmation" ),
320
- cancelBtn = dialogBox.find( ".button-secondary" ),
321
- submitBtn = dialogBox.find( ".button-primary" );
322
-
323
- dialogBox.dialog({
324
- width: 325,
325
- resizable : false,
326
- modal: true,
327
- minHeight: 0
328
- });
329
-
330
- $( ".ui-dialog-titlebar" ).remove();
331
- cancelBtn.on( "click", function() {
332
- dialogBox.dialog( "close" );
333
- submitBtn.unbind( "click" );
334
- dialogBox.unbind( "click" );
335
- });
336
-
337
- submitBtn.on( "click", function() {
338
- dialogBox.dialog( "close" );
339
- deleteStore( elem );
340
- submitBtn.unbind( "click" );
341
- dialogBox.unbind( "click" );
342
-
343
- return false;
344
- });
345
-
346
- return false;
347
- });
348
 
349
- function deleteStore( elem ) {
350
- var ajaxData = {},
351
- $parentTr = elem.parents( "tr" );
352
 
353
- showPreloader( elem );
354
- elem.attr( "disabled", "disabled" );
355
-
356
- ajaxData = {
357
- action: "delete_store",
358
- store_id: elem.parent( ".column-action" ).find( "input[name='wpsl_store_id']" ).val(),
359
- _ajax_nonce: elem.parent( ".column-action" ).find( "input[name='wpsl_delete_nonce']" ).val()
360
- };
361
-
362
- jQuery.ajaxQueue({
363
- url: ajaxurl,
364
- data: ajaxData,
365
- type: "POST"
366
- }).done( function( response ) {
367
- if ( response === -1 ) {
368
- elem.removeAttr( "disabled" );
369
- $( ".wpsl-preloader" ).remove();
370
- alert( wpslL10n.securityFail );
371
- } else if ( response.success ) {
372
-
373
- /* Remove the deleted store row */
374
- setTimeout( function() {
375
- $parentTr.fadeOut( "200", function() {
376
- $parentTr.remove();
377
-
378
- /* Update the remaining store count */
379
- updateStoreCount();
380
- });
381
- }, 2000);
382
- }
383
- });
384
  }
385
 
386
  $( ".wpsl-marker-list input[type=radio]" ).click( function() {
387
- $(this).parents( ".wpsl-marker-list" ).find( "li" ).removeClass();
388
- $(this).parent( "li" ).addClass( "wpsl-active-marker" );
389
  });
390
 
391
  $( ".wpsl-marker-list li" ).click( function() {
392
- $(this).parents( ".wpsl-marker-list" ).find( "input" ).prop( "checked", false );
393
- $(this).find( "input" ).prop( "checked", true );
394
- $(this).siblings().removeClass();
395
- $(this).addClass( "wpsl-active-marker" );
396
  });
397
 
398
  /* Handle a click on the dismiss button. So that the warning msg that no starting point is set is disabled */
399
  $( ".wpsl-dismiss" ).click( function() {
400
- var $link = $(this),
401
  data = {
402
  action: "disable_location_warning",
403
  _ajax_nonce: $link.attr( "data-nonce" )
@@ -405,60 +308,505 @@ $( ".wpsl-dismiss" ).click( function() {
405
 
406
  $.post( ajaxurl, data );
407
 
408
- $( "#wpbody-content #message.error" ).remove();
409
 
410
  return false;
411
  });
412
 
413
- /* Insert the preloader after the button */
414
- function showPreloader( elem ) {
415
- if ( !elem.parent().find( ".wpsl-preloader" ).length ) {
416
- elem.after( "<img class='wpsl-preloader' src='" + wpsl_data.url + "img/ajax-loader.gif' />" );
417
- }
418
- }
419
-
420
- /* Detect changes for the 'More info' option on the settings page */
421
  $( "#wpsl-more-info" ).on( "change", function() {
422
  $( "#wpsl-more-info-options" ).toggle();
423
  });
424
 
 
 
 
 
 
 
 
 
425
  /* Detect changes to the store template dropdown. If the template is selected to
426
  * show the store list under the map then we show the option to hide the scrollbar.
427
  */
428
  $( "#wpsl-store-template" ).on( "change", function() {
429
- var $scrollOption = $( "#wpsl-store-below-scroll" );
430
-
431
- if ( $( "#wpsl-store-template" ).val() == "1" ) {
432
  $scrollOption.show();
433
  } else {
434
  $scrollOption.hide();
435
  }
436
  });
437
 
 
 
 
 
 
 
438
  /* If the marker cluster checkbox changes, show/hide the options */
439
  $( "#wpsl-marker-clusters" ).on( "change", function() {
440
  $( ".wpsl-cluster-options" ).toggle();
441
  });
442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
  /**
444
- * When a store is deleted, update the store count that is
445
- * shown above and below the store overview list
446
  *
447
- * @since 1.2.20
448
- * @return void
 
 
 
 
449
  */
450
- function updateStoreCount() {
451
- var pageNum = $( ".tablenav.top .displaying-num" ).text(),
452
- pageNum = pageNum.split( " " );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
 
454
- if ( !isNaN( parseInt( pageNum[0] ) ) ) {
455
- $( ".tablenav .displaying-num" ).text( pageNum[0]-1 + ' ' + pageNum[1] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
  }
457
  }
458
 
459
- /* Load the map */
460
- if ( $( "#wpsl-gmap-wrap" ).length ) {
461
- google.maps.event.addDomListener( window, "load", initializeGmap );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  }
463
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  });
1
  jQuery( document ).ready( function( $ ) {
2
+ var map, geocoder, markersArray = [];
3
+
4
+ if ( $( "#wpsl-gmap-wrap" ).length ) {
5
+ initializeGmap();
6
+ }
7
 
8
  /**
9
+ * Initialize the map with the correct settings.
10
  *
11
  * @since 1.0
12
  * @returns {void}
13
  */
14
  function initializeGmap() {
15
+ var defaultLatLng = wpslSettings.defaultLatLng.split( "," ),
16
+ latLng = new google.maps.LatLng( defaultLatLng[0], defaultLatLng[1] ),
17
+ mapOptions = {};
18
+
19
+ mapOptions = {
20
+ zoom: parseInt( wpslSettings.defaultZoom ),
21
+ center: latLng,
22
+ mapTypeId: google.maps.MapTypeId[ wpslSettings.mapType.toUpperCase() ],
23
+ mapTypeControl: false,
24
+ streetViewControl: false,
25
+ zoomControlOptions: {
26
+ position: google.maps.ControlPosition.RIGHT_TOP
27
+ }
28
+ };
29
 
30
  geocoder = new google.maps.Geocoder();
31
+ map = new google.maps.Map( document.getElementById( "wpsl-gmap-wrap" ), mapOptions );
32
+
33
  checkEditStoreMarker();
34
  }
35
 
36
  /**
37
+ * Check if we have an existing latlng value.
38
+ *
39
+ * If there is an latlng value we add a marker to the map.
40
+ * This can only happen on the edit store page.
41
  *
42
  * @since 1.0
43
  * @returns {void}
44
  */
45
  function checkEditStoreMarker() {
46
  var location,
47
+ lat = $( "#wpsl-lat" ).val(),
48
+ lng = $( "#wpsl-lng" ).val();
49
 
50
  if ( ( lat ) && ( lng ) ) {
51
  location = new google.maps.LatLng( lat, lng );
62
  }
63
 
64
  /**
65
+ * Activate the autocomplete function for the city/country field.
66
  *
67
  * @since 1.0
68
  * @returns {void}
82
  }
83
 
84
  /**
85
+ * Add a new marker to the map based on the provided location (latlng).
86
  *
87
  * @since 1.0
88
+ * @param {object} location The latlng value
89
  * @returns {void}
90
  */
91
  function addMarker( location ) {
97
 
98
  markersArray.push( marker );
99
 
100
+ /* If the marker is dragged on the map, make sure the latlng values are updated. */
101
  google.maps.event.addListener( marker, "dragend", function() {
102
+ setLatlng( marker.getPosition(), "store" );
103
  });
104
  }
105
 
106
+ /* Lookup the provided location with the Google Maps API */
107
+ $( "#wpsl-lookup-location" ).on( "click", function( e ) {
108
+ e.preventDefault();
109
+ codeAddress();
110
+ });
111
+
112
  /**
113
+ * Update the hidden input field with the current latlng values.
114
  *
115
  * @since 1.0
116
+ * @param {object} latLng The latLng values
117
+ * @param {string} target The location where we need to set the latLng
118
  * @returns {void}
119
  */
120
+ function setLatlng( latLng, target ) {
121
+ var coordinates = stripCoordinates( latLng ),
122
+ lat = roundCoordinate( coordinates[0] ),
123
+ lng = roundCoordinate( coordinates[1] );
 
 
 
 
 
 
 
124
 
125
+ if ( target == "store" ) {
126
+ $( "#wpsl-lat" ).val( lat );
127
+ $( "#wpsl-lng" ).val( lng );
128
+ } else if ( target == "zoom" ) {
129
+ $( "#wpsl-latlng" ).val( lat + ',' + lng );
130
+ }
131
+ }
132
 
133
  /**
134
+ * Geocode the user input.
135
  *
136
  * @since 1.0
137
  * @returns {void}
138
  */
139
  function codeAddress() {
140
  var filteredResponse, fullAddress,
141
+ address = $( "#wpsl-address" ).val(),
142
+ city = $( "#wpsl-city" ).val(),
143
+ zip = $( "#wpsl-zip" ).val(),
144
+ country = $( "#wpsl-country" ).val();
145
 
146
  if ( zip ) {
147
  fullAddress = address + ',' + city + ',' + zip + ',' + country;
149
  fullAddress = address + ',' + city + ',' + country;
150
  }
151
 
152
+ $( "#wpsl-missing-geodata" ).remove();
153
+
154
  /* Check we have all the requird data before attempting to geocode the address */
155
  if ( !validatePreviewFields( address, city, country ) ) {
156
  geocoder.geocode( { 'address': fullAddress }, function( response, status ) {
171
  setLatlng( response[0].geometry.location, "store" );
172
 
173
  filteredResponse = filterApiResponse( response );
174
+ $( "#wpsl-country" ).val( filteredResponse.country.long_name );
175
+ $( "#wpsl-country_iso" ).val( filteredResponse.country.short_name );
176
  } else {
177
+ alert( wpslL10n.geocodeFail + ": " + status );
178
  }
179
  });
180
+
181
+ return false;
182
+ } else {
183
+ activateStoreTab( "first" );
184
+
185
+ alert( wpslL10n.missingGeoData );
186
+
187
+ return true;
188
  }
189
  }
190
 
191
  /**
192
+ * Check that all required fields for the preview to work are there.
193
  *
194
  * @since 1.0
195
+ * @param {string} address The store address
196
+ * @param {string} city The store city
197
+ * @param {string} country The store country
198
+ * @returns {boolean} error Whether a field validated or not
199
  */
200
  function validatePreviewFields( address, city, country ) {
201
  var error = false;
202
 
203
+ $( ".wpsl-store-meta input" ).removeClass( "wpsl-error" );
204
 
205
  if ( !address ) {
206
+ $( "#wpsl-address" ).addClass( "wpsl-error" );
207
  error = true;
208
  }
209
 
210
  if ( !city ) {
211
+ $( "#wpsl-city" ).addClass( "wpsl-error" );
212
  error = true;
213
  }
214
 
215
  if ( !country ) {
216
+ $( "#wpsl-country" ).addClass( "wpsl-error" );
217
  error = true;
218
  }
219
 
220
  return error;
221
  }
222
 
223
+ /**
224
+ * Filter out the country name from the API response.
225
+ *
226
+ * @since 1.0
227
+ * @param {object} response The response of the geocode API
228
+ * @returns {object} collectedData The short and long country name
229
+ */
230
  function filterApiResponse( response ) {
231
+ var i, responseType,
232
+ country = {},
233
  collectedData = {},
234
  addressLength = response[0].address_components.length;
235
+
236
  /* Loop over the API response */
237
  for ( i = 0; i < addressLength; i++ ){
238
  responseType = response[0].address_components[i].types;
240
  /* filter out the country name */
241
  if ( /^country,political$/.test( responseType ) ) {
242
  country = {
243
+ long_name: response[0].address_components[i].long_name,
244
+ short_name: response[0].address_components[i].short_name
245
  };
246
  }
247
  }
248
 
249
  collectedData = {
250
+ country: country
251
  };
252
 
253
  return collectedData;
254
  }
255
 
256
+ /**
257
+ * Round the coordinate to 6 digits after the comma.
258
+ *
259
+ * @since 1.0
260
+ * @param {string} coordinate The coordinate
261
+ * @returns {number} roundedCoord The rounded coordinate
262
+ */
263
+ function roundCoordinate( coordinate ) {
264
+ var roundedCoord, decimals = 6;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
 
266
+ roundedCoord = Math.round( coordinate * Math.pow( 10, decimals ) ) / Math.pow( 10, decimals );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
 
268
+ return roundedCoord;
 
 
 
 
 
 
 
269
  }
270
 
271
+ /**
272
+ * Strip the '(' and ')' from the captured coordinates and split them.
273
+ *
274
+ * @since 1.0
275
+ * @param {string} coordinates The coordinates
276
+ * @returns {object} latLng The latlng coordinates
277
+ */
278
+ function stripCoordinates( coordinates ) {
279
+ var latLng = [],
280
+ selected = coordinates.toString(),
281
+ latLngStr = selected.split( ",", 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
 
283
+ latLng[0] = latLngStr[0].replace( "(", "" );
284
+ latLng[1] = latLngStr[1].replace( ")", "" );
 
285
 
286
+ return latLng;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  }
288
 
289
  $( ".wpsl-marker-list input[type=radio]" ).click( function() {
290
+ $( this ).parents( ".wpsl-marker-list" ).find( "li" ).removeClass();
291
+ $( this ).parent( "li" ).addClass( "wpsl-active-marker" );
292
  });
293
 
294
  $( ".wpsl-marker-list li" ).click( function() {
295
+ $( this ).parents( ".wpsl-marker-list" ).find( "input" ).prop( "checked", false );
296
+ $( this ).find( "input" ).prop( "checked", true );
297
+ $( this ).siblings().removeClass();
298
+ $( this ).addClass( "wpsl-active-marker" );
299
  });
300
 
301
  /* Handle a click on the dismiss button. So that the warning msg that no starting point is set is disabled */
302
  $( ".wpsl-dismiss" ).click( function() {
303
+ var $link = $( this ),
304
  data = {
305
  action: "disable_location_warning",
306
  _ajax_nonce: $link.attr( "data-nonce" )
308
 
309
  $.post( ajaxurl, data );
310
 
311
+ $( ".wpsl-dismiss" ).parents( ".error" ).remove();
312
 
313
  return false;
314
  });
315
 
316
+ /* Detect changes to the 'More info' and 'Load Locations' option on the settings page */
 
 
 
 
 
 
 
317
  $( "#wpsl-more-info" ).on( "change", function() {
318
  $( "#wpsl-more-info-options" ).toggle();
319
  });
320
 
321
+ $( "#wpsl-autoload" ).on( "change", function() {
322
+ $( "#wpsl-autoload-options" ).toggle();
323
+ });
324
+
325
+ $( "#wpsl-editor-hide-hours" ).on( "change", function() {
326
+ $( ".wpsl-hours" ).toggle();
327
+ });
328
+
329
  /* Detect changes to the store template dropdown. If the template is selected to
330
  * show the store list under the map then we show the option to hide the scrollbar.
331
  */
332
  $( "#wpsl-store-template" ).on( "change", function() {
333
+ var $scrollOption = $( "#wpsl-listing-below-no-scroll" );
334
+
335
+ if ( $( this ).val() == "below_map" ) {
336
  $scrollOption.show();
337
  } else {
338
  $scrollOption.hide();
339
  }
340
  });
341
 
342
+ /* Make sure the correct hour input format is visible */
343
+ $( "#wpsl-editor-hour-input" ).on( "change", function() {
344
+ $( ".wpsl-" + $( this ).val() + "-hours" ).show().siblings( "div" ).hide();
345
+ $( ".wpsl-hour-notice" ).toggle();
346
+ });
347
+
348
  /* If the marker cluster checkbox changes, show/hide the options */
349
  $( "#wpsl-marker-clusters" ).on( "change", function() {
350
  $( ".wpsl-cluster-options" ).toggle();
351
  });
352
 
353
+ /* If the permalink checkbox changes, show/hide the options */
354
+ $( "#wpsl-permalinks-active" ).on( "change", function() {
355
+ $( ".wpsl-permalink-option" ).toggle();
356
+ });
357
+
358
+ /* Set the correct tab to active and show the correct content block */
359
+ $( "#wpsl-meta-nav li" ).on( "click", function( e ) {
360
+ var activeClass = $( this ).attr( "class" );
361
+ activeClass = activeClass.split( "-tab" );
362
+
363
+ e.stopPropagation();
364
+
365
+ /* Set the correct tab and metabox to active */
366
+ $( this ).addClass( "wpsl-active" ).siblings().removeClass( "wpsl-active" );
367
+ $( ".wpsl-store-meta ." + activeClass[0] + "" ).show().addClass( "wpsl-active" ).siblings( "div" ).hide().removeClass( "wpsl-active" );
368
+ });
369
+
370
+ /* Make sure the required store fields contain data */
371
+ if ( $( "#wpsl-store-details" ).length ) {
372
+ $( "#publish" ).click( function() {
373
+ var firstErrorElem, currentTabClass, elemClass,
374
+ errorMsg = '<div id="message" class="error"><p>' + wpslL10n.requiredFields + '</p></div>',
375
+ missingData = false;
376
+
377
+ /* Remove error messages and css classes from previous submissions */
378
+ $( "#wpbody-content .wrap #message" ).remove();
379
+ $( ".wpsl-required" ).removeClass( "wpsl-error" );
380
+
381
+ /* Loop over the required fields and check for a value */
382
+ $( ".wpsl-required" ).each( function() {
383
+ if ( $( this ).val() == "" ) {
384
+ $( this ).addClass( "wpsl-error" );
385
+
386
+ if ( typeof firstErrorElem === "undefined" ) {
387
+ firstErrorElem = getFirstErrorElemAttr( $( this ) );
388
+ }
389
+
390
+ missingData = true;
391
+ }
392
+ });
393
+
394
+ /* If one of the required fields are empty, then show the error msg and make sure the correct tab is visible. */
395
+ if ( missingData ) {
396
+ $( "#wpbody-content .wrap > h2" ).after( errorMsg );
397
+
398
+ if ( typeof firstErrorElem.val !== "undefined" ) {
399
+ if ( firstErrorElem.type == "id" ) {
400
+ currentTabClass = $( "#" + firstErrorElem.val + "" ).parents( ".wpsl-tab" ).attr( "class" );
401
+ $( "html, body" ).scrollTop( Math.round( $( "#" + firstErrorElem.val + "" ).offset().top - 100 ) );
402
+ } else if ( firstErrorElem.type == "class" ) {
403
+ elemClass = firstErrorElem.val.replace( /wpsl-required|wpsl-error/g, "" );
404
+ currentTabClass = $( "." + elemClass + "" ).parents( ".wpsl-tab" ).attr( "class" );
405
+ $( "html, body" ).scrollTop( Math.round( $( "." + elemClass + "" ).offset().top - 100 ) );
406
+ }
407
+
408
+ currentTabClass = $.trim( currentTabClass.replace( /wpsl-tab|wpsl-active/g, "" ) );
409
+ }
410
+
411
+ /* If we don't have a class of the tab that should be set to visible, we just show the first one */
412
+ if ( !currentTabClass ) {
413
+ activateStoreTab( 'first' );
414
+ } else {
415
+ activateStoreTab( currentTabClass );
416
+ }
417
+
418
+ /* If not all required fields contains data, and the user has
419
+ * clicked the submit button. Then an extra css class is added to the
420
+ * button that will disabled it. This only happens in WP 3.8 or earlier.
421
+ *
422
+ * We need to make sure this css class doesn't exist otherwise
423
+ * the user can never resubmit the page.
424
+ */
425
+ $( "#publish" ).removeClass( "button-primary-disabled" );
426
+ $( ".spinner" ).hide();
427
+
428
+ return false;
429
+ } else {
430
+ return true;
431
+ }
432
+ });
433
+ }
434
+
435
+ /**
436
+ * Set the correct tab to visible, and hide all other metaboxes
437
+ *
438
+ * @since 2.0
439
+ * @param {string} $target The name of the tab to show
440
+ * @returns {void}
441
+ */
442
+ function activateStoreTab( $target ) {
443
+ if ( $target == 'first' ) {
444
+ $target = ':first-child';
445
+ } else {
446
+ $target = '.' + $target;
447
+ }
448
+
449
+ if ( !$( "#wpsl-meta-nav li" + $target + "-tab" ).hasClass( "wpsl-active" ) ) {
450
+ $( "#wpsl-meta-nav li" + $target + "-tab" ).addClass( "wpsl-active" ).siblings().removeClass( "wpsl-active" );
451
+ $( ".wpsl-store-meta > div" + $target + "" ).show().addClass( "wpsl-active" ).siblings( "div" ).hide().removeClass( "wpsl-active" );
452
+ }
453
+ }
454
+
455
  /**
456
+ * Get the id or class of the first element that is required but is empty.
 
457
  *
458
+ * We need this to determine which tab we need to set active,
459
+ * which will be the tab were the first error occured.
460
+ *
461
+ * @since 2.0
462
+ * @param {object} elem The element the error occured on
463
+ * @returns {object} firstErrorElem The id/class set on the first elem that an error occured on and the attr value
464
  */
465
+ function getFirstErrorElemAttr( elem ) {
466
+ var firstErrorElem = {};
467
+
468
+ firstErrorElem = { "type": "id", "val" : elem.attr( "id" ) };
469
+
470
+ /* If no ID value exists, then check if we can get the class name */
471
+ if ( typeof firstErrorElem.val === "undefined" ) {
472
+ firstErrorElem = { "type": "class", "val" : elem.attr( "class" ) };
473
+ }
474
+
475
+ return firstErrorElem;
476
+ }
477
+
478
+ /* If we have a store hours dropdown, init the event handler */
479
+ if ( $( "#wpsl-store-hours" ).length ) {
480
+ initHourEvents();
481
+ }
482
+
483
+ /**
484
+ * Assign an event handler to the button that enables
485
+ * users to remove an opening hour period.
486
+ *
487
+ * @since 2.0
488
+ * @returns {void}
489
+ */
490
+ function initHourEvents() {
491
+ $( "#wpsl-store-hours .wpsl-icon-cancel-circled" ).off();
492
+ $( "#wpsl-store-hours .wpsl-icon-cancel-circled" ).on( "click", function() {
493
+ removePeriod( $( this ) );
494
+ });
495
+ }
496
+
497
+ /* Add new openings period to the openings hours table */
498
+ $( ".wpsl-add-period" ).on( "click", function( e ) {
499
+ var newPeriod,
500
+ hours = {},
501
+ returnList = true,
502
+ $tr = $( this ).parents( "tr" ),
503
+ periodCount = currentPeriodCount( $( this ) ),
504
+ periodCss = ( periodCount >= 1 ) ? "wpsl-current-period wpsl-multiple-periods" : "wpsl-current-period",
505
+ day = $tr.find( ".wpsl-opening-hours" ).attr( "data-day" ),
506
+ selectName = ( $( "#wpsl-settings-form" ).length ) ? "wpsl_editor[dropdown]" : "wpsl[hours]";
507
+
508
+ newPeriod = '<div class="' + periodCss +'">';
509
+ newPeriod += '<select autocomplete="off" name="' + selectName + '[' + day + '_open][]" class="wpsl-open-hour">' + createHourOptionList( returnList ) + '</select>';
510
+ newPeriod += '<span> - </span>';
511
+ newPeriod += '<select autocomplete="off" name="' + selectName + '[' + day + '_close][]" class="wpsl-close-hour">' + createHourOptionList( returnList ) + '</select>';
512
+ newPeriod += '<div class="wpsl-icon-cancel-circled"></div>';
513
+ newPeriod += '</div>';
514
+
515
+ $tr.find( ".wpsl-store-closed" ).remove();
516
+ $( "#wpsl-hours-" + day + "" ).append( newPeriod ).end();
517
+
518
+ initHourEvents();
519
 
520
+ if ( $( "#wpsl-editor-hour-format" ).val() == 24 ) {
521
+ hours = {
522
+ "open": "09:00",
523
+ "close": "17:00"
524
+ };
525
+ } else {
526
+ hours = {
527
+ "open": "9:00 AM",
528
+ "close": "5:00 PM"
529
+ };
530
+ }
531
+
532
+ $tr.find( ".wpsl-open-hour:last option[value='" + hours.open + "']" ).attr( "selected", "selected" );
533
+ $tr.find( ".wpsl-close-hour:last option[value='" + hours.close + "']" ).attr( "selected", "selected" );
534
+
535
+ e.preventDefault();
536
+ });
537
+
538
+ /**
539
+ * Remove an openings period
540
+ *
541
+ * @since 2.0
542
+ * @param {object} elem The clicked element
543
+ * @return {void}
544
+ */
545
+ function removePeriod( elem ) {
546
+ var periodsLeft = currentPeriodCount( elem ),
547
+ $tr = elem.parents( "tr" ),
548
+ day = $tr.find( ".wpsl-opening-hours" ).attr( "data-day" );
549
+
550
+ /* If there was 1 opening hour left then we add the 'Closed' text */
551
+ if ( periodsLeft == 1 ) {
552
+ $tr.find( ".wpsl-opening-hours" ).html( "<p class='wpsl-store-closed'>" + wpslL10n.closedDate + "<input type='hidden' name='wpsl[hours][" + day + "_open]' value='' /></p>" );
553
+ }
554
+
555
+ /* Remove the selected openings period */
556
+ elem.parent().closest( ".wpsl-current-period" ).remove();
557
+
558
+ /* If the first element has the multiple class, then we need to remove it */
559
+ if ( $tr.find( ".wpsl-opening-hours div:first-child" ).hasClass( "wpsl-multiple-periods" ) ) {
560
+ $tr.find( ".wpsl-opening-hours div:first-child" ).removeClass( "wpsl-multiple-periods" );
561
  }
562
  }
563
 
564
+ /**
565
+ * Count the current opening periods in a day block
566
+ *
567
+ * @since 2.0
568
+ * @param {object} elem The clicked element
569
+ * @return {string} currentPeriods The ammount of period divs found
570
+ */
571
+ function currentPeriodCount( elem ) {
572
+ var currentPeriods = elem.parents( "tr" ).find( ".wpsl-current-period" ).length;
573
+
574
+ return currentPeriods;
575
+ }
576
+
577
+ /**
578
+ * Create an option list with the correct opening hour format and interval
579
+ *
580
+ * @since 2.0
581
+ * @param {string} returnList Whether to return the option list or call the setSelectedOpeningHours function
582
+ * @return {mixed} optionList The html for the option list of or void
583
+ */
584
+ function createHourOptionList( returnList ) {
585
+ var openingHours, openingHourInterval, hour, hrFormat,
586
+ pm = false,
587
+ pmOrAm = "",
588
+ optionList = "",
589
+ openingTimes = [],
590
+ openingHourOptions = {
591
+ "hours": {
592
+ "hr12": [ 0, 1, 2, 3 ,4 ,5 ,6, 7, 8, 9, 10, 11, 12, 1, 2, 3 , 4, 5, 6, 7, 8, 9, 10, 11 ],
593
+ "hr24": [ 0, 1, 2, 3 ,4 ,5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16, 17, 18, 19, 20, 21, 22, 23 ]
594
+ },
595
+ "interval": [ '00', '15', '30', '45' ]
596
+ };
597
+
598
+ if ( $( "#wpsl-editor-hour-format" ).length ) {
599
+ hrFormat = $( "#wpsl-editor-hour-format" ).val(); //todo andere naam - editor eruit halen
600
+ } else {
601
+ hrFormat = wpslSettings.hourFormat;
602
+ }
603
+
604
+ $( "#wpsl-store-hours td" ).removeAttr( "style" );
605
+
606
+ if ( hrFormat == 12 ) {
607
+ $( "#wpsl-store-hours" ).removeClass().addClass( "wpsl-twelve-format" );
608
+ openingHours = openingHourOptions.hours.hr12;
609
+ } else {
610
+ $( "#wpsl-store-hours" ).removeClass().addClass( "wpsl-twentyfour-format" );
611
+ openingHours = openingHourOptions.hours.hr24;
612
+ }
613
+
614
+ openingHourInterval = openingHourOptions.interval;
615
+
616
+ for ( var i = 0; i < openingHours.length; i++ ) {
617
+ hour = openingHours[i];
618
+
619
+ /* If the 12hr format is selected, then check if we need to show AM or PM.
620
+ If the 24hr format is selected and the hour is a single digit
621
+ then we add a 0 to the start so 5:00 becomes 05:00.
622
+ */
623
+ if ( hrFormat == 12 ) {
624
+ if ( hour >= 12 ) {
625
+ pm = true;
626
+ }
627
+
628
+ pmOrAm = ( pm ) ? "PM" : "AM";
629
+ } else if ( ( hrFormat == 24 ) && ( hour.toString().length == 1 ) ) {
630
+ hour = "0" + hour;
631
+ }
632
+
633
+ /* Collect the new opening hour format and interval */
634
+ for ( var j = 0; j < openingHourInterval.length; j++ ) {
635
+ openingTimes.push( hour + ":" + openingHourInterval[j] + " " + pmOrAm );
636
+ }
637
+ }
638
+
639
+ /* Create the <option> list */
640
+ for ( var i = 0; i < openingTimes.length; i++ ) {
641
+ optionList = optionList + '<option value="' + $.trim( openingTimes[i] ) + '">' + $.trim( openingTimes[i] ) + '</option>';
642
+ }
643
+
644
+ if ( returnList ) {
645
+ return optionList;
646
+ } else {
647
+ setSelectedOpeningHours( optionList, hrFormat );
648
+ }
649
+ }
650
+
651
+ /**
652
+ * Set the correct selected opening hour in the dropdown
653
+ *
654
+ * @since 2.0
655
+ * @param {string} optionList The html for the option list
656
+ * @param {string} hrFormat The html for the option list
657
+ * @return {void}
658
+ */
659
+ function setSelectedOpeningHours( optionList, hrFormat ) {
660
+ var splitHour, hourType, periodBlock,
661
+ hours = {};
662
+
663
+ /* Loop over each open/close block and make sure the selected value is still set as selected after changing the hr format */
664
+ $( ".wpsl-current-period" ).each( function() {
665
+ periodBlock = $( this ),
666
+ hours = {
667
+ "open": $( this ).find( ".wpsl-open-hour" ).val(),
668
+ "close": $( this ).find( ".wpsl-close-hour" ).val()
669
+ };
670
+
671
+ /* Set the new hour format for both dropdowns */
672
+ $( this ).find( "select" ).html( optionList ).promise().done( function() {
673
+
674
+ /* Select the correct start/end hours as selected */
675
+ for ( var key in hours ) {
676
+ if ( hours.hasOwnProperty( key ) ) {
677
+
678
+ /* Breakup the hour, so we can check the part before and after the : separately */
679
+ splitHour = hours[key].split( ":" );
680
+
681
+ if ( hrFormat == 12 ) {
682
+ hourType = "";
683
+
684
+ /* Change the hours to a 12hr format and add the correct AM or PM */
685
+ if ( hours[key].charAt( 0 ) == 0 ) {
686
+ hours[key] = hours[key].substr( 1 );
687
+ hourType = " AM";
688
+ } else if ( ( splitHour[0].length == 2 ) && ( splitHour[0] > 12 ) ) {
689
+ hours[key] = ( splitHour[0] - 12 ) + ":" + splitHour[1];
690
+ hourType = " PM";
691
+ } else if ( splitHour[0] < 12 ) {
692
+ hours[key] = splitHour[0] + ":" + splitHour[1];
693
+ hourType = " AM";
694
+ } else if ( splitHour[0] == 12 ) {
695
+ hours[key] = splitHour[0] + ":" + splitHour[1];
696
+ hourType = " PM";
697
+ }
698
+
699
+ /* Add either AM or PM behind the time. */
700
+ if ( ( splitHour[1].indexOf( "PM" ) == -1 ) && ( splitHour[1].indexOf( "AM" ) == -1 ) ) {
701
+ hours[key] = hours[key] + hourType;
702
+ }
703
+
704
+ } else if ( hrFormat == 24 ) {
705
+
706
+ /* Change the hours to a 24hr format and remove the AM or PM */
707
+ if ( splitHour[1].indexOf( "PM" ) != -1 ) {
708
+ if ( splitHour[0] == 12 ) {
709
+ hours[key] = "12:" + splitHour[1].replace( " PM", "" );
710
+ } else {
711
+ hours[key] = ( + splitHour[0] + 12 ) + ":" + splitHour[1].replace( " PM", "" );
712
+ }
713
+ } else if ( splitHour[1].indexOf( "AM" ) != -1 ) {
714
+ if ( splitHour[0].toString().length == 1 ) {
715
+ hours[key] = "0" + splitHour[0] + ":" + splitHour[1].replace( " AM", "" );
716
+ } else {
717
+ hours[key] = splitHour[0] + ":" + splitHour[1].replace( " AM", "" );
718
+ }
719
+ } else {
720
+ hours[key] = splitHour[0] + ":" + splitHour[1]; // When the interval is changed
721
+ }
722
+ }
723
+
724
+ /* Set the correct value as the selected one */
725
+ periodBlock.find( ".wpsl-" + key + "-hour option[value='" + $.trim( hours[key] ) + "']" ).attr( "selected", "selected" );
726
+ }
727
+ }
728
+
729
+ });
730
+ });
731
  }
732
+
733
+ /* Update the opening hours format if one of the dropdown values change */
734
+ $( "#wpsl-editor-hour-format, #wpsl-editor-hour-interval" ).on( "change", function() {
735
+ createHourOptionList();
736
+ });
737
+
738
+ /* Show the tooltips */
739
+ $( ".wpsl-info" ).on( "mouseover", function() {
740
+ $( this ).find( ".wpsl-info-text" ).show();
741
+ });
742
+
743
+ $( ".wpsl-info" ).on( "mouseout", function() {
744
+ $( this ).find( ".wpsl-info-text" ).hide();
745
+ });
746
+
747
+ /* If the start location is empty, then we color the info icon red instead of black */
748
+ if ( $( "#wpsl-latlng" ).length && !$( "#wpsl-latlng" ).val() ) {
749
+ $( "#wpsl-latlng" ).siblings( "label" ).find( ".wpsl-info" ).addClass( "wpsl-required-setting" );
750
+ }
751
+
752
+ /* Try to apply the custom style data to the map.
753
+ *
754
+ * If the style data is invalid json we show an error.
755
+ *
756
+ * @since 2.0
757
+ * @return {void}
758
+ */
759
+ function tryCustomMapStyle() {
760
+ var validStyle = "",
761
+ mapStyle = $.trim( $( "#wpsl-map-style" ).val() );
762
+
763
+ $( ".wpsl-style-preview-error" ).remove();
764
+
765
+ if ( mapStyle ) {
766
+ /* Make sure the data is valid json */
767
+ validStyle = tryParseJSON( mapStyle );
768
+
769
+ if ( !validStyle ) {
770
+ $( "#wpsl-style-preview" ).after( "<div class='wpsl-style-preview-error'>" + wpslL10n.styleError + "</div>" );
771
+ }
772
+ }
773
+
774
+ map.setOptions({ styles: validStyle });
775
+ }
776
+
777
+ /* Handle the map style changes on the settings page */
778
+ if ( $( "#wpsl-map-style" ).val() ) {
779
+ tryCustomMapStyle();
780
+ }
781
+
782
+ /* Handle clicks on the map style preview button */
783
+ $( "#wpsl-style-preview" ).on( "click", function() {
784
+ tryCustomMapStyle();
785
+
786
+ return false;
787
+ });
788
+
789
+ /* Make sure the json is valid.
790
+ *
791
+ * @since 2.0
792
+ * @see http://stackoverflow.com/a/20392392/1065294
793
+ * @return {object|boolean} The json string or false if it's invalid json.
794
+ */
795
+ function tryParseJSON( jsonString ) {
796
+ try {
797
+ var o = JSON.parse(jsonString);
798
+
799
+ // Handle non-exception-throwing cases:
800
+ // Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking,
801
+ // but... JSON.parse(null) returns 'null', and typeof null === "object",
802
+ // so we must check for that, too.
803
+ if (o && typeof o === "object" && o !== null) {
804
+ return o;
805
+ }
806
+ }
807
+ catch (e) { }
808
+
809
+ return false;
810
+ }
811
+
812
  });
admin/js/wpsl-admin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(e){function s(){var e=wpslSettings.defaultLatLng.split(","),s=new google.maps.LatLng(e[0],e[1]),o={};o={zoom:parseInt(wpslSettings.defaultZoom),center:s,mapTypeId:google.maps.MapTypeId[wpslSettings.mapType.toUpperCase()],mapTypeControl:!1,streetViewControl:!1,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP}},b=new google.maps.Geocoder,C=new google.maps.Map(document.getElementById("wpsl-gmap-wrap"),o),t()}function t(){var s,t=e("#wpsl-lat").val(),o=e("#wpsl-lng").val();t&&o&&(s=new google.maps.LatLng(t,o),C.setCenter(s),C.setZoom(16),l(s))}function o(){var e,s=document.getElementById("wpsl-zoom-name"),t={types:["geocode"]},o=new google.maps.places.Autocomplete(s,t);google.maps.event.addListener(o,"place_changed",function(){e=o.getPlace().geometry.location,n(e,"zoom")})}function l(e){var s=new google.maps.Marker({position:e,map:C,draggable:!0});M.push(s),google.maps.event.addListener(s,"dragend",function(){n(s.getPosition(),"store")})}function n(s,t){var o=c(s),l=p(o[0]),n=p(o[1]);"store"==t?(e("#wpsl-lat").val(l),e("#wpsl-lng").val(n)):"zoom"==t&&e("#wpsl-latlng").val(l+","+n)}function r(){var s,t,o=e("#wpsl-address").val(),r=e("#wpsl-city").val(),p=e("#wpsl-zip").val(),c=e("#wpsl-country").val();return t=p?o+","+r+","+p+","+c:o+","+r+","+c,e("#wpsl-missing-geodata").remove(),a(o,r,c)?(d("first"),alert(wpslL10n.missingGeoData),!0):(b.geocode({address:t},function(t,o){o===google.maps.GeocoderStatus.OK?("undefined"!=typeof M[0]&&M[0].draggable&&(M[0].setMap(null),M.splice(0,1)),C.setCenter(t[0].geometry.location),C.setZoom(16),l(t[0].geometry.location),n(t[0].geometry.location,"store"),s=i(t),e("#wpsl-country").val(s.country.long_name),e("#wpsl-country_iso").val(s.country.short_name)):alert(wpslL10n.geocodeFail+": "+o)}),!1)}function a(s,t,o){var l=!1;return e(".wpsl-store-meta input").removeClass("wpsl-error"),s||(e("#wpsl-address").addClass("wpsl-error"),l=!0),t||(e("#wpsl-city").addClass("wpsl-error"),l=!0),o||(e("#wpsl-country").addClass("wpsl-error"),l=!0),l}function i(e){var s,t,o={},l={},n=e[0].address_components.length;for(s=0;n>s;s++)t=e[0].address_components[s].types,/^country,political$/.test(t)&&(o={long_name:e[0].address_components[s].long_name,short_name:e[0].address_components[s].short_name});return l={country:o}}function p(e){var s,t=6;return s=Math.round(e*Math.pow(10,t))/Math.pow(10,t)}function c(e){var s=[],t=e.toString(),o=t.split(",",2);return s[0]=o[0].replace("(",""),s[1]=o[1].replace(")",""),s}function d(s){s="first"==s?":first-child":"."+s,e("#wpsl-meta-nav li"+s+"-tab").hasClass("wpsl-active")||(e("#wpsl-meta-nav li"+s+"-tab").addClass("wpsl-active").siblings().removeClass("wpsl-active"),e(".wpsl-store-meta > div"+s).show().addClass("wpsl-active").siblings("div").hide().removeClass("wpsl-active"))}function w(e){var s={};return s={type:"id",val:e.attr("id")},"undefined"==typeof s.val&&(s={type:"class",val:e.attr("class")}),s}function u(){e("#wpsl-store-hours .wpsl-icon-cancel-circled").off(),e("#wpsl-store-hours .wpsl-icon-cancel-circled").on("click",function(){h(e(this))})}function h(e){var s=m(e),t=e.parents("tr"),o=t.find(".wpsl-opening-hours").attr("data-day");1==s&&t.find(".wpsl-opening-hours").html("<p class='wpsl-store-closed'>"+wpslL10n.closedDate+"<input type='hidden' name='wpsl[hours]["+o+"_open]' value='' /></p>"),e.parent().closest(".wpsl-current-period").remove(),t.find(".wpsl-opening-hours div:first-child").hasClass("wpsl-multiple-periods")&&t.find(".wpsl-opening-hours div:first-child").removeClass("wpsl-multiple-periods")}function m(e){var s=e.parents("tr").find(".wpsl-current-period").length;return s}function v(s){var t,o,l,n,r=!1,a="",i="",p=[],c={hours:{hr12:[0,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11],hr24:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]},interval:["00","15","30","45"]};n=e("#wpsl-editor-hour-format").length?e("#wpsl-editor-hour-format").val():wpslSettings.hourFormat,e("#wpsl-store-hours td").removeAttr("style"),12==n?(e("#wpsl-store-hours").removeClass().addClass("wpsl-twelve-format"),t=c.hours.hr12):(e("#wpsl-store-hours").removeClass().addClass("wpsl-twentyfour-format"),t=c.hours.hr24),o=c.interval;for(var d=0;d<t.length;d++){l=t[d],12==n?(l>=12&&(r=!0),a=r?"PM":"AM"):24==n&&1==l.toString().length&&(l="0"+l);for(var w=0;w<o.length;w++)p.push(l+":"+o[w]+" "+a)}for(var d=0;d<p.length;d++)i=i+'<option value="'+e.trim(p[d])+'">'+e.trim(p[d])+"</option>";return s?i:void f(i,n)}function f(s,t){var o,l,n,r={};e(".wpsl-current-period").each(function(){n=e(this),r={open:e(this).find(".wpsl-open-hour").val(),close:e(this).find(".wpsl-close-hour").val()},e(this).find("select").html(s).promise().done(function(){for(var s in r)r.hasOwnProperty(s)&&(o=r[s].split(":"),12==t?(l="",0==r[s].charAt(0)?(r[s]=r[s].substr(1),l=" AM"):2==o[0].length&&o[0]>12?(r[s]=o[0]-12+":"+o[1],l=" PM"):o[0]<12?(r[s]=o[0]+":"+o[1],l=" AM"):12==o[0]&&(r[s]=o[0]+":"+o[1],l=" PM"),-1==o[1].indexOf("PM")&&-1==o[1].indexOf("AM")&&(r[s]=r[s]+l)):24==t&&(r[s]=-1!=o[1].indexOf("PM")?12==o[0]?"12:"+o[1].replace(" PM",""):+o[0]+12+":"+o[1].replace(" PM",""):-1!=o[1].indexOf("AM")?1==o[0].toString().length?"0"+o[0]+":"+o[1].replace(" AM",""):o[0]+":"+o[1].replace(" AM",""):o[0]+":"+o[1]),n.find(".wpsl-"+s+"-hour option[value='"+e.trim(r[s])+"']").attr("selected","selected"))})})}function g(){var s="",t=e.trim(e("#wpsl-map-style").val());e(".wpsl-style-preview-error").remove(),t&&(s=y(t),s||e("#wpsl-style-preview").after("<div class='wpsl-style-preview-error'>"+wpslL10n.styleError+"</div>")),C.setOptions({styles:s})}function y(e){try{var s=JSON.parse(e);if(s&&"object"==typeof s&&null!==s)return s}catch(t){}return!1}var C,b,M=[];e("#wpsl-gmap-wrap").length&&s(),e("#wpsl-zoom-name").length&&o(),e("#wpsl-lookup-location").on("click",function(e){e.preventDefault(),r()}),e(".wpsl-marker-list input[type=radio]").click(function(){e(this).parents(".wpsl-marker-list").find("li").removeClass(),e(this).parent("li").addClass("wpsl-active-marker")}),e(".wpsl-marker-list li").click(function(){e(this).parents(".wpsl-marker-list").find("input").prop("checked",!1),e(this).find("input").prop("checked",!0),e(this).siblings().removeClass(),e(this).addClass("wpsl-active-marker")}),e(".wpsl-dismiss").click(function(){var s=e(this),t={action:"disable_location_warning",_ajax_nonce:s.attr("data-nonce")};return e.post(ajaxurl,t),e(".wpsl-dismiss").parents(".error").remove(),!1}),e("#wpsl-more-info").on("change",function(){e("#wpsl-more-info-options").toggle()}),e("#wpsl-autoload").on("change",function(){e("#wpsl-autoload-options").toggle()}),e("#wpsl-editor-hide-hours").on("change",function(){e(".wpsl-hours").toggle()}),e("#wpsl-store-template").on("change",function(){var s=e("#wpsl-listing-below-no-scroll");"below_map"==e(this).val()?s.show():s.hide()}),e("#wpsl-editor-hour-input").on("change",function(){e(".wpsl-"+e(this).val()+"-hours").show().siblings("div").hide(),e(".wpsl-hour-notice").toggle()}),e("#wpsl-marker-clusters").on("change",function(){e(".wpsl-cluster-options").toggle()}),e("#wpsl-permalinks-active").on("change",function(){e(".wpsl-permalink-option").toggle()}),e("#wpsl-meta-nav li").on("click",function(s){var t=e(this).attr("class");t=t.split("-tab"),s.stopPropagation(),e(this).addClass("wpsl-active").siblings().removeClass("wpsl-active"),e(".wpsl-store-meta ."+t[0]).show().addClass("wpsl-active").siblings("div").hide().removeClass("wpsl-active")}),e("#wpsl-store-details").length&&e("#publish").click(function(){var s,t,o,l='<div id="message" class="error"><p>'+wpslL10n.requiredFields+"</p></div>",n=!1;return e("#wpbody-content .wrap #message").remove(),e(".wpsl-required").removeClass("wpsl-error"),e(".wpsl-required").each(function(){""==e(this).val()&&(e(this).addClass("wpsl-error"),"undefined"==typeof s&&(s=w(e(this))),n=!0)}),n?(e("#wpbody-content .wrap > h2").after(l),"undefined"!=typeof s.val&&("id"==s.type?(t=e("#"+s.val).parents(".wpsl-tab").attr("class"),e("html, body").scrollTop(Math.round(e("#"+s.val).offset().top-100))):"class"==s.type&&(o=s.val.replace(/wpsl-required|wpsl-error/g,""),t=e("."+o).parents(".wpsl-tab").attr("class"),e("html, body").scrollTop(Math.round(e("."+o).offset().top-100))),t=e.trim(t.replace(/wpsl-tab|wpsl-active/g,""))),d(t?t:"first"),e("#publish").removeClass("button-primary-disabled"),e(".spinner").hide(),!1):!0}),e("#wpsl-store-hours").length&&u(),e(".wpsl-add-period").on("click",function(s){var t,o={},l=!0,n=e(this).parents("tr"),r=m(e(this)),a=r>=1?"wpsl-current-period wpsl-multiple-periods":"wpsl-current-period",i=n.find(".wpsl-opening-hours").attr("data-day"),p=e("#wpsl-settings-form").length?"wpsl_editor[dropdown]":"wpsl[hours]";t='<div class="'+a+'">',t+='<select autocomplete="off" name="'+p+"["+i+'_open][]" class="wpsl-open-hour">'+v(l)+"</select>",t+="<span> - </span>",t+='<select autocomplete="off" name="'+p+"["+i+'_close][]" class="wpsl-close-hour">'+v(l)+"</select>",t+='<div class="wpsl-icon-cancel-circled"></div>',t+="</div>",n.find(".wpsl-store-closed").remove(),e("#wpsl-hours-"+i).append(t).end(),u(),o=24==e("#wpsl-editor-hour-format").val()?{open:"09:00",close:"17:00"}:{open:"9:00 AM",close:"5:00 PM"},n.find(".wpsl-open-hour:last option[value='"+o.open+"']").attr("selected","selected"),n.find(".wpsl-close-hour:last option[value='"+o.close+"']").attr("selected","selected"),s.preventDefault()}),e("#wpsl-editor-hour-format, #wpsl-editor-hour-interval").on("change",function(){v()}),e(".wpsl-info").on("mouseover",function(){e(this).find(".wpsl-info-text").show()}),e(".wpsl-info").on("mouseout",function(){e(this).find(".wpsl-info-text").hide()}),e("#wpsl-latlng").length&&!e("#wpsl-latlng").val()&&e("#wpsl-latlng").siblings("label").find(".wpsl-info").addClass("wpsl-required-setting"),e("#wpsl-map-style").val()&&g(),e("#wpsl-style-preview").on("click",function(){return g(),!1})});
admin/js/wpsl-cpt-upgrade.js ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( document ).ready( function( $ ) {
2
+ var updateInterval;
3
+
4
+ $( "#wpsl-cpt-dialog" ).on( "click", function() {
5
+ $( "#wpsl-cpt-lightbox, #wpsl-cpt-overlay" ).show();
6
+ });
7
+
8
+ $( "#wpsl-cpt-overlay, #wpsl-cpt-lightbox .tb-close-icon" ).on( "click", function() {
9
+ $( "#wpsl-cpt-lightbox, #wpsl-cpt-overlay" ).hide();
10
+ });
11
+
12
+ /* Start converting the locations to custom post types once the button is clicked */
13
+ $( "#wpsl-start-cpt-conversion" ).on( "click", function() {
14
+ var ajaxData = {
15
+ action: "convert_cpt",
16
+ _ajax_nonce: $( this ).parents( "#wpsl-cpt-lightbox" ).find( "input[name='wpsl-cpt-fix-nonce']" ).val()
17
+ };
18
+
19
+ $( "#wpsl-cpt-lightbox .wpsl-preloader" ).show();
20
+ $( ".wpsl-cpt-timeout" ).remove();
21
+
22
+ /* Make the ajax request to start the cpt conversion */
23
+ $.get( ajaxurl, ajaxData, function( response ) {
24
+ if ( response == -1 ) {
25
+ alert( wpslCptConversion.securityFail );
26
+ stopConvertingCpt();
27
+ }
28
+ });
29
+
30
+ /* Get the latest amount of locations that still need to be converted */
31
+ updateInterval = setInterval( function() { convertCptCount(); }, 10000 );
32
+
33
+ return false;
34
+ });
35
+
36
+ /**
37
+ * Cancel the conversion count updates and hide the preloader.
38
+ *
39
+ * @since 2.0
40
+ * @return {void}
41
+ */
42
+ function stopConvertingCpt() {
43
+ clearInterval( updateInterval );
44
+ $( ".wpsl-preloader" ).hide();
45
+ }
46
+
47
+ /**
48
+ * When the script that converts the locations to custom post types timed out, we show this msg.
49
+ *
50
+ * @since 2.0
51
+ * @return {void}
52
+ */
53
+ function convertCptTimeoutMsg() {
54
+ $( ".wslp-cpt-fix-wrap" ).after( "<p class='wpsl-cpt-timeout'>" + wpslCptConversion.timeout + "</p>" );
55
+ }
56
+
57
+ /**
58
+ * Make the ajax request to update the count of the
59
+ * remaining locations that need to be converted.
60
+ *
61
+ * @since 2.0
62
+ * @return {void}
63
+ */
64
+ function convertCptCount() {
65
+ var convertCount, ajaxData = {
66
+ action: "convert_cpt_count",
67
+ _ajax_nonce: $( "#wpsl-cpt-lightbox" ).find( "input[name='wpsl-cpt-conversion-count']" ).val()
68
+ };
69
+
70
+ $.ajaxQueue({
71
+ url: ajaxurl,
72
+ data: ajaxData,
73
+ type: "GET"
74
+ }).done( function( response ) {
75
+
76
+ if ( response == -1 ) {
77
+ stopConvertingCpt();
78
+ alert( wpslCptConversion.securityFail );
79
+ } else if ( typeof response.count !== "undefined" ) {
80
+ convertCount = $( "#wpsl-cpt-lightbox p span" ).text();
81
+
82
+ /* Check if the convert count still changes, if so the script is still running and we update the correct value.
83
+ * If not then the convert script timed out and we show a different message.
84
+ */
85
+ if ( response.count != convertCount ) {
86
+ $( ".wpsl-cpt-remaining span").html( response.count );
87
+ } else if ( response.count > 0 ) {
88
+ stopConvertingCpt();
89
+ convertCptTimeoutMsg();
90
+ }
91
+ } else if ( typeof response.url !== "undefined" ) {
92
+ $( ".wpsl-cpt-remaining" ).html( response.url ).parents( ".error" ).remove();
93
+ $( ".wslp-cpt-fix-wrap" ).remove();
94
+ stopConvertingCpt();
95
+ }
96
+ });
97
+ }
98
+
99
+ /* Copy the remaining number of locations that need to be
100
+ * converted to custom post types to the thickbox field.
101
+ */
102
+ if ( $( ".error .wpsl-cpt-remaining" ).length ) {
103
+ var cptCount = parseInt( $( ".error .wpsl-cpt-remaining" ).text() );
104
+
105
+ if ( isNaN( cptCount ) ) {
106
+ cptCount = '-';
107
+ }
108
+
109
+ $( ".wpsl-cpt-remaining span" ).html( cptCount );
110
+ }
111
+
112
+ });
admin/roles.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Add WPSL Roles
5
+ *
6
+ * @since 2.0
7
+ * @return void
8
+ */
9
+ function wpsl_add_roles() {
10
+
11
+ global $wp_roles;
12
+
13
+ if ( class_exists( 'WP_Roles' ) ) {
14
+ if ( !isset( $wp_roles ) ) {
15
+ $wp_roles = new WP_Roles();
16
+ }
17
+ }
18
+
19
+ if ( is_object( $wp_roles ) ) {
20
+ add_role( 'wpsl_store_locator_manager', __( 'Store Locator Manager', 'wpsl' ), array(
21
+ 'read' => true,
22
+ 'edit_posts' => true,
23
+ 'delete_posts' => true,
24
+ 'unfiltered_html' => true,
25
+ 'upload_files' => true,
26
+ 'delete_others_pages' => true,
27
+ 'delete_others_posts' => true,
28
+ 'delete_pages' => true,
29
+ 'delete_private_pages' => true,
30
+ 'delete_private_posts' => true,
31
+ 'delete_published_pages' => true,
32
+ 'delete_published_posts' => true,
33
+ 'edit_others_pages' => true,
34
+ 'edit_others_posts' => true,
35
+ 'edit_pages' => true,
36
+ 'edit_private_pages' => true,
37
+ 'edit_private_posts' => true,
38
+ 'edit_published_pages' => true,
39
+ 'edit_published_posts' => true,
40
+ 'moderate_comments' => true,
41
+ 'publish_pages' => true,
42
+ 'publish_posts' => true,
43
+ 'read_private_pages' => true,
44
+ 'read_private_posts' => true
45
+ ) );
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Add WPSL user capabilities
51
+ *
52
+ * @since 2.0
53
+ * @return void
54
+ */
55
+ function wpsl_add_caps() {
56
+
57
+ global $wp_roles;
58
+
59
+ if ( class_exists( 'WP_Roles' ) ) {
60
+ if ( !isset( $wp_roles ) ) {
61
+ $wp_roles = new WP_Roles();
62
+ }
63
+ }
64
+
65
+ if ( is_object( $wp_roles ) ) {
66
+ $wp_roles->add_cap( 'administrator', 'manage_wpsl_settings' );
67
+
68
+ $capabilities = wpsl_get_post_caps();
69
+
70
+ foreach ( $capabilities as $cap ) {
71
+ $wp_roles->add_cap( 'wpsl_store_locator_manager', $cap );
72
+ $wp_roles->add_cap( 'administrator', $cap );
73
+ }
74
+ }
75
+ }
76
+
77
+ /* Get the WPSL post type capabilities
78
+ *
79
+ * @since 2.0
80
+ * @return array $capabilities The post type capabilities
81
+ */
82
+ function wpsl_get_post_caps() {
83
+
84
+ $capabilities = array(
85
+ 'edit_store',
86
+ 'read_store',
87
+ 'delete_store',
88
+ 'edit_stores',
89
+ 'edit_others_stores',
90
+ 'publish_stores',
91
+ 'read_private_stores',
92
+ 'delete_stores',
93
+ 'delete_private_stores',
94
+ 'delete_published_stores',
95
+ 'delete_others_stores',
96
+ 'edit_private_stores',
97
+ 'edit_published_stores'
98
+ );
99
+
100
+ return $capabilities;
101
+ }
102
+
103
+ /**
104
+ * Remove the WPSL caps and roles
105
+ *
106
+ * Only called from uninstall.php
107
+ *
108
+ * @since 2.0
109
+ * @return void
110
+ */
111
+ function wpsl_remove_caps_and_roles() {
112
+
113
+ global $wp_roles;
114
+
115
+ if ( class_exists( 'WP_Roles' ) ) {
116
+ if ( !isset( $wp_roles ) ) {
117
+ $wp_roles = new WP_Roles();
118
+ }
119
+ }
120
+
121
+ if ( is_object( $wp_roles ) ) {
122
+ $wp_roles->remove_cap( 'administrator', 'manage_wpsl_settings' );
123
+
124
+ $capabilities = wpsl_get_post_caps();
125
+
126
+ foreach ( $capabilities as $cap ) {
127
+ $wp_roles->remove_cap( 'wpsl_store_locator_manager', $cap );
128
+ $wp_roles->remove_cap( 'administrator', $cap );
129
+ }
130
+ }
131
+
132
+ remove_role( 'wpsl_store_locator_manager' );
133
+ }
admin/templates/map-settings.php CHANGED
@@ -1,122 +1,167 @@
1
- <div id="wpsl-wrap" class="wrap wpsl-settings">
2
- <h2>WP Store Locator: <?php _e( 'Settings', 'wpsl' ); ?></h2>
3
-
4
- <?php
5
- global $wpdb;
6
-
7
- settings_errors();
8
-
9
- echo $this->create_menu();
10
- ?>
11
-
12
- <form id="wpsl-settings-form" method="post" action="options.php" accept-charset="utf-8">
13
  <div class="postbox-container">
14
  <div class="metabox-holder">
15
- <div class="postbox">
16
- <h3><span><?php _e( 'API Settings', 'wpsl' ); ?></span></h3>
17
  <div class="inside">
18
  <p>
19
- <label for="wpsl-api-key"><?php _e( 'API key:', 'wpsl' ); ?> *</label>
20
- <input type="text" value="<?php echo esc_attr( $this->settings['api_key'] ); ?>" name="wpsl_api[key]" placeholder="<?php _e( 'Optional', 'wpsl' ); ?>" class="textinput" id="wpsl-api-key">
21
  </p>
22
  <p>
23
- <label for="wpsl-api-language"><?php _e( 'Map language:', 'wpsl' ); ?></label>
24
  <select id="wpsl-api-language" name="wpsl_api[language]">
25
- <?php echo $this->get_api_option_list( 'language' ); ?>
26
  </select>
27
  </p>
28
  <p>
29
- <label for="wpsl-api-region"><?php _e( 'Map region:', 'wpsl' ); ?></label>
30
  <select id="wpsl-api-region" name="wpsl_api[region]">
31
- <?php echo $this->get_api_option_list( 'region' ); ?>
32
  </select>
33
  </p>
34
- <em><?php echo sprintf( __( '* A valid <a href="%s">API key</a> allows you to monitor the API usage <br> and is required if you need to purchase additional quota.', 'wpsl' ), 'https://developers.google.com/maps/documentation/javascript/tutorial#api_key' ); ?></em>
35
- </div>
36
- </div>
37
- </div>
 
 
38
  </div>
39
-
40
- <div class="postbox-container">
41
  <div class="metabox-holder">
42
- <div class="postbox">
43
- <h3><span><?php _e( 'Search Settings', 'wpsl' ); ?></span></h3>
44
  <div class="inside">
45
  <p>
46
- <label for="wpsl-distance-unit"><?php _e( 'Distance unit:', 'wpsl' ); ?></label>
47
- <?php echo $this->show_distance_units(); ?>
 
 
 
 
48
  </p>
49
  <p>
50
- <label for="wpsl-max-results"><?php _e( 'Max search results:', 'wpsl' ); ?> *</label>
51
- <input type="text" value="<?php echo esc_attr( $this->settings['max_results'] ); ?>" name="wpsl_search[max_results]" class="textinput" id="wpsl-max-results">
52
  </p>
53
  <p>
54
- <label for="wpsl-search-radius"><?php _e( 'Search radius options:', 'wpsl' ); ?> *</label>
55
- <input type="text" value="<?php echo esc_attr( $this->settings['search_radius'] ); ?>" name="wpsl_search[radius]" class="textinput" id="wpsl-search-radius">
 
 
 
 
 
 
 
 
 
56
  </p>
57
  <p>
58
- <label for="wpsl-bounce"><?php _e( 'If a user hovers over the search results, the corresponding marker will bounce?', 'wpsl' ); ?></label>
59
- <input type="checkbox" value="" <?php checked( $this->settings['marker_bounce'], true ); ?> name="wpsl_map[marker_bounce]" id="wpsl-bounce">
60
- </p>
61
- <em><?php _e( '* The default value is set between the ( )', 'wpsl' ); ?></em>
 
 
62
  </div>
63
  </div>
64
  </div>
65
  </div>
66
-
67
  <div class="postbox-container">
68
  <div class="metabox-holder">
69
- <div class="postbox">
70
- <h3><span><?php _e( 'Map Settings', 'wpsl' ); ?></span></h3>
71
  <div class="inside">
72
  <p>
73
- <label for="wpsl-auto-locate"><?php _e( 'Attempt to auto-locate the user:', 'wpsl' ); ?></label>
74
- <input type="checkbox" value="" <?php checked( $this->settings['auto_locate'], true ); ?> name="wpsl_map[auto_locate]" id="wpsl-auto-locate">
75
  </p>
76
  <p>
77
- <label for="wpsl-auto-load"><?php _e( 'Load all stores on page load:', 'wpsl' ); ?></label>
78
- <input type="checkbox" value="" <?php checked( $this->settings['auto_load'], true ); ?> name="wpsl_map[auto_load]" id="wpsl-auto-locate">
79
- </p>
 
 
 
 
 
 
 
 
 
80
  <p>
81
- <label for="wpsl-zoom-name"><?php _e( 'Start point: *', 'wpsl' ); ?></label>
82
- <input type="text" value="<?php echo esc_attr( $this->settings['zoom_name'] ); ?>" name="wpsl_map[zoom_name]" class="textinput" id="wpsl-zoom-name">
83
- <input type="hidden" value="<?php echo esc_attr( $this->settings['zoom_latlng'] ); ?>" name="wpsl_map[zoom_latlng]" id="wpsl-latlng" />
84
  </p>
85
  <p>
86
- <label for="wpsl-zoom-level"><?php _e( 'Zoom level:', 'wpsl' ); ?></label>
87
- <?php echo $this->show_zoom_levels(); ?>
 
 
 
 
88
  </p>
89
  <p>
90
- <label for="wpsl-map-type"><?php _e( 'Map type:', 'wpsl' ); ?></label>
91
- <?php echo $this->show_map_types(); ?>
92
  </p>
93
  <p>
94
- <label for="wpsl-streetview"><?php _e( 'Show the street view controls?', 'wpsl' ); ?></label>
95
- <input type="checkbox" value="" <?php checked( $this->settings['streetview'], true ); ?> name="wpsl_map[streetview]" id="wpsl-streetview">
96
  </p>
97
  <p>
98
- <label for="wpsl-pan-controls"><?php _e( 'Show the pan controls?', 'wpsl' ); ?></label>
99
- <input type="checkbox" value="" <?php checked( $this->settings['pan_controls'], true ); ?> name="wpsl_map[pan_controls]" id="wpsl-pan-controls">
100
- </p>
101
  <p>
102
- <label><?php _e( 'Position of the map controls:', 'wpsl' ); ?></label>
103
- <span class="wpsl_radioboxes">
104
- <input type="radio" value="left" <?php checked( 'left', $this->settings['control_position'], true ); ?> name="wpsl_map[control_position]" id="wpsl-control-left">
105
  <label for="wpsl-control-left"><?php _e( 'Left', 'wpsl' ); ?></label>
106
- <input type="radio" value="right" <?php checked( 'right', $this->settings['control_position'], true ); ?> name="wpsl_map[control_position]" id="wpsl-control-right">
107
  <label for="wpsl-control-right"><?php _e( 'Right', 'wpsl' ); ?></label>
108
  </span>
109
  </p>
110
  <p>
111
- <label><?php _e( 'Zoom control style:', 'wpsl' ); ?></label>
112
- <span class="wpsl_radioboxes">
113
- <input type="radio" value="small" <?php checked( 'small', $this->settings['control_style'], true ); ?> name="wpsl_map[control_style]" id="wpsl-small-style">
114
  <label for="wpsl-small-style"><?php _e( 'Small', 'wpsl' ); ?></label>
115
- <input type="radio" value="large" <?php checked( 'large', $this->settings['control_style'], true ); ?> name="wpsl_map[control_style]" id="wpsl-large-style">
116
  <label for="wpsl-large-style"><?php _e( 'Large', 'wpsl' ); ?></label>
117
  </span>
118
  </p>
119
- <em><?php _e( '* Required field. If auto-locating the user is disabled or fails, the center of the provided city or country will be used as the initial starting point for the user.', 'wpsl' ); ?></em>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  </div>
121
  </div>
122
  </div>
@@ -124,116 +169,193 @@
124
 
125
  <div class="postbox-container">
126
  <div class="metabox-holder">
127
- <div class="postbox">
128
- <h3><span><?php _e( 'Design Settings', 'wpsl' ); ?></span></h3>
129
  <div class="inside">
130
  <p>
131
- <label for="wpsl-design-height"><?php _e( 'Store Locator height', 'wpsl' ); ?></label>
132
- <input size="3" value="<?php echo esc_attr( $this->settings['height'] ); ?>" id="wpsl-design-height" name="wpsl_design[height_value]"> px
133
  </p>
134
  <p>
135
- <label for="wpsl-infowindow-width"><?php _e( 'Max width for the infowindow', 'wpsl' ); ?></label>
136
- <input size="3" value="<?php echo esc_attr( $this->settings['infowindow_width'] ); ?>" id="wpsl-infowindow-width" name="wpsl_design[infowindow_width]"> px
137
  </p>
138
  <p>
139
- <label for="wpsl-search-width"><?php _e( 'Search field width', 'wpsl' ); ?></label>
140
- <input size="3" value="<?php echo esc_attr( $this->settings['search_width'] ); ?>" id="wpsl-search-width" name="wpsl_design[search_width]"> px
141
  </p>
142
  <p>
143
- <label for="wpsl-label-width"><?php _e( 'Search and radius label width *', 'wpsl' ); ?></label>
144
- <input size="3" value="<?php echo esc_attr( $this->settings['label_width'] ); ?>" id="wpsl-label-width" name="wpsl_design[label_width]"> px
145
  </p>
146
  <p>
147
- <label for="wpsl-store-template"><?php _e( 'Select template', 'wpsl' ); ?></label>
148
- <?php echo $this->show_template_options(); ?>
149
  </p>
150
- <p id="wpsl-store-below-scroll" <?php if ( $this->settings['template_id'] != '1' ) { echo 'style="display:none;"'; } ?>>
151
  <label for="wpsl-more-info-list"><?php _e( 'Hide the scrollbar?', 'wpsl' ); ?></label>
152
- <input type="checkbox" value="" <?php checked( $this->settings['store_below_scroll'], true ); ?> name="wpsl_design[store_below_scroll]" id="wpsl-store-below-scroll">
153
- </p>
154
- <p>
155
- <label for="wpsl-design-results"><?php _e( 'Show the limit results dropdown?', 'wpsl' ); ?></label>
156
- <input type="checkbox" value="" <?php checked( $this->settings['results_dropdown'], true ); ?> name="wpsl_design[design_results]">
157
  </p>
158
  <p>
159
  <label for="wpsl-new-window"><?php _e( 'Open links in a new window?', 'wpsl' ); ?></label>
160
- <input type="checkbox" value="" <?php checked( $this->settings['new_window'], true ); ?> name="wpsl_design[new_window]" id="wpsl-new-window">
161
  </p>
162
  <p>
163
  <label for="wpsl-reset-map"><?php _e( 'Show a reset map button?', 'wpsl' ); ?></label>
164
- <input type="checkbox" value="" <?php checked( $this->settings['reset_map'], true ); ?> name="wpsl_design[reset_map]" id="wpsl-reset-map">
165
  </p>
166
  <p>
167
- <label for="wpsl-direction-redirect"><?php _e( 'When a user clicks on "Directions", open a new window and show the route on maps.google.com', 'wpsl' ); ?></label>
168
- <input type="checkbox" value="" <?php checked( $this->settings['direction_redirect'], true ); ?> name="wpsl_design[direction_redirect]" id="wpsl-direction-redirect">
169
  </p>
170
  <p>
171
- <label for="wpsl-more-info"><?php _e( 'Show a "More info" link in the store listings?', 'wpsl' ); ?></label>
172
- <input type="checkbox" value="" <?php checked( $this->settings['more_info'], true ); ?> name="wpsl_design[more_info]" id="wpsl-more-info">
173
- </p>
174
- <p id="wpsl-more-info-options" <?php if ( $this->settings['more_info'] == '0' ) { echo 'style="display:none;"'; } ?>>
175
  <label for="wpsl-more-info-list"><?php _e( 'Where do you want to show the "More info" details?', 'wpsl' ); ?></label>
176
- <?php echo $this->show_more_info_options(); ?>
177
  </p>
178
  <p>
179
- <label for="wpsl-store-url"><?php _e( 'If a store url exists, make the store name clickable?', 'wpsl' ); ?></label>
180
- <input type="checkbox" value="" <?php checked( $this->settings['store_url'], true ); ?> name="wpsl_design[store_url]" id="wpsl-store-url">
181
  </p>
182
  <p>
183
  <label for="wpsl-phone-url"><?php _e( 'Make the phone number clickable on mobile devices?', 'wpsl' ); ?></label>
184
- <input type="checkbox" value="" <?php checked( $this->settings['phone_url'], true ); ?> name="wpsl_design[phone_url]" id="wpsl-phone-url">
185
  </p>
186
  <p>
187
- <label for="wpsl-marker-streetview"><?php _e( 'If available for the current location, show a link to enable street view from the infowindow?', 'wpsl' ); ?></label>
188
- <input type="checkbox" value="" <?php checked( $this->settings['marker_streetview'], true ); ?> name="wpsl_design[marker_streetview]" id="wpsl-marker-streetview">
189
  </p>
190
  <p>
191
- <label for="wpsl-marker-zoom-to"><?php _e( 'Show a "zoom to" link in the infowindow?', 'wpsl' ); ?></label>
192
- <input type="checkbox" value="" <?php checked( $this->settings['marker_zoom_to'], true ); ?> name="wpsl_design[marker_zoom_to]" id="wpsl-marker-zoom-to">
193
  </p>
194
  <p>
195
- <label for="wpsl-mouse-focus"><?php _e( 'On pageload move the mousecursor to the input field. **', 'wpsl' ); ?></label>
196
- <input type="checkbox" value="" <?php checked( $this->settings['mouse_focus'], true ); ?> name="wpsl_design[mouse_focus]" id="wpsl-mouse-focus">
197
- </p>
198
- <em><?php _e( '* This is the text that is placed before the search input and radius dropdown', 'wpsl' ); ?></em>
199
- <em><?php _e( '** If the store locator is not placed at the top of the page, enabling this feature can result in the page sliding down.', 'wpsl' ); ?></em>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  </div>
201
  </div>
202
  </div>
203
  </div>
204
-
205
  <div class="postbox-container">
206
  <div class="metabox-holder">
207
- <div class="postbox">
208
- <h3><span><?php _e( 'Markers', 'wpsl' ); ?></span></h3>
209
  <div class="inside">
210
- <?php echo $this->show_marker_options(); ?>
211
  <p>
212
- <label for="wpsl-marker-clusters"><?php _e( 'Enable marker clusters? *', 'wpsl' ); ?></label>
213
- <input type="checkbox" value="" <?php checked( $this->settings['marker_clusters'], true ); ?> name="wpsl_map[marker_clusters]" id="wpsl-marker-clusters">
214
  </p>
215
- <p class="wpsl-cluster-options" <?php if ( !$this->settings['marker_clusters'] ) { echo 'style="display:none;"'; } ?>>
216
- <label for="wpsl-marker-zoom"><?php _e( 'Max zoom level:', 'wpsl' ); ?></label>
217
- <?php echo $this->show_cluster_options( 'cluster_zoom' ); ?>
218
  </p>
219
- <p class="wpsl-cluster-options" <?php if ( !$this->settings['marker_clusters'] ) { echo 'style="display:none;"'; } ?>>
220
- <label for="wpsl-marker-cluster-size"><?php _e( 'Cluster size:', 'wpsl' ); ?></label>
221
- <?php echo $this->show_cluster_options( 'cluster_size' ); ?>
 
 
 
222
  </p>
223
- <em><?php _e( '* Recommended for maps with a large amounts of markers.', 'wpsl' ); ?></em>
224
  </div>
225
  </div>
226
  </div>
227
  </div>
228
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  <div class="postbox-container">
230
  <div class="metabox-holder">
231
- <div class="postbox">
232
- <h3><span><?php _e( 'Store Editor Settings', 'wpsl' ); ?></span></h3>
233
  <div class="inside">
234
  <p>
235
- <label for="wpsl-editor-country"><?php _e( 'Default country that will be used on the "Add Store" page.', 'wpsl' ); ?></label>
236
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['editor_country'] ) ); ?>" name="wpsl_editor[default_country]" class="textinput" id="wpsl-editor-country">
 
 
 
 
 
 
 
 
 
 
 
 
237
  </p>
238
  </div>
239
  </div>
@@ -242,93 +364,122 @@
242
 
243
  <div class="postbox-container">
244
  <div class="metabox-holder">
245
- <div class="postbox">
246
- <h3><span><?php _e( 'Labels', 'wpsl' ); ?></span></h3>
247
  <div class="inside">
248
  <p>
249
- <label for="wpsl-search"><?php _e( 'Your location:', 'wpsl' ); ?></label>
250
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['search_label'] ) ); ?>" name="wpsl_label[search]" class="textinput" id="wpsl-search">
 
 
 
 
251
  </p>
252
  <p>
253
- <label for="wpsl-search-radius"><?php _e( 'Search radius:', 'wpsl' ); ?></label>
254
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['radius_label'] ) ); ?>" name="wpsl_label[radius]" class="textinput" id="wpsl-search-radius">
255
  </p>
256
  <p>
257
- <label for="wpsl-no-results"><?php _e( 'No results found:', 'wpsl' ); ?></label>
258
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['no_results_label'] ) ); ?>" name="wpsl_label[no_results]" class="textinput" id="wpsl-no-results">
259
  </p>
260
  <p>
261
- <label for="wpsl-search-btn"><?php _e( 'Search:', 'wpsl' ); ?></label>
262
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['search_btn_label'] ) ); ?>" name="wpsl_label[search_btn]" class="textinput" id="wpsl-search-btn">
263
  </p>
264
  <p>
265
- <label for="wpsl-preloader"><?php _e( 'Searching (preloader text):', 'wpsl' ); ?></label>
266
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['preloader_label'] ) ); ?>" name="wpsl_label[preloader]" class="textinput" id="wpsl-preloader">
267
  </p>
268
  <p>
269
- <label for="wpsl-results"><?php _e( 'Results:', 'wpsl' ); ?></label>
270
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['results_label'] ) ); ?>" name="wpsl_label[results]" class="textinput" id="wpsl-results">
271
  </p>
272
  <p>
273
- <label for="wpsl-more-info"><?php _e( 'More info:', 'wpsl' ); ?></label>
274
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['more_label'] ) ); ?>" name="wpsl_label[more]" class="textinput" id="wpsl-more-info">
275
  </p>
276
  <p>
277
- <label for="wpsl-phone"><?php _e( 'Phone:', 'wpsl' ); ?></label>
278
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['phone_label'] ) ); ?>" name="wpsl_label[phone]" class="textinput" id="wpsl-phone">
279
  </p>
280
  <p>
281
- <label for="wpsl-fax"><?php _e( 'Fax:', 'wpsl' ); ?></label>
282
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['fax_label'] ) ); ?>" name="wpsl_label[fax]" class="textinput" id="wpsl-fax">
283
  </p>
284
  <p>
285
- <label for="wpsl-hours"><?php _e( 'Hours:', 'wpsl' ); ?></label>
286
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['hours_label'] ) ); ?>" name="wpsl_label[hours]" class="textinput" id="wpsl-hours">
287
  </p>
288
  <p>
289
- <label for="wpsl-start"><?php _e( 'Start location:', 'wpsl' ); ?></label>
290
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['start_label'] ) ); ?>" name="wpsl_label[start]" class="textinput" id="wpsl-start">
291
  </p>
292
  <p>
293
- <label for="wpsl-directions"><?php _e( 'Get directions:', 'wpsl' ); ?></label>
294
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['directions_label'] ) ); ?>" name="wpsl_label[directions]" class="textinput" id="wpsl-directions">
295
  </p>
296
  <p>
297
- <label for="wpsl-no-directions"><?php _e( 'No directions found:', 'wpsl' ); ?></label>
298
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['no_directions_label'] ) ); ?>" name="wpsl_label[no_directions]" class="textinput" id="wpsl-no-directions">
299
  </p>
300
  <p>
301
- <label for="wpsl-back"><?php _e( 'Back:', 'wpsl' ); ?></label>
302
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['back_label'] ) ); ?>" name="wpsl_label[back]" class="textinput" id="wpsl-back">
303
  </p>
304
  <p>
305
- <label for="wpsl-reset"><?php _e( 'Reset:', 'wpsl' ); ?></label>
306
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['reset_label'] ) ); ?>" name="wpsl_label[reset]" class="textinput" id="wpsl-reset">
307
  </p>
308
  <p>
309
- <label for="wpsl-street-view"><?php _e( 'Street view:', 'wpsl' ); ?></label>
310
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['street_view_label'] ) ); ?>" name="wpsl_label[street_view]" class="textinput" id="wpsl-street-view">
 
 
 
 
311
  </p>
312
  <p>
313
- <label for="wpsl-zoom-here"><?php _e( 'Zoom here:', 'wpsl' ); ?></label>
314
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['zoom_here_label'] ) ); ?>" name="wpsl_label[zoom_here]" class="textinput" id="wpsl-zoom-here">
315
  </p>
316
  <p>
317
- <label for="wpsl-error"><?php _e( 'General error:', 'wpsl' ); ?></label>
318
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['error_label'] ) ); ?>" name="wpsl_label[error]" class="textinput" id="wpsl-error">
319
  </p>
320
  <p>
321
- <label for="wpsl-limit"><?php _e( 'Query limit error:', 'wpsl' ); ?> *</label>
322
- <input type="text" value="<?php echo esc_attr( stripslashes( $this->settings['limit_label'] ) ); ?>" name="wpsl_label[limit]" class="textinput" id="wpsl-limit">
 
 
 
323
  </p>
324
- <em><?php echo sprintf( __( '* You can raise the <a href="%s">usage limit</a> by obtaining an API <a href="%s">key</a>, <br> and fill in the "API key" field at the top of this page.', 'wpsl' ), 'https://developers.google.com/maps/documentation/javascript/usage#usage_limits', 'https://developers.google.com/maps/documentation/javascript/tutorial#api_key' ); ?></em>
325
  </div>
326
  </div>
327
  </div>
328
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
 
330
- <input type="submit" value="<?php _e( 'Update Settings', 'wpsl' ); ?>" class="button-primary" name="wpsl-save-settings" id="wpsl-save-settings">
331
  <?php settings_fields( 'wpsl_settings' ); ?>
332
  </form>
333
-
334
  </div>
1
+ <?php global $wpdb, $wpsl, $wpsl_admin, $wp_version, $wpsl_settings; ?>
2
+
3
+ <div id="wpsl-wrap" class="wrap wpsl-settings <?php if ( floatval( $wp_version ) < 3.8 ) { echo 'wpsl-pre-38'; } // Fix CSS issue with < 3.8 versions ?>">
4
+ <h2>WP Store Locator <?php _e( 'Settings', 'wpsl' ); ?></h2>
5
+
6
+ <?php settings_errors(); ?>
7
+
8
+ <form id="wpsl-settings-form" method="post" action="options.php" autocomplete="off" accept-charset="utf-8">
 
 
 
 
9
  <div class="postbox-container">
10
  <div class="metabox-holder">
11
+ <div id="wpsl-api-settings" class="postbox">
12
+ <h3 class="hndle"><span><?php _e( 'Google Maps API', 'wpsl' ); ?></span></h3>
13
  <div class="inside">
14
  <p>
15
+ <label for="wpsl-api-key"><?php _e( 'API key', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'A valid %sAPI key%s allows you to monitor the API usage and is required if you need to purchase additional quota.', 'wpsl' ), '<a href="https://developers.google.com/maps/documentation/javascript/tutorial#api_key" target="_blank">', '</a>' ); ?></span></span></label>
16
+ <input type="text" value="<?php echo esc_attr( $wpsl_settings['api_key'] ); ?>" name="wpsl_api[key]" placeholder="<?php _e( 'Optional', 'wpsl' ); ?>" class="textinput" id="wpsl-api-key">
17
  </p>
18
  <p>
19
+ <label for="wpsl-api-language"><?php _e( 'Map language', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php _e( 'If no map language is selected the browser\'s prefered language is used.', 'wpsl' ); ?></span></span></label>
20
  <select id="wpsl-api-language" name="wpsl_api[language]">
21
+ <?php echo $wpsl_admin->settings_page->get_api_option_list( 'language' ); ?>
22
  </select>
23
  </p>
24
  <p>
25
+ <label for="wpsl-api-region"><?php _e( 'Map region', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'This will bias the geocoding results towards the selected region. %s If no region is selected the bias is set to the United States.', 'wpsl' ), '<br><br>' ); ?></span></span></label>
26
  <select id="wpsl-api-region" name="wpsl_api[region]">
27
+ <?php echo $wpsl_admin->settings_page->get_api_option_list( 'region' ); ?>
28
  </select>
29
  </p>
30
+ <p class="submit">
31
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
32
+ </p>
33
+ </div>
34
+ </div>
35
+ </div>
36
  </div>
37
+
38
+ <div class="postbox-container wpsl-search-settings">
39
  <div class="metabox-holder">
40
+ <div id="wpsl-search-settings" class="postbox">
41
+ <h3 class="hndle"><span><?php _e( 'Search', 'wpsl' ); ?></span></h3>
42
  <div class="inside">
43
  <p>
44
+ <label for="wpsl-results-dropdown"><?php _e( 'Show the max results dropdown?', 'wpsl' ); ?></label>
45
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['results_dropdown'], true ); ?> name="wpsl_search[results_dropdown]" id="wpsl-results-dropdown">
46
+ </p>
47
+ <p>
48
+ <label for="wpsl-radius-dropdown"><?php _e( 'Show the search radius dropdown?', 'wpsl' ); ?></label>
49
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['radius_dropdown'], true ); ?> name="wpsl_search[radius_dropdown]" id="wpsl-radius-dropdown">
50
  </p>
51
  <p>
52
+ <label for="wpsl-category-dropdown"><?php _e( 'Show the category dropdown?', 'wpsl' ); ?></label>
53
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['category_dropdown'], true ); ?> name="wpsl_search[category_dropdown]" id="wpsl-category-dropdown">
54
  </p>
55
  <p>
56
+ <label for="wpsl-distance-unit"><?php _e( 'Distance unit', 'wpsl' ); ?>:</label>
57
+ <span class="wpsl-radioboxes">
58
+ <input type="radio" autocomplete="off" value="km" <?php checked( 'km', $wpsl_settings['distance_unit'] ); ?> name="wpsl_search[distance_unit]" id="wpsl-distance-km">
59
+ <label for="wpsl-distance-km"><?php _e( 'km', 'wpsl' ); ?></label>
60
+ <input type="radio" autocomplete="off" value="mi" <?php checked( 'mi', $wpsl_settings['distance_unit'] ); ?> name="wpsl_search[distance_unit]" id="wpsl-distance-mi">
61
+ <label for="wpsl-distance-mi"><?php _e( 'mi', 'wpsl' ); ?></label>
62
+ </span>
63
+ </p>
64
+ <p>
65
+ <label for="wpsl-max-results"><?php _e( 'Max search results', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php _e( 'The default value is set between the [ ].', 'wpsl' ); ?></span></span></label>
66
+ <input type="text" value="<?php echo esc_attr( $wpsl_settings['max_results'] ); ?>" name="wpsl_search[max_results]" class="textinput" id="wpsl-max-results">
67
  </p>
68
  <p>
69
+ <label for="wpsl-search-radius"><?php _e( 'Search radius options', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php _e( 'The default value is set between the [ ].', 'wpsl' ); ?></span></span></label>
70
+ <input type="text" value="<?php echo esc_attr( $wpsl_settings['search_radius'] ); ?>" name="wpsl_search[radius]" class="textinput" id="wpsl-search-radius">
71
+ </p>
72
+ <p class="submit">
73
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
74
+ </p>
75
  </div>
76
  </div>
77
  </div>
78
  </div>
79
+
80
  <div class="postbox-container">
81
  <div class="metabox-holder">
82
+ <div id="wpsl-map-settings" class="postbox">
83
+ <h3 class="hndle"><span><?php _e( 'Map', 'wpsl' ); ?></span></h3>
84
  <div class="inside">
85
  <p>
86
+ <label for="wpsl-auto-locate"><?php _e( 'Attempt to auto-locate the user', 'wpsl' ); ?>:</label>
87
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['auto_locate'], true ); ?> name="wpsl_map[auto_locate]" id="wpsl-auto-locate">
88
  </p>
89
  <p>
90
+ <label for="wpsl-autoload"><?php _e( 'Load locations on page load', 'wpsl' ); ?>:</label>
91
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['autoload'], true ); ?> name="wpsl_map[autoload]" id="wpsl-autoload">
92
+ </p>
93
+ <p id="wpsl-autoload-options" <?php if ( !$wpsl_settings['autoload'] ) { echo 'style="display:none;"'; } ?>>
94
+ <label for="wpsl-autoload-limit"><?php _e( 'Number of locations to show', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'Although the location data is cached after the first load, a lower number will result in the map being more responsive. %s If this field is left empty or set to 0, then all locations are loaded.', 'wpsl' ), '<br><br>' ); ?></span></span></label>
95
+ <input type="text" value="<?php echo esc_attr( $wpsl_settings['autoload_limit'] ); ?>" name="wpsl_map[autoload_limit]" class="textinput" id="wpsl-autoload-limit">
96
+ </p>
97
+ <p>
98
+ <label for="wpsl-zoom-name"><?php _e( 'Start point', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( '%sRequired field.%s %s If auto-locating the user is disabled or fails, the center of the provided city or country will be used as the initial starting point for the user.', 'wpsl' ), '<strong>', '</strong>', '<br><br>' ); ?></span></span></label>
99
+ <input type="text" value="<?php echo esc_attr( $wpsl_settings['zoom_name'] ); ?>" name="wpsl_map[zoom_name]" class="textinput" id="wpsl-zoom-name">
100
+ <input type="hidden" value="<?php echo esc_attr( $wpsl_settings['zoom_latlng'] ); ?>" name="wpsl_map[zoom_latlng]" id="wpsl-latlng" />
101
+ </p>
102
  <p>
103
+ <label for="wpsl-zoom-level"><?php _e( 'Initial zoom level', 'wpsl' ); ?>:</label>
104
+ <?php echo $wpsl_admin->settings_page->show_zoom_levels(); ?>
 
105
  </p>
106
  <p>
107
+ <label for="wpsl-max-zoom-level"><?php _e( 'Max auto zoom level', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'This value sets the zoom level for the "Zoom here" link in the info window. %s It is also used to limit the zooming when the viewport of the map is changed to make all the markers fit on the screen.', 'wpsl' ), '<br><br>' ); ?></span></span></label>
108
+ <?php echo $wpsl_admin->settings_page->create_dropdown( 'max_zoom_level' ); ?>
109
+ </p>
110
+ <p>
111
+ <label for="wpsl-streetview"><?php _e( 'Show the street view controls?', 'wpsl' ); ?></label>
112
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['streetview'], true ); ?> name="wpsl_map[streetview]" id="wpsl-streetview">
113
  </p>
114
  <p>
115
+ <label for="wpsl-pan-controls"><?php _e( 'Show the pan controls?', 'wpsl' ); ?></label>
116
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['pan_controls'], true ); ?> name="wpsl_map[pan_controls]" id="wpsl-pan-controls">
117
  </p>
118
  <p>
119
+ <label for="wpsl-type-control"><?php _e( 'Show the map type control?', 'wpsl' ); ?></label>
120
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['type_control'], true ); ?> name="wpsl_map[type_control]" id="wpsl-type-control">
121
  </p>
122
  <p>
123
+ <label for="wpsl-scollwheel-zoom"><?php _e( 'Enable scroll wheel zooming?', 'wpsl' ); ?></label>
124
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['scrollwheel'], true ); ?> name="wpsl_map[scrollwheel]" id="wpsl-scollwheel-zoom">
125
+ </p>
126
  <p>
127
+ <label><?php _e( 'Zoom control position', 'wpsl' ); ?>:</label>
128
+ <span class="wpsl-radioboxes">
129
+ <input type="radio" autocomplete="off" value="left" <?php checked( 'left', $wpsl_settings['control_position'], true ); ?> name="wpsl_map[control_position]" id="wpsl-control-left">
130
  <label for="wpsl-control-left"><?php _e( 'Left', 'wpsl' ); ?></label>
131
+ <input type="radio" autocomplete="off" value="right" <?php checked( 'right', $wpsl_settings['control_position'], true ); ?> name="wpsl_map[control_position]" id="wpsl-control-right">
132
  <label for="wpsl-control-right"><?php _e( 'Right', 'wpsl' ); ?></label>
133
  </span>
134
  </p>
135
  <p>
136
+ <label><?php _e( 'Zoom control style', 'wpsl' ); ?>:</label>
137
+ <span class="wpsl-radioboxes">
138
+ <input type="radio" autocomplete="off" value="small" <?php checked( 'small', $wpsl_settings['control_style'], true ); ?> name="wpsl_map[control_style]" id="wpsl-small-style">
139
  <label for="wpsl-small-style"><?php _e( 'Small', 'wpsl' ); ?></label>
140
+ <input type="radio" autocomplete="off" value="large" <?php checked( 'large', $wpsl_settings['control_style'], true ); ?> name="wpsl_map[control_style]" id="wpsl-large-style">
141
  <label for="wpsl-large-style"><?php _e( 'Large', 'wpsl' ); ?></label>
142
  </span>
143
  </p>
144
+ <p>
145
+ <label for="wpsl-map-type"><?php _e( 'Map type', 'wpsl' ); ?>:</label>
146
+ <?php echo $wpsl_admin->settings_page->create_dropdown( 'map_types' ); ?>
147
+ </p>
148
+ <p>
149
+ <label for="wpsl-map-style"><?php _e( 'Map style', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php _e( 'Custom map styles only work if the map type is set to "Roadmap" or "Terrain".', 'wpsl' ); ?></span></span></label>
150
+ </p>
151
+ <div class="wpsl-style-input">
152
+ <p><?php echo sprintf( __( 'You can use existing map styles from %sSnazzy Maps%s or %sMap Stylr%s and paste it in the textarea below, or you can generate a custom map style through the %sMap Style Editor%s or %sStyled Maps Wizard%s.', 'wpsl' ), '<a target="_blank" href="http://snazzymaps.com">', '</a>', '<a target="_blank" href="http://mapstylr.com">', '</a>', '<a target="_blank" href="http://mapstylr.com/map-style-editor/">', '</a>', '<a target="_blank" href="http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html">', '</a>' ); ?></p>
153
+ <p><?php echo sprintf( __( 'If you like to write the style code yourself, then you can find the documentation from Google %shere%s.', 'wpsl' ), '<a target="_blank" href="https://developers.google.com/maps/documentation/javascript/styling">', '</a>' ); ?></p>
154
+ <textarea id="wpsl-map-style" name="wpsl_map[map_style]"><?php echo strip_tags( stripslashes( json_decode( $wpsl_settings['map_style'] ) ) ); ?></textarea>
155
+ <input type="submit" value="<?php _e( 'Preview Map Style', 'wpsl' ); ?>" class="button-primary" name="wpsl-style-preview" id="wpsl-style-preview">
156
+ </div>
157
+ <div id="wpsl-gmap-wrap" class="wpsl-styles-preview"></div>
158
+ <p>
159
+ <label for="wpsl-show-credits"><?php _e( 'Show credits?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php _e( 'This will place a "Search provided by WP Store Locator" backlink below the map.', 'wpsl' ); ?></span></span></label>
160
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['show_credits'], true ); ?> name="wpsl_credits" id="wpsl-show-credits">
161
+ </p>
162
+ <p class="submit">
163
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
164
+ </p>
165
  </div>
166
  </div>
167
  </div>
169
 
170
  <div class="postbox-container">
171
  <div class="metabox-holder">
172
+ <div id="wpsl-user-experience" class="postbox">
173
+ <h3 class="hndle"><span><?php _e( 'User Experience', 'wpsl' ); ?></span></h3>
174
  <div class="inside">
175
  <p>
176
+ <label for="wpsl-design-height"><?php _e( 'Store Locator height', 'wpsl' ); ?>:</label>
177
+ <input size="3" value="<?php echo esc_attr( $wpsl_settings['height'] ); ?>" id="wpsl-design-height" name="wpsl_ux[height]"> px
178
  </p>
179
  <p>
180
+ <label for="wpsl-infowindow-width"><?php _e( 'Max width for the info window content', 'wpsl' ); ?>:</label>
181
+ <input size="3" value="<?php echo esc_attr( $wpsl_settings['infowindow_width'] ); ?>" id="wpsl-infowindow-width" name="wpsl_ux[infowindow_width]"> px
182
  </p>
183
  <p>
184
+ <label for="wpsl-search-width"><?php _e( 'Search field width', 'wpsl' ); ?>:</label>
185
+ <input size="3" value="<?php echo esc_attr( $wpsl_settings['search_width'] ); ?>" id="wpsl-search-width" name="wpsl_ux[search_width]"> px
186
  </p>
187
  <p>
188
+ <label for="wpsl-label-width"><?php _e( 'Search and radius label width', 'wpsl' ); ?>:</label>
189
+ <input size="3" value="<?php echo esc_attr( $wpsl_settings['label_width'] ); ?>" id="wpsl-label-width" name="wpsl_ux[label_width]"> px
190
  </p>
191
  <p>
192
+ <label for="wpsl-store-template"><?php _e( 'Store Locator template', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'The selected template is used with the [wpsl] shortcode. %s You can add a custom template with the %swpsl_templates%s filter.', 'wpsl' ), '<br><br>', '<a href="http://wpstorelocator.co/document/wpsl_templates/">', '</a>' ); ?></span></span></label>
193
+ <?php echo $wpsl_admin->settings_page->show_template_options(); ?>
194
  </p>
195
+ <p id="wpsl-listing-below-no-scroll" <?php if ( $wpsl_settings['template_id'] != 'below_map' ) { echo 'style="display:none;"'; } ?>>
196
  <label for="wpsl-more-info-list"><?php _e( 'Hide the scrollbar?', 'wpsl' ); ?></label>
197
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['listing_below_no_scroll'], true ); ?> name="wpsl_ux[listing_below_no_scroll]" id="wpsl-listing-below-no-scroll">
 
 
 
 
198
  </p>
199
  <p>
200
  <label for="wpsl-new-window"><?php _e( 'Open links in a new window?', 'wpsl' ); ?></label>
201
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['new_window'], true ); ?> name="wpsl_ux[new_window]" id="wpsl-new-window">
202
  </p>
203
  <p>
204
  <label for="wpsl-reset-map"><?php _e( 'Show a reset map button?', 'wpsl' ); ?></label>
205
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['reset_map'], true ); ?> name="wpsl_ux[reset_map]" id="wpsl-reset-map">
206
  </p>
207
  <p>
208
+ <label for="wpsl-direction-redirect"><?php _e( 'When a user clicks on "Directions", open a new window, and show the route on google.com/maps ?', 'wpsl' ); ?></label>
209
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['direction_redirect'], true ); ?> name="wpsl_ux[direction_redirect]" id="wpsl-direction-redirect">
210
  </p>
211
  <p>
212
+ <label for="wpsl-more-info"><?php _e( 'Show a "More info" link in the store listings?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'This places a "More Info" link below the address and will show the phone, fax, email, opening hours and description once the link is clicked. %s If you for example want the contact details to always be visible, then please follow the instructions on %sthis%s page.', 'wpsl' ), '<br><br>', '<a href="http://wpstorelocator.co/document/include-contact-details-in-search-results/">', '</a>' ); ?></span></span></label>
213
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['more_info'], true ); ?> name="wpsl_ux[more_info]" id="wpsl-more-info">
214
+ </p>
215
+ <p id="wpsl-more-info-options" <?php if ( !$wpsl_settings['more_info'] ) { echo 'style="display:none;"'; } ?>>
216
  <label for="wpsl-more-info-list"><?php _e( 'Where do you want to show the "More info" details?', 'wpsl' ); ?></label>
217
+ <?php echo $wpsl_admin->settings_page->create_dropdown( 'more_info' ); ?>
218
  </p>
219
  <p>
220
+ <label for="wpsl-store-url"><?php _e( 'Make the store name clickable if a store URL exists?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'If %spermalinks%s are enabled, the store name will always link to the store page.', 'wpsl' ), '<a href="' . admin_url( 'edit.php?post_type=wpsl_stores&page=wpsl_settings#wpsl-permalink-settings' ) . '">', '</a>' ); ?></span></span></label>
221
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['store_url'], true ); ?> name="wpsl_ux[store_url]" id="wpsl-store-url">
222
  </p>
223
  <p>
224
  <label for="wpsl-phone-url"><?php _e( 'Make the phone number clickable on mobile devices?', 'wpsl' ); ?></label>
225
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['phone_url'], true ); ?> name="wpsl_ux[phone_url]" id="wpsl-phone-url">
226
  </p>
227
  <p>
228
+ <label for="wpsl-marker-streetview"><?php _e( 'If street view is available for the current location, then show a "Street view" link in the info window?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'Enabling this option can sometimes result in a small delay in the opening of the info window. %s This happens because an API request is made to Google Maps to check if street view is available for the current location.', 'wpsl' ), '<br><br>' ); ?></span></span></label>
229
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['marker_streetview'], true ); ?> name="wpsl_ux[marker_streetview]" id="wpsl-marker-streetview">
230
  </p>
231
  <p>
232
+ <label for="wpsl-marker-zoom-to"><?php _e( 'Show a "Zoom here" link in the info window?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'Clicking this link will make the map zoom in to the %s max auto zoom level %s.', 'wpsl' ), '<a href="#wpsl-zoom-level">', '</a>' ); ?></span></span></label>
233
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['marker_zoom_to'], true ); ?> name="wpsl_ux[marker_zoom_to]" id="wpsl-marker-zoom-to">
234
  </p>
235
  <p>
236
+ <label for="wpsl-mouse-focus"><?php _e( 'On page load move the mouse cursor to the search field?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'If the store locator is not placed at the top of the page, enabling this feature can result in the page scrolling down. %s %sThis option is disabled on mobile devices.%s', 'wpsl' ), '<br><br>', '<em>', '</em>' ); ?></span></span></label>
237
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['mouse_focus'], true ); ?> name="wpsl_ux[mouse_focus]" id="wpsl-mouse-focus">
238
+ </p>
239
+ <p>
240
+ <label for="wpsl-infowindow-style"><?php _e( 'Use the default style for the info window?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'If the default style is disabled the %sInfoBox%s library will be used instead. %s This enables you to easily change the look and feel of the info window through the .wpsl-infobox css class.', 'wpsl' ), '<a href="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html" target="_blank">', '</a>', '<br><br>' ); ?></span></span></label>
241
+ <input type="checkbox" value="default" <?php checked( $wpsl_settings['infowindow_style'], 'default' ); ?> name="wpsl_ux[infowindow_style]" id="wpsl-infowindow-style">
242
+ </p>
243
+ <p>
244
+ <label for="wpsl-hide-distance"><?php _e( 'Hide the distance in the search results?', 'wpsl' ); ?></label>
245
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['hide_distance'], true ); ?> name="wpsl_ux[hide_distance]" id="wpsl-hide-distance">
246
+ </p>
247
+ <p>
248
+ <label for="wpsl-bounce"><?php _e( 'If a user hovers over the search results the store marker', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'If marker clusters are enabled this option will not work as expected as long as the markers are clustered. %s The bouncing of the marker won\'t be visible at all unless a user zooms in far enough for the marker cluster to change back in to individual markers. %s The info window will open as expected, but it won\'t be clear to which marker it belongs to. ', 'wpsl' ), '<br><br>' , '<br><br>' ); ?></span></span></label>
249
+ <?php echo $wpsl_admin->settings_page->create_dropdown( 'marker_effects' ); ?>
250
+ </p>
251
+ <p>
252
+ <label for="wpsl-address-format"><?php _e( 'Address format', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'You can add custom address formats with the %swpsl_address_formats%s filter.', 'wpsl' ), '<a href="http://wpstorelocator.co/document/wpsl_address_formats/">', '</a>' ); ?></span></span></label>
253
+ <?php echo $wpsl_admin->settings_page->create_dropdown( 'address_format' ); ?>
254
+ </p>
255
+ <p class="submit">
256
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
257
+ </p>
258
  </div>
259
  </div>
260
  </div>
261
  </div>
262
+
263
  <div class="postbox-container">
264
  <div class="metabox-holder">
265
+ <div id="wpsl-marker-settings" class="postbox">
266
+ <h3 class="hndle"><span><?php _e( 'Markers', 'wpsl' ); ?></span></h3>
267
  <div class="inside">
268
+ <?php echo $wpsl_admin->settings_page->show_marker_options(); ?>
269
  <p>
270
+ <label for="wpsl-marker-clusters"><?php _e( 'Enable marker clusters?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php _e( 'Recommended for maps with a large amount of markers.', 'wpsl' ); ?></span></span></label>
271
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['marker_clusters'], true ); ?> name="wpsl_map[marker_clusters]" id="wpsl-marker-clusters">
272
  </p>
273
+ <p class="wpsl-cluster-options" <?php if ( !$wpsl_settings['marker_clusters'] ) { echo 'style="display:none;"'; } ?>>
274
+ <label for="wpsl-marker-zoom"><?php _e( 'Max zoom level', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php _e( 'If this zoom level is reached or exceeded, then all markers are moved out of the marker cluster and shown as individual markers.', 'wpsl' ); ?></span></span></label>
275
+ <?php echo $wpsl_admin->settings_page->show_cluster_options( 'cluster_zoom' ); ?>
276
  </p>
277
+ <p class="wpsl-cluster-options" <?php if ( !$wpsl_settings['marker_clusters'] ) { echo 'style="display:none;"'; } ?>>
278
+ <label for="wpsl-marker-cluster-size"><?php _e( 'Cluster size', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'The grid size of a cluster in pixels. %s A larger number will result in a lower amount of clusters and also make the algorithm run faster.', 'wpsl' ), '<br><br>' ); ?></span></span></label>
279
+ <?php echo $wpsl_admin->settings_page->show_cluster_options( 'cluster_size' ); ?>
280
+ </p>
281
+ <p class="submit">
282
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
283
  </p>
 
284
  </div>
285
  </div>
286
  </div>
287
  </div>
288
+
289
+ <div class="postbox-container">
290
+ <div class="metabox-holder">
291
+ <div id="wpsl-store-editor-settings" class="postbox">
292
+ <h3 class="hndle"><span><?php _e( 'Store Editor', 'wpsl' ); ?></span></h3>
293
+ <div class="inside">
294
+ <p>
295
+ <label for="wpsl-editor-country"><?php _e( 'Default country', 'wpsl' ); ?>:</label>
296
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'editor_country', '' ) ); ?>" name="wpsl_editor[default_country]" class="textinput" id="wpsl-editor-country">
297
+ </p>
298
+ <p>
299
+ <label for="wpsl-editor-map-type"><?php _e( 'Map type for the location preview', 'wpsl' ); ?>:</label>
300
+ <?php echo $wpsl_admin->settings_page->create_dropdown( 'editor_map_types' ); ?>
301
+ </p>
302
+ <p>
303
+ <label for="wpsl-editor-hide-hours"><?php _e( 'Hide the opening hours?', 'wpsl' ); ?></label>
304
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['hide_hours'], true ); ?> name="wpsl_editor[hide_hours]" id="wpsl-editor-hide-hours">
305
+ </p>
306
+ <div class="wpsl-hours" <?php if ( $wpsl_settings['hide_hours'] ) { echo 'style="display:none"'; } ?>>
307
+ <?php if ( get_option( 'wpsl_legacy_support' ) ) { // Is only set for users who upgraded from 1.x ?>
308
+ <p>
309
+ <label for="wpsl-editor-hour-input"><?php _e( 'Opening hours input type', 'wpsl' ); ?>:</label>
310
+ <?php echo $wpsl_admin->settings_page->create_dropdown( 'hour_input' ); ?>
311
+ </p>
312
+ <p class="wpsl-hour-notice <?php if ( $wpsl_settings['editor_hour_input'] !== 'dropdown' ) { echo 'style="display:none"'; } ?>">
313
+ <em><?php echo sprintf( __( 'Opening hours created in version 1.x %sare not%s automatically converted to the new dropdown format.', 'wpsl' ), '<strong>', '</strong>' ); ?></em>
314
+ </p>
315
+ <div class="wpsl-textarea-hours" <?php if ( $wpsl_settings['editor_hour_input'] !== 'textarea' ) { echo 'style="display:none"'; } ?>>
316
+ <p class="wpsl-default-hours"><strong><?php _e( 'The default opening hours', 'wpsl' ); ?></strong></p>
317
+ <textarea rows="5" cols="5" name="wpsl_editor[textarea]" id="wpsl-textarea-hours"><?php if ( isset( $wpsl_settings['editor_hours']['textarea'] ) ) { echo esc_textarea( stripslashes( $wpsl_settings['editor_hours']['textarea'] ) ); } ?></textarea>
318
+ </div>
319
+ <?php } ?>
320
+ <div class="wpsl-dropdown-hours" <?php if ( $wpsl_settings['editor_hour_input'] !== 'dropdown' ) { echo 'style="display:none"'; } ?>>
321
+ <p>
322
+ <label for="wpsl-editor-hour-format"><?php _e( 'Opening hours format', 'wpsl' ); ?>:</label>
323
+ <?php echo $wpsl_admin->settings_page->show_opening_hours_format(); ?>
324
+ </p>
325
+ <p class="wpsl-default-hours"><strong><?php _e( 'The default opening hours', 'wpsl' ); ?></strong></p>
326
+ <?php echo $wpsl_admin->metaboxes->opening_hours( 'settings' ); ?>
327
+ </div>
328
+ </div>
329
+ <p><em><?php _e( 'The default country and opening hours are only used when a new store is created. So changing the default values will have no effect on existing store locations.', 'wpsl' ); ?></em></p>
330
+
331
+ <p class="submit">
332
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
333
+ </p>
334
+ </div>
335
+ </div>
336
+ </div>
337
+ </div>
338
+
339
  <div class="postbox-container">
340
  <div class="metabox-holder">
341
+ <div id="wpsl-permalink-settings" class="postbox">
342
+ <h3 class="hndle"><span><?php _e( 'Permalink', 'wpsl' ); ?></span></h3>
343
  <div class="inside">
344
  <p>
345
+ <label for="wpsl-permalinks-active"><?php _e( 'Enable permalink?', 'wpsl' ); ?></label>
346
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['permalinks'], true ); ?> name="wpsl_permalinks[active]" id="wpsl-permalinks-active">
347
+ </p>
348
+ <p class="wpsl-permalink-option" <?php if ( !$wpsl_settings['permalinks'] ) { echo 'style="display:none;"'; } ?>>
349
+ <label for="wpsl-permalinks-slug"><?php _e( 'Store slug', 'wpsl' ); ?>:</label>
350
+ <input type="text" value="<?php echo esc_attr( $wpsl_settings['permalink_slug'] ); ?>" name="wpsl_permalinks[slug]" class="textinput" id="wpsl-permalinks-slug">
351
+ </p>
352
+ <p class="wpsl-permalink-option" <?php if ( !$wpsl_settings['permalinks'] ) { echo 'style="display:none;"'; } ?>>
353
+ <label for="wpsl-category-slug"><?php _e( 'Category slug', 'wpsl' ); ?>:</label>
354
+ <input type="text" value="<?php echo esc_attr( $wpsl_settings['category_slug'] ); ?>" name="wpsl_permalinks[category_slug]" class="textinput" id="wpsl-category-slug">
355
+ </p>
356
+ <em class="wpsl-permalink-option"><?php echo sprintf( __( 'The permalink slugs %smust be unique%s on your site.', 'wpsl' ), '<strong>', '</strong>' ); ?></em>
357
+ <p class="submit">
358
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
359
  </p>
360
  </div>
361
  </div>
364
 
365
  <div class="postbox-container">
366
  <div class="metabox-holder">
367
+ <div id="wpsl-label-settings" class="postbox">
368
+ <h3 class="hndle"><span><?php _e( 'Labels', 'wpsl' ); ?></span></h3>
369
  <div class="inside">
370
  <p>
371
+ <label for="wpsl-search"><?php _e( 'Your location', 'wpsl' ); ?>:</label>
372
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'search_label', __( 'Your location', 'wpsl' ) ) ); ?>" name="wpsl_label[search]" class="textinput" id="wpsl-search">
373
+ </p>
374
+ <p>
375
+ <label for="wpsl-search-radius"><?php _e( 'Search radius', 'wpsl' ); ?>:</label>
376
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'radius_label', __( 'Search radius', 'wpsl' ) ) ); ?>" name="wpsl_label[radius]" class="textinput" id="wpsl-search-radius">
377
  </p>
378
  <p>
379
+ <label for="wpsl-no-results"><?php _e( 'No results found', 'wpsl' ); ?>:</label>
380
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'no_results_label', __( 'No results found', 'wpsl' ) ) ); ?>" name="wpsl_label[no_results]" class="textinput" id="wpsl-no-results">
381
  </p>
382
  <p>
383
+ <label for="wpsl-search-btn"><?php _e( 'Search', 'wpsl' ); ?>:</label>
384
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'search_btn_label', __( 'Search', 'wpsl' ) ) ); ?>" name="wpsl_label[search_btn]" class="textinput" id="wpsl-search-btn">
385
  </p>
386
  <p>
387
+ <label for="wpsl-preloader"><?php _e( 'Searching (preloader text)', 'wpsl' ); ?>:</label>
388
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'preloader_label', __( 'Searching...', 'wpsl' ) ) ); ?>" name="wpsl_label[preloader]" class="textinput" id="wpsl-preloader">
389
  </p>
390
  <p>
391
+ <label for="wpsl-results"><?php _e( 'Results', 'wpsl' ); ?>:</label>
392
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'results_label', __( 'Results', 'wpsl' ) ) ); ?>" name="wpsl_label[results]" class="textinput" id="wpsl-results">
393
  </p>
394
  <p>
395
+ <label for="wpsl-category"><?php _e( 'Category filter', 'wpsl' ); ?>:</label>
396
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'category_label', __( 'Category', 'wpsl' ) ) ); ?>" name="wpsl_label[category]" class="textinput" id="wpsl-category">
397
  </p>
398
  <p>
399
+ <label for="wpsl-more-info"><?php _e( 'More info', 'wpsl' ); ?>:</label>
400
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'more_label', __( 'More info', 'wpsl' ) ) ); ?>" name="wpsl_label[more]" class="textinput" id="wpsl-more-info">
401
  </p>
402
  <p>
403
+ <label for="wpsl-phone"><?php _e( 'Phone', 'wpsl' ); ?>:</label>
404
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'phone_label', __( 'Phone', 'wpsl' ) ) ); ?>" name="wpsl_label[phone]" class="textinput" id="wpsl-phone">
405
  </p>
406
  <p>
407
+ <label for="wpsl-fax"><?php _e( 'Fax', 'wpsl' ); ?>:</label>
408
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'fax_label', __( 'Fax', 'wpsl' ) ) ); ?>" name="wpsl_label[fax]" class="textinput" id="wpsl-fax">
409
  </p>
410
  <p>
411
+ <label for="wpsl-email"><?php _e( 'Email', 'wpsl' ); ?>:</label>
412
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'email_label', __( 'Email', 'wpsl' ) ) ); ?>" name="wpsl_label[email]" class="textinput" id="wpsl-email">
413
  </p>
414
  <p>
415
+ <label for="wpsl-url"><?php _e( 'Url', 'wpsl' ); ?>:</label>
416
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'url_label', __( 'Url', 'wpsl' ) ) ); ?>" name="wpsl_label[url]" class="textinput" id="wpsl-url">
417
  </p>
418
  <p>
419
+ <label for="wpsl-hours"><?php _e( 'Hours', 'wpsl' ); ?>:</label>
420
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'hours_label', __( 'Hours', 'wpsl' ) ) ); ?>" name="wpsl_label[hours]" class="textinput" id="wpsl-hours">
421
  </p>
422
  <p>
423
+ <label for="wpsl-start"><?php _e( 'Start location', 'wpsl' ); ?>:</label>
424
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'start_label', __( 'Start location', 'wpsl' ) ) ); ?>" name="wpsl_label[start]" class="textinput" id="wpsl-start">
425
  </p>
426
  <p>
427
+ <label for="wpsl-directions"><?php _e( 'Get directions', 'wpsl' ); ?>:</label>
428
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'directions_label', __( 'Directions', 'wpsl' ) ) ); ?>" name="wpsl_label[directions]" class="textinput" id="wpsl-directions">
429
  </p>
430
  <p>
431
+ <label for="wpsl-no-directions"><?php _e( 'No directions found', 'wpsl' ); ?>:</label>
432
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'no_directions_label', __( 'No route could be found between the origin and destination', 'wpsl' ) ) ); ?>" name="wpsl_label[no_directions]" class="textinput" id="wpsl-no-directions">
433
  </p>
434
  <p>
435
+ <label for="wpsl-back"><?php _e( 'Back', 'wpsl' ); ?>:</label>
436
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'back_label', __( 'Back', 'wpsl' ) ) ); ?>" name="wpsl_label[back]" class="textinput" id="wpsl-back">
437
+ </p>
438
+ <p>
439
+ <label for="wpsl-street-view"><?php _e( 'Street view', 'wpsl' ); ?>:</label>
440
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'street_view_label', __( 'Street view', 'wpsl' ) ) ); ?>" name="wpsl_label[street_view]" class="textinput" id="wpsl-street-view">
441
  </p>
442
  <p>
443
+ <label for="wpsl-zoom-here"><?php _e( 'Zoom here', 'wpsl' ); ?>:</label>
444
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'zoom_here_label', __( 'Zoom here', 'wpsl' ) ) ); ?>" name="wpsl_label[zoom_here]" class="textinput" id="wpsl-zoom-here">
445
  </p>
446
  <p>
447
+ <label for="wpsl-error"><?php _e( 'General error', 'wpsl' ); ?>:</label>
448
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'error_label', __( 'Something went wrong, please try again!', 'wpsl' ) ) ); ?>" name="wpsl_label[error]" class="textinput" id="wpsl-error">
449
  </p>
450
  <p>
451
+ <label for="wpsl-limit"><?php _e( 'Query limit error', 'wpsl' ); ?>:<span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'You can raise the %susage limit%s by obtaining an API %skey%s, and fill in the "API key" field at the top of this page.', 'wpsl' ), '<a href="https://developers.google.com/maps/documentation/javascript/usage#usage_limits" target="_blank">', '</a>' ,'<a href="https://developers.google.com/maps/documentation/javascript/tutorial#api_key" target="_blank">', '</a>' ); ?></span></span></label>
452
+ <input type="text" value="<?php echo esc_attr( $wpsl->i18n->get_translation( 'limit_label', __( 'API usage limit reached', 'wpsl' ) ) ); ?>" name="wpsl_label[limit]" class="textinput" id="wpsl-limit">
453
+ </p>
454
+ <p class="submit">
455
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
456
  </p>
 
457
  </div>
458
  </div>
459
  </div>
460
  </div>
461
+
462
+ <div class="postbox-container">
463
+ <div class="metabox-holder">
464
+ <div id="wpsl-tools" class="postbox">
465
+ <h3 class="hndle"><span><?php _e( 'Tools', 'wpsl' ); ?></span></h3>
466
+ <div class="inside">
467
+ <p>
468
+ <label for="wpsl-debug"><?php _e( 'Enable store locator debug?', 'wpsl' ); ?><span class="wpsl-info"><span class="wpsl-info-text wpsl-hide"><?php echo sprintf( __( 'This disables the WPSL transient cache. %sThe transient cache is only used if the %sLoad locations on page load%s option is enabled.', 'wpsl' ), '<br><br>', '<em>', '</em>' ); ?></span></span></label>
469
+ <input type="checkbox" value="" <?php checked( $wpsl_settings['debug'], true ); ?> name="wpsl_tools[debug]" id="wpsl-debug">
470
+ </p>
471
+ <p>
472
+ <label for="wpsl-transient"><?php _e( 'WPSL transients', 'wpsl' ); ?></label>
473
+ <a class="button" href="<?php echo wp_nonce_url( admin_url( "edit.php?post_type=wpsl_stores&page=wpsl_settings&action=clear_wpsl_transients" ), 'clear_transients' ); ?>"><?php _e( 'Clear store locator transient cache', 'wpsl' ); ?></a>
474
+ </p>
475
+ <p class="submit">
476
+ <input type="submit" value="<?php _e( 'Save Changes', 'wpsl' ); ?>" class="button-primary">
477
+ </p>
478
+ </div>
479
+ </div>
480
+ </div>
481
+ </div>
482
 
 
483
  <?php settings_fields( 'wpsl_settings' ); ?>
484
  </form>
 
485
  </div>
admin/upgrade.php ADDED
@@ -0,0 +1,631 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action( 'admin_init', 'wpsl_check_upgrade' );
3
+ add_action( 'admin_init', 'wpsl_cpt_update_state' );
4
+
5
+ /**
6
+ * If the db doesn't hold the current version, run the upgrade procedure
7
+ *
8
+ * @since 1.2
9
+ * @return void
10
+ */
11
+ function wpsl_check_upgrade() {
12
+
13
+ global $wpsl_settings;
14
+
15
+ $current_version = get_option( 'wpsl_version' );
16
+
17
+ if ( version_compare( $current_version, WPSL_VERSION_NUM, '===' ) )
18
+ return;
19
+
20
+ if ( version_compare( $current_version, '1.1', '<' ) ) {
21
+ if ( is_array( $wpsl_settings ) ) {
22
+ /* Add the default value for the reset map option */
23
+ if ( empty( $wpsl_settings['reset_map'] ) ) {
24
+ $wpsl_settings['reset_map'] = 0;
25
+ }
26
+
27
+ /* Add the default value for the way the store listings are shown, either below or next to the map */
28
+ if ( empty( $wpsl_settings['auto_load'] ) ) {
29
+ $wpsl_settings['auto_load'] = 1;
30
+ }
31
+
32
+ /* Add the default value for the route redirect */
33
+ if ( empty( $wpsl_settings['new_window'] ) ) {
34
+ $wpsl_settings['new_window'] = 0;
35
+ }
36
+
37
+ update_option( 'wpsl_settings', $wpsl_settings );
38
+ }
39
+ }
40
+
41
+ if ( version_compare( $current_version, '1.2', '<' ) ) {
42
+ if ( is_array( $wpsl_settings ) ) {
43
+ /* Add the default value for the way the store listings are shown, either below or next to the map */
44
+ if ( empty( $wpsl_settings['store_below'] ) ) {
45
+ $wpsl_settings['store_below'] = 0;
46
+ }
47
+
48
+ /* Add the default value for the route redirect */
49
+ if ( empty( $wpsl_settings['direction_redirect'] ) ) {
50
+ $wpsl_settings['direction_redirect'] = 0;
51
+ }
52
+
53
+ update_option( 'wpsl_settings', $wpsl_settings );
54
+ }
55
+ }
56
+
57
+ if ( version_compare( $current_version, '1.2.11', '<' ) ) {
58
+ if ( is_array( $wpsl_settings ) ) {
59
+ /* Add the default value for the 'more info' link option */
60
+ if ( empty( $wpsl_settings['more_info'] ) ) {
61
+ $wpsl_settings['more_info'] = 0;
62
+ }
63
+
64
+ /* Add the default value for the 'more info' label */
65
+ if ( empty( $wpsl_settings['more_label'] ) ) {
66
+ $wpsl_settings['more_label'] = __( 'More info', 'wpsl' );
67
+ }
68
+
69
+ /* Add the default value mouse focus option */
70
+ if ( empty( $wpsl_settings['mouse_focus'] ) ) {
71
+ $wpsl_settings['mouse_focus'] = 1;
72
+ }
73
+
74
+ update_option( 'wpsl_settings', $wpsl_settings );
75
+ }
76
+ }
77
+
78
+ if ( version_compare( $current_version, '1.2.12', '<' ) ) {
79
+ if ( is_array( $wpsl_settings ) ) {
80
+ /* Add the default value for the 'more info link' link option */
81
+ if ( empty( $wpsl_settings['more_info_location'] ) ) {
82
+ $wpsl_settings['more_info_location'] = __( 'info window', 'wpsl' );
83
+ }
84
+
85
+ /* Add the default value for the back label */
86
+ if ( empty( $wpsl_settings['back_label'] ) ) {
87
+ $wpsl_settings['back_label'] = __( 'Back', 'wpsl' );
88
+ }
89
+
90
+ /* Add the default value for the reset label */
91
+ if ( empty( $wpsl_settings['reset_label'] ) ) {
92
+ $wpsl_settings['reset_label'] = __( 'Reset', 'wpsl' );
93
+ }
94
+
95
+ /* Add the default value for removing the scroll bar when the store listing is shown below the map */
96
+ if ( empty( $wpsl_settings['store_below_scroll'] ) ) {
97
+ $wpsl_settings['store_below_scroll'] = 0;
98
+ }
99
+
100
+ update_option( 'wpsl_settings', $wpsl_settings );
101
+ }
102
+ }
103
+
104
+ if ( version_compare( $current_version, '1.2.20', '<' ) ) {
105
+
106
+ global $wpdb;
107
+
108
+ $wpsl_table = $wpdb->prefix . 'wpsl_stores';
109
+
110
+ /* Rename the street field to address */
111
+ $wpdb->query( "ALTER TABLE $wpsl_table CHANGE street address VARCHAR(255)" );
112
+
113
+ /* Add the second address field */
114
+ $wpdb->query( "ALTER TABLE $wpsl_table ADD address2 VARCHAR(255) NULL AFTER address" );
115
+
116
+ if ( is_array( $wpsl_settings ) ) {
117
+ if ( empty( $wpsl_settings['store_url'] ) ) {
118
+ $wpsl_settings['store_url'] = 0;
119
+ }
120
+
121
+ if ( empty( $wpsl_settings['phone_url'] ) ) {
122
+ $wpsl_settings['phone_url'] = 0;
123
+ }
124
+
125
+ if ( empty( $wpsl_settings['marker_clusters'] ) ) {
126
+ $wpsl_settings['marker_clusters'] = 0;
127
+ }
128
+
129
+ if ( empty( $wpsl_settings['cluster_zoom'] ) ) {
130
+ $wpsl_settings['cluster_zoom'] = 0;
131
+ }
132
+
133
+ if ( empty( $wpsl_settings['cluster_size'] ) ) {
134
+ $wpsl_settings['cluster_size'] = 0;
135
+ }
136
+
137
+ if ( empty( $wpsl_settings['template_id'] ) ) {
138
+ $wpsl_settings['template_id'] = ( $wpsl_settings['store_below'] ) ? 1 : 0;
139
+ unset( $wpsl_settings['store_below'] );
140
+ }
141
+
142
+ if ( empty( $wpsl_settings['marker_streetview'] ) ) {
143
+ $wpsl_settings['marker_streetview'] = 0;
144
+ }
145
+
146
+ if ( empty( $wpsl_settings['marker_zoom_to'] ) ) {
147
+ $wpsl_settings['marker_zoom_to'] = 0;
148
+ }
149
+
150
+ if ( !isset( $wpsl_settings['editor_country'] ) ) {
151
+ $wpsl_settings['editor_country'] = '';
152
+ }
153
+
154
+ if ( empty( $wpsl_settings['street_view_label'] ) ) {
155
+ $wpsl_settings['street_view_label'] = __( 'Street view', 'wpsl' );
156
+ }
157
+
158
+ if ( empty( $wpsl_settings['zoom_here_label'] ) ) {
159
+ $wpsl_settings['zoom_here_label'] = __( 'Zoom here', 'wpsl' );
160
+ }
161
+
162
+ if ( empty( $wpsl_settings['no_directions_label'] ) ) {
163
+ $wpsl_settings['no_directions_label'] = __( 'No route could be found between the origin and destination', 'wpsl' );
164
+ }
165
+
166
+ update_option( 'wpsl_settings', $wpsl_settings );
167
+ }
168
+ }
169
+
170
+ if ( version_compare( $current_version, '2.0', '<' ) ) {
171
+
172
+ global $wpdb;
173
+
174
+ $wpsl_table = $wpdb->prefix . 'wpsl_stores';
175
+
176
+ if ( is_array( $wpsl_settings ) ) {
177
+ if ( empty( $wpsl_settings['radius_dropdown'] ) ) {
178
+ $wpsl_settings['radius_dropdown'] = 1;
179
+ }
180
+
181
+ if ( empty( $wpsl_settings['permalinks'] ) ) {
182
+ $wpsl_settings['permalinks'] = 0;
183
+ }
184
+
185
+ if ( empty( $wpsl_settings['permalink_slug'] ) ) {
186
+ $wpsl_settings['permalink_slug'] = __( 'stores', 'wpsl' );
187
+ }
188
+
189
+ if ( empty( $wpsl_settings['category_slug'] ) ) {
190
+ $wpsl_settings['category_slug'] = __( 'store-category', 'wpsl' );
191
+ }
192
+
193
+ if ( empty( $wpsl_settings['editor_hours'] ) ) {
194
+ $wpsl_settings['editor_hours'] = wpsl_default_opening_hours();
195
+ }
196
+
197
+ if ( empty( $wpsl_settings['editor_hour_format'] ) ) {
198
+ $wpsl_settings['editor_hour_format'] = 12;
199
+ }
200
+
201
+ if ( empty( $wpsl_settings['editor_map_type'] ) ) {
202
+ $wpsl_settings['editor_map_type'] = 'roadmap';
203
+ }
204
+
205
+ if ( empty( $wpsl_settings['infowindow_style'] ) ) {
206
+ $wpsl_settings['infowindow_style'] = 'default';
207
+ }
208
+
209
+ if ( empty( $wpsl_settings['email_label'] ) ) {
210
+ $wpsl_settings['email_label'] = __( 'Email', 'wpsl' );
211
+ }
212
+
213
+ if ( empty( $wpsl_settings['url_label'] ) ) {
214
+ $wpsl_settings['url_label'] = __( 'Url', 'wpsl' );
215
+ }
216
+
217
+ if ( empty( $wpsl_settings['category_label'] ) ) {
218
+ $wpsl_settings['category_label'] = __( 'Category filter', 'wpsl' );
219
+ }
220
+
221
+ if ( empty( $wpsl_settings['show_credits'] ) ) {
222
+ $wpsl_settings['show_credits'] = 0;
223
+ }
224
+
225
+ if ( empty( $wpsl_settings['autoload_limit'] ) ) {
226
+ $wpsl_settings['autoload_limit'] = 50;
227
+ }
228
+
229
+ if ( empty( $wpsl_settings['scrollwheel'] ) ) {
230
+ $wpsl_settings['scrollwheel'] = 1;
231
+ }
232
+
233
+ if ( empty( $wpsl_settings['type_control'] ) ) {
234
+ $wpsl_settings['type_control'] = 0;
235
+ }
236
+
237
+ if ( empty( $wpsl_settings['hide_hours'] ) ) {
238
+ $wpsl_settings['hide_hours'] = 0;
239
+ }
240
+
241
+ /* Either correct the existing map style format from the 2.0 beta or set it to empty */
242
+ if ( isset( $wpsl_settings['map_style'] ) && is_array( $wpsl_settings['map_style'] ) && isset( $wpsl_settings['map_style']['id'] ) ) {
243
+ switch( $wpsl_settings['map_style']['id'] ) {
244
+ case 'custom':
245
+ $map_style = $wpsl_settings['map_style']['custom_json'];
246
+ break;
247
+ case 'default':
248
+ $map_style = '';
249
+ break;
250
+ default:
251
+ $map_style = $wpsl_settings['map_style']['theme_json'];
252
+ break;
253
+ }
254
+
255
+ $wpsl_settings['map_style'] = $map_style;
256
+ } else {
257
+ $wpsl_settings['map_style'] = '';
258
+ }
259
+
260
+ if ( empty( $wpsl_settings['autoload'] ) ) {
261
+ $wpsl_settings['autoload'] = $wpsl_settings['auto_load'];
262
+ unset( $wpsl_settings['auto_load'] );
263
+ }
264
+
265
+ if ( empty( $wpsl_settings['address_format'] ) ) {
266
+ $wpsl_settings['address_format'] = 'city_state_zip';
267
+ }
268
+
269
+ if ( empty( $wpsl_settings['auto_zoom_level'] ) ) {
270
+ $wpsl_settings['auto_zoom_level'] = 15;
271
+ }
272
+
273
+ if ( empty( $wpsl_settings['hide_distance'] ) ) {
274
+ $wpsl_settings['hide_distance'] = 0;
275
+ }
276
+
277
+ if ( empty( $wpsl_settings['debug'] ) ) {
278
+ $wpsl_settings['debug'] = 0;
279
+ }
280
+
281
+ if ( empty( $wpsl_settings['category_dropdown'] ) ) {
282
+ $wpsl_settings['category_dropdown'] = 0;
283
+ }
284
+
285
+ /* Replace marker_bounce with marker_effect to better reflect what the option contains.
286
+ *
287
+ * If a user hovers over the result list then either the corresponding marker will bounce,
288
+ * the info window will open, or nothing will happen.
289
+ *
290
+ * The default behaviour is that the marker will bounce.
291
+ */
292
+ if ( empty( $wpsl_settings['marker_effect'] ) ) {
293
+ $wpsl_settings['marker_effect'] = ( $wpsl_settings['marker_bounce'] ) ? 'bounce' : 'ignore';
294
+ unset( $wpsl_settings['marker_bounce'] );
295
+ }
296
+
297
+ /* The default input for the opening hours is set to textarea for current users,
298
+ * for new users it will be set to dropdown ( easier to format in a table output and to use with schema.org in the future ).
299
+ */
300
+ if ( empty( $wpsl_settings['editor_hour_input'] ) ) {
301
+ $wpsl_settings['editor_hour_input'] = 'textarea';
302
+ }
303
+
304
+ /* Rename store_below_scroll to listing_below_no_scroll, it better reflects what it does */
305
+ if ( empty( $wpsl_settings['listing_below_no_scroll'] ) && isset( $wpsl_settings['store_below_scroll'] ) ) {
306
+ $wpsl_settings['listing_below_no_scroll'] = $wpsl_settings['store_below_scroll'];
307
+ unset( $wpsl_settings['store_below_scroll'] );
308
+ }
309
+
310
+ /* Change the template ids from number based to name based */
311
+ if ( is_numeric( $wpsl_settings['template_id'] ) ) {
312
+ $wpsl_settings['template_id'] = ( !$wpsl_settings['template_id'] ) ? 'default' : 'below_map';
313
+ }
314
+
315
+ $replace_data = array(
316
+ 'max_results' => $wpsl_settings['max_results'],
317
+ 'search_radius' => $wpsl_settings['search_radius']
318
+ );
319
+
320
+ /* Replace the () with [], this fixes an issue with the mod_security module that is installed on some servers.
321
+ * It triggerd a 'Possible SQL injection attack' warning probably because of the int,(int) format of the data.
322
+ */
323
+ foreach ( $replace_data as $index => $option_value ) {
324
+ $wpsl_settings[$index] = str_replace( array( '(', ')' ), array( '[', ']' ), $option_value );
325
+ }
326
+
327
+ /* The reset button now uses an icon instead of text, so no need for the label anymore */
328
+ unset( $wpsl_settings['reset_label'] );
329
+
330
+ update_option( 'wpsl_settings', $wpsl_settings );
331
+
332
+ /* Users upgrading from 1.x will be given the choice between the textarea or
333
+ * dropdowns for the opening hours.
334
+ *
335
+ * New users don't get that choice, they will only get the dropdowns.
336
+ *
337
+ * The wpsl_legacy_support option is used to determine if we need to show both options.
338
+ */
339
+ update_option( 'wpsl_legacy_support', 1 );
340
+
341
+ /* Add the WPSL roles and caps */
342
+ wpsl_add_roles();
343
+ wpsl_add_caps();
344
+
345
+ /* If there is a wpsl_stores table, then we need to convert all the locations to the 'wpsl_stores' custom post type */
346
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpsl_table'" ) && version_compare( $current_version, '1.9', '<' ) ) {
347
+ if ( wpsl_remaining_cpt_count() ) {
348
+ update_option( 'wpsl_convert_cpt', 'in_progress' );
349
+ }
350
+ }
351
+ }
352
+ }
353
+
354
+ update_option( 'wpsl_version', WPSL_VERSION_NUM );
355
+ }
356
+
357
+ /**
358
+ * Check if we need to show the notice that tells users that the store locations
359
+ * need to be converted to custom post types before the update from 1.x to 2.x is complete.
360
+ *
361
+ * @since 2.0
362
+ * @return void
363
+ */
364
+ function wpsl_cpt_update_state() {
365
+
366
+ global $wpsl_admin;
367
+
368
+ $conversion_state = get_option( 'wpsl_convert_cpt' );
369
+
370
+ if ( $conversion_state == 'in_progress' ) {
371
+ if ( ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) ) {
372
+ $remaining = wpsl_remaining_cpt_count();
373
+ $wpsl_admin->notices->save( 'error', sprintf( __( 'Because you updated WP Store Locator from version 1.x, the %s current store locations need to be %sconverted%s to custom post types.', 'wpsl' ), "<span class='wpsl-cpt-remaining'>" . $remaining . "</span>", "<a href='#' id='wpsl-cpt-dialog'>", "</a>" ) );
374
+
375
+ add_action( 'admin_footer', 'wpsl_cpt_dialog_html' );
376
+ }
377
+
378
+ add_action( 'admin_enqueue_scripts', 'wpsl_convert_cpt_js' );
379
+ add_action( 'wp_ajax_convert_cpt', 'wpsl_convert_cpt' );
380
+ add_action( 'wp_ajax_convert_cpt_count', 'wpsl_convert_cpt_count' );
381
+ }
382
+ }
383
+
384
+ /**
385
+ * Include the js file that handles the ajax request to
386
+ * start converting the 1.x store locations to custom post types.
387
+ *
388
+ * @since 2.0
389
+ * @return void
390
+ */
391
+ function wpsl_convert_cpt_js() {
392
+
393
+ $cpt_js_l10n = array(
394
+ 'timeout' => sprintf( __( 'The script converting the locations timed out. %s You can click the "Start Converting" button again to restart the script. %s If there are thousands of store locations left to convert and you keep seeing this message, then you can try to contact your host and ask if they can increase the maximum execution time. %s The plugin tried to disable the maximum execution time, but if you are reading this then that failed.', 'wpsl' ), '<br><br>', '<br><br>', '<br><br>' ),
395
+ 'securityFail' => __( 'Security check failed, reload the page and try again.', 'wpsl' )
396
+ );
397
+
398
+ wp_enqueue_script( 'jquery-ui-dialog' );
399
+ wp_enqueue_script( 'wpsl-queue', plugins_url( '/js/ajax-queue.js', __FILE__ ), array( 'jquery' ), false );
400
+ wp_enqueue_script( 'wpsl-cpt-js', plugins_url( '/js/wpsl-cpt-upgrade.js', __FILE__ ), array( 'jquery' ), false );
401
+ wp_localize_script( 'wpsl-cpt-js', 'wpslCptConversion', $cpt_js_l10n );
402
+ }
403
+
404
+ /**
405
+ * The html for the lightbox
406
+ *
407
+ * @since 2.0
408
+ * @return void
409
+ */
410
+ function wpsl_cpt_dialog_html() {
411
+
412
+ ?>
413
+ <div id="wpsl-cpt-lightbox" style="display:none;">
414
+ <span class="tb-close-icon"></span>
415
+ <p class="wpsl-cpt-remaining"><?php _e( 'Store locations to convert:', 'wpsl' ); echo '<span></span>'; ?></p>
416
+ <div class="wslp-cpt-fix-wrap">
417
+ <input id="wpsl-start-cpt-conversion" class="button-primary" type="submit" value="<?php _e( 'Start Converting', 'wpsl' ); ?>" >
418
+ <img class="wpsl-preloader" alt="preloader" src="<?php echo WPSL_URL . 'img/ajax-loader.gif'; ?>" />
419
+ </div>
420
+ <input type="hidden" name="wpsl-cpt-fix-nonce" value="<?php echo wp_create_nonce( 'wpsl-cpt-fix' ); ?>" />
421
+ <input type="hidden" name="wpsl-cpt-conversion-count" value="<?php echo wp_create_nonce( 'wpsl-cpt-count' ); ?>" />
422
+ </div>
423
+ <div id="wpsl-cpt-overlay" style="display:none;"></div>
424
+ <style>
425
+ .wslp-cpt-fix-wrap {
426
+ float:left;
427
+ clear:both;
428
+ width:100%;
429
+ margin:0 0 15px 0;
430
+ }
431
+
432
+ #wpsl-cpt-lightbox .wpsl-cpt-remaining span {
433
+ margin-left:5px;
434
+ }
435
+
436
+ #wpsl-start-cpt-conversion {
437
+ float:left;
438
+ }
439
+
440
+ .wslp-cpt-fix-wrap .wpsl-preloader,
441
+ .wslp-cpt-fix-wrap span {
442
+ float:left;
443
+ margin:8px 0 0 10px;
444
+ }
445
+
446
+ .wslp-cpt-fix-wrap .wpsl-preloader {
447
+ display: none;
448
+ }
449
+
450
+ #wpsl-cpt-lightbox {
451
+ position:fixed;
452
+ width:450px;
453
+ left:50%;
454
+ right:50%;
455
+ top:3.8em;
456
+ padding:15px;
457
+ background:none repeat scroll 0 0 #fff;
458
+ border-radius:3px;
459
+ margin-left:-225px;
460
+ z-index: 9999;
461
+ }
462
+
463
+ #wpsl-cpt-overlay {
464
+ position:fixed;
465
+ right:0;
466
+ top:0;
467
+ z-index:9998;
468
+ background:none repeat scroll 0 0 #000;
469
+ bottom:0;
470
+ left:0;
471
+ opacity:0.5;
472
+ }
473
+
474
+ .tb-close-icon {
475
+ color: #666;
476
+ text-align: center;
477
+ line-height: 29px;
478
+ width: 29px;
479
+ height: 29px;
480
+ position: absolute;
481
+ top: 0;
482
+ right: 0;
483
+ }
484
+
485
+ .tb-close-icon:before {
486
+ content: '\f158';
487
+ font: normal 20px/29px 'dashicons';
488
+ speak: none;
489
+ -webkit-font-smoothing: antialiased;
490
+ -moz-osx-font-smoothing: grayscale;
491
+ }
492
+
493
+ .tb-close-icon:hover {
494
+ color: #999 !important;
495
+ cursor: pointer;
496
+ }
497
+ </style>
498
+ <?php
499
+ }
500
+
501
+ /**
502
+ * Handle the ajax call to start converting the
503
+ * store locations to custom post types.
504
+ *
505
+ * @since 2.0
506
+ * @return void|string json on completion
507
+ */
508
+ function wpsl_convert_cpt() {
509
+
510
+ if ( !current_user_can( 'manage_options' ) )
511
+ die( '-1' );
512
+ check_ajax_referer( 'wpsl-cpt-fix' );
513
+
514
+ /* Start the cpt coversion */
515
+ wpsl_cpt_conversion();
516
+
517
+ exit();
518
+ }
519
+
520
+ /**
521
+ * Get the amount of locations that still need to be converted.
522
+ *
523
+ * @since 2.0
524
+ * @return string json The amount of locations that still need to be converted
525
+ */
526
+ function wpsl_convert_cpt_count() {
527
+
528
+ if ( !current_user_can( 'manage_options' ) )
529
+ die( '-1' );
530
+ check_ajax_referer( 'wpsl-cpt-count' );
531
+
532
+ $remaining_count = wpsl_remaining_cpt_count();
533
+
534
+ $response['success'] = true;
535
+
536
+ if ( $remaining_count ) {
537
+ $response['count'] = $remaining_count;
538
+ } else {
539
+ $response['url'] = sprintf( __( 'All the store locations are now converted to custom post types. %s You can view them on the %sAll Stores%s page.', 'wpsl' ), '<br><br>', '<a href="' . admin_url( 'edit.php?post_type=wpsl_stores' ) . '">', '</a>' );
540
+
541
+ delete_option( 'wpsl_convert_cpt' );
542
+ }
543
+
544
+ wp_send_json( $response );
545
+
546
+ exit();
547
+ }
548
+
549
+ /**
550
+ * Return the difference between the number of existing wpsl custom post types,
551
+ * and the number of records in the old wpsl_stores database.
552
+ *
553
+ * @since 2.0
554
+ * @return int|boolean $remaining The amount of locations that still need to be converted
555
+ */
556
+ function wpsl_remaining_cpt_count() {
557
+
558
+ global $wpdb;
559
+
560
+ $table = $wpdb->prefix . 'wpsl_stores';
561
+ $count = wp_count_posts( 'wpsl_stores' );
562
+
563
+ if ( isset( $count->publish ) && isset( $count->draft ) ) {
564
+ $cpt_count = $count->publish + $count->draft;
565
+ } else {
566
+ $cpt_count = 0;
567
+ }
568
+
569
+ $db_count = $wpdb->get_var( "SELECT COUNT(wpsl_id) FROM $table" );
570
+ $difference = $db_count - $cpt_count;
571
+
572
+ /* This prevents users who used the 2.0 beta, and later added
573
+ * more stores from seeing the upgrade notice again.
574
+ */
575
+ $remaining = ( $difference < 0 ) ? false : $difference;
576
+
577
+ return $remaining;
578
+ }
579
+
580
+ /**
581
+ * Convert the existing locations to custom post types.
582
+ *
583
+ * @since 2.0
584
+ * @return void|boolean True if the conversion is completed
585
+ */
586
+ function wpsl_cpt_conversion() {
587
+
588
+ global $wpdb;
589
+
590
+ /* Try to disable the time limit to prevent timeouts */
591
+ @set_time_limit( 0 );
592
+
593
+ $meta_keys = array( 'address', 'address2', 'city', 'state', 'zip', 'country', 'country_iso', 'lat', 'lng', 'phone', 'fax', 'url', 'email', 'hours' );
594
+ $offset = wpsl_remaining_cpt_count();
595
+ $wpsl_table = $wpdb->prefix . 'wpsl_stores';
596
+ $stores = $wpdb->get_results( "(SELECT * FROM $wpsl_table ORDER BY wpsl_id DESC LIMIT $offset) ORDER BY wpsl_id ASC" );
597
+
598
+ foreach ( $stores as $store ) {
599
+
600
+ /* Make sure we set the correct post status */
601
+ if ( $store->active ) {
602
+ $post_status = 'publish';
603
+ } else {
604
+ $post_status = 'draft';
605
+ }
606
+
607
+ $post = array (
608
+ 'post_type' => 'wpsl_stores',
609
+ 'post_status' => $post_status,
610
+ 'post_title' => $store->store,
611
+ 'post_content' => $store->description
612
+ );
613
+
614
+ $post_id = wp_insert_post( $post );
615
+
616
+ if ( $post_id ) {
617
+
618
+ /* Save the data from the wpsl_stores db table as post meta data */
619
+ foreach ( $meta_keys as $meta_key ) {
620
+ if ( isset( $store->{$meta_key} ) && !empty( $store->{$meta_key} ) ) {
621
+ update_post_meta( $post_id, 'wpsl_' . $meta_key, $store->{$meta_key} );
622
+ }
623
+ }
624
+
625
+ /* If we have a thumb ID set the post thumbnail for the inserted post */
626
+ if ( $store->thumb_id ) {
627
+ set_post_thumbnail( $post_id, $store->thumb_id );
628
+ }
629
+ }
630
+ }
631
+ }
css/styles.css CHANGED
@@ -1,11 +1,19 @@
1
- /* The map container */
2
- .wpsl-gmap-wrap {
3
- position:relative;
 
 
 
 
 
 
4
  }
 
5
  #wpsl-gmap {
6
- float:left;
7
  width:66.5%;
8
  height:350px;
 
9
  }
10
 
11
  .wpsl-store-below #wpsl-gmap {
@@ -13,46 +21,160 @@
13
  width:100%;
14
  }
15
 
16
- /* Map reset button */
17
- #wpsl-reset-map {
18
- position:absolute;
19
- right:15px;
20
- top:15px;
21
- padding:6px 14px;
22
- background:#fff;
23
- box-shadow:0 1px 2px rgba(64, 64, 64, 0.3);
24
- border-radius: 3px;
25
- z-index:3;
26
- display:none;
27
  }
 
28
  #wpsl-reset-map:hover {
29
  cursor: pointer;
30
  }
31
 
32
- #wpsl-reset-map.wpsl-right-controls {
33
- right:42px;
 
 
34
  }
35
 
36
  /*
37
  Some themes set a box-shadow or max-width for all image /
38
  div elements, we disable it to prevent it from messing up the map
39
  */
40
- #wpsl-gmap div,
41
- #wpsl-gmap img {
42
- box-shadow:none;
43
- max-width:none;
44
- background:none;
 
 
 
 
 
 
 
 
45
  }
46
 
47
  #wpsl-wrap {
48
- width:100%;
49
- overflow:hidden;
50
- clear:both;
51
- margin-bottom:20px;
52
  }
 
53
  #wpsl-search-wrap {
54
- float:left;
55
- width:100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
  /* Possible fix for vertical text issue in IE9? */
@@ -67,8 +189,8 @@ div elements, we disable it to prevent it from messing up the map
67
 
68
  #wpsl-search-wrap .wpsl-input label,
69
  #wpsl-search-wrap .wpsl-input input,
70
- #wpsl-search-wrap .wpsl-select-wrap #wpsl-radius,
71
- #wpsl-search-wrap .wpsl-select-wrap #wpsl-results,
72
  #wpsl-search-btn {
73
  display:table-cell;
74
  }
@@ -76,13 +198,15 @@ div elements, we disable it to prevent it from messing up the map
76
  #wpsl-search-wrap label {
77
  margin-bottom:0;
78
  }
 
79
  #wpsl-search-input {
80
- width:179px;
 
81
  padding: 7px 12px;
82
  font-size: 100%;
83
- margin:0;
84
- /* padding: 3% 12px;*/
85
  }
 
86
  #wpsl-search-wrap input,
87
  #wpsl-search-btn {
88
  border: 1px solid #d2d2d2;
@@ -104,9 +228,11 @@ div elements, we disable it to prevent it from messing up the map
104
  box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1);
105
  text-transform: none !important;
106
  }
 
107
  #wpsl-search-input.wpsl-error {
108
  border:1px solid #bd0028 !important;
109
  }
 
110
  .wpsl-search {
111
  margin-bottom:12px;
112
  padding:12px 12px 0 12px;
@@ -115,16 +241,15 @@ div elements, we disable it to prevent it from messing up the map
115
 
116
  /* Result list */
117
  .wpsl-back {
118
- display:block;
119
  }
120
 
121
  #wpsl-result-list {
122
- float:left;
123
  width:33%;
124
  margin-right:0.5%;
125
  }
 
126
  .wpsl-store-below #wpsl-result-list {
127
- float:none;
128
  width:100%;
129
  margin:12px 0 0 0;
130
  }
@@ -134,7 +259,11 @@ div elements, we disable it to prevent it from messing up the map
134
  height:350px;
135
  overflow-y:auto;
136
  }
137
- #wpsl-direction-details {display:none;}
 
 
 
 
138
 
139
  #wpsl-result-list p {
140
  padding-left:10px;
@@ -143,34 +272,46 @@ div elements, we disable it to prevent it from messing up the map
143
  padding-left: 0;
144
  }
145
 
146
- #wpsl-result-list p a {
147
- margin-bottom:10px;
148
- }
149
-
150
  #wpsl-result-list a {
151
  outline:none;
152
  }
153
 
154
- #wpsl-result-list li {
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  padding: 10px;
156
  border-bottom: 1px dotted #ccc;
157
  margin-left: 0;
158
  overflow: hidden;
159
- list-style: none outside none !important
 
160
  }
161
- .wpsl-store-below #wpsl-result-list li {
 
162
  padding: 10px 10px 10px 0;
163
  }
164
 
165
  #wpsl-result-list li p {
166
- padding-left:0;
167
- margin-bottom:20px;
168
  }
169
 
170
  .wpsl-store-details.wpsl-store-listing {
171
- position:relative;
172
- padding-right:20px;
173
  }
 
174
  .wpsl-store-details.wpsl-store-listing:before,
175
  .wpsl-store-details.wpsl-store-listing.wpsl-active-details:before {
176
  position: absolute;
@@ -193,8 +334,6 @@ div elements, we disable it to prevent it from messing up the map
193
  float:right;
194
  border-radius:3px;
195
  margin:7px 0 0 10px;
196
- width:48px;
197
- height:48px;
198
  padding:0;
199
  border:none;
200
  }
@@ -225,24 +364,51 @@ div elements, we disable it to prevent it from messing up the map
225
  }
226
 
227
  /* Preloader */
228
- #wpsl-result-list li.wpsl-preloader {
229
- border-bottom:none;
 
 
230
  }
 
231
  .wpsl-preloader img {
232
- float:left;
 
 
 
233
  box-shadow:none !important;
234
  border:none !important;
235
  }
236
 
237
  .wpsl-preloader span {
238
- float:left;
239
- margin:-5px 0 0 11px;
240
  }
241
 
242
  #wpsl-search-wrap div,
243
  #wpsl-search-btn {
244
- margin-right:10px;
245
- float:left;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
247
 
248
  #wpsl-search-wrap .wpsl-dropdown div {
@@ -276,7 +442,9 @@ div elements, we disable it to prevent it from messing up the map
276
  display:inline;
277
  }
278
 
279
- #wpsl-radius {margin-right:10px;}
 
 
280
  #wpsl-search-btn:hover {
281
  cursor: pointer;
282
  }
@@ -292,6 +460,10 @@ div elements, we disable it to prevent it from messing up the map
292
  line-height: 32px;
293
  }
294
 
 
 
 
 
295
  #wpsl-result-list ul {
296
  list-style: none;
297
  margin: 0;
@@ -302,7 +474,8 @@ div elements, we disable it to prevent it from messing up the map
302
  }
303
 
304
  /* Infowindow */
305
- #wpsl-gmap .wpsl-info-window {
 
306
  max-width:225px;
307
  }
308
 
@@ -311,6 +484,10 @@ div elements, we disable it to prevent it from messing up the map
311
  display:block;
312
  }
313
 
 
 
 
 
314
  /* More info details in the store listings */
315
  .wpsl-more-info-listings {
316
  display:none;
@@ -320,26 +497,30 @@ div elements, we disable it to prevent it from messing up the map
320
  .wpsl-info-window span span {
321
  display:inline !important;
322
  }
323
- .wpsl-info-window p {
324
- margin-bottom:10px;
 
325
  }
 
326
  .wpsl-store-hours {
327
  margin-top:10px;
328
  }
 
329
  .wpsl-store-hours strong {
330
  display:block;
331
  }
332
 
333
- .wpsl-info-actions {
334
  display:block;
335
- margin:10px 0;
336
  }
337
- .wpsl-info-actions a {
338
- float:left;
339
- margin-right: 7px;
340
- }
341
 
342
- .wpsl-zoom-here {
 
 
 
 
 
343
  margin-right:0;
344
  }
345
 
@@ -358,13 +539,17 @@ div elements, we disable it to prevent it from messing up the map
358
  z-index: 2;
359
  }
360
 
 
 
 
 
361
  .wpsl-dropdown ul {
362
  position: absolute;
363
  left: 0;
364
  width: 100%;
365
  height: 100%;
366
- padding: 0;
367
- margin: 0;
368
  list-style: none;
369
  overflow: hidden;
370
  }
@@ -418,212 +603,277 @@ div elements, we disable it to prevent it from messing up the map
418
  font-weight: bold;
419
  }
420
 
421
- #wpsl-radius, #wpsl-results {
422
- float: left;
423
- margin-right: 15px;
424
- }
425
-
426
- .clearfix:before,
427
- .clearfix:after {
428
  content: " ";
429
  display: table;
430
  }
431
- .clearfix:after {
 
432
  clear: both;
433
  }
434
 
435
- #wpsl-results .wpsl-dropdown {
436
- width:70px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  }
438
 
439
- .wpsl-input, .wpsl-select-wrap {
440
- margin-bottom:10px;
 
 
 
 
 
 
 
 
 
 
441
  }
442
 
443
  @media (max-width: 825px) {
444
  #wpsl-search-input {
445
  width: 348px;
446
  }
447
-
448
- #wpsl-search-wrap .wpsl-dropdown {
449
- width:114px;
450
  }
451
 
452
  #wpsl-search-wrap .wpsl-input {
453
  width: 100%;
454
- margin-bottom:10px;
455
  }
456
 
457
- .wpsl-no-results #wpsl-search-wrap .wpsl-input,
458
- .wpsl-no-results #wpsl-search-input,
459
- .wpsl-no-results .wpsl-input label,
460
- .wpsl-no-results #wpsl-radius label {
461
- width: auto;
462
- }
463
-
464
  .wpsl-input label,
465
- #wpsl-radius label {
466
- min-width: 100px !important;
467
- width:auto;
 
 
 
468
  }
469
  }
470
 
471
  @media (max-width: 720px) {
472
- .wpsl-no-results .wpsl-dropdown {
473
- width: 100px;
474
- }
475
-
476
  #wpsl-search-wrap .wpsl-dropdown {
477
  width: 114px;
478
  }
479
-
480
- .wpsl-no-results #wpsl-search-input {
481
- width: 150px !important;
482
- }
483
- }
484
-
485
- @media (max-width: 700px) {
486
- .wpsl-no-results #wpsl-search-input {
487
- width: 250px !important;
488
- }
489
-
490
- .wpsl-no-results #wpsl-search-wrap .wpsl-input {
491
- margin-bottom:10px;
492
- }
493
  }
494
 
495
  @media (max-width: 675px) {
496
  #wpsl-search-wrap #wpsl-search-btn {
497
- float:left;
498
- margin:0 5px 0 0;
499
  }
500
 
 
501
  .wpsl-dropdown {
502
  width: 100%;
503
  }
 
504
  .wpsl-search {
505
- width: 96%;
506
  padding: 2%;
507
  }
 
508
  .wpsl-input {
509
- margin-right:0;
510
  }
511
 
512
  #wpsl-result-list,
513
  #wpsl-gmap {
514
  width:49.75%;
515
  }
 
516
  #wpsl-result-list,
517
  #wpsl-gmap {
518
- float:none;
519
- width:100%;
520
  }
521
- #wpsl-reset-map {
522
- top:25px;
 
523
  }
 
524
  #wpsl-gmap {
525
- margin-top:10px;
526
- }
527
 
528
- .wpsl-no-results #wpsl-search-wrap .wpsl-input {
529
- width:100%;
 
 
530
  }
531
- .wpsl-no-results #wpsl-search-wrap .wpsl-dropdown {
532
- width: 201px;
 
 
533
  }
534
-
535
- .wpsl-input, .wpsl-select-wrap, #wpsl-search-btn {
536
- margin-bottom:0;
 
 
 
 
537
  }
538
- }
539
 
540
- @media (max-width: 570px) {
541
- #wpsl-search-wrap #wpsl-search-btn {
542
- margin-bottom: 5px;
543
  }
544
- #wpsl-search-input {
545
- width: 277px;
 
546
  }
547
- #wpsl-search-wrap #wpsl-search-btn {
548
- margin-top:15px;
 
 
 
 
 
 
 
549
  }
550
 
551
- .wpsl-no-results #wpsl-search-wrap #wpsl-search-btn {
552
- margin-top:0;
553
  }
554
  }
555
 
556
- @media (max-width: 520px) {
 
 
 
 
557
  .wpsl-search {
558
- width: 94%;
559
- padding: 3%;
560
  }
 
561
  #wpsl-search-input {
562
- width:91%;
 
 
 
 
 
 
 
 
 
 
 
563
  }
 
564
  #wpsl-search-wrap div,
565
  #wpsl-search-btn {
566
  margin-right: 0;
567
  }
568
 
569
  #wpsl-search-wrap div label {
570
- display:block;
571
- width:100%;
572
- }
573
-
574
- .wpsl-no-results #wpsl-search-wrap div label {
575
- display:inline;
576
- width: auto;
577
  }
578
- .wpsl-no-results #wpsl-search-input,
579
- .wpsl-no-results #wpsl-radius,
580
  #wpsl-results {
581
  width:auto;
582
  }
583
 
584
  .wpsl-select-wrap {
585
- width:100%;
586
  }
587
 
588
- #wpsl-radius, #wpsl-results {
589
- width:50%;
 
590
  }
 
591
  #wpsl-radius {
592
  margin-right: 4%;
593
  }
594
- #wpsl-search-wrap .wpsl-dropdown {
595
- width: 96%;
596
- }
597
-
598
- .wpsl-no-results #wpsl-search-wrap #wpsl-search-btn {
599
- margin-top:15px;
600
- }
601
 
602
- #wpsl-search-btn {
603
- clear: both;
604
  }
605
- }
606
 
607
- @media (max-width: 460px) {
608
- #wpsl-search-input {
609
- width:90%;
610
- }
611
- .wpsl-no-results #wpsl-search-wrap div label {
612
- display:block;
613
- }
614
- .wpsl-no-results #wpsl-search-wrap .wpsl-dropdown {
615
- width: 274px;
616
  }
617
- }
618
 
619
- @media (max-width: 375px) {
620
- #wpsl-search-input {
621
- width:auto !important;
622
- }
623
- .wpsl-no-results #wpsl-search-input {
624
- width:200px !important;
625
  }
626
- .wpsl-no-results #wpsl-search-wrap .wpsl-dropdown {
627
- width:223px !important;
628
- }
629
  }
1
+ @font-face {
2
+ font-family: 'wpsl-fontello';
3
+ src: url('../font/fontello.eot?28897909');
4
+ src: url('../font/fontello.eot?28897909#iefix') format('embedded-opentype'),
5
+ url('../font/fontello.woff?28897909') format('woff'),
6
+ url('../font/fontello.ttf?28897909') format('truetype'),
7
+ url('../font/fontello.svg?28897909#fontello') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
  }
11
+
12
  #wpsl-gmap {
13
+ float:right;
14
  width:66.5%;
15
  height:350px;
16
+ margin-bottom:0;
17
  }
18
 
19
  .wpsl-store-below #wpsl-gmap {
21
  width:100%;
22
  }
23
 
24
+ .wpsl-gmap-canvas {
25
+ width:100%;
26
+ height:300px;
27
+ margin-bottom:20px;
 
 
 
 
 
 
 
28
  }
29
+
30
  #wpsl-reset-map:hover {
31
  cursor: pointer;
32
  }
33
 
34
+ /* Fix an overlay issue with the map style */
35
+ .gmnoprint,
36
+ .gm-style-mtc {
37
+ z-index: 9999 !important;
38
  }
39
 
40
  /*
41
  Some themes set a box-shadow or max-width for all image /
42
  div elements, we disable it to prevent it from messing up the map
43
  */
44
+ #wpsl-gmap div,
45
+ #wpsl-gmap img,
46
+ .wpsl-gmap-canvas div,
47
+ .wpsl-gmap-canvas img {
48
+ box-shadow: none !important;
49
+ max-width: none !important;
50
+ background: none;
51
+ }
52
+
53
+ #wpsl-gmap img,
54
+ .wpsl-gmap-canvas img {
55
+ display: inline !important;
56
+ opacity: 1 !important;
57
  }
58
 
59
  #wpsl-wrap {
60
+ width: 100%;
61
+ overflow: hidden;
62
+ clear: both;
63
+ margin-bottom: 20px;
64
  }
65
+
66
  #wpsl-search-wrap {
67
+ float: left;
68
+ width: 100%;
69
+ }
70
+
71
+ /* Map Controls */
72
+ #wpsl-gmap #wpsl-map-controls {
73
+ position: absolute;
74
+ right: 5px;
75
+ bottom: 20px;
76
+ border-radius: 3px;
77
+ z-index: 3;
78
+ font-size: 11px;
79
+ white-space: nowrap;
80
+ }
81
+
82
+ #wpsl-map-controls .wpsl-direction-preloader {
83
+ margin: 5px 5px 0 5px;
84
+ }
85
+
86
+ #wpsl-map-controls div {
87
+ float: left;
88
+ background: #fff;
89
+ border-radius: 3px;
90
+ }
91
+
92
+ #wpsl-map-controls div:hover {
93
+ cursor: pointer;
94
+ }
95
+
96
+ #wpsl-wrap [class^="wpsl-icon-"],
97
+ #wpsl-wrap [class*=" wpsl-icon-"] {
98
+ position: relative;
99
+ float: left;
100
+ padding: 5px 7px;
101
+ display: inline-block;
102
+ font-family: "wpsl-fontello";
103
+ font-style: normal;
104
+ font-weight: normal;
105
+ font-size: 1.3em;
106
+ color: #7c7c7c;
107
+ speak: none;
108
+ text-decoration: inherit;
109
+ text-align: center;
110
+ font-variant: normal;
111
+ text-transform: none;
112
+ line-height: 1em;
113
+ -webkit-font-smoothing: antialiased;
114
+ -moz-osx-font-smoothing: grayscale;
115
+ }
116
+
117
+ /* Fix the padding for the icon fonts in IE 8-11 :( */
118
+ #wpsl-wrap .wpsl-ie [class^="wpsl-icon-"],
119
+ #wpsl-wrap .wpsl-ie [class*=" wpsl-icon-"] {
120
+ padding: 8px 8px 4px 8px;
121
+ }
122
+
123
+ /* Make the clickable area bigger for the buttons on mobile devices */
124
+ #wpsl-wrap.wpsl-mobile [class^="wpsl-icon-"],
125
+ #wpsl-wrap.wpsl-mobile [class*=" wpsl-icon-"] {
126
+ padding: 8px 10px;
127
+ }
128
+
129
+ #wpsl-wrap .wpsl-icon-reset {
130
+ /* display: none;*/
131
+ border: 1px solid #ccc;
132
+ border-radius: 3px 0 0 3px;
133
+ z-index: 2;
134
+ }
135
+
136
+ #wpsl-wrap .wpsl-icon-direction {
137
+ border: 1px solid #ccc;
138
+ z-index: 1;
139
+ }
140
+
141
+ #wpsl-wrap .wpsl-reset-exists {
142
+ border-radius: 0 3px 3px 0;
143
+ border-left: 0;
144
+ }
145
+
146
+ #wpsl-wrap .wpsl-active-icon,
147
+ #wpsl-wrap [class^="wpsl-icon-"]:hover,
148
+ #wpsl-wrap [class*=" wpsl-icon-"]:hover {
149
+ color: #000;
150
+ }
151
+
152
+ #wpsl-wrap [class^="wpsl-icon-"]:active,
153
+ #wpsl-wrap [class*=" wpsl-icon-"]:focus {
154
+ outline: 0;
155
+ }
156
+
157
+ #wpsl-wrap .wpsl-in-progress:hover,
158
+ #wpsl-wrap .wpsl-in-progress {
159
+ color: #c6c6c6;
160
+ }
161
+
162
+ /* Map reset button */
163
+ #wpsl-gmap #wpsl-reset-map {
164
+ position: absolute;
165
+ display: none;
166
+ right: 37px;
167
+ top: 37px;
168
+ padding: 6px 14px;
169
+ background: #fff !important;
170
+ background-clip: padding-box;
171
+ border: 1px solid rgba(0, 0, 0, 0.15);
172
+ border-radius: 3px;
173
+ z-index: 3;
174
+ }
175
+
176
+ #wpsl-reset-map:hover {
177
+ cursor: pointer;
178
  }
179
 
180
  /* Possible fix for vertical text issue in IE9? */
189
 
190
  #wpsl-search-wrap .wpsl-input label,
191
  #wpsl-search-wrap .wpsl-input input,
192
+ #wpsl-search-wrap #wpsl-radius,
193
+ #wpsl-search-wrap #wpsl-results,
194
  #wpsl-search-btn {
195
  display:table-cell;
196
  }
198
  #wpsl-search-wrap label {
199
  margin-bottom:0;
200
  }
201
+
202
  #wpsl-search-input {
203
+ width: 179px;
204
+ height: auto;
205
  padding: 7px 12px;
206
  font-size: 100%;
207
+ margin: 0;
 
208
  }
209
+
210
  #wpsl-search-wrap input,
211
  #wpsl-search-btn {
212
  border: 1px solid #d2d2d2;
228
  box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1);
229
  text-transform: none !important;
230
  }
231
+
232
  #wpsl-search-input.wpsl-error {
233
  border:1px solid #bd0028 !important;
234
  }
235
+
236
  .wpsl-search {
237
  margin-bottom:12px;
238
  padding:12px 12px 0 12px;
241
 
242
  /* Result list */
243
  .wpsl-back {
244
+ display: inline-block;
245
  }
246
 
247
  #wpsl-result-list {
 
248
  width:33%;
249
  margin-right:0.5%;
250
  }
251
+
252
  .wpsl-store-below #wpsl-result-list {
 
253
  width:100%;
254
  margin:12px 0 0 0;
255
  }
259
  height:350px;
260
  overflow-y:auto;
261
  }
262
+
263
+ .wpsl-hide,
264
+ #wpsl-direction-details {
265
+ display:none;
266
+ }
267
 
268
  #wpsl-result-list p {
269
  padding-left:10px;
272
  padding-left: 0;
273
  }
274
 
 
 
 
 
275
  #wpsl-result-list a {
276
  outline:none;
277
  }
278
 
279
+ .wpsl-direction-before {
280
+ margin: 14px 0 21px 0;
281
+ padding-left: 10px;
282
+ }
283
+
284
+ .wpsl-store-below .wpsl-direction-before {
285
+ padding-left: 0;
286
+ }
287
+
288
+ .wpsl-direction-before div {
289
+ margin-top: 10px;
290
+ }
291
+
292
+ #wpsl-wrap #wpsl-result-list li {
293
  padding: 10px;
294
  border-bottom: 1px dotted #ccc;
295
  margin-left: 0;
296
  overflow: hidden;
297
+ list-style: none outside none !important;
298
+ text-indent: 0;
299
  }
300
+
301
+ #wpsl-wrap.wpsl-store-below #wpsl-result-list li {
302
  padding: 10px 10px 10px 0;
303
  }
304
 
305
  #wpsl-result-list li p {
306
+ padding-left: 0;
307
+ margin: 0 0 20px 0;
308
  }
309
 
310
  .wpsl-store-details.wpsl-store-listing {
311
+ position: relative;
312
+ padding-right: 20px;
313
  }
314
+
315
  .wpsl-store-details.wpsl-store-listing:before,
316
  .wpsl-store-details.wpsl-store-listing.wpsl-active-details:before {
317
  position: absolute;
334
  float:right;
335
  border-radius:3px;
336
  margin:7px 0 0 10px;
 
 
337
  padding:0;
338
  border:none;
339
  }
364
  }
365
 
366
  /* Preloader */
367
+ #wpsl-wrap #wpsl-result-list li.wpsl-preloader {
368
+ position: relative;
369
+ border-bottom: none;
370
+ padding: 10px 10px 10px 35px;
371
  }
372
+
373
  .wpsl-preloader img {
374
+ position: absolute;
375
+ left: 10px;
376
+ top: 50%;
377
+ margin-top: -8px;
378
  box-shadow:none !important;
379
  border:none !important;
380
  }
381
 
382
  .wpsl-preloader span {
383
+ float: left;
384
+ margin: -5px 0 0 11px;
385
  }
386
 
387
  #wpsl-search-wrap div,
388
  #wpsl-search-btn {
389
+ margin-right: 10px;
390
+ float: left;
391
+ }
392
+
393
+ #wpsl-search-wrap .wpsl-select-wrap {
394
+ position: relative;
395
+ z-index: 2;
396
+ margin-right: 0;
397
+ }
398
+
399
+ #wpsl-search-wrap .wpsl-input-field {
400
+ position: relative;
401
+ }
402
+
403
+ #wpsl-radius, #wpsl-results {
404
+ float: left;
405
+ margin-right: 15px;
406
+ }
407
+
408
+ #wpsl-category {
409
+ position: relative;
410
+ z-index: 1;
411
+ clear: both;
412
  }
413
 
414
  #wpsl-search-wrap .wpsl-dropdown div {
442
  display:inline;
443
  }
444
 
445
+ #wpsl-radius {
446
+ margin-right:10px;
447
+ }
448
  #wpsl-search-btn:hover {
449
  cursor: pointer;
450
  }
460
  line-height: 32px;
461
  }
462
 
463
+ #wpsl-results label {
464
+ width: auto;
465
+ }
466
+
467
  #wpsl-result-list ul {
468
  list-style: none;
469
  margin: 0;
474
  }
475
 
476
  /* Infowindow */
477
+ #wpsl-gmap .wpsl-info-window,
478
+ .wpsl-gmap-canvas .wpsl-info-window {
479
  max-width:225px;
480
  }
481
 
484
  display:block;
485
  }
486
 
487
+ .wpsl-info-window .wpsl-no-margin {
488
+ margin:0;
489
+ }
490
+
491
  /* More info details in the store listings */
492
  .wpsl-more-info-listings {
493
  display:none;
497
  .wpsl-info-window span span {
498
  display:inline !important;
499
  }
500
+
501
+ #wpsl-wrap .wpsl-info-window p {
502
+ margin: 0 0 10px 0;
503
  }
504
+
505
  .wpsl-store-hours {
506
  margin-top:10px;
507
  }
508
+
509
  .wpsl-store-hours strong {
510
  display:block;
511
  }
512
 
513
+ #wpsl-gmap .wpsl-info-actions {
514
  display:block;
515
+ margin:10px 0 !important;
516
  }
 
 
 
 
517
 
518
+ .wpsl-info-actions a {
519
+ float:left;
520
+ margin-right: 7px;
521
+ }
522
+
523
+ .wpsl-info-actions .wpsl-zoom-here {
524
  margin-right:0;
525
  }
526
 
539
  z-index: 2;
540
  }
541
 
542
+ #wpsl-results .wpsl-dropdown {
543
+ width: 70px;
544
+ }
545
+
546
  .wpsl-dropdown ul {
547
  position: absolute;
548
  left: 0;
549
  width: 100%;
550
  height: 100%;
551
+ padding: 0 !important;
552
+ margin: 0 !important;
553
  list-style: none;
554
  overflow: hidden;
555
  }
603
  font-weight: bold;
604
  }
605
 
606
+ .wpsl-clearfix:before,
607
+ .wpsl-clearfix:after {
 
 
 
 
 
608
  content: " ";
609
  display: table;
610
  }
611
+
612
+ .wpsl-clearfix:after {
613
  clear: both;
614
  }
615
 
616
+ #wpsl-wrap .wpsl-selected-item {
617
+ position: static;
618
+ padding-right: 35px !important;
619
+ }
620
+
621
+ #wpsl-category,
622
+ .wpsl-input,
623
+ .wpsl-select-wrap {
624
+ position: relative;
625
+ margin-bottom: 10px;
626
+ }
627
+
628
+ .wpsl-provided-by {
629
+ float: right;
630
+ padding: 5px 0;
631
+ text-align: right;
632
+ font-size: 12px;
633
+ width: 100%;
634
+ }
635
+
636
+ #wpsl-wrap .wpsl-results-only label {
637
+ width: auto;
638
+ }
639
+
640
+ /* wpsl custom post type pages */
641
+ .wpsl-locations-details,
642
+ .wpsl-location-address,
643
+ .wpsl-contact-details {
644
+ margin-bottom: 15px;
645
+ }
646
+
647
+ .wpsl-contact-details {
648
+ clear: both;
649
+ }
650
+
651
+ table.wpsl-opening-hours td {
652
+ vertical-align:top;
653
+ padding: 0 15px 0 0;
654
+ }
655
+
656
+ .wpsl_stores .wpsl-contact-details span,
657
+ #wpsl-stores .wpsl-contact-details span,
658
+ table.wpsl-opening-hours time {
659
+ display:block;
660
+ }
661
+
662
+ table.wpsl-opening-hours {
663
+ width:auto !important;
664
+ font-size:100% !important;
665
+ }
666
+
667
+ table.wpsl-opening-hours,
668
+ table.wpsl-opening-hours td {
669
+ border:none !important;
670
+ }
671
+
672
+ /* Custom Infobox */
673
+ .wpsl-gmap-canvas .wpsl-infobox {
674
+ min-width:155px;
675
+ max-width:350px !important;
676
+ padding:10px;
677
+ border-radius:4px;
678
+ font-size:13px;
679
+ font-weight:300;
680
+ border:1px solid #ccc;
681
+ background:#fff !important;
682
+ }
683
+
684
+ .wpsl-gmap-canvas .wpsl-infobox:after,
685
+ .wpsl-gmap-canvas .wpsl-infobox:before {
686
+ position:absolute;
687
+ content:"";
688
+ left:40px;
689
+ bottom:-11px;
690
  }
691
 
692
+ .wpsl-gmap-canvas .wpsl-infobox:after {
693
+ border-left:11px solid transparent;
694
+ border-right:11px solid transparent;
695
+ border-top:11px solid #fff;
696
+ }
697
+
698
+ .wpsl-gmap-canvas .wpsl-infobox:before {
699
+ border-left:13px solid transparent;
700
+ border-right:13px solid transparent;
701
+ border-top:13px solid #ccc;
702
+ bottom:-13px;
703
+ left:38px;
704
  }
705
 
706
  @media (max-width: 825px) {
707
  #wpsl-search-input {
708
  width: 348px;
709
  }
710
+
711
+ .wpsl-results-only #wpsl-search-wrap .wpsl-dropdown {
712
+ width: 70px;
713
  }
714
 
715
  #wpsl-search-wrap .wpsl-input {
716
  width: 100%;
717
+ margin-bottom: 10px;
718
  }
719
 
 
 
 
 
 
 
 
720
  .wpsl-input label,
721
+ #wpsl-radius label,
722
+ #wpsl-category label,
723
+ .wpsl-cat-results-filter #wpsl-search-wrap .wpsl-input,
724
+ .wpsl-no-filters #wpsl-search-wrap .wpsl-input,
725
+ .wpsl-results-only #wpsl-search-wrap .wpsl-input {
726
+ width: auto;
727
  }
728
  }
729
 
730
  @media (max-width: 720px) {
 
 
 
 
731
  #wpsl-search-wrap .wpsl-dropdown {
732
  width: 114px;
733
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734
  }
735
 
736
  @media (max-width: 675px) {
737
  #wpsl-search-wrap #wpsl-search-btn {
738
+ float: left;
739
+ margin: 0 5px 0 0;
740
  }
741
 
742
+ .wpsl-results-only #wpsl-search-wrap .wpsl-input,
743
  .wpsl-dropdown {
744
  width: 100%;
745
  }
746
+
747
  .wpsl-search {
 
748
  padding: 2%;
749
  }
750
+
751
  .wpsl-input {
752
+ margin-right: 0;
753
  }
754
 
755
  #wpsl-result-list,
756
  #wpsl-gmap {
757
  width:49.75%;
758
  }
759
+
760
  #wpsl-result-list,
761
  #wpsl-gmap {
762
+ float: none;
763
+ width: 100%;
764
  }
765
+
766
+ .wpsl-direction-before {
767
+ padding-left: 0;
768
  }
769
+
770
  #wpsl-gmap {
771
+ margin-bottom: 15px;
772
+ }
773
 
774
+ .wpsl-cat-results-filter .wpsl-select-wrap,
775
+ .wpsl-filter .wpsl-select-wrap,
776
+ #wpsl-result-list {
777
+ margin-bottom: 10px;
778
  }
779
+
780
+ #wpsl-result-list p,
781
+ #wpsl-wrap #wpsl-result-list li {
782
+ padding-left: 0;
783
  }
784
+
785
+ #wpsl-wrap #wpsl-result-list li.wpsl-preloader {
786
+ padding-left: 25px;
787
+ }
788
+
789
+ .wpsl-preloader img {
790
+ left: 0;
791
  }
 
792
 
793
+ #wpsl-stores.wpsl-not-loaded {
794
+ height: 25px;
 
795
  }
796
+
797
+ #wpsl-reset-map {
798
+ top: 25px;
799
  }
800
+
801
+ #wpsl-gmap {
802
+ margin-top: 10px;
803
+ }
804
+
805
+ .wpsl-no-filters #wpsl-search-wrap .wpsl-input,
806
+ #wpsl-category, .wpsl-input, .wpsl-select-wrap,
807
+ .wpsl-input, #wpsl-search-btn {
808
+ margin-bottom: 0;
809
  }
810
 
811
+ #wpsl-stores.wpsl-no-autoload {
812
+ height: auto !important;
813
  }
814
  }
815
 
816
+ @media (max-width: 570px) {
817
+ #wpsl-search-wrap #wpsl-search-btn {
818
+ margin-bottom: 5px;
819
+ }
820
+
821
  .wpsl-search {
822
+ padding: 4%;
 
823
  }
824
+
825
  #wpsl-search-input {
826
+ width: 98% !important;
827
+ }
828
+
829
+ .wpsl-cat-results-filter #wpsl-search-wrap .wpsl-input,
830
+ .wpsl-cat-results-filter #wpsl-search-input,
831
+ .wpsl-no-results #wpsl-search-input,
832
+ .wpsl-results-only #wpsl-search-input {
833
+ width: 100% !important;
834
+ }
835
+
836
+ .wpsl-search-btn-wrap {
837
+ margin-top: 15px;
838
  }
839
+
840
  #wpsl-search-wrap div,
841
  #wpsl-search-btn {
842
  margin-right: 0;
843
  }
844
 
845
  #wpsl-search-wrap div label {
846
+ display: block;
847
+ width: 100%;
 
 
 
 
 
848
  }
849
+
 
850
  #wpsl-results {
851
  width:auto;
852
  }
853
 
854
  .wpsl-select-wrap {
855
+ width: 100%;
856
  }
857
 
858
+ #wpsl-radius,
859
+ #wpsl-results {
860
+ width: 50%;
861
  }
862
+
863
  #wpsl-radius {
864
  margin-right: 4%;
865
  }
 
 
 
 
 
 
 
866
 
867
+ #wpsl-search-wrap .wpsl-dropdown {
868
+ width: 96% !important;
869
  }
 
870
 
871
+ .wpsl-search-btn-wrap {
872
+ clear: both;
 
 
 
 
 
 
 
873
  }
 
874
 
875
+ .wpsl-no-filters #wpsl-search-wrap .wpsl-input,
876
+ .wpsl-no-filters #wpsl-search-input {
877
+ width: 100% !important;
 
 
 
878
  }
 
 
 
879
  }
css/styles.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #wpsl-result-list a,#wpsl-wrap [class*=" wpsl-icon-"]:focus,#wpsl-wrap [class^=wpsl-icon-]:active{outline:0}#wpsl-map-controls div:hover,#wpsl-reset-map:hover,#wpsl-search-btn:hover,.wpsl-dropdown{cursor:pointer}#wpsl-wrap,.wpsl-clearfix:after,.wpsl-contact-details{clear:both}@font-face{font-family:wpsl-fontello;src:url(../font/fontello.eot?28897909);src:url(../font/fontello.eot?28897909#iefix) format('embedded-opentype'),url(../font/fontello.woff?28897909) format('woff'),url(../font/fontello.ttf?28897909) format('truetype'),url(../font/fontello.svg?28897909#fontello) format('svg');font-weight:400;font-style:normal}#wpsl-gmap{float:right;width:66.5%;height:350px;margin-bottom:0}.wpsl-store-below #wpsl-gmap{float:none;width:100%}.wpsl-gmap-canvas{width:100%;height:300px;margin-bottom:20px}.gm-style-mtc,.gmnoprint{z-index:9999!important}#wpsl-gmap div,#wpsl-gmap img,.wpsl-gmap-canvas div,.wpsl-gmap-canvas img{box-shadow:none!important;max-width:none!important;background:0 0}#wpsl-gmap img,.wpsl-gmap-canvas img{display:inline!important;opacity:1!important}#wpsl-wrap{width:100%;overflow:hidden;margin-bottom:20px}#wpsl-search-wrap{float:left;width:100%}#wpsl-gmap #wpsl-map-controls{position:absolute;right:5px;bottom:20px;border-radius:3px;z-index:3;font-size:11px;white-space:nowrap}#wpsl-map-controls .wpsl-direction-preloader{margin:5px 5px 0}#wpsl-map-controls div{float:left;background:#fff;border-radius:3px}#wpsl-wrap [class*=" wpsl-icon-"],#wpsl-wrap [class^=wpsl-icon-]{position:relative;float:left;padding:5px 7px;display:inline-block;font-family:wpsl-fontello;font-style:normal;font-weight:400;font-size:1.3em;color:#7c7c7c;speak:none;text-decoration:inherit;text-align:center;font-variant:normal;text-transform:none;line-height:1em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#wpsl-wrap .wpsl-ie [class*=" wpsl-icon-"],#wpsl-wrap .wpsl-ie [class^=wpsl-icon-]{padding:8px 8px 4px}#wpsl-wrap.wpsl-mobile [class*=" wpsl-icon-"],#wpsl-wrap.wpsl-mobile [class^=wpsl-icon-]{padding:8px 10px}#wpsl-wrap .wpsl-icon-reset{border:1px solid #ccc;border-radius:3px 0 0 3px;z-index:2}#wpsl-wrap .wpsl-icon-direction{border:1px solid #ccc;z-index:1}#wpsl-wrap .wpsl-reset-exists{border-radius:0 3px 3px 0;border-left:0}#wpsl-wrap .wpsl-active-icon,#wpsl-wrap [class*=" wpsl-icon-"]:hover,#wpsl-wrap [class^=wpsl-icon-]:hover{color:#000}#wpsl-wrap .wpsl-in-progress,#wpsl-wrap .wpsl-in-progress:hover{color:#c6c6c6}#wpsl-gmap #wpsl-reset-map{position:absolute;display:none;right:37px;top:37px;padding:6px 14px;background:#fff!important;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:3px;z-index:3}.gm-style-cc{word-wrap:normal}#wpsl-search-wrap .wpsl-input,#wpsl-search-wrap .wpsl-select-wrap{display:table}#wpsl-search-btn,#wpsl-search-wrap #wpsl-radius,#wpsl-search-wrap #wpsl-results,#wpsl-search-wrap .wpsl-input input,#wpsl-search-wrap .wpsl-input label{display:table-cell}#wpsl-search-wrap label{margin-bottom:0}#wpsl-search-input{width:179px;height:auto;padding:7px 12px;font-size:100%;margin:0}#wpsl-search-btn,#wpsl-search-wrap input{border:1px solid #d2d2d2;border-radius:3px}#wpsl-search-btn{padding:7px 10px;line-height:1.428571429;font-weight:400;color:#7c7c7c;background-color:#e6e6e6;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-ms-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-webkit-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-o-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:linear-gradient(top,#f4f4f4,#e6e6e6);box-shadow:0 1px 2px rgba(64,64,64,.1);text-transform:none!important}#wpsl-search-input.wpsl-error{border:1px solid #bd0028!important}.wpsl-search{margin-bottom:12px;padding:12px 12px 0;background:#f4f3f3}.wpsl-back{display:inline-block}#wpsl-result-list{width:33%;margin-right:.5%}.wpsl-store-below #wpsl-result-list{width:100%;margin:12px 0 0}#wpsl-direction-details,#wpsl-stores{height:350px;overflow-y:auto}#wpsl-direction-details,.wpsl-hide{display:none}#wpsl-result-list p{padding-left:10px}.wpsl-store-below #wpsl-result-list p{padding-left:0}.wpsl-direction-before{margin:14px 0 21px;padding-left:10px}.wpsl-store-below .wpsl-direction-before{padding-left:0}.wpsl-direction-before div{margin-top:10px}#wpsl-wrap #wpsl-result-list li{padding:10px;border-bottom:1px dotted #ccc;margin-left:0;overflow:hidden;list-style:none!important;text-indent:0}#wpsl-wrap.wpsl-store-below #wpsl-result-list li{padding:10px 10px 10px 0}#wpsl-result-list li p{padding-left:0;margin:0 0 20px}.wpsl-store-details.wpsl-store-listing{position:relative;padding-right:20px}.wpsl-store-details.wpsl-store-listing.wpsl-active-details:before,.wpsl-store-details.wpsl-store-listing:before{position:absolute;content:'';bottom:6px;right:0;border-top:5px solid #000;border-left:6px solid transparent;border-right:6px solid transparent}.wpsl-store-details.wpsl-store-listing.wpsl-active-details:before{border-bottom:5px solid #000;border-top:none;border-left:6px solid transparent;border-right:6px solid transparent}#wpsl-stores .wpsl-store-thumb{float:right;border-radius:3px;margin:7px 0 0 10px;padding:0;border:none}.wpsl-direction-index{float:left;width:8%;margin:0 5% 0 0}.wpsl-direction-txt{float:left;width:62%}.wpsl-direction-distance{float:left;width:20%;margin:0 0 0 5%}.wpsl-direction-txt span{display:block;margin-top:10px}.wpsl-country,.wpsl-directions,.wpsl-street{display:block;border-bottom:none!important}#wpsl-wrap #wpsl-result-list li.wpsl-preloader{position:relative;border-bottom:none;padding:10px 10px 10px 35px}.wpsl-preloader img{position:absolute;left:10px;top:50%;margin-top:-8px;box-shadow:none!important;border:none!important}.wpsl-preloader span{float:left;margin:-5px 0 0 11px}#wpsl-search-btn,#wpsl-search-wrap div{margin-right:10px;float:left}#wpsl-search-wrap .wpsl-select-wrap{position:relative;z-index:2;margin-right:0}#wpsl-search-wrap .wpsl-input-field{position:relative}#wpsl-radius,#wpsl-results{float:left;margin-right:15px;display:inline}#wpsl-category{z-index:1;clear:both}#wpsl-search-wrap .wpsl-dropdown div{position:absolute;float:none;margin:-1px 0 0;top:100%;left:-1px;right:-1px;border:1px solid #ccc;background:#fff;border-top:1px solid #eee;border-radius:0 0 3px 3px;opacity:0;overflow:hidden;-webkit-transition:all 150ms ease-in-out;-moz-transition:all 150ms ease-in-out;-ms-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out}#wpsl-search-wrap .wpsl-dropdown.wpsl-active div{opacity:1}#wpsl-search-wrap .wpsl-input label{margin-right:0}#wpsl-radius{margin-right:10px}#wpsl-search select,#wpsl-search-wrap select,.wpsl-direction-details{display:none}#wpsl-search-wrap div label{float:left;margin-right:10px;line-height:32px}#wpsl-results label{width:auto}#wpsl-result-list ul{list-style:none;margin:0;padding:0}#wpsl-gmap .wpsl-info-window,.wpsl-gmap-canvas .wpsl-info-window{max-width:225px}.wpsl-info-window span,.wpsl-more-info-listings span{display:block}.wpsl-info-window .wpsl-no-margin{margin:0}.wpsl-more-info-listings{display:none}.wpsl-info-window span span{display:inline!important}#wpsl-wrap .wpsl-info-window p{margin:0 0 10px}.wpsl-store-hours{margin-top:10px}.wpsl-store-hours strong{display:block}#wpsl-gmap .wpsl-info-actions{display:block;margin:10px 0!important}.wpsl-info-actions a{float:left;margin-right:7px}.wpsl-info-actions .wpsl-zoom-here{margin-right:0}.wpsl-dropdown{position:relative;width:90px;border:1px solid #ccc;background:#fff;border-radius:3px;-webkit-user-select:none;-moz-user-select:none;user-select:none;margin-right:0!important;z-index:2}#wpsl-results .wpsl-dropdown{width:70px}.wpsl-dropdown ul{position:absolute;left:0;width:100%;height:100%;padding:0!important;margin:0!important;list-style:none;overflow:hidden}.wpsl-dropdown:hover{box-shadow:0 0 5px rgba(0,0,0,.15)}.wpsl-dropdown .wpsl-selected-item,.wpsl-dropdown li{position:relative;display:block;line-height:1;color:#000;overflow:hidden;white-space:nowrap}.wpsl-selected-item:after{position:absolute;content:"";right:12px;top:50%;margin-top:-4px;border:6px solid transparent;border-top:8px solid #000}.wpsl-active .wpsl-selected-item:after{margin-top:-10px;border:6px solid transparent;border-bottom:8px solid #000}.wpsl-dropdown li:hover{background:#f8f9f8;position:relative;z-index:3;color:#000}.wpsl-dropdown .wpsl-selected-item,.wpsl-dropdown li,.wpsl-selected-item{list-style:none;padding:9px 12px!important;margin:0!important}.wpsl-selected-dropdown{font-weight:700}.wpsl-clearfix:after,.wpsl-clearfix:before{content:" ";display:table}#wpsl-wrap .wpsl-selected-item{position:static;padding-right:35px!important}#wpsl-category,.wpsl-input,.wpsl-select-wrap{position:relative;margin-bottom:10px}.wpsl-provided-by{float:right;padding:5px 0;text-align:right;font-size:12px;width:100%}#wpsl-wrap .wpsl-results-only label{width:auto}.wpsl-contact-details,.wpsl-location-address,.wpsl-locations-details{margin-bottom:15px}table.wpsl-opening-hours td{vertical-align:top;padding:0 15px 0 0}#wpsl-stores .wpsl-contact-details span,.wpsl_stores .wpsl-contact-details span,table.wpsl-opening-hours time{display:block}table.wpsl-opening-hours{width:auto!important;font-size:100%!important}table.wpsl-opening-hours,table.wpsl-opening-hours td{border:none!important}.wpsl-gmap-canvas .wpsl-infobox{min-width:155px;max-width:350px!important;padding:10px;border-radius:4px;font-size:13px;font-weight:300;border:1px solid #ccc;background:#fff!important}.wpsl-gmap-canvas .wpsl-infobox:after,.wpsl-gmap-canvas .wpsl-infobox:before{position:absolute;content:"";left:40px;bottom:-11px}.wpsl-gmap-canvas .wpsl-infobox:after{border-left:11px solid transparent;border-right:11px solid transparent;border-top:11px solid #fff}.wpsl-gmap-canvas .wpsl-infobox:before{border-left:13px solid transparent;border-right:13px solid transparent;border-top:13px solid #ccc;bottom:-13px;left:38px}@media (max-width:825px){#wpsl-search-input{width:348px}.wpsl-results-only #wpsl-search-wrap .wpsl-dropdown{width:70px}#wpsl-search-wrap .wpsl-input{width:100%;margin-bottom:10px}#wpsl-category label,#wpsl-radius label,.wpsl-cat-results-filter #wpsl-search-wrap .wpsl-input,.wpsl-input label,.wpsl-no-filters #wpsl-search-wrap .wpsl-input,.wpsl-results-only #wpsl-search-wrap .wpsl-input{width:auto}}@media (max-width:720px){#wpsl-search-wrap .wpsl-dropdown{width:114px}}@media (max-width:675px){#wpsl-search-wrap #wpsl-search-btn{float:left;margin:0 5px 0 0}.wpsl-dropdown,.wpsl-results-only #wpsl-search-wrap .wpsl-input{width:100%}.wpsl-search{padding:2%}#wpsl-result-list p,#wpsl-wrap #wpsl-result-list li,.wpsl-direction-before{padding-left:0}.wpsl-input{margin-right:0}#wpsl-gmap,#wpsl-result-list{float:none;width:100%}#wpsl-gmap{margin-bottom:15px;margin-top:10px}#wpsl-result-list,.wpsl-cat-results-filter .wpsl-select-wrap,.wpsl-filter .wpsl-select-wrap{margin-bottom:10px}#wpsl-wrap #wpsl-result-list li.wpsl-preloader{padding-left:25px}.wpsl-preloader img{left:0}#wpsl-stores.wpsl-not-loaded{height:25px}#wpsl-reset-map{top:25px}#wpsl-category,#wpsl-search-btn,.wpsl-input,.wpsl-no-filters #wpsl-search-wrap .wpsl-input,.wpsl-select-wrap{margin-bottom:0}#wpsl-stores.wpsl-no-autoload{height:auto!important}}@media (max-width:570px){#wpsl-search-wrap #wpsl-search-btn{margin-bottom:5px}.wpsl-search{padding:4%}#wpsl-search-input{width:98%!important}.wpsl-cat-results-filter #wpsl-search-input,.wpsl-cat-results-filter #wpsl-search-wrap .wpsl-input,.wpsl-no-results #wpsl-search-input,.wpsl-results-only #wpsl-search-input{width:100%!important}.wpsl-search-btn-wrap{margin-top:15px;clear:both}#wpsl-search-btn,#wpsl-search-wrap div{margin-right:0}#wpsl-search-wrap div label{display:block;width:100%}.wpsl-select-wrap{width:100%}#wpsl-radius,#wpsl-results{width:50%}#wpsl-radius{margin-right:4%}#wpsl-search-wrap .wpsl-dropdown{width:96%!important}.wpsl-no-filters #wpsl-search-input,.wpsl-no-filters #wpsl-search-wrap .wpsl-input{width:100%!important}}
font/fontello.eot ADDED
Binary file
font/fontello.svg ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2015 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="fontello" horiz-adv-x="1000" >
7
+ <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="direction" unicode="&#xe800;" d="m782 655l-357-714q-10-20-32-20-3 0-8 1-13 3-20 13t-8 22v322h-321q-13 0-22 7t-13 20 2 23 17 17l714 357q7 4 16 4 15 0 25-10 8-8 10-20t-3-22z" horiz-adv-x="785.7" />
10
+ <glyph glyph-name="arrows-cw" unicode="&#xe801;" d="m843 261q0-3 0-4-36-150-150-243t-267-93q-81 0-157 31t-136 88l-72-72q-11-11-25-11t-25 11-11 25v250q0 14 11 25t25 11h250q14 0 25-11t10-25-10-25l-77-77q40-37 90-57t105-20q74 0 139 37t104 99q6 10 29 66 5 13 17 13h107q8 0 13-6t5-12z m14 446v-250q0-14-10-25t-26-11h-250q-14 0-25 11t-10 25 10 25l77 77q-82 77-194 77-75 0-140-37t-104-99q-6-10-29-66-5-13-17-13h-111q-7 0-13 6t-5 12v4q36 150 151 243t268 93q81 0 158-31t137-88l72 72q11 11 25 11t26-11 10-25z" horiz-adv-x="857.1" />
11
+ </font>
12
+ </defs>
13
+ </svg>
font/fontello.ttf ADDED
Binary file
font/fontello.woff ADDED
Binary file
frontend/class-frontend.php CHANGED
@@ -3,134 +3,1105 @@
3
  * Frontend class
4
  *
5
  * @package WP_Store_locator
6
- * @subpackage Classes/Frontend
7
- * @copyright Copyright (c) 2013, Tijmen Smit
8
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
  * @since 1.0
10
- */
11
 
12
- if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  if ( !class_exists( 'WPSL_Frontend' ) ) {
 
15
  /**
16
  * Handle the frontend of the store locator
17
  *
18
  * @since 1.0
19
  */
20
- class WPSL_Frontend extends WP_Store_locator {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  /**
23
  * Class constructor
24
  */
25
- public function __construct() {
26
- add_shortcode( 'wpsl', array( $this, 'render_store_locator' ) );
27
- $this->settings = $this->get_settings();
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  /**
31
- * Load the required front-end template and scripts
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  *
33
  * @since 1.0
34
- * @return void
 
35
  */
36
- public function render_store_locator() {
37
-
38
- $this->add_frontend_scripts();
 
 
 
 
 
 
 
 
39
 
40
- $template_list = $this->get_templates();
41
- $output = include( $template_list[ absint( $this->settings['template_id'] ) ]['path'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  return $output;
44
  }
45
 
46
  /**
47
- * Create the css rules based on the height / max-width that is set on the settings page
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  *
49
  * @since 1.0
50
  * @return string $css The custom css rules
51
  */
52
- public function get_custom_css() {
53
- $css = '<style>' . "\r\n";
54
-
55
- if ( ( $this->settings['template_id'] == '1' ) && ( $this->settings['store_below_scroll'] == '1' ) ) {
56
- $css .= "#wpsl-gmap {height:" . esc_attr( $this->settings['height'] ) . "px !important;}" . "\r\n";
57
- $css .= "#wpsl-stores, #wpsl-direction-details {height:auto !important;}";
 
 
 
 
 
 
 
 
 
58
  } else {
59
- $css .= "#wpsl-stores, #wpsl-direction-details, #wpsl-gmap {height:" . esc_attr( $this->settings['height'] ) . "px !important;}" . "\r\n";
60
  }
61
-
62
- $css .= "#wpsl-gmap .wpsl-info-window {max-width:" . esc_attr( $this->settings['infowindow_width'] ) . "px !important;}" . "\r\n";
63
- $css .= ".wpsl-input label, #wpsl-radius label {width:" . esc_attr( $this->settings['label_width'] ) . "px;}" . "\r\n";
64
- $css .= "#wpsl-search-input {width:" . esc_attr( $this->settings['search_width'] ) . "px !important;}" . "\r\n";
 
 
 
 
 
 
 
 
65
  $css .= '</style>' . "\r\n";
66
 
67
  return $css;
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  /**
71
  * Collect all the attributes (language, key, region)
72
- * we need before making a request to the Google Maps API
73
  *
74
  * @since 1.0
75
- * @param string The name of the list we need to load data for
76
  * @return string $dropdown_list A list with the available options for the dropdown list
77
  */
78
  public function get_dropdown_list( $list_type ) {
79
 
 
 
80
  $dropdown_list = '';
81
- $settings = explode( ',', $this->settings[$list_type] );
82
 
83
- /* Only show the distance unit when we are dealing with the search radius */
84
  if ( $list_type == 'search_radius' ) {
85
- $distance_unit = ' '. esc_attr( $this->settings['distance_unit'] );
86
  } else {
87
  $distance_unit = '';
88
  }
89
 
90
- foreach ( $settings as $k => $setting_value ) {
91
 
92
- /* The default radius has a () wrapped around it, so we check for that and filter out the () */
93
- if ( strpos( $setting_value, '(' ) !== false ) {
94
  $setting_value = filter_var( $setting_value, FILTER_SANITIZE_NUMBER_INT );
95
- $selected = 'selected="selected"';
96
  } else {
97
  $selected = '';
98
  }
99
 
100
- $dropdown_list .= '<option ' . $selected . ' value="'. absint( $setting_value ) .'">'. absint( $setting_value ) . $distance_unit .'</option>';
101
  }
102
 
103
  return $dropdown_list;
104
  }
105
-
106
  /**
107
- * Collect all the attributes (language, key, region)
108
- * we need before making a request to the Google Maps API
109
  *
110
- * @since 1.0
111
- * @return string $api_data The collected api attributes
112
  */
113
- public function get_gmap_api_attributes() {
 
 
114
 
115
- $api_data = '';
116
- $api_attributes = array( 'language', 'key', 'region' );
117
 
118
- foreach ( $api_attributes as $api_key ) {
119
- if ( !empty( $this->settings['api_'.$api_key] ) ) {
120
- $api_data .= '&'.$api_key.'=' . $this->settings['api_'.$api_key];
121
- }
122
- }
 
 
 
 
123
 
124
- return apply_filters( 'wpsl_gmap_api_attributes', $api_data );
125
- }
 
 
 
 
126
 
127
  /**
128
  * Create a filename with @2x in it for the selected marker color.
129
- * So when a user selected green.png in the admin panel. The js on the front-end will end up
 
130
  * loading green@2x.png to provide support for retina compatible devices.
131
  *
132
  * @since 1.0
133
- * @param string $filename The name of the seleted marker
134
  * @return string $filename The filename with @2x added to the end
135
  */
136
  public function create_retina_filename( $filename ) {
@@ -142,106 +1113,249 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
142
  }
143
 
144
  /**
145
- * Get the default values for the max_results and the search_radius dropdown
146
  *
147
  * @since 1.0.2
148
  * @return array $output The default dropdown values
149
  */
150
  public function get_dropdown_defaults() {
 
 
151
 
152
  $required_defaults = array(
153
- "max_results",
154
- "search_radius"
155
  );
156
 
157
- /* Strip out the default values that are wrapped in ( ) */
158
  foreach ( $required_defaults as $required_default ) {
159
- preg_match_all('/\(([0-9]+?)\)/', $this->settings[$required_default], $match, PREG_PATTERN_ORDER );
160
  $output[$required_default] = $match[1][0];
161
  }
162
-
163
  return $output;
164
  }
165
 
166
  /**
167
- * Load the front-end scripts and localize the required js data
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  *
169
  * @since 1.0
170
  * @return void
171
  */
172
  public function add_frontend_scripts() {
173
- wp_enqueue_style( 'wpsl-css', WPSL_URL . 'css/styles.css', false );
174
- wp_enqueue_script( 'wpsl-gmap', ( "//maps.google.com/maps/api/js?sensor=false".$this->get_gmap_api_attributes() ),'' ,'' ,true );
175
 
176
- if ( $this->settings['marker_clusters'] ) {
177
- wp_enqueue_script( 'wpsl-cluster', WPSL_URL . 'js/markerclusterer.min.js' ); //not minified version is in the /js folder
178
- }
179
 
180
- wp_enqueue_script( 'wpsl-js', WPSL_URL.'js/wpsl-gmap.js', array( 'jquery' ) );
 
 
 
181
 
 
 
182
  $dropdown_defaults = $this->get_dropdown_defaults();
183
 
184
- $settings = array(
185
- 'startMarker' => $this->create_retina_filename( $this->settings['start_marker'] ),
186
- 'storeMarker' => $this->create_retina_filename( $this->settings['store_marker'] ),
187
- 'markerClusters' => $this->settings['marker_clusters'],
188
- 'autoLocate' => $this->settings['auto_locate'],
189
- 'autoLoad' => $this->settings['auto_load'],
190
- 'mapType' => $this->settings['map_type'],
191
- 'zoomLevel' => $this->settings['zoom_level'],
192
- 'zoomLatlng' => $this->settings['zoom_latlng'],
193
- 'streetView' => $this->settings['streetview'],
194
- 'panControls' => $this->settings['pan_controls'],
195
- 'controlPosition' => $this->settings['control_position'],
196
- 'controlStyle' => $this->settings['control_style'],
197
- 'markerBounce' => $this->settings['marker_bounce'],
198
- 'newWindow' => $this->settings['new_window'],
199
- 'resetMap' => $this->settings['reset_map'],
200
- 'directionRedirect' => $this->settings['direction_redirect'],
201
- 'moreInfo' => $this->settings['more_info'],
202
- 'storeUrl' => $this->settings['store_url'],
203
- 'phoneUrl' => $this->settings['phone_url'],
204
- 'moreInfoLocation' => $this->settings['more_info_location'],
205
- 'mouseFocus' => $this->settings['mouse_focus'],
206
- 'templateId' => $this->settings['template_id'],
207
- 'markerStreetView' => $this->settings['marker_streetview'],
208
- 'markerZoomTo' => $this->settings['marker_zoom_to'],
 
 
 
 
 
 
 
 
209
  'maxResults' => $dropdown_defaults['max_results'],
210
  'searchRadius' => $dropdown_defaults['search_radius'],
211
- 'distanceUnit' => $this->settings['distance_unit'],
 
212
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
213
- 'path' => WPSL_URL,
214
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
- /* If the marker clusters are enabled, include the required script and setting values */
217
- if ( $this->settings['marker_clusters'] ) {
218
- $settings['clusterZoom'] = $this->settings['cluster_zoom'];
219
- $settings['clusterSize'] = $this->settings['cluster_size'];
220
- }
221
-
222
- $labels = array(
223
- 'preloader' => stripslashes( __( $this->settings['preloader_label'], 'wpsl' ) ),
224
- 'noResults' => stripslashes( __( $this->settings['no_results_label'], 'wpsl' ) ),
225
- 'moreInfo' => stripslashes( __( $this->settings['more_label'], 'wpsl' ) ),
226
- 'generalError' => stripslashes( __( $this->settings['error_label'], 'wpsl' ) ),
227
- 'queryLimit' => stripslashes( __( $this->settings['limit_label'], 'wpsl' ) ),
228
- 'directions' => stripslashes( __( $this->settings['directions_label'], 'wpsl' ) ),
229
- 'noDirectionsFound' => stripslashes( __( $this->settings['no_directions_label'], 'wpsl' ) ),
230
- 'phone' => stripslashes( __( $this->settings['phone_label'], 'wpsl' ) ),
231
- 'fax' => stripslashes( __( $this->settings['fax_label'], 'wpsl' ) ),
232
- 'hours' => stripslashes( __( $this->settings['hours_label'], 'wpsl' ) ),
233
- 'startPoint' => stripslashes( __( $this->settings['start_label'], 'wpsl' ) ),
234
- 'back' => stripslashes( __( $this->settings['back_label'], 'wpsl' ) ),
235
- 'streetView' => stripslashes( __( $this->settings['street_view_label'], 'wpsl' ) ),
236
- 'zoomHere' => stripslashes( __( $this->settings['zoom_here_label'], 'wpsl' ) )
237
- );
238
-
239
- wp_localize_script( 'wpsl-js', 'wpslSettings', $settings );
240
- wp_localize_script( 'wpsl-js', 'wpslLabels', $labels );
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
 
243
- }
 
 
244
 
245
- new WPSL_Frontend;
 
 
 
246
 
 
247
  }
3
  * Frontend class
4
  *
5
  * @package WP_Store_locator
 
 
 
6
  * @since 1.0
7
+ */
8
 
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
 
11
  if ( !class_exists( 'WPSL_Frontend' ) ) {
12
+
13
  /**
14
  * Handle the frontend of the store locator
15
  *
16
  * @since 1.0
17
  */
18
+ class WPSL_Frontend {
19
+
20
+ /**
21
+ * Keep track which scripts we need to load
22
+ *
23
+ * @since 2.0
24
+ */
25
+ private $load_scripts = array();
26
+
27
+ /**
28
+ * Keep track of the amount of maps on the page
29
+ *
30
+ * @since 2.0
31
+ */
32
+ private static $map_count = 0;
33
+
34
+ private $store_map_data = array();
35
 
36
  /**
37
  * Class constructor
38
  */
39
+ public function __construct() {
40
+
41
+ $this->includes();
42
+
43
+ add_action( 'wp_ajax_store_search', array( $this, 'store_search' ) );
44
+ add_action( 'wp_ajax_nopriv_store_search', array( $this, 'store_search' ) );
45
+ add_action( 'wp_enqueue_scripts', array( $this, 'add_frontend_styles' ) );
46
+ add_action( 'wp_footer', array( $this, 'add_frontend_scripts' ) );
47
+
48
+ add_filter( 'the_content', array( $this, 'cpt_template' ) );
49
+
50
+ add_shortcode( 'wpsl', array( $this, 'show_store_locator' ) );
51
+ add_shortcode( 'wpsl_address', array( $this, 'show_store_address' ) );
52
+ add_shortcode( 'wpsl_hours', array( $this, 'show_opening_hours' ) );
53
+ add_shortcode( 'wpsl_map', array( $this, 'show_store_map' ) );
54
  }
55
+
56
+ /**
57
+ * Include the required front-end files.
58
+ *
59
+ * @since 2.0
60
+ * @return void
61
+ */
62
+ public function includes() {
63
+ require_once( WPSL_PLUGIN_DIR . 'frontend/underscore-functions.php' );
64
+ }
65
+
66
+ /**
67
+ * Handle the Ajax search on the frontend.
68
+ *
69
+ * @since 1.0
70
+ * @return json A list of store locations that are located within the selected search radius
71
+ */
72
+ public function store_search() {
73
+
74
+ global $wpsl, $wpsl_settings;
75
+
76
+ /* Check if auto loading the locations on page load is enabled.
77
+ *
78
+ * If so then we save the store data in a transient to prevent a long loading time
79
+ * in case a large amount of locations need to be displayed.
80
+ *
81
+ * The SQL query that selects nearby locations doesn't take that long,
82
+ * but collecting all the store meta data in get_store_meta_data() for hunderds,
83
+ * or thousands of stores can make it really slow.
84
+ */
85
+ if ( $wpsl_settings['autoload'] && isset( $_GET['autoload'] ) && $_GET['autoload'] && !$wpsl_settings['debug'] && !isset( $_GET['skip_cache'] ) ) {
86
+
87
+ /* If a multilingual plugin ( WPML or qTranslate X ) is active then we have
88
+ * to make sure each language has his own unique transient. We do this by
89
+ * including the lang code in the transient name.
90
+ *
91
+ * Otherwise if the language is for example set to German on page load,
92
+ * and the user switches to Spanish. He would get the incorrect
93
+ * permalink structure ( /de/.. instead or /es/.. ) and translated
94
+ * store details.
95
+ */
96
+ $lang_code = $wpsl->i18n->check_multilingual_code();
97
+
98
+ if ( false === ( $store_data = get_transient( 'wpsl_autoload_' . $wpsl_settings['autoload_limit'] . $lang_code ) ) ) {
99
+ $store_data = $this->find_nearby_locations();
100
+ set_transient( 'wpsl_autoload_' . $wpsl_settings['autoload_limit'] . $lang_code, $store_data, 0 );
101
+ }
102
+ } else {
103
+ $store_data = $this->find_nearby_locations();
104
+ }
105
+
106
+ wp_send_json( $store_data );
107
+
108
+ exit();
109
+ }
110
 
111
  /**
112
+ * Find store locations that are located within the selected search radius.
113
+ *
114
+ * This happens by calculating the distance between the
115
+ * latlng of the searched location, and the latlng from
116
+ * the stores in the db.
117
+ *
118
+ * @since 2.0
119
+ * @return void|array $store_data The list of stores that fall within the selected range.
120
+ */
121
+ public function find_nearby_locations() {
122
+
123
+ global $wpdb, $wpsl, $wpsl_settings;
124
+
125
+ /* Set the correct earth radius in either km or miles.
126
+ * We need this to calculate the distance between two coordinates.
127
+ */
128
+ $radius = ( $wpsl_settings['distance_unit'] == 'km' ) ? 6371 : 3959;
129
+
130
+ /* The placeholder values for the prepared statement in the sql query. */
131
+ $placeholder_values = array(
132
+ $radius,
133
+ $_GET['lat'],
134
+ $_GET['lng'],
135
+ $_GET['lat']
136
+ );
137
+
138
+ /* Check if we need to filter the results by category. */
139
+ if ( isset( $_GET['filter'] ) && $_GET['filter'] ) {
140
+ $placeholder_values[] = $_GET['filter'];
141
+
142
+ $cat_filter = "INNER JOIN $wpdb->term_relationships AS term_rel ON posts.ID = term_rel.object_id
143
+ INNER JOIN $wpdb->term_taxonomy AS term_tax ON term_rel.term_taxonomy_id = term_tax.term_taxonomy_id
144
+ AND term_tax.taxonomy = 'wpsl_store_category'
145
+ AND term_tax.term_id = %d";
146
+ } else {
147
+ $cat_filter = '';
148
+ }
149
+
150
+ /**
151
+ * If WPML is active we include 'GROUP BY lat' in the sql query
152
+ * to prevent duplicate locations from showing up in the results.
153
+ *
154
+ * This is a problem when a store location for example
155
+ * exists in 4 different languages. They would all fall within
156
+ * the selected radius, but we only need one store ID for the 'icl_object_id'
157
+ * function to get the correct store ID for the current language.
158
+ */
159
+ if ( $wpsl->i18n->wpml_exists() ) {
160
+ $group_by = 'GROUP BY lat';
161
+ } else {
162
+ $group_by = '';
163
+ }
164
+
165
+ /* If autoload is enabled we need to check if there is a limit to the
166
+ * amount of locations we need to show.
167
+ *
168
+ * Otherwise include the radius and max results limit in the sql query.
169
+ */
170
+ if ( isset( $_GET['autoload'] ) && $_GET['autoload'] ) {
171
+ $limit = '';
172
+
173
+ if ( $wpsl_settings['autoload_limit'] ) {
174
+ $limit = 'LIMIT %d';
175
+ $placeholder_values[] = $wpsl_settings['autoload_limit'];
176
+ }
177
+
178
+ $sql_sort = 'ORDER BY distance '. $limit;
179
+ } else {
180
+ array_push( $placeholder_values, $this->check_store_filter( 'radius' ), $this->check_store_filter( 'max_results' ) );
181
+ $sql_sort = 'HAVING distance < %d ORDER BY distance LIMIT 0, %d';
182
+ }
183
+
184
+ $placeholder_values = apply_filters( 'wpsl_sql_placeholder_values', $placeholder_values );
185
+
186
+ /* The sql that will check which store locations falls within
187
+ * the selected radius based on the lat and lng values.
188
+ */
189
+ $sql = apply_filters( 'wpsl_sql',
190
+ "SELECT post_lat.meta_value AS lat,
191
+ post_lng.meta_value AS lng,
192
+ posts.ID,
193
+ ( %d * acos( cos( radians( %s ) ) * cos( radians( post_lat.meta_value ) ) * cos( radians( post_lng.meta_value ) - radians( %s ) ) + sin( radians( %s ) ) * sin( radians( post_lat.meta_value ) ) ) )
194
+ AS distance
195
+ FROM $wpdb->posts AS posts
196
+ INNER JOIN $wpdb->postmeta AS post_lat ON post_lat.post_id = posts.ID AND post_lat.meta_key = 'wpsl_lat'
197
+ INNER JOIN $wpdb->postmeta AS post_lng ON post_lng.post_id = posts.ID AND post_lng.meta_key = 'wpsl_lng'
198
+ $cat_filter
199
+ WHERE posts.post_type = 'wpsl_stores'
200
+ AND posts.post_status = 'publish' $group_by $sql_sort"
201
+ );
202
+
203
+ $stores = $wpdb->get_results( $wpdb->prepare( $sql, $placeholder_values ) );
204
+
205
+ /* Make sure we have a valid response */
206
+ if ( $stores === false ) {
207
+ wp_send_json_error();
208
+ } else {
209
+ $store_data = $this->get_store_meta_data( $stores );
210
+
211
+ return apply_filters( 'wpsl_store_data', $store_data );
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Get the post meta data for the selected stores.
217
+ *
218
+ * @since 2.0
219
+ * @param object $stores
220
+ * @return array $all_stores The stores that fall within the selected range with the post meta data.
221
+ */
222
+ public function get_store_meta_data( $stores ) {
223
+
224
+ global $wpsl_settings, $wpsl;
225
+
226
+ $all_stores = array();
227
+ $include_post_content = apply_filters( 'wpsl_include_post_content', false );
228
+
229
+ /* Get the list of store fields that we need to filter out of the post meta data. */
230
+ $meta_field_map = $this->frontend_meta_fields();
231
+
232
+ foreach ( $stores as $store_key => $store ) {
233
+
234
+ /* If WPML is active try to get the id of the translated page. */
235
+ if ( $wpsl->i18n->wpml_exists() ) {
236
+ $store->ID = $wpsl->i18n->maybe_get_wpml_id( $store->ID );
237
+
238
+ if ( !$store->ID ) {
239
+ continue;
240
+ }
241
+ }
242
+
243
+ /* Get the post meta data for each store that was within the range of the search radius. */
244
+ $custom_fields = get_post_custom( $store->ID );
245
+
246
+ foreach ( $meta_field_map as $meta_key => $meta_value ) {
247
+
248
+ if ( isset( $custom_fields[$meta_key][0] ) ) {
249
+ if ( ( isset( $meta_value['type'] ) ) && ( !empty( $meta_value['type'] ) ) ) {
250
+ $meta_type = $meta_value['type'];
251
+ } else {
252
+ $meta_type = '';
253
+ }
254
+
255
+ /* If we need to hide the opening hours, and the current meta type is set to hours we skip it */
256
+ if ( $wpsl_settings['hide_hours'] && $meta_type == 'hours' ) {
257
+ continue;
258
+ }
259
+
260
+ /* Make sure the data is safe to use on the frontend and in the format we expect it to be */
261
+ switch ( $meta_type ) {
262
+ case 'numeric':
263
+ $meta_data = ( is_numeric( $custom_fields[$meta_key][0] ) ) ? $custom_fields[$meta_key][0] : 0 ;
264
+ break;
265
+ case 'email':
266
+ $meta_data = sanitize_email( $custom_fields[$meta_key][0] );
267
+ break;
268
+ case 'url':
269
+ $meta_data = esc_url( $custom_fields[$meta_key][0] );
270
+ break;
271
+ case 'hours':
272
+ $meta_data = $this->get_opening_hours( $custom_fields[$meta_key][0], $hide_closed = false );
273
+ break;
274
+ case 'textarea':
275
+ $meta_data = wp_kses_post( wpautop( $custom_fields[$meta_key][0] ) );
276
+ break;
277
+ case 'text':
278
+ default:
279
+ $meta_data = sanitize_text_field( stripslashes( $custom_fields[$meta_key][0] ) );
280
+ break;
281
+ }
282
+
283
+ $store_meta[$meta_value['name']] = $meta_data;
284
+ } else {
285
+ $store_meta[$meta_value['name']] = '';
286
+ }
287
+
288
+ /* Include the post content if the "More info" option is enabled on the settings page,
289
+ * or if $include_post_content is set to true through the 'wpsl_include_post_content' filter.
290
+ */
291
+ if ( ( $wpsl_settings['more_info'] && $wpsl_settings['more_info_location'] == 'store listings' ) || $include_post_content ) {
292
+ $page_object = get_page( $store->ID );
293
+ $store_meta['description'] = apply_filters( 'the_content', strip_shortcodes( $page_object->post_content ) );
294
+ }
295
+
296
+ $store_meta['store'] = get_the_title( $store->ID );
297
+ $store_meta['thumb'] = $this->get_store_thumb( $store->ID, $store_meta['store'] );
298
+ $store_meta['id'] = $store->ID;
299
+
300
+ if ( !$wpsl_settings['hide_distance'] ) {
301
+ $store_meta['distance'] = round( $store->distance, 1 );
302
+ }
303
+
304
+ if ( $wpsl_settings['permalinks'] ) {
305
+ $store_meta['permalink'] = get_permalink( $store->ID );
306
+ }
307
+ }
308
+
309
+ $all_stores[] = apply_filters( 'wpsl_store_meta', $store_meta, $store->ID );
310
+ }
311
+
312
+ return $all_stores;
313
+ }
314
+
315
+ /**
316
+ * The store meta fields that are included in the json output.
317
+ *
318
+ * The wpsl_ is the name in db, the name value is used as the key in the json output.
319
+ *
320
+ * The type itself is used to determine how the value should be sanitized.
321
+ * Text will go through sanitize_text_field, email through sanitize_email and so on.
322
+ *
323
+ * If no type is set it will default to sanitize_text_field.
324
+ *
325
+ * @since 2.0
326
+ * @return array $store_fields The names of the meta fields used by the store
327
+ */
328
+ public function frontend_meta_fields() {
329
+
330
+ $store_fields = array(
331
+ 'wpsl_address' => array(
332
+ 'name' => 'address'
333
+ ),
334
+ 'wpsl_address2' => array(
335
+ 'name' => 'address2'
336
+ ),
337
+ 'wpsl_city' => array(
338
+ 'name' => 'city'
339
+ ),
340
+ 'wpsl_state' => array(
341
+ 'name' => 'state'
342
+ ),
343
+ 'wpsl_zip' => array(
344
+ 'name' => 'zip'
345
+ ),
346
+ 'wpsl_country' => array(
347
+ 'name' => 'country'
348
+ ),
349
+ 'wpsl_lat' => array(
350
+ 'name' => 'lat',
351
+ 'type' => 'numeric'
352
+ ),
353
+ 'wpsl_lng' => array(
354
+ 'name' => 'lng',
355
+ 'type' => 'numeric'
356
+ ),
357
+ 'wpsl_phone' => array(
358
+ 'name' => 'phone'
359
+ ),
360
+ 'wpsl_fax' => array(
361
+ 'name' => 'fax'
362
+ ),
363
+ 'wpsl_email' => array(
364
+ 'name' => 'email',
365
+ 'type' => 'email'
366
+ ),
367
+ 'wpsl_hours' => array(
368
+ 'name' => 'hours',
369
+ 'type' => 'hours'
370
+ ),
371
+ 'wpsl_url' => array(
372
+ 'name' => 'url',
373
+ 'type' => 'url'
374
+ )
375
+ );
376
+
377
+ return apply_filters( 'wpsl_frontend_meta_fields', $store_fields );
378
+ }
379
+
380
+ /**
381
+ * Get the store thumbnail.
382
+ *
383
+ * @since 2.0
384
+ * @param string $post_id The post id of the store
385
+ * @param string $store_name The name of the store
386
+ * @return void|string $thumb The html img tag
387
+ */
388
+ public function get_store_thumb( $post_id, $store_name ) {
389
+
390
+ $attr = array(
391
+ 'class' => 'wpsl-store-thumb',
392
+ 'alt' => $store_name
393
+ );
394
+
395
+ $thumb = get_the_post_thumbnail( $post_id, $this->get_store_thumb_size(), apply_filters( 'wpsl_thumb_attr', $attr ) );
396
+
397
+ return $thumb;
398
+ }
399
+
400
+ /**
401
+ * Get the store thumbnail size.
402
+ *
403
+ * @since 2.0
404
+ * @return array $size The thumb format
405
+ */
406
+ public function get_store_thumb_size() {
407
+
408
+ $size = apply_filters( 'wpsl_thumb_size', array( 45, 45 ) );
409
+
410
+ return $size;
411
+ }
412
+
413
+ /**
414
+ * Get the opening hours in the correct format.
415
+ *
416
+ * Either convert the hour values that are set through
417
+ * a dropdown to a table, or wrap the textarea input in a <p>.
418
+ *
419
+ * Note: The opening hours can only be set in the textarea format by users who upgraded from 1.x.
420
+ *
421
+ * @since 2.0
422
+ * @param array|string $hours The opening hours
423
+ * @param boolean $hide_closed Hide the days were the location is closed
424
+ * @return string $hours The formated opening hours
425
+ */
426
+ public function get_opening_hours( $hours, $hide_closed ) {
427
+
428
+ $hours = maybe_unserialize( $hours );
429
+
430
+ /* If the hours are set through the dropdown then we create a table for the opening hours.
431
+ * Otherwise we output the data entered in the textarea.
432
+ */
433
+ if ( is_array( $hours ) ) {
434
+ $hours = $this->create_opening_hours_tabel( $hours, $hide_closed );
435
+ } else {
436
+ $hours = wp_kses_post( wpautop( $hours ) );
437
+ }
438
+
439
+ return $hours;
440
+ }
441
+
442
+ /**
443
+ * Create a table for the opening hours.
444
+ *
445
+ * @since 2.0
446
+ * @param array $hours The opening hours
447
+ * @param boolean $hide_closed Hide the days where the location is closed
448
+ * @return string $hour_table The opening hours sorted in a table
449
+ */
450
+ public function create_opening_hours_tabel( $hours, $hide_closed ) {
451
+
452
+ $opening_days = wpsl_get_weekdays();
453
+
454
+ /* Make sure that we have actual opening hours, and not every day is empty */
455
+ if ( $this->not_always_closed( $hours ) ) {
456
+ $hour_table = '<table class="wpsl-opening-hours">';
457
+
458
+ foreach ( $opening_days as $index => $day ) {
459
+ $i = 0;
460
+ $hour_count = count( $hours[$index] );
461
+
462
+ /* If we need to hide days that are set to closed then skip them */
463
+ if ( $hide_closed && !$hour_count ) {
464
+ continue;
465
+ }
466
+
467
+ $hour_table .= '<tr>';
468
+ $hour_table .= '<td>' . esc_html( $day ) . '</td>';
469
+
470
+ /* If we have opening hours we show them, otherwise just show 'Closed' */
471
+ if ( $hour_count > 0 ) {
472
+ $hour_table .= '<td>';
473
+
474
+ while ( $i < $hour_count ) {
475
+ $hour = explode( ',', $hours[$index][$i] );
476
+ $hour_table .= '<time>' . esc_html( $hour[0] ) . ' - ' . esc_html( $hour[1] ) . '</time>';
477
+
478
+ $i++;
479
+ }
480
+
481
+ $hour_table .= '</td>';
482
+ } else {
483
+ $hour_table .= '<td>' . __( 'Closed', 'wpsl' ) . '</td>';
484
+ }
485
+
486
+ $hour_table .= '</tr>';
487
+ }
488
+
489
+ $hour_table .= '</table>';
490
+
491
+ return $hour_table;
492
+ }
493
+ }
494
+
495
+ /**
496
+ * Create the wpsl post type output.
497
+ *
498
+ * If you want to create a custom template you need to
499
+ * create a single-wpsl_stores.php file in your theme folder.
500
+ * You can see an example here http://wpstorelocator.co/document/create-custom-store-page-template/
501
+ *
502
+ * @since 2.0
503
+ * @param string $content
504
+ * @return string $content
505
+ */
506
+ public function cpt_template( $content ) {
507
+
508
+ global $wpsl_settings, $post;
509
+
510
+ if ( isset( $post->post_type ) && $post->post_type == 'wpsl_stores' && is_single() && in_the_loop() ) {
511
+ array_push( $this->load_scripts, 'wpsl_base' );
512
+
513
+ $content .= '[wpsl_map]';
514
+ $content .= '[wpsl_address]';
515
+
516
+ if ( !$wpsl_settings['hide_hours'] ) {
517
+ $content .= '[wpsl_hours]';
518
+ }
519
+ }
520
+
521
+ return $content;
522
+ }
523
+
524
+ /**
525
+ * Handle the [wpsl] shortcode.
526
  *
527
  * @since 1.0
528
+ * @param array $atts Shortcode attributes
529
+ * @return string $output The wpsl template
530
  */
531
+ public function show_store_locator( $atts ) {
532
+
533
+ global $wpsl_settings;
534
+
535
+ /* Accept a 'template' attribute to specify the template ID (e.g. "default" or "below_map" */
536
+ $atts = shortcode_atts( array(
537
+ 'template' => $wpsl_settings['template_id']
538
+ ), $atts );
539
+
540
+ /* Make sure the required scripts are included for the wpsl shortcode */
541
+ array_push( $this->load_scripts, 'wpsl_store_locator' );
542
 
543
+ $template_list = wpsl_get_templates();
544
+ $template_path = '';
545
+
546
+ /* Loop over the template list and look for a matching id with the one set on the settings page. */
547
+ foreach ( $template_list as $template ) {
548
+ if ( $atts['template'] == $template['id'] ) {
549
+ $template_path = $template['path'];
550
+ break;
551
+ }
552
+ }
553
+
554
+ /* Check if we have a template path and the file exists, otherwise we use the default template. */
555
+ if ( !$template_path || ( !file_exists( $template_path ) ) ) {
556
+ $template_path = WPSL_PLUGIN_DIR . 'frontend/templates/default.php';
557
+ }
558
+
559
+ $output = include( $template_path );
560
 
561
  return $output;
562
  }
563
 
564
  /**
565
+ * Handle the [wpsl_address] shortcode.
566
+ *
567
+ * @since 2.0
568
+ * @param array $atts Shortcode attributes
569
+ * @return void|string $output The store address
570
+ */
571
+ public function show_store_address( $atts ) {
572
+
573
+ global $post, $wpsl_settings, $wpsl;
574
+
575
+ $atts = shortcode_atts( apply_filters( 'wpsl_address_shortcode_defaults', array(
576
+ 'id' => '',
577
+ 'name' => true,
578
+ 'address' => true,
579
+ 'address2' => true,
580
+ 'city' => true,
581
+ 'state' => true,
582
+ 'zip' => true,
583
+ 'country' => true,
584
+ 'phone' => true,
585
+ 'fax' => true,
586
+ 'email' => true,
587
+ 'url' => true
588
+ ) ), $atts );
589
+
590
+ if ( get_post_type() == 'wpsl_stores' ) {
591
+ if ( empty( $atts['id'] ) ) {
592
+ if ( isset( $post->ID ) ) {
593
+ $atts['id'] = $post->ID;
594
+ } else {
595
+ return;
596
+ }
597
+ }
598
+ } else if ( empty( $atts['id'] ) ) {
599
+ return __( 'If you use the [wpsl_address] shortcode outside a store page you need to set the ID attribute.', 'wpsl' );
600
+ }
601
+
602
+ $content = '<div class="wpsl-locations-details">';
603
+
604
+ if ( $atts['name'] && $store_name = get_the_title( $atts['id'] ) ) {
605
+ $content .= '<span><strong>' . esc_html( $store_name ) . '</strong></span>';
606
+ }
607
+
608
+ $content .= '<div class="wpsl-location-address">';
609
+
610
+ if ( $atts['address'] && $store_address = get_post_meta( $atts['id'], 'wpsl_address', true ) ) {
611
+ $content .= '<span>' . esc_html( $store_address ) . '</span><br/>';
612
+ }
613
+
614
+ if ( $atts['address2'] && $store_address2 = get_post_meta( $atts['id'], 'wpsl_address2', true ) ) {
615
+ $content .= '<span>' . esc_html( $store_address2 ) . '</span><br/>';
616
+ }
617
+
618
+ $address_format = explode( '_', $wpsl_settings['address_format'] );
619
+ $count = count( $address_format );
620
+ $i = 1;
621
+
622
+ /* Loop over the address parts to make sure they are shown in the right order */
623
+ foreach ( $address_format as $address_part ) {
624
+
625
+ /* Make sure the shortcode attribute is set to true for the $address_part, and it's not the 'comma' part */
626
+ if ( $address_part != 'comma' && $atts[$address_part] ) {
627
+ $post_meta = get_post_meta( $atts['id'], 'wpsl_' . $address_part, true );
628
+
629
+ if ( $post_meta ) {
630
+
631
+ /* Check if the next part of the address is set to 'comma'.
632
+ * If so add the, after the current address part, otherwise just show a space
633
+ */
634
+ if ( isset( $address_format[$i] ) && ( $address_format[$i] == 'comma' ) ) {
635
+ $punctuation = ', ';
636
+ } else {
637
+ $punctuation = ' ';
638
+ }
639
+
640
+ /* If we have reached the last item add a <br /> behind it */
641
+ $br = ( $count == $i ) ? '<br />' : '';
642
+
643
+ $content .= '<span>' . esc_html( $post_meta ) . $punctuation . '</span>' . $br;
644
+ }
645
+ }
646
+
647
+ $i++;
648
+ }
649
+
650
+ if ( $atts['country'] && $store_country = get_post_meta( $atts['id'], 'wpsl_country', true ) ) {
651
+ $content .= '<span>' . esc_html( $store_country ) . '</span>';
652
+ }
653
+
654
+ $content .= '</div>';
655
+
656
+ /* If either the phone, fax, email or url is set to true add the wrap div for the contact div */
657
+ if ( $atts['phone'] || $atts['fax'] || $atts['email'] || $atts['url'] ) {
658
+ $content .= '<div class="wpsl-contact-details">';
659
+
660
+ if ( $atts['phone'] && $store_phone = get_post_meta( $atts['id'], 'wpsl_phone', true ) ) {
661
+ $content .= '<span>' . esc_html( $wpsl->i18n->get_translation( 'phone_label', __( 'Phone', 'wpsl' ) ) ) . ': ' . esc_html( $store_phone ) . '</span>';
662
+ }
663
+
664
+ if ( $atts['fax'] && $store_fax = get_post_meta( $atts['id'], 'wpsl_fax', true ) ) {
665
+ $content .= '<span>' . esc_html( $wpsl->i18n->get_translation( 'fax_label', __( 'Fax', 'wpsl' ) ) ) . ': ' . esc_html( $store_fax ) . '</span>';
666
+ }
667
+
668
+ if ( $atts['email'] && $store_email = get_post_meta( $atts['id'], 'wpsl_email', true ) ) {
669
+ $content .= '<span>' . esc_html( $wpsl->i18n->get_translation( 'email_label', __( 'Email', 'wpsl' ) ) ) . ': ' . sanitize_email( $store_email ) . '</span>';
670
+ }
671
+
672
+ if ( $atts['url'] && $store_url = get_post_meta( $atts['id'], 'wpsl_url', true ) ) {
673
+ $new_window = ( $wpsl_settings['new_window'] ) ? 'target="_blank"' : '' ;
674
+ $content .= '<span>' . esc_html( $wpsl->i18n->get_translation( 'url_label', __( 'Url', 'wpsl' ) ) ) . ': <a ' . $new_window . ' href="' . esc_url( $store_url ) . '">' . esc_url( $store_url ) . '</a></span>';
675
+ }
676
+
677
+ $content .= '</div>';
678
+ }
679
+
680
+ $content .= '</div>';
681
+
682
+ return $content;
683
+ }
684
+
685
+ /**
686
+ * Handle the [wpsl_hours] shortcode.
687
+ *
688
+ * @since 2.0
689
+ * @param array $atts Shortcode attributes
690
+ * @return void|string $output The opening hours
691
+ */
692
+ public function show_opening_hours( $atts ) {
693
+
694
+ global $post;
695
+
696
+ $atts = shortcode_atts( apply_filters( 'wpsl_hour_shortcode_defaults', array(
697
+ 'id' => '',
698
+ 'hide_closed' => false
699
+ ) ), $atts );
700
+
701
+ if ( get_post_type() == 'wpsl_stores' ) {
702
+ if ( empty( $atts['id'] ) ) {
703
+ if ( isset( $post->ID ) ) {
704
+ $atts['id'] = $post->ID;
705
+ } else {
706
+ return;
707
+ }
708
+ }
709
+ } else if ( empty( $atts['id'] ) ) {
710
+ return __( 'If you use the [wpsl_hours] shortcode outside a store page you need to set the ID attribute.', 'wpsl' );
711
+ }
712
+
713
+ $opening_hours = get_post_meta( $atts['id'], 'wpsl_hours' );
714
+
715
+ if ( $opening_hours ) {
716
+ $output = $this->get_opening_hours( $opening_hours[0], $atts['hide_closed'] );
717
+
718
+ return $output;
719
+ }
720
+ }
721
+
722
+ /**
723
+ * Handle the [wpsl_map] shortcode.
724
+ *
725
+ * @since 2.0
726
+ * @param array $atts Shortcode attributes
727
+ * @return string $output The html for the map
728
+ */
729
+ public function show_store_map( $atts ) {
730
+
731
+ global $wpsl_settings, $post;
732
+
733
+ $atts = shortcode_atts( apply_filters( 'wpsl_map_shortcode_defaults', array(
734
+ 'id' => '',
735
+ 'width' => '',
736
+ 'height' => $wpsl_settings['height'],
737
+ 'zoom' => $wpsl_settings['zoom_level'],
738
+ 'map_type' => $wpsl_settings['map_type'],
739
+ 'map_type_control' => $wpsl_settings['type_control'],
740
+ 'map_style' => '',
741
+ 'street_view' => $wpsl_settings['streetview'],
742
+ 'pan_controls' => $wpsl_settings['pan_controls'],
743
+ 'scrollwheel' => $wpsl_settings['scrollwheel'],
744
+ 'control_position' => $wpsl_settings['control_position'],
745
+ 'control_style' => $wpsl_settings['control_style']
746
+ ) ), $atts );
747
+
748
+ array_push( $this->load_scripts, 'wpsl_base' );
749
+
750
+ if ( get_post_type() == 'wpsl_stores' ) {
751
+ if ( empty( $atts['id'] ) ) {
752
+ if ( isset( $post->ID ) ) {
753
+ $atts['id'] = $post->ID;
754
+ } else {
755
+ return;
756
+ }
757
+ }
758
+ } else if ( empty( $atts['id'] ) ) {
759
+ return __( 'If you use the [wpsl_map] shortcode outside a store page you need to set the ID attribute.', 'wpsl' );
760
+ }
761
+
762
+ $store_ids = array_map( 'absint', explode( ',', $atts['id'] ) );
763
+ $store_meta = array();
764
+ $i = 0;
765
+
766
+ foreach ( $store_ids as $store_id ) {
767
+ $lat = get_post_meta( $store_id, 'wpsl_lat', true );
768
+ $lng = get_post_meta( $store_id, 'wpsl_lng', true );
769
+
770
+ /* Make sure the latlng is numeric before collecting the other meta data */
771
+ if ( is_numeric( $lat ) && is_numeric( $lng ) ) {
772
+ $store_meta[$i] = apply_filters( 'wpsl_cpt_info_window_meta_fields', array(
773
+ 'store' => get_the_title( $store_id ),
774
+ 'address' => get_post_meta( $store_id, 'wpsl_address', true ),
775
+ 'address2' => get_post_meta( $store_id, 'wpsl_address2', true ),
776
+ 'city' => get_post_meta( $store_id, 'wpsl_city', true ),
777
+ 'state' => get_post_meta( $store_id, 'wpsl_state', true ),
778
+ 'zip' => get_post_meta( $store_id, 'wpsl_zip', true ),
779
+ 'country' => get_post_meta( $store_id, 'wpsl_country', true )
780
+ ), $store_id );
781
+
782
+ $store_meta[$i]['lat'] = $lat;
783
+ $store_meta[$i]['lng'] = $lng;
784
+ $store_meta[$i]['id'] = $store_id;
785
+
786
+ $i++;
787
+ }
788
+ }
789
+
790
+ $output = '<div id="wpsl-base-gmap_' . self::$map_count . '" class="wpsl-gmap-canvas"></div>' . "\r\n";
791
+
792
+ /* Make sure the shortcode attributes are valid */
793
+ $map_styles = $this->check_map_shortcode_atts( $atts );
794
+
795
+ if ( $map_styles ) {
796
+ if ( isset( $map_styles['css'] ) && !empty( $map_styles['css'] ) ) {
797
+ $output .= '<style>' . $map_styles['css'] . '</style>' . "\r\n";
798
+ unset( $map_styles['css'] );
799
+ }
800
+
801
+ if ( $map_styles ) {
802
+ $store_data['shortCode'] = $map_styles;
803
+ }
804
+ }
805
+
806
+ $store_data['locations'] = $store_meta;
807
+
808
+ $this->store_map_data[self::$map_count] = $store_data;
809
+
810
+ self::$map_count++;
811
+
812
+ return $output;
813
+ }
814
+
815
+ /**
816
+ * Make sure the map style shortcode attributes are valid.
817
+ *
818
+ * The values are send to wp_localize_script in add_frontend_scripts.
819
+ *
820
+ * @since 2.0
821
+ * @param array $atts The map style shortcode attributes
822
+ * @return array $map_atts Validated map style shortcode attributes
823
+ */
824
+ public function check_map_shortcode_atts( $atts ) {
825
+
826
+ $map_atts = array();
827
+
828
+ if ( isset( $atts['width'] ) && is_numeric( $atts['width'] ) ) {
829
+ $width = 'width:' . $atts['width'] . 'px;';
830
+ } else {
831
+ $width = '';
832
+ }
833
+
834
+ if ( isset( $atts['height'] ) && is_numeric( $atts['height'] ) ) {
835
+ $height = 'height:' . $atts['height'] . 'px;';
836
+ } else {
837
+ $height = '';
838
+ }
839
+
840
+ if ( $width || $height ) {
841
+ $map_atts['css'] = '#wpsl-base-gmap_' . self::$map_count . ' {' . $width . $height . '}';
842
+ }
843
+
844
+ if ( isset( $atts['zoom'] ) && !empty( $atts['zoom'] ) ) {
845
+ $map_atts['zoomLevel'] = wpsl_valid_zoom_level( $atts['zoom'] );
846
+ }
847
+
848
+ if ( isset( $atts['map_type'] ) && !empty( $atts['map_type'] ) ) {
849
+ $map_atts['mapType'] = wpsl_valid_map_type( $atts['map_type'] );
850
+ }
851
+
852
+ if ( isset( $atts['map_type_control'] ) ) {
853
+ $map_atts['mapTypeControl'] = $this->shortcode_atts_boolean( $atts['map_type_control'] );
854
+ }
855
+
856
+ if ( isset( $atts['map_style'] ) && $atts['map_style'] == 'default' ) {
857
+ $map_atts['mapStyle'] = '';
858
+ }
859
+
860
+ if ( isset( $atts['street_view'] ) ) {
861
+ $map_atts['streetView'] = $this->shortcode_atts_boolean( $atts['street_view'] );
862
+ }
863
+
864
+ if ( isset( $atts['pan_controls'] ) ) {
865
+ $map_atts['panControls'] = $this->shortcode_atts_boolean( $atts['pan_controls'] );
866
+ }
867
+
868
+ if ( isset( $atts['scrollwheel'] ) ) {
869
+ $map_atts['scrollWheel'] = $this->shortcode_atts_boolean( $atts['scrollwheel'] );
870
+ }
871
+
872
+ if ( isset( $atts['control_position'] ) && !empty( $atts['control_position'] ) && ( $atts['control_position'] == 'left' || $atts['control_position'] == 'right' ) ) {
873
+ $map_atts['controlPosition'] = $atts['control_position'];
874
+ }
875
+
876
+ if ( isset( $atts['control_style'] ) && !empty( $atts['control_style'] ) && ( $atts['control_style'] == 'small' || $atts['control_style'] == 'large' ) ) {
877
+ $map_atts['controlStyle'] = $atts['control_style'];
878
+ }
879
+
880
+ return $map_atts;
881
+ }
882
+
883
+ /**
884
+ * Set the shortcode attribute to either 1 or 0.
885
+ *
886
+ * @since 2.0
887
+ * @param string $att The shortcode attribute val
888
+ * @return int $att_val Either 1 or 0
889
+ */
890
+ public function shortcode_atts_boolean( $att ) {
891
+
892
+ if ( $att === 'true' || absint( $att ) ) {
893
+ $att_val = 1;
894
+ } else {
895
+ $att_val = 0;
896
+ }
897
+
898
+ return $att_val;
899
+ }
900
+
901
+ /**
902
+ * Make sure the filter contains a valid value, otherwise use the default value.
903
+ *
904
+ * @since 2.0
905
+ * @return string $filter_value The filter value
906
+ */
907
+ public function check_store_filter( $filter ) {
908
+
909
+ if ( isset( $_GET[$filter] ) && absint( $_GET[$filter] ) ) {
910
+ $filter_value = $_GET[$filter];
911
+ } else {
912
+ $filter_value = $this->get_default_filter_value( $filter );
913
+ }
914
+
915
+ return $filter_value;
916
+ }
917
+
918
+ /**
919
+ * Get the default selected value for a dropdown.
920
+ *
921
+ * @since 1.0
922
+ * @param string $type The request list type
923
+ * @return string $response The default list value
924
+ */
925
+ public function get_default_filter_value( $type ) {
926
+
927
+ $settings = get_option( 'wpsl_settings' );
928
+ $list_values = explode( ',', $settings[$type] );
929
+
930
+ foreach ( $list_values as $k => $list_value ) {
931
+
932
+ /* The default radius has a [] wrapped around it, so we check for that and filter out the [] */
933
+ if ( strpos( $list_value, '[' ) !== false ) {
934
+ $response = filter_var( $list_value, FILTER_SANITIZE_NUMBER_INT );
935
+ break;
936
+ }
937
+ }
938
+
939
+ return $response;
940
+ }
941
+
942
+ /**
943
+ * Check if we have a opening day that has an value, if not they are all set to closed.
944
+ *
945
+ * @since 2.0
946
+ * @param array $opening_hours The opening hours
947
+ * @return boolean True if a day is found that isn't empty
948
+ */
949
+ public function not_always_closed( $opening_hours ) {
950
+
951
+ foreach ( $opening_hours as $hours => $hour ) {
952
+ if ( !empty( $hour ) ) {
953
+ return true;
954
+ }
955
+ }
956
+ }
957
+
958
+ /**
959
+ * Create the css rules based on the height / max-width that is set on the settings page.
960
  *
961
  * @since 1.0
962
  * @return string $css The custom css rules
963
  */
964
+ public function get_custom_css() {
965
+
966
+ global $wpsl_settings;
967
+
968
+ $thumb_size = $this->get_store_thumb_size();
969
+
970
+ $css = '<style>' . "\r\n";
971
+
972
+ if ( isset( $thumb_size[0] ) && is_numeric( $thumb_size[0] ) && isset( $thumb_size[1] ) && is_numeric( $thumb_size[1] ) ) {
973
+ $css .= "\t" . "#wpsl-stores .wpsl-store-thumb {height:" . esc_attr( $thumb_size[0] ) . "px !important; width:" . esc_attr( $thumb_size[1] ) . "px !important;}" . "\r\n";
974
+ }
975
+
976
+ if ( $wpsl_settings['template_id'] == 'below_map' && $wpsl_settings['listing_below_no_scroll'] ) {
977
+ $css .= "\t" . "#wpsl-gmap {height:" . esc_attr( $wpsl_settings['height'] ) . "px !important;}" . "\r\n";
978
+ $css .= "\t" . "#wpsl-stores, #wpsl-direction-details {height:auto !important;}";
979
  } else {
980
+ $css .= "\t" . "#wpsl-stores, #wpsl-direction-details, #wpsl-gmap {height:" . esc_attr( $wpsl_settings['height'] ) . "px !important;}" . "\r\n";
981
  }
982
+
983
+ /* If the category dropdowns are enabled then we make it
984
+ * the same width as the search input field. */
985
+ if ( $wpsl_settings['category_dropdown'] ) {
986
+ $cat_elem = ',#wpsl-category .wpsl-dropdown';
987
+ } else {
988
+ $cat_elem = '';
989
+ }
990
+
991
+ $css .= "\t" . "#wpsl-gmap .wpsl-info-window {max-width:" . esc_attr( $wpsl_settings['infowindow_width'] ) . "px !important;}" . "\r\n";
992
+ $css .= "\t" . ".wpsl-input label, #wpsl-radius label, #wpsl-category label {width:" . esc_attr( $wpsl_settings['label_width'] ) . "px;}" . "\r\n";
993
+ $css .= "\t" . "#wpsl-search-input " . $cat_elem . " {width:" . esc_attr( $wpsl_settings['search_width'] ) . "px;}" . "\r\n";
994
  $css .= '</style>' . "\r\n";
995
 
996
  return $css;
997
  }
998
 
999
+ /**
1000
+ * Collect the CSS classes that are placed on the outer div.
1001
+ *
1002
+ * @since 2.0
1003
+ * @return string $classes The custom CSS rules
1004
+ */
1005
+ public function get_css_classes() {
1006
+
1007
+ global $wpsl_settings;
1008
+
1009
+ $classes = array();
1010
+
1011
+ if ( $wpsl_settings['category_dropdown'] && $wpsl_settings['results_dropdown'] && !$wpsl_settings['radius_dropdown'] ) {
1012
+ $classes[] = 'wpsl-cat-results-filter';
1013
+ } else if ( $wpsl_settings['category_dropdown'] && ( $wpsl_settings['results_dropdown'] || $wpsl_settings['radius_dropdown'] ) ) {
1014
+ $classes[] = 'wpsl-filter';
1015
+ }
1016
+
1017
+ if ( !$wpsl_settings['category_dropdown'] && !$wpsl_settings['results_dropdown'] && !$wpsl_settings['radius_dropdown'] ) {
1018
+ $classes[] = 'wpsl-no-filters';
1019
+ }
1020
+
1021
+ if ( $wpsl_settings['results_dropdown'] && !$wpsl_settings['category_dropdown'] && !$wpsl_settings['radius_dropdown'] ) {
1022
+ $classes[] = 'wpsl-results-only';
1023
+ }
1024
+
1025
+ if ( !empty( $classes ) ) {
1026
+ return join( ' ', $classes );
1027
+ }
1028
+ }
1029
+
1030
  /**
1031
  * Collect all the attributes (language, key, region)
1032
+ * we need before making a request to the Google Maps API.
1033
  *
1034
  * @since 1.0
1035
+ * @param string $list_type The name of the list we need to load data for
1036
  * @return string $dropdown_list A list with the available options for the dropdown list
1037
  */
1038
  public function get_dropdown_list( $list_type ) {
1039
 
1040
+ global $wpsl_settings;
1041
+
1042
  $dropdown_list = '';
1043
+ $settings = explode( ',', $wpsl_settings[$list_type] );
1044
 
1045
+ /* Only show the distance unit if we are dealing with the search radius */
1046
  if ( $list_type == 'search_radius' ) {
1047
+ $distance_unit = ' '. esc_attr( $wpsl_settings['distance_unit'] );
1048
  } else {
1049
  $distance_unit = '';
1050
  }
1051
 
1052
+ foreach ( $settings as $index => $setting_value ) {
1053
 
1054
+ /* The default radius has a [] wrapped around it, so we check for that and filter out the [] */
1055
+ if ( strpos( $setting_value, '[' ) !== false ) {
1056
  $setting_value = filter_var( $setting_value, FILTER_SANITIZE_NUMBER_INT );
1057
+ $selected = 'selected="selected" ';
1058
  } else {
1059
  $selected = '';
1060
  }
1061
 
1062
+ $dropdown_list .= '<option ' . $selected . 'value="'. absint( $setting_value ) .'">'. absint( $setting_value ) . $distance_unit .'</option>';
1063
  }
1064
 
1065
  return $dropdown_list;
1066
  }
1067
+
1068
  /**
1069
+ * Create the category filter.
 
1070
  *
1071
+ * @since 2.0
1072
+ * @return string|void $category The HTML for the category dropdown, or nothing if no terms exist.
1073
  */
1074
+ public function create_category_filter() {
1075
+
1076
+ global $wpsl;
1077
 
1078
+ $terms = get_terms( 'wpsl_store_category' );
 
1079
 
1080
+ if ( count( $terms ) > 0 ) {
1081
+ $category = '<div id="wpsl-category">' . "\r\n";
1082
+ $category .= '<label for="wpsl-category-list">' . esc_html( $wpsl->i18n->get_translation( 'category_label', __( 'Category', 'wpsl' ) ) ) . '</label>' . "\r\n";
1083
+ $category .= '<select autocomplete="off" name="wpsl-category" id="wpsl-category-list" class="wpsl-dropdown">';
1084
+ $category .= '<option value="0">'. __( 'Any' , 'wpsl' ) .'</option>';
1085
+
1086
+ foreach ( $terms as $term ) {
1087
+ $category .= '<option value="' . $term->term_id . '">' . $term->name . '</option>';
1088
+ }
1089
 
1090
+ $category .= '</select>';
1091
+ $category .= '</div>' . "\r\n";
1092
+
1093
+ return $category;
1094
+ }
1095
+ }
1096
 
1097
  /**
1098
  * Create a filename with @2x in it for the selected marker color.
1099
+ *
1100
+ * So when a user selected green.png in the admin panel. The JS on the front-end will end up
1101
  * loading green@2x.png to provide support for retina compatible devices.
1102
  *
1103
  * @since 1.0
1104
+ * @param string $filename The name of the seleted marker
1105
  * @return string $filename The filename with @2x added to the end
1106
  */
1107
  public function create_retina_filename( $filename ) {
1113
  }
1114
 
1115
  /**
1116
+ * Get the default values for the max_results and the search_radius dropdown.
1117
  *
1118
  * @since 1.0.2
1119
  * @return array $output The default dropdown values
1120
  */
1121
  public function get_dropdown_defaults() {
1122
+
1123
+ global $wpsl_settings;
1124
 
1125
  $required_defaults = array(
1126
+ 'max_results',
1127
+ 'search_radius'
1128
  );
1129
 
1130
+ /* Strip out the default values that are wrapped in [] */
1131
  foreach ( $required_defaults as $required_default ) {
1132
+ preg_match_all( '/\[([0-9]+?)\]/', $wpsl_settings[$required_default], $match, PREG_PATTERN_ORDER );
1133
  $output[$required_default] = $match[1][0];
1134
  }
1135
+
1136
  return $output;
1137
  }
1138
 
1139
  /**
1140
+ * Load the required css styles.
1141
+ *
1142
+ * @since 2.0
1143
+ * @return void
1144
+ */
1145
+ public function add_frontend_styles() {
1146
+
1147
+ $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1148
+
1149
+ wp_enqueue_style( 'wpsl-styles', WPSL_URL . 'css/styles'. $min .'.css', '', WPSL_VERSION_NUM );
1150
+ }
1151
+
1152
+ /**
1153
+ * Get the HTML for the map controls.
1154
+ *
1155
+ * The '&#xe800;' and '&#xe801;' code is for the icon font from fontello.com
1156
+ *
1157
+ * @since 2.0
1158
+ * @return string The HTML for the map controls
1159
+ */
1160
+ public function get_map_controls() {
1161
+
1162
+ global $wpsl_settings, $is_IE;
1163
+
1164
+ if ( $wpsl_settings['reset_map'] ) {
1165
+ $reset_button = '<div class="wpsl-icon-reset"><span>&#xe801;</span></div>';
1166
+ } else {
1167
+ $reset_button = '';
1168
+ }
1169
+
1170
+ /* IE messes up the top padding for the icon fonts from fontello >_<.
1171
+ *
1172
+ * Luckily it's the same in all IE version ( 8-11 ),
1173
+ * so adjusting the padding just for IE fixes it.
1174
+ */
1175
+ if ( $is_IE ) {
1176
+ $class = 'class="wpsl-ie"';
1177
+ } else {
1178
+ $class = '';
1179
+ }
1180
+
1181
+ $map_controls = '<div id="wpsl-map-controls" ' . $class . '>' . $reset_button . '<div class="wpsl-icon-direction"><span>&#xe800;</span></div></div>';
1182
+
1183
+ return apply_filters( 'wpsl_map_controls', $map_controls );
1184
+ }
1185
+
1186
+ /**
1187
+ * The different geolocation errors.
1188
+ *
1189
+ * They are shown when the HTML Geolocation API returns an error.
1190
+ *
1191
+ * @since 2.0
1192
+ * @return array $geolocation_errors
1193
+ */
1194
+ public function geolocation_errors() {
1195
+
1196
+ $geolocation_errors = array(
1197
+ 'denied' => __( 'The application does not have permission to use the Geolocation API.', 'wpsl' ),
1198
+ 'unavailable' => __( 'Location information is unavailable.', 'wpsl' ),
1199
+ 'timeout' => __( 'The geolocation request timed out.', 'wpsl' ),
1200
+ 'generalError' => __( 'An unknown error occurred.', 'wpsl' )
1201
+ );
1202
+
1203
+ return $geolocation_errors;
1204
+ }
1205
+
1206
+ /**
1207
+ * Load the required js scripts.
1208
  *
1209
  * @since 1.0
1210
  * @return void
1211
  */
1212
  public function add_frontend_scripts() {
 
 
1213
 
1214
+ global $wpsl_settings, $wpsl;
 
 
1215
 
1216
+ /* Only load the required js files on the store locator page or individual store pages. */
1217
+ if ( empty( $this->load_scripts ) ) {
1218
+ return;
1219
+ }
1220
 
1221
+ $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1222
+
1223
  $dropdown_defaults = $this->get_dropdown_defaults();
1224
 
1225
+ wp_enqueue_script( 'wpsl-gmap', ( 'https://maps.google.com/maps/api/js?sensor=false' . wpsl_get_gmap_api_params() ), '', null, true );
1226
+
1227
+ $base_settings = array(
1228
+ 'storeMarker' => $this->create_retina_filename( $wpsl_settings['store_marker'] ),
1229
+ 'mapType' => $wpsl_settings['map_type'],
1230
+ 'mapTypeControl' => $wpsl_settings['type_control'],
1231
+ 'zoomLevel' => $wpsl_settings['zoom_level'],
1232
+ 'zoomLatlng' => $wpsl_settings['zoom_latlng'],
1233
+ 'autoZoomLevel' => $wpsl_settings['auto_zoom_level'],
1234
+ 'panControls' => $wpsl_settings['pan_controls'],
1235
+ 'scrollWheel' => $wpsl_settings['scrollwheel'],
1236
+ 'controlPosition' => $wpsl_settings['control_position'],
1237
+ 'controlStyle' => $wpsl_settings['control_style'],
1238
+ 'path' => WPSL_URL
1239
+ );
1240
+
1241
+ $locator_map_settings = array(
1242
+ 'startMarker' => $this->create_retina_filename( $wpsl_settings['start_marker'] ),
1243
+ 'markerClusters' => $wpsl_settings['marker_clusters'],
1244
+ 'streetView' => $wpsl_settings['streetview'],
1245
+ 'autoLocate' => $wpsl_settings['auto_locate'],
1246
+ 'autoLoad' => $wpsl_settings['autoload'],
1247
+ 'markerEffect' => $wpsl_settings['marker_effect'],
1248
+ 'markerStreetView' => $wpsl_settings['marker_streetview'],
1249
+ 'markerZoomTo' => $wpsl_settings['marker_zoom_to'],
1250
+ 'newWindow' => $wpsl_settings['new_window'],
1251
+ 'resetMap' => $wpsl_settings['reset_map'],
1252
+ 'directionRedirect' => $wpsl_settings['direction_redirect'],
1253
+ 'phoneUrl' => $wpsl_settings['phone_url'],
1254
+ 'storeUrl' => $wpsl_settings['store_url'],
1255
+ 'moreInfoLocation' => $wpsl_settings['more_info_location'],
1256
+ 'mouseFocus' => $wpsl_settings['mouse_focus'],
1257
+ 'templateId' => $wpsl_settings['template_id'],
1258
  'maxResults' => $dropdown_defaults['max_results'],
1259
  'searchRadius' => $dropdown_defaults['search_radius'],
1260
+ 'distanceUnit' => $wpsl_settings['distance_unit'],
1261
+ 'geoLocationTimout' => apply_filters( 'wpsl_geolocation_timeout', 5000 ),
1262
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
1263
+ 'mapControls' => $this->get_map_controls()
1264
  );
1265
+
1266
+ /* If the marker clusters are enabled, include the js file and marker settings */
1267
+ if ( $wpsl_settings['marker_clusters'] ) {
1268
+ wp_enqueue_script( 'wpsl-cluster', WPSL_URL . 'js/markerclusterer'. $min .'.js', '', WPSL_VERSION_NUM, true ); //not minified version is in the /js folder
1269
+
1270
+ $base_settings['clusterZoom'] = $wpsl_settings['cluster_zoom'];
1271
+ $base_settings['clusterSize'] = $wpsl_settings['cluster_size'];
1272
+ }
1273
+
1274
+ /* Check if we need to include the infobox script and settings */
1275
+ if ( $wpsl_settings['infowindow_style'] == 'infobox' ) {
1276
+ wp_enqueue_script( 'wpsl-infobox', WPSL_URL . 'js/infobox'. $min .'.js', array( 'wpsl-gmap' ), WPSL_VERSION_NUM, true ); // Not minified version is in the /js folder
1277
+
1278
+ $base_settings['infoWindowStyle'] = $wpsl_settings['infowindow_style'];
1279
+ $base_settings = $this->get_infobox_settings( $base_settings );
1280
+ }
1281
+
1282
+ /* Include the map style */
1283
+ if ( !empty( $wpsl_settings['map_style'] ) ) {
1284
+ $base_settings['mapStyle'] = strip_tags( stripslashes( json_decode( $wpsl_settings['map_style'] ) ) );
1285
+ }
1286
+
1287
+ wp_enqueue_script( 'wpsl-js', WPSL_URL . 'js/wpsl-gmap'. $min .'.js', array( 'jquery' ), WPSL_VERSION_NUM, true );
1288
+ wp_enqueue_script( 'underscore' );
1289
 
1290
+ /* Check if we need to include all the settings and labels or just a part of them */
1291
+ if ( in_array( 'wpsl_store_locator', $this->load_scripts ) ) {
1292
+ $settings = wp_parse_args( $base_settings, $locator_map_settings );
1293
+ $template = 'wpsl_store_locator';
1294
+ $labels = array(
1295
+ 'preloader' => $wpsl->i18n->get_translation( 'preloader_label', __( 'Searching...', 'wpsl' ) ),
1296
+ 'noResults' => $wpsl->i18n->get_translation( 'no_results_label', __( 'No results found', 'wpsl' ) ),
1297
+ 'moreInfo' => $wpsl->i18n->get_translation( 'more_label', __( 'More info', 'wpsl' ) ),
1298
+ 'generalError' => $wpsl->i18n->get_translation( 'error_label', __( 'Something went wrong, please try again!', 'wpsl' ) ),
1299
+ 'queryLimit' => $wpsl->i18n->get_translation( 'limit_label', __( 'API usage limit reached', 'wpsl' ) ),
1300
+ 'directions' => $wpsl->i18n->get_translation( 'directions_label', __( 'Directions', 'wpsl' ) ),
1301
+ 'noDirectionsFound' => $wpsl->i18n->get_translation( 'no_directions_label', __( 'No route could be found between the origin and destination', 'wpsl' ) ),
1302
+ 'startPoint' => $wpsl->i18n->get_translation( 'start_label', __( 'Start location', 'wpsl' ) ),
1303
+ 'back' => $wpsl->i18n->get_translation( 'back_label', __( 'Back', 'wpsl' ) ),
1304
+ 'streetView' => $wpsl->i18n->get_translation( 'street_view_label', __( 'Street view', 'wpsl' ) ),
1305
+ 'zoomHere' => $wpsl->i18n->get_translation( 'zoom_here_label', __( 'Zoom here', 'wpsl' ) )
1306
+ );
1307
+
1308
+ wp_localize_script( 'wpsl-js', 'wpslLabels', $labels );
1309
+ wp_localize_script( 'wpsl-js', 'wpslGeolocationErrors', $this->geolocation_errors() );
1310
+ } else {
1311
+ $template = '';
1312
+ $settings = $base_settings;
1313
+ }
1314
+
1315
+ wp_localize_script( 'wpsl-js', 'wpslSettings', $settings );
1316
+
1317
+ wpsl_create_underscore_templates( $template );
1318
+
1319
+ if ( !empty( $this->store_map_data ) ) {
1320
+ $i = 0;
1321
+
1322
+ foreach ( $this->store_map_data as $map ) {
1323
+ wp_localize_script( 'wpsl-js', 'wpslMap_' . $i, $map );
1324
+
1325
+ $i++;
1326
+ }
1327
+ }
1328
  }
1329
+
1330
+ /**
1331
+ * Get the infobox settings.
1332
+ *
1333
+ * @since 2.0
1334
+ * @see http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html
1335
+ * @param array $settings The plugin settings used on the front-end in js
1336
+ * @return array $settings The plugin settings including the infobox settings
1337
+ */
1338
+ public function get_infobox_settings( $settings ) {
1339
+
1340
+ $infobox_settings = apply_filters( 'wpsl_infobox_settings', array(
1341
+ 'infoBoxClass' => 'wpsl-infobox',
1342
+ 'infoBoxCloseMargin' => '2px', // The margin can be written in css style, so 2px 2px 4px 2px for top, right, bottom, left
1343
+ 'infoBoxCloseUrl' => '//www.google.com/intl/en_us/mapfiles/close.gif',
1344
+ 'infoBoxClearance' => '40,40',
1345
+ 'infoBoxDisableAutoPan' => 0,
1346
+ 'infoBoxEnableEventPropagation' => 0,
1347
+ 'infoBoxPixelOffset' => '-52,-45',
1348
+ 'infoBoxZindex' => 1500
1349
+ ) );
1350
 
1351
+ foreach ( $infobox_settings as $infobox_key => $infobox_setting ) {
1352
+ $settings[$infobox_key] = $infobox_setting;
1353
+ }
1354
 
1355
+ return $settings;
1356
+ }
1357
+
1358
+ }
1359
 
1360
+ new WPSL_Frontend();
1361
  }
frontend/templates/default.php CHANGED
@@ -1,62 +1,63 @@
1
  <?php
2
- $output = $this->get_custom_css();
3
 
4
- $show_results_filter = $this->settings['results_dropdown'];
5
- $results_filter_class = ( $show_results_filter ) ? '' : 'wpsl-no-results';
6
 
7
  $output .= '<div id="wpsl-wrap">' . "\r\n";
8
- $output .= '<div class="wpsl-search clearfix ' . $results_filter_class . '">' . "\r\n";
9
- $output .= '<div id="wpsl-search-wrap">' . "\r\n";
10
- $output .= '<div class="wpsl-input">' . "\r\n";
11
- $output .= '<div><label for="wpsl-search-input">' . esc_html_x( stripslashes( $this->settings['search_label'] ), 'wpsl' ) . '</label></div>' . "\r\n";
12
- $output .= '<input autocomplete="off" id="wpsl-search-input" type="text" value="" name="wpsl-search-input" />' . "\r\n";
13
- $output .= '</div>' . "\r\n";
14
- $output .= '<div class="wpsl-select-wrap">' . "\r\n";
15
- $output .= '<div id="wpsl-radius">' . "\r\n";
16
- $output .= '<label for="wpsl-radius-label">' . esc_html_x( stripslashes( $this->settings['radius_label'] ), 'wpsl' ) . '</label>' . "\r\n";
17
- $output .= '<select autocomplete="off" id="wpsl-radius-label" class="wpsl-dropdown" name="wpsl-radius">' . "\r\n";
18
- $output .= $this->get_dropdown_list( 'search_radius' );
19
- $output .= '</select>' . "\r\n";
20
- $output .= '</div>' . "\r\n";
21
 
22
- if ( $show_results_filter ) {
23
- $output .= '<div id="wpsl-results">' . "\r\n";
24
- $output .= '<label for="wpsl-results-label">' . esc_html_x( stripslashes( $this->settings['results_label'] ), 'wpsl' ) . '</label>' . "\r\n";
25
- $output .= '<select autocomplete="off" id="wpsl-results-label" class="wpsl-dropdown" name="wpsl-results">' . "\r\n";
26
- $output .= $this->get_dropdown_list( 'max_results' );
27
- $output .= '</select>' . "\r\n";
28
- $output .= '</div>' . "\r\n";
29
- }
30
 
31
- $output .= '<div><input id="wpsl-search-btn" type="submit" value='. esc_attr_x( stripslashes( $this->settings['search_btn_label'] ), 'wpsl' ) . '></div>' . "\r\n";
32
- $output .= '</div>' . "\r\n";
33
- $output .= '</div>' . "\r\n";
34
- $output .= '</div>' . "\r\n";
35
-
36
- $output .= '<div id="wpsl-result-list">' . "\r\n";
37
- $output .= '<div id="wpsl-stores">' . "\r\n";
38
- $output .= '<ul></ul>' . "\r\n";
39
- $output .= '</div>' . "\r\n";
40
- $output .= '<div id="wpsl-direction-details">' . "\r\n";
41
- $output .= '<ul></ul>' . "\r\n";
42
- $output .= '</div>' . "\r\n";
43
- $output .= '</div>' . "\r\n";
44
-
45
- if ( $this->settings['reset_map'] ) {
46
-
47
- /* If the control position is set to right, we need to adjust to right space to make sure it doesn't cover map controls. */
48
- if ( $this->settings['control_position'] == 'right' ) {
49
- $align_class = 'class="wpsl-right-controls"';
50
- } else {
51
- $align_class = '';
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
- $output .= '<div class="wpsl-gmap-wrap">' . "\r\n";
55
- $output .= '<div id="wpsl-reset-map" ' . $align_class . '>' . esc_html_x( stripslashes( $this->settings['reset_label'] ), 'wpsl' ) . '</div>' . "\r\n";
56
- $output .= '<div id="wpsl-gmap"></div>' . "\r\n";
57
- $output .= '</div>' . "\r\n";
58
- } else {
59
- $output .= '<div id="wpsl-gmap"></div>' . "\r\n";
 
 
 
 
 
 
 
60
  }
61
 
62
  $output .= '</div>' . "\r\n";
1
  <?php
2
+ global $wpsl_settings, $wpsl;
3
 
4
+ $output = $this->get_custom_css();
5
+ $autoload_class = ( !$wpsl_settings['autoload'] ) ? 'class="wpsl-not-loaded"' : '';
6
 
7
  $output .= '<div id="wpsl-wrap">' . "\r\n";
8
+ $output .= "\t" . '<div class="wpsl-search wpsl-clearfix ' . $this->get_css_classes() . '">' . "\r\n";
9
+ $output .= "\t\t" . '<div id="wpsl-search-wrap">' . "\r\n";
10
+ $output .= "\t\t\t" . '<div class="wpsl-input">' . "\r\n";
11
+ $output .= "\t\t\t\t" . '<div><label for="wpsl-search-input">' . esc_html( $wpsl->i18n->get_translation( 'search_label', __( 'Your location', 'wpsl' ) ) ) . '</label></div>' . "\r\n";
12
+ $output .= "\t\t\t\t" . '<input autocomplete="off" id="wpsl-search-input" type="text" value="" name="wpsl-search-input" />' . "\r\n";
13
+ $output .= "\t\t\t" . '</div>' . "\r\n";
 
 
 
 
 
 
 
14
 
15
+ if ( $wpsl_settings['radius_dropdown'] || $wpsl_settings['results_dropdown'] ) {
16
+ $output .= "\t\t\t" . '<div class="wpsl-select-wrap">' . "\r\n";
 
 
 
 
 
 
17
 
18
+ if ( $wpsl_settings['radius_dropdown'] ) {
19
+ $output .= "\t\t\t\t" . '<div id="wpsl-radius">' . "\r\n";
20
+ $output .= "\t\t\t\t\t" . '<label for="wpsl-radius-dropdown">' . esc_html( $wpsl->i18n->get_translation( 'radius_label', __( 'Search radius', 'wpsl' ) ) ) . '</label>' . "\r\n";
21
+ $output .= "\t\t\t\t\t" . '<select autocomplete="off" id="wpsl-radius-dropdown" class="wpsl-dropdown" name="wpsl-radius">' . "\r\n";
22
+ $output .= "\t\t\t\t\t\t" . $this->get_dropdown_list( 'search_radius' ) . "\r\n";
23
+ $output .= "\t\t\t\t\t" . '</select>' . "\r\n";
24
+ $output .= "\t\t\t\t" . '</div>' . "\r\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
+
27
+ if ( $wpsl_settings['results_dropdown'] ) {
28
+ $output .= "\t\t\t\t" . '<div id="wpsl-results">' . "\r\n";
29
+ $output .= "\t\t\t\t\t" . '<label for="wpsl-results-dropdown">' . esc_html( $wpsl->i18n->get_translation( 'results_label', __( 'Results', 'wpsl' ) ) ) . '</label>' . "\r\n";
30
+ $output .= "\t\t\t\t\t" . '<select autocomplete="off" id="wpsl-results-dropdown" class="wpsl-dropdown" name="wpsl-results">' . "\r\n";
31
+ $output .= "\t\t\t\t\t\t" . $this->get_dropdown_list( 'max_results' ) . "\r\n";
32
+ $output .= "\t\t\t\t\t" . '</select>' . "\r\n";
33
+ $output .= "\t\t\t\t" . '</div>' . "\r\n";
34
+ }
35
+
36
+ $output .= "\t\t\t" . '</div>' . "\r\n";
37
+ }
38
+
39
+ if ( $wpsl_settings['category_dropdown'] ) {
40
+ $output .= $this->create_category_filter();
41
+ }
42
+
43
+ $output .= "\t\t\t\t" . '<div class="wpsl-search-btn-wrap"><input id="wpsl-search-btn" type="submit" value="' . esc_attr( $wpsl->i18n->get_translation( 'search_btn_label', __( 'Search', 'wpsl' ) ) ) . '"></div>' . "\r\n";
44
+
45
+ $output .= "\t\t" . '</div>' . "\r\n";
46
+ $output .= "\t" . '</div>' . "\r\n";
47
 
48
+ $output .= "\t" . '<div id="wpsl-gmap" class="wpsl-gmap-canvas"></div>' . "\r\n";
49
+
50
+ $output .= "\t" . '<div id="wpsl-result-list">' . "\r\n";
51
+ $output .= "\t\t" . '<div id="wpsl-stores" '. $autoload_class .'>' . "\r\n";
52
+ $output .= "\t\t\t" . '<ul></ul>' . "\r\n";
53
+ $output .= "\t\t" . '</div>' . "\r\n";
54
+ $output .= "\t\t" . '<div id="wpsl-direction-details">' . "\r\n";
55
+ $output .= "\t\t\t" . '<ul></ul>' . "\r\n";
56
+ $output .= "\t\t" . '</div>' . "\r\n";
57
+ $output .= "\t" . '</div>' . "\r\n";
58
+
59
+ if ( $wpsl_settings['show_credits'] ) {
60
+ $output .= "\t" . '<div class="wpsl-provided-by">'. sprintf( __( "Search provided by %sWP Store Locator%s", "wpsl" ), "<a target='_blank' href='http://wpstorelocator.co'>", "</a>" ) .'</div>' . "\r\n";
61
  }
62
 
63
  $output .= '</div>' . "\r\n";
frontend/templates/store-listings-below.php CHANGED
@@ -1,63 +1,70 @@
1
  <?php
2
- $output = $this->get_custom_css();
3
 
4
- $show_results_filter = $this->settings['results_dropdown'];
5
- $results_filter_class = ( $show_results_filter ) ? '' : 'wpsl-no-results';
6
 
7
  $output .= '<div id="wpsl-wrap" class="wpsl-store-below">' . "\r\n";
8
- $output .= '<div class="wpsl-search clearfix ' . $results_filter_class . '">' . "\r\n";
9
- $output .= '<div id="wpsl-search-wrap">' . "\r\n";
10
- $output .= '<div class="wpsl-input">' . "\r\n";
11
- $output .= '<div><label for="wpsl-search-input">' . esc_html_x( stripslashes( $this->settings['search_label'] ), 'wpsl' ) . '</label></div>' . "\r\n";
12
- $output .= '<input autocomplete="off" id="wpsl-search-input" type="text" value="" name="wpsl-search-input" />' . "\r\n";
13
- $output .= '</div>' . "\r\n";
14
- $output .= '<div class="wpsl-select-wrap">' . "\r\n";
15
- $output .= '<div id="wpsl-radius">' . "\r\n";
16
- $output .= '<label for="wpsl-radius-label">' . esc_html_x( stripslashes( $this->settings['radius_label'] ), 'wpsl' ).'</label>' . "\r\n";
17
- $output .= '<select autocomplete="off" id="wpsl-radius-label" class="wpsl-dropdown" name="wpsl-radius">' . "\r\n";
18
- $output .= $this->get_dropdown_list( 'search_radius' );
19
- $output .= '</select>' . "\r\n";
20
- $output .= '</div>' . "\r\n";
21
 
22
- if ( $show_results_filter ) {
23
- $output .= '<div id="wpsl-results">' . "\r\n";
24
- $output .= '<label for="wpsl-results-label">' . esc_html_x( stripslashes( $this->settings['results_label'] ), 'wpsl' ) . '</label>' . "\r\n";
25
- $output .= '<select autocomplete="off" id="wpsl-results-label" class="wpsl-dropdown" name="wpsl-results">' . "\r\n";
26
- $output .= $this->get_dropdown_list( 'max_results' );
27
- $output .= '</select>' . "\r\n";
28
- $output .= '</div>' . "\r\n";
29
- }
30
 
31
- $output .= '<div><input id="wpsl-search-btn" type="submit" value='. esc_attr_x( stripslashes( $this->settings['search_btn_label'] ), 'wpsl' ) . '></div>' . "\r\n";
32
- $output .= '</div>' . "\r\n";
33
- $output .= '</div>' . "\r\n";
34
- $output .= '</div>' . "\r\n";
35
-
36
- if ( $this->settings['reset_map'] ) {
37
-
38
- /* If the control position is set to right, we need to adjust to right space to make sure it doesn't cover map controls. */
39
- if ( $this->settings['control_position'] == 'right' ) {
40
- $align_class = 'class="wpsl-right-controls"';
41
- } else {
42
- $align_class = '';
43
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
- $output .= '<div class="wpsl-gmap-wrap">' . "\r\n";
46
- $output .= '<div id="wpsl-reset-map" ' . $align_class . '>' . esc_html_x( stripslashes( $this->settings['reset_label'] ), 'wpsl' ) . '</div>' . "\r\n";
47
- $output .= '<div id="wpsl-gmap"></div>' . "\r\n";
48
- $output .= '</div>' . "\r\n";
49
  } else {
50
- $output .= '<div id="wpsl-gmap"></div>' . "\r\n";
51
  }
52
 
53
- $output .= '<div id="wpsl-result-list">' . "\r\n";
54
- $output .= '<div id="wpsl-stores">' . "\r\n";
55
- $output .= '<ul></ul>' . "\r\n";
56
- $output .= '</div>' . "\r\n";
57
- $output .= '<div id="wpsl-direction-details">' . "\r\n";
58
- $output .= '<ul></ul>' . "\r\n";
59
- $output .= '</div>' . "\r\n";
60
- $output .= '</div>' . "\r\n";
 
 
 
 
61
 
62
  $output .= '</div>' . "\r\n";
63
 
1
  <?php
2
+ global $wpsl_settings, $wpsl;
3
 
4
+ $output = $this->get_custom_css();
5
+ $autoload_class = ( !$wpsl_settings['autoload'] ) ? 'class="wpsl-not-loaded"' : '';
6
 
7
  $output .= '<div id="wpsl-wrap" class="wpsl-store-below">' . "\r\n";
8
+ $output .= "\t" . '<div class="wpsl-search wpsl-clearfix ' . $this->get_css_classes() . '">' . "\r\n";
9
+ $output .= "\t\t" . '<div id="wpsl-search-wrap">' . "\r\n";
10
+ $output .= "\t\t\t" . '<div class="wpsl-input">' . "\r\n";
11
+ $output .= "\t\t\t\t" . '<div><label for="wpsl-search-input">' . esc_html( $wpsl->i18n->get_translation( 'search_label', __( 'Your location', 'wpsl' ) ) ) . '</label></div>' . "\r\n";
12
+ $output .= "\t\t\t\t" . '<input autocomplete="off" id="wpsl-search-input" type="text" value="" name="wpsl-search-input" />' . "\r\n";
13
+ $output .= "\t\t\t" . '</div>' . "\r\n";
 
 
 
 
 
 
 
14
 
15
+ if ( $wpsl_settings['radius_dropdown'] || $wpsl_settings['results_dropdown'] ) {
16
+ $output .= "\t\t\t" . '<div class="wpsl-select-wrap">' . "\r\n";
 
 
 
 
 
 
17
 
18
+ if ( $wpsl_settings['radius_dropdown'] ) {
19
+ $output .= "\t\t\t\t" . '<div id="wpsl-radius">' . "\r\n";
20
+ $output .= "\t\t\t\t\t" . '<label for="wpsl-radius-dropdown">' . esc_html( $wpsl->i18n->get_translation( 'radius_label', __( 'Search radius', 'wpsl' ) ) ) . '</label>' . "\r\n";
21
+ $output .= "\t\t\t\t\t" . '<select autocomplete="off" id="wpsl-radius-dropdown" class="wpsl-dropdown" name="wpsl-radius">' . "\r\n";
22
+ $output .= "\t\t\t\t\t\t" . $this->get_dropdown_list( 'search_radius' ) . "\r\n";
23
+ $output .= "\t\t\t\t\t" . '</select>' . "\r\n";
24
+ $output .= "\t\t\t\t" . '</div>' . "\r\n";
 
 
 
 
 
25
  }
26
+
27
+ if ( $wpsl_settings['results_dropdown'] ) {
28
+ $output .= "\t\t\t\t" . '<div id="wpsl-results">' . "\r\n";
29
+ $output .= "\t\t\t\t\t" . '<label for="wpsl-results-dropdown">' . esc_html( $wpsl->i18n->get_translation( 'results_label', __( 'Results', 'wpsl' ) ) ) . '</label>' . "\r\n";
30
+ $output .= "\t\t\t\t\t" . '<select autocomplete="off" id="wpsl-results-dropdown" class="wpsl-dropdown" name="wpsl-results">' . "\r\n";
31
+ $output .= "\t\t\t\t\t\t" . $this->get_dropdown_list( 'max_results' ) . "\r\n";
32
+ $output .= "\t\t\t\t\t" . '</select>' . "\r\n";
33
+ $output .= "\t\t\t\t" . '</div>' . "\r\n";
34
+ }
35
+
36
+ $output .= "\t\t\t" . '</div>' . "\r\n";
37
+ }
38
+
39
+ if ( $wpsl_settings['category_dropdown'] ) {
40
+ $output .= $this->create_category_filter();
41
+ }
42
+
43
+ $output .= "\t\t\t\t" . '<div class="wpsl-search-btn-wrap"><input id="wpsl-search-btn" type="submit" value="' . esc_attr( $wpsl->i18n->get_translation( 'search_btn_label', __( 'Search', 'wpsl' ) ) ) . '"></div>' . "\r\n";
44
+
45
+ $output .= "\t\t" . '</div>' . "\r\n";
46
+ $output .= "\t" . '</div>' . "\r\n";
47
 
48
+ if ( $wpsl_settings['reset_map'] ) {
49
+ $output .= "\t" . '<div class="wpsl-gmap-wrap">' . "\r\n";
50
+ $output .= "\t\t" . '<div id="wpsl-gmap" class="wpsl-gmap-canvas"></div>' . "\r\n";
51
+ $output .= "\t" . '</div>' . "\r\n";
52
  } else {
53
+ $output .= "\t" . '<div id="wpsl-gmap" class="wpsl-gmap-canvas"></div>' . "\r\n";
54
  }
55
 
56
+ $output .= "\t" . '<div id="wpsl-result-list">' . "\r\n";
57
+ $output .= "\t\t" . '<div id="wpsl-stores" '. $autoload_class .'>' . "\r\n";
58
+ $output .= "\t\t\t" . '<ul></ul>' . "\r\n";
59
+ $output .= "\t\t" . '</div>' . "\r\n";
60
+ $output .= "\t\t" . '<div id="wpsl-direction-details">' . "\r\n";
61
+ $output .= "\t\t\t" . '<ul></ul>' . "\r\n";
62
+ $output .= "\t\t" . '</div>' . "\r\n";
63
+ $output .= "\t" . '</div>' . "\r\n";
64
+
65
+ if ( $wpsl_settings['show_credits'] ) {
66
+ $output .= "\t" . '<div class="wpsl-provided-by">'. sprintf( __( "Search provided by %sWP Store Locator%s", "wpsl" ), "<a target='_blank' href='http://wpstorelocator.co'>", "</a>" ) .'</div>' . "\r\n";
67
+ }
68
 
69
  $output .= '</div>' . "\r\n";
70
 
frontend/underscore-functions.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Create the store data templates.
4
+ *
5
+ * The template is created in JS with _.template, see http://underscorejs.org/#template
6
+ *
7
+ * @since 2.0
8
+ * @param string $template The type of template we need to create
9
+ * @return void
10
+ */
11
+ function wpsl_create_underscore_templates( $template ) {
12
+
13
+ global $wpsl_settings, $wpsl;
14
+
15
+ if ( $template == 'wpsl_store_locator' ) {
16
+ ?>
17
+ <script id="wpsl-info-window-template" type="text/template">
18
+ <?php
19
+ $info_window_template = '<div data-store-id="<%= id %>" class="wpsl-info-window">' . "\r\n";
20
+ $info_window_template .= "\t\t" . '<p>' . "\r\n";
21
+ $info_window_template .= "\t\t\t" . wpsl_store_header_template() . "\r\n"; // Check which header format we use
22
+ $info_window_template .= "\t\t\t" . '<span><%= address %></span>' . "\r\n";
23
+ $info_window_template .= "\t\t\t" . '<% if ( address2 ) { %>' . "\r\n";
24
+ $info_window_template .= "\t\t\t" . '<span><%= address2 %></span>' . "\r\n";
25
+ $info_window_template .= "\t\t\t" . '<% } %>' . "\r\n";
26
+ $info_window_template .= "\t\t\t" . '<span>' . wpsl_address_format_placeholders() . '</span>' . "\r\n"; // Use the correct address format
27
+ $info_window_template .= "\t\t" . '</p>' . "\r\n";
28
+ $info_window_template .= "\t\t" . '<% if ( phone ) { %>' . "\r\n";
29
+ $info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'phone_label', __( 'Phone', 'wpsl' ) ) ) . '</strong>: <%= formatPhoneNumber( phone ) %></span>' . "\r\n";
30
+ $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
31
+ $info_window_template .= "\t\t" . '<% if ( fax ) { %>' . "\r\n";
32
+ $info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'fax_label', __( 'Fax', 'wpsl' ) ) ) . '</strong>: <%= fax %></span>' . "\r\n";
33
+ $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
34
+ $info_window_template .= "\t\t" . '<% if ( email ) { %>' . "\r\n";
35
+ $info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'email_label', __( 'Email', 'wpsl' ) ) ) . '</strong>: <%= email %></span>' . "\r\n";
36
+ $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
37
+ $info_window_template .= "\t\t" . '<%= createInfoWindowActions( id ) %>' . "\r\n";
38
+ $info_window_template .= "\t" . '</div>';
39
+
40
+ echo apply_filters( 'wpsl_info_window_template', $info_window_template . "\n" );
41
+ ?>
42
+ </script>
43
+ <script id="wpsl-listing-template" type="text/template">
44
+ <?php
45
+ $listing_template = '<li data-store-id="<%= id %>">' . "\r\n";
46
+ $listing_template .= "\t\t" . '<div class="wpsl-store-location">' . "\r\n";
47
+ $listing_template .= "\t\t\t" . '<p><%= thumb %>' . "\r\n";
48
+ $listing_template .= "\t\t\t\t" . wpsl_store_header_template( 'listing' ) . "\r\n"; // Check which header format we use
49
+ $listing_template .= "\t\t\t\t" . '<span class="wpsl-street"><%= address %></span>' . "\r\n";
50
+ $listing_template .= "\t\t\t\t" . '<% if ( address2 ) { %>' . "\r\n";
51
+ $listing_template .= "\t\t\t\t" . '<span class="wpsl-street"><%= address2 %></span>' . "\r\n";
52
+ $listing_template .= "\t\t\t\t" . '<% } %>' . "\r\n";
53
+ $listing_template .= "\t\t\t\t" . '<span>' . wpsl_address_format_placeholders() . '</span>' . "\r\n"; // Use the correct address format
54
+ $listing_template .= "\t\t\t\t" . '<span class="wpsl-country"><%= country %></span>' . "\r\n";
55
+ $listing_template .= "\t\t\t" . '</p>' . "\r\n";
56
+ $listing_template .= "\t\t\t" . wpsl_more_info_template() . "\r\n"; // Check if we need to show the 'More Info' link and info
57
+ $listing_template .= "\t\t" . '</div>' . "\r\n";
58
+ $listing_template .= "\t\t" . '<div class="wpsl-direction-wrap">' . "\r\n";
59
+
60
+ if ( !$wpsl_settings['hide_distance'] ) {
61
+ $listing_template .= "\t\t\t" . '<%= distance %> ' . esc_html( $wpsl_settings['distance_unit'] ) . '' . "\r\n";
62
+ }
63
+
64
+ $listing_template .= "\t\t\t" . '<%= createDirectionUrl() %>' . "\r\n";
65
+ $listing_template .= "\t\t" . '</div>' . "\r\n";
66
+ $listing_template .= "\t" . '</li>';
67
+
68
+ echo apply_filters( 'wpsl_listing_template', $listing_template . "\n" );
69
+ ?>
70
+ </script>
71
+ <?php
72
+ } else {
73
+ ?>
74
+ <script id="wpsl-cpt-info-window-template" type="text/template">
75
+ <?php
76
+ $cpt_info_window_template = '<div class="wpsl-info-window">' . "\r\n";
77
+ $cpt_info_window_template .= "\t\t" . '<p class="wpsl-no-margin">' . "\r\n";
78
+ $cpt_info_window_template .= "\t\t\t" . '<strong><%= store %></strong>' . "\r\n";
79
+ $cpt_info_window_template .= "\t\t\t" . '<span><%= address %></span>' . "\r\n";
80
+ $cpt_info_window_template .= "\t\t\t" . '<% if ( address2 ) { %>' . "\r\n";
81
+ $cpt_info_window_template .= "\t\t\t" . '<span><%= address2 %></span>' . "\r\n";
82
+ $cpt_info_window_template .= "\t\t\t" . '<% } %>' . "\r\n";
83
+ $cpt_info_window_template .= "\t\t\t" . '<span>' . wpsl_address_format_placeholders() . '</span>' . "\r\n"; // Use the correct address format
84
+ $cpt_info_window_template .= "\t\t\t" . '<span class="wpsl-country"><%= country %></span>' . "\r\n";
85
+ $cpt_info_window_template .= "\t\t" . '</p>' . "\r\n";
86
+ $cpt_info_window_template .= "\t" . '</div>';
87
+
88
+ echo apply_filters( 'wpsl_cpt_info_window_template', $cpt_info_window_template . "\n" );
89
+ ?>
90
+ </script>
91
+ <?php
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Create the more info template.
97
+ *
98
+ * @since 2.0
99
+ * @return string $more_info_template The template that is used to show the "More info" content
100
+ */
101
+ function wpsl_more_info_template() {
102
+
103
+ global $wpsl_settings, $wpsl;
104
+
105
+ if ( $wpsl_settings['more_info'] ) {
106
+ $more_info_url = '#';
107
+
108
+ if ( $wpsl_settings['template_id'] == 'default' && $wpsl_settings['more_info_location'] == 'info window' ) {
109
+ $more_info_url = '#wpsl-search-wrap';
110
+ }
111
+
112
+ if ( $wpsl_settings['more_info_location'] == 'store listings' ) {
113
+ $more_info_template = '<% if ( !_.isEmpty( phone ) || !_.isEmpty( fax ) || !_.isEmpty( email ) ) { %>' . "\r\n";
114
+ $more_info_template .= "\t\t\t" . '<p><a class="wpsl-store-details wpsl-store-listing" href="#wpsl-id-<%= id %>">' . esc_html( $wpsl->i18n->get_translation( 'more_label', __( 'More info', 'wpsl' ) ) ) . '</a></p>' . "\r\n";
115
+ $more_info_template .= "\t\t\t" . '<div id="wpsl-id-<%= id %>" class="wpsl-more-info-listings">' . "\r\n";
116
+ $more_info_template .= "\t\t\t\t" . '<% if ( description ) { %>' . "\r\n";
117
+ $more_info_template .= "\t\t\t\t" . '<%= description %>' . "\r\n";
118
+ $more_info_template .= "\t\t\t\t" . '<% } %>' . "\r\n";
119
+ $more_info_template .= "\t\t\t\t" . '<p>' . "\r\n";
120
+ $more_info_template .= "\t\t\t\t" . '<% if ( phone ) { %>' . "\r\n";
121
+ $more_info_template .= "\t\t\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'phone_label', __( 'Phone', 'wpsl' ) ) ) . '</strong>: <%= formatPhoneNumber( phone ) %></span>' . "\r\n";
122
+ $more_info_template .= "\t\t\t\t" . '<% } %>' . "\r\n";
123
+ $more_info_template .= "\t\t\t\t" . '<% if ( fax ) { %>' . "\r\n";
124
+ $more_info_template .= "\t\t\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'fax_label', __( 'Fax', 'wpsl' ) ) ) . '</strong>: <%= fax %></span>' . "\r\n";
125
+ $more_info_template .= "\t\t\t\t" . '<% } %>' . "\r\n";
126
+ $more_info_template .= "\t\t\t\t" . '<% if ( email ) { %>' . "\r\n";
127
+ $more_info_template .= "\t\t\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'email_label', __( 'Email', 'wpsl' ) ) ) . '</strong>: <%= email %></span>' . "\r\n";
128
+ $more_info_template .= "\t\t\t\t" . '<% } %>' . "\r\n";
129
+ $more_info_template .= "\t\t\t\t" . '</p>' . "\r\n";
130
+
131
+ if ( !$wpsl_settings['hide_hours'] ) {
132
+ $more_info_template .= "\t\t\t\t" . '<% if ( hours ) { %>' . "\r\n";
133
+ $more_info_template .= "\t\t\t\t" . '<div class="wpsl-store-hours"><strong>' . esc_html( $wpsl->i18n->get_translation( 'hours_label', __( 'Hours', 'wpsl' ) ) ) . '</strong><%= hours %></div>' . "\r\n";
134
+ $more_info_template .= "\t\t\t\t" . '<% } %>' . "\r\n";
135
+ }
136
+
137
+ $more_info_template .= "\t\t\t" . '</div>' . "\r\n";
138
+ $more_info_template .= "\t\t\t" . '<% } %>';
139
+
140
+ } else {
141
+ $more_info_template = '<p><a class="wpsl-store-details" href="' . $more_info_url . '">' . esc_html( $wpsl->i18n->get_translation( 'more_label', __( 'More info', 'wpsl' ) ) ) . '</a></p>';
142
+ }
143
+
144
+ return apply_filters( 'wpsl_more_info_template', $more_info_template );
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Create the store header template.
150
+ *
151
+ * @since 2.0
152
+ * @param string $location The location where the header is shown ( info_window or listing )
153
+ * @return string $header_template The template for the store header
154
+ */
155
+ function wpsl_store_header_template( $location = 'info_window' ) {
156
+
157
+ global $wpsl_settings;
158
+
159
+ if ( $wpsl_settings['new_window'] ) {
160
+ $new_window = ' target="_blank"';
161
+ } else {
162
+ $new_window = '';
163
+ }
164
+
165
+ /* To keep the code readable in the HTML source we ( unfortunately ) need to adjust the
166
+ * amount of tabs in front of it based on the location were it is shown.
167
+ */
168
+ if ( $location == 'listing') {
169
+ $tab = "\t\t\t\t";
170
+ } else {
171
+ $tab = "\t\t\t";
172
+ }
173
+
174
+ if ( $wpsl_settings['permalinks'] ) {
175
+ $header_template = '<strong><a' . $new_window . ' href="<%= permalink %>"><%= store %></a></strong>';
176
+ } else {
177
+ $header_template = '<% if ( wpslSettings.storeUrl == 1 && url ) { %>' . "\r\n";
178
+ $header_template .= $tab . '<strong><a' . $new_window . ' href="<%= url %>"><%= store %></a></strong>' . "\r\n";
179
+ $header_template .= $tab . '<% } else { %>' . "\r\n";
180
+ $header_template .= $tab . '<strong><%= store %></strong>' . "\r\n";
181
+ $header_template .= $tab . '<% } %>';
182
+ }
183
+
184
+ return apply_filters( 'wpsl_store_header_template', $header_template );
185
+ }
186
+
187
+ /**
188
+ * Create the address placeholders based on the structure defined on the settings page.
189
+ *
190
+ * @since 2.0
191
+ * @return string $address_placeholders A list of address placeholders in the correct order
192
+ */
193
+ function wpsl_address_format_placeholders() {
194
+
195
+ global $wpsl_settings;
196
+
197
+ $address_format = explode( '_', $wpsl_settings['address_format'] );
198
+ $placeholders = '';
199
+ $part_count = count( $address_format ) - 1;
200
+ $i = 0;
201
+
202
+ foreach ( $address_format as $address_part ) {
203
+ if ( $address_part != 'comma' ) {
204
+
205
+ /* Don't add a space after the placeholder if the next part
206
+ * is going to be a comma or if it is the last part.
207
+ */
208
+ if ( $i == $part_count || $address_format[$i + 1] == 'comma' ) {
209
+ $space = '';
210
+ } else {
211
+ $space = ' ';
212
+ }
213
+
214
+ $placeholders .= '<%= ' . $address_part . ' %>' . $space;
215
+ } else {
216
+ $placeholders .= ', ';
217
+ }
218
+
219
+ $i++;
220
+ }
221
+
222
+ return $placeholders;
223
+ }
inc/class-i18n.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * i18n class
4
+ *
5
+ * @package WP_Store_locator
6
+ * @since 2.0
7
+ */
8
+
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
+
11
+ if ( !class_exists( 'WPSL_i18n' ) ) {
12
+
13
+ class WPSL_i18n {
14
+
15
+ private $wpml_active = null;
16
+
17
+ private $qtrans_active = null;
18
+
19
+ /**
20
+ * Class constructor
21
+ */
22
+ function __construct() {
23
+ add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain' ) );
24
+ }
25
+
26
+ /**
27
+ * Load the translations from the language folder
28
+ *
29
+ * @since 2.0
30
+ * @return void
31
+ */
32
+ public function load_plugin_textdomain() {
33
+
34
+ $domain = 'wpsl';
35
+ $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
36
+
37
+ /* Load the language file from the /wp-content/languages/wp-store-locator folder, custom + update proof translations */
38
+ load_textdomain( $domain, WP_LANG_DIR . '/wp-store-locator/' . $domain . '-' . $locale . '.mo' );
39
+
40
+ /* Load the language file from the /wp-content/plugins/wp-store-locator/languages/ folder */
41
+ load_plugin_textdomain( $domain, false, dirname( WPSL_BASENAME ) . '/languages/' );
42
+ }
43
+
44
+ /**
45
+ * Check if WPML is active
46
+ *
47
+ * @since 2.0
48
+ * @return boolean|null
49
+ */
50
+ public function wpml_exists() {
51
+
52
+ if ( $this->wpml_active == null ) {
53
+ $this->wpml_active = function_exists( 'icl_register_string' );
54
+ }
55
+
56
+ return $this->wpml_active;
57
+ }
58
+
59
+ /**
60
+ * Check if a qTranslate compatible plugin is active.
61
+ *
62
+ * @since 2.0
63
+ * @return boolean|null
64
+ */
65
+ public function qtrans_exists() {
66
+
67
+ if ( $this->qtrans_active == null ) {
68
+ $this->qtrans_active = ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) || function_exists( 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) );
69
+ }
70
+
71
+ return $this->qtrans_active;
72
+ }
73
+
74
+ /**
75
+ * See if there is a translated page available for the provided store ID.
76
+ *
77
+ * @since 2.0
78
+ * @see https://wpml.org/documentation/support/creating-multilingual-wordpress-themes/language-dependent-ids/#2
79
+ * @param string $store_id
80
+ * @return string empty or the id of the translated store
81
+ */
82
+ public function maybe_get_wpml_id( $store_id ) {
83
+
84
+ $return_original_id = apply_filters( 'wpsl_return_original_wpml_id', true );
85
+ $translated_id = icl_object_id( $store_id, 'wpsl_stores', $return_original_id, ICL_LANGUAGE_CODE );
86
+
87
+ /* If '$return_original_id' is set to false, NULL is returned if no translation exists. */
88
+ if ( is_null( $translated_id ) ) {
89
+ $translated_id = '';
90
+ }
91
+
92
+ return $translated_id;
93
+ }
94
+
95
+ /**
96
+ * Translate with a qTranslate compatible plugin.
97
+ *
98
+ * @since 2.0
99
+ * @param string $text The original text
100
+ * @return string $translation The translated text
101
+ */
102
+ public function qtranslation( $text ) {
103
+
104
+ if ( function_exists( 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) {
105
+ $translation = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage( $text );
106
+ } else {
107
+ $translation = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $text );
108
+ }
109
+
110
+ return $translation;
111
+ }
112
+
113
+ /**
114
+ * Get the correct translation
115
+ *
116
+ * Return the translated text from either WPML or qTranslate
117
+ * or the translation that was set on the settings page.
118
+ *
119
+ * @since 2.0
120
+ * @param string $name The name of the translated string
121
+ * @param string $text The text of the translated string
122
+ * @return string The translation
123
+ */
124
+ public function get_translation( $name, $text ) {
125
+
126
+ global $wpsl_settings;
127
+
128
+ $translation = '';
129
+
130
+ /* Check if we need to use WPML or qTranslate for the translation */
131
+ if ( $this->wpml_exists() ) {
132
+ $translation = icl_t( 'admin_texts_wpsl_settings', '[wpsl_settings]' . $name, $text );
133
+ } else if ( $this->qtrans_exists() ) {
134
+ $translation = $this->qtranslation( $text );
135
+ }
136
+
137
+ /* If we don't have a translation here, we use the value set on the settings page */
138
+ if ( empty( $translation ) ) {
139
+ $translation = stripslashes( $wpsl_settings[$name] );
140
+ }
141
+
142
+ return $translation;
143
+ }
144
+
145
+ /**
146
+ * If a multilingual plugin like WPML or qTranslate X is active
147
+ * we return the active language code.
148
+ *
149
+ * @since 2.0
150
+ * @return string Empty or the current language code
151
+ */
152
+ public function check_multilingual_code() {
153
+
154
+ $language_code = '';
155
+
156
+ if ( $this->wpml_exists() ) {
157
+ $language_code = '_' . ICL_LANGUAGE_CODE;
158
+ } else if ( $this->qtrans_exists() ) {
159
+
160
+ if ( function_exists( 'qtranxf_getLanguage' ) ) {
161
+ $language_code = '_' . qtranxf_getLanguage();
162
+ } else if ( function_exists( 'qtrans_getLanguage' ) ) {
163
+ $language_code = '_' . qtrans_getLanguage();
164
+ }
165
+ }
166
+
167
+ return $language_code;
168
+ }
169
+
170
+ }
171
+
172
+ new WPSL_i18n();
173
+ }
inc/class-post-types.php ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Store Locator custom post type
4
+ *
5
+ * @package WP_Store_locator
6
+ * @since 2.0
7
+ */
8
+
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
+
11
+ if ( !class_exists( 'WPSL_Post_Types' ) ) {
12
+
13
+ class WPSL_Post_Types {
14
+
15
+ /**
16
+ * Constructor
17
+ */
18
+ public function __construct() {
19
+ add_action( 'init', array( $this, 'register_post_types' ), 10, 1 );
20
+ add_action( 'init', array( $this, 'register_taxonomies' ), 10, 1 );
21
+ add_action( 'manage_wpsl_stores_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 );
22
+
23
+ add_filter( 'enter_title_here', array( $this, 'change_default_title' ) );
24
+ add_filter( 'manage_edit-wpsl_stores_columns', array( $this, 'edit_columns' ) );
25
+ add_filter( 'manage_edit-wpsl_stores_sortable_columns', array( $this, 'sortable_columns' ) );
26
+ add_filter( 'request', array( $this, 'sort_columns' ) );
27
+ }
28
+
29
+ /**
30
+ * Register the WPSL post type.
31
+ *
32
+ * @since 2.0
33
+ * @return void
34
+ */
35
+ public function register_post_types() {
36
+
37
+ global $wpsl_settings;
38
+
39
+ /* Enable permalinks for the post type? */
40
+ if ( isset( $wpsl_settings['permalinks'] ) && $wpsl_settings['permalinks'] ) {
41
+ $public = true;
42
+ $exclude_from_search = false;
43
+ $rewrite = array( 'slug' => $wpsl_settings['permalink_slug'] );
44
+ } else {
45
+ $public = false;
46
+ $exclude_from_search = true;
47
+ $rewrite = false;
48
+ }
49
+
50
+ $singular = __( 'Store', 'wpsl' );
51
+ $plural = __( 'Stores', 'wpsl' );
52
+
53
+ /* The labels for the wpsl_stores post type */
54
+ $labels = apply_filters( 'wpsl_post_type_labels', array(
55
+ 'name' => __( 'Store Locator', 'wpsl' ),
56
+ 'all_items' => sprintf( __( 'All %s', 'wpsl' ), $plural ),
57
+ 'singular_name' => $singular,
58
+ 'add_new' => sprintf( __( 'New %s', 'wpsl' ), $singular ),
59
+ 'add_new_item' => sprintf( __( 'Add New %s', 'wpsl' ), $singular ),
60
+ 'edit_item' => sprintf( __( 'Edit %s', 'wpsl' ), $singular ),
61
+ 'new_item' => sprintf( __( 'New %s', 'wpsl' ), $singular ),
62
+ 'view_item' => sprintf( __( 'View %s', 'wpsl' ), $plural ),
63
+ 'search_items' => sprintf( __( 'Search %s', 'wpsl' ), $plural ),
64
+ 'not_found' => sprintf( __( 'No %s found', 'wpsl' ), $plural ),
65
+ 'not_found_in_trash' => sprintf( __( 'No %s found in trash', 'wpsl' ), $plural )
66
+ )
67
+ );
68
+
69
+ /* The arguments for the wpsl_stores post type */
70
+ $args = apply_filters( 'wpsl_post_type_args', array(
71
+ 'labels' => $labels,
72
+ 'public' => $public,
73
+ 'exclude_from_search' => $exclude_from_search,
74
+ 'show_ui' => true,
75
+ 'menu_position' => apply_filters( 'wpsl_post_type_menu_position', null ),
76
+ 'capability_type' => 'store',
77
+ 'map_meta_cap' => true,
78
+ 'rewrite' => $rewrite,
79
+ 'query_var' => 'wpsl_stores',
80
+ 'supports' => array( 'title', 'editor', 'author', 'excerpt', 'revisions', 'thumbnail' )
81
+ )
82
+ );
83
+
84
+ register_post_type( 'wpsl_stores', $args );
85
+ }
86
+
87
+ /**
88
+ * Register the WPSL custom taxonomy.
89
+ *
90
+ * @since 2.0
91
+ * @return void
92
+ */
93
+ public function register_taxonomies() {
94
+
95
+ global $wpsl_settings;
96
+
97
+ /* Enable permalinks for the taxonomy? */
98
+ if ( isset( $wpsl_settings['permalinks'] ) && $wpsl_settings['permalinks'] ) {
99
+ $public = true;
100
+ $rewrite = array( 'slug' => $wpsl_settings['category_slug'] );
101
+ } else {
102
+ $public = false;
103
+ $rewrite = false;
104
+ }
105
+
106
+ $labels = array(
107
+ 'name' => __( 'Store Categories', 'wpsl' ),
108
+ 'singular_name' => __( 'Store Category', 'wpsl' ),
109
+ 'search_items' => __( 'Search Store Categories', 'wpsl' ),
110
+ 'all_items' => __( 'All Store Categories', 'wpsl' ),
111
+ 'parent_item' => __( 'Parent Store Category', 'wpsl' ),
112
+ 'parent_item_colon' => __( 'Parent Store Category:', 'wpsl' ),
113
+ 'edit_item' => __( 'Edit Store Category', 'wpsl' ),
114
+ 'update_item' => __( 'Update Store Category', 'wpsl' ),
115
+ 'add_new_item' => __( 'Add New Store Category', 'wpsl' ),
116
+ 'new_item_name' => __( 'New Store Category Name', 'wpsl' ),
117
+ 'menu_name' => __( 'Store Categories', 'wpsl' ),
118
+ );
119
+
120
+ $args = apply_filters( 'wpsl_store_category_args', array(
121
+ 'labels' => $labels,
122
+ 'public' => $public,
123
+ 'hierarchical' => true,
124
+ 'show_ui' => true,
125
+ 'show_admin_column' => true,
126
+ 'update_count_callback' => '_update_post_term_count',
127
+ 'query_var' => true,
128
+ 'rewrite' => $rewrite
129
+ )
130
+ );
131
+
132
+ register_taxonomy( 'wpsl_store_category', 'wpsl_stores', $args );
133
+ }
134
+
135
+ /**
136
+ * Change the default "Enter title here" placeholder.
137
+ *
138
+ * @since 2.0
139
+ * @param string $title The default title placeholder
140
+ * @return string $title The new title placeholder
141
+ */
142
+ public function change_default_title( $title ) {
143
+
144
+ $screen = get_current_screen();
145
+
146
+ if ( $screen->post_type == 'wpsl_stores' ) {
147
+ $title = __( 'Enter store title here', 'wpsl' );
148
+ }
149
+
150
+ return $title;
151
+ }
152
+
153
+ /**
154
+ * Add new columns to the store list table.
155
+ *
156
+ * @since 2.0
157
+ * @param array $columns The default columns
158
+ * @return array $columns Updated column list
159
+ */
160
+ public function edit_columns( $columns ) {
161
+
162
+ $columns['address'] = __( 'Address', 'wpsl' );
163
+ $columns['city'] = __( 'City', 'wpsl' );
164
+ $columns['state'] = __( 'State', 'wpsl' );
165
+ $columns['zip'] = __( 'Zip', 'wpsl' );
166
+
167
+ return $columns;
168
+ }
169
+
170
+ /**
171
+ * Show the correct store content in the correct custom column.
172
+ *
173
+ * @since 2.0
174
+ * @param string $column The column name
175
+ * @param int $post_id The post id
176
+ * @return void
177
+ */
178
+ public function custom_columns( $column, $post_id ) {
179
+
180
+ switch ( $column ) {
181
+ case 'address':
182
+ echo esc_html( get_post_meta( $post_id, 'wpsl_address', true ) );
183
+ break;
184
+ case 'city':
185
+ echo esc_html( get_post_meta( $post_id, 'wpsl_city', true ) );
186
+ break;
187
+ case 'state':
188
+ echo esc_html( get_post_meta( $post_id, 'wpsl_state', true ) );
189
+ break;
190
+ case 'zip':
191
+ echo esc_html( get_post_meta( $post_id, 'wpsl_zip', true ) );
192
+ break;
193
+ }
194
+ }
195
+
196
+ /**
197
+ * Define the columns that are sortable.
198
+ *
199
+ * @since 2.0
200
+ * @param array $columns List of sortable columns
201
+ * @return array
202
+ */
203
+ public function sortable_columns( $columns ) {
204
+
205
+ $custom = array(
206
+ 'address' => 'wpsl_address',
207
+ 'city' => 'wpsl_city',
208
+ 'state' => 'wpsl_state',
209
+ 'zip' => 'wpsl_zip'
210
+ );
211
+
212
+ return wp_parse_args( $custom, $columns );
213
+ }
214
+
215
+ /**
216
+ * Set the correct column sort parameters.
217
+ *
218
+ * @since 2.0
219
+ * @param array $vars Column sorting parameters
220
+ * @return array $vars The column sorting parameters inc the correct orderby and wpsl meta_key
221
+ */
222
+ public function sort_columns( $vars ) {
223
+
224
+ if ( isset( $vars['post_type'] ) && $vars['post_type'] == 'wpsl_stores' ) {
225
+ if ( isset( $vars['orderby'] ) ) {
226
+ if ( $vars['orderby'] === 'wpsl_address' ) {
227
+ $vars = array_merge( $vars, array(
228
+ 'meta_key' => 'wpsl_address',
229
+ 'orderby' => 'meta_value'
230
+ ) );
231
+ }
232
+
233
+ if ( $vars['orderby'] === 'wpsl_city' ) {
234
+ $vars = array_merge( $vars, array(
235
+ 'meta_key' => 'wpsl_city',
236
+ 'orderby' => 'meta_value'
237
+ ) );
238
+ }
239
+
240
+ if ( $vars['orderby'] === 'wpsl_state' ) {
241
+ $vars = array_merge( $vars, array(
242
+ 'meta_key' => 'wpsl_state',
243
+ 'orderby' => 'meta_value'
244
+ ) );
245
+ }
246
+
247
+ if ( $vars['orderby'] === 'wpsl_zip' ) {
248
+ $vars = array_merge( $vars, array(
249
+ 'meta_key' => 'wpsl_zip',
250
+ 'orderby' => 'meta_value'
251
+ ) );
252
+ }
253
+ }
254
+ }
255
+
256
+ return $vars;
257
+ }
258
+ }
259
+
260
+ }
inc/install.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WPSL Install
4
+ *
5
+ * @package WP_Store_locator
6
+ * @since 2.0
7
+ */
8
+
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
+
11
+ /**
12
+ * Run the install
13
+ *
14
+ * @since 1.2.20
15
+ * @return void
16
+ */
17
+ function wpsl_install( $network_wide ) {
18
+
19
+ global $wpdb;
20
+
21
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
22
+
23
+ if ( $network_wide ) {
24
+ $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
25
+
26
+ foreach ( $blog_ids as $blog_id ) {
27
+ switch_to_blog( $blog_id );
28
+ wpsl_install_data();
29
+ }
30
+
31
+ restore_current_blog();
32
+ } else {
33
+ wpsl_install_data();
34
+ }
35
+ } else {
36
+ wpsl_install_data();
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Install the required data
42
+ *
43
+ * @since 1.2.20
44
+ * @return void
45
+ */
46
+ function wpsl_install_data() {
47
+
48
+ global $wpsl;
49
+
50
+ /* Register the post type and flush the permalinks */
51
+ $wpsl->post_types->register_post_types();
52
+ flush_rewrite_rules();
53
+
54
+ /* Create the default settings */
55
+ wpsl_set_default_settings();
56
+
57
+ /* Set the correct version */
58
+ update_option( 'wpsl_version', WPSL_VERSION_NUM );
59
+
60
+ /* Add user roles */
61
+ wpsl_add_roles();
62
+
63
+ /* Add user capabilities */
64
+ wpsl_add_caps();
65
+ }
inc/wpsl-functions.php ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Collect all the parameters ( language, key, region )
5
+ * we need before making a request to the Google Maps API.
6
+ *
7
+ * @since 1.0
8
+ * @return string $api_params The api parameters
9
+ */
10
+ function wpsl_get_gmap_api_params() {
11
+
12
+ global $wpsl_settings;
13
+
14
+ $api_params = '';
15
+ $api_keys = array( 'language', 'key', 'region' );
16
+
17
+ foreach ( $api_keys as $api_key ) {
18
+ if ( !empty( $wpsl_settings['api_'.$api_key] ) ) {
19
+ $api_params .= '&' . $api_key . '=' . $wpsl_settings['api_'.$api_key];
20
+ }
21
+ }
22
+
23
+ return apply_filters( 'wpsl_gmap_api_params', $api_params );
24
+ }
25
+
26
+ /**
27
+ * Get the default plugin settings.
28
+ *
29
+ * @since 1.0
30
+ * @return void
31
+ */
32
+ function wpsl_get_default_settings() {
33
+
34
+ $default_settings = array(
35
+ 'api_key' => '',
36
+ 'api_language' => 'en',
37
+ 'api_region' => '',
38
+ 'distance_unit' => 'km',
39
+ 'max_results' => '[25],50,75,100',
40
+ 'search_radius' => '10,25,[50],100,200,500',
41
+ 'marker_effect' => 'bounce',
42
+ 'address_format' => 'city_state_zip',
43
+ 'hide_distance' => 0,
44
+ 'auto_locate' => 1,
45
+ 'autoload' => 1,
46
+ 'autoload_limit' => 50,
47
+ 'zoom_level' => 3,
48
+ 'auto_zoom_level' => 15,
49
+ 'zoom_name' => '',
50
+ 'zoom_latlng' => '',
51
+ 'height' => 350,
52
+ 'map_type' => 'roadmap',
53
+ 'map_style' => '',
54
+ 'pan_controls' => 0,
55
+ 'type_control' => 0,
56
+ 'streetview' => 0,
57
+ 'results_dropdown' => 1,
58
+ 'radius_dropdown' => 1,
59
+ 'category_dropdown' => 0,
60
+ 'infowindow_width' => 225,
61
+ 'search_width' => 179,
62
+ 'label_width' => 95,
63
+ 'control_position' => 'left',
64
+ 'control_style' => 'small',
65
+ 'scrollwheel' => 1,
66
+ 'marker_clusters' => 0,
67
+ 'cluster_zoom' => 0,
68
+ 'cluster_size' => 0,
69
+ 'new_window' => 0,
70
+ 'reset_map' => 0,
71
+ 'template_id' => 'default',
72
+ 'listing_below_no_scroll' => 0,
73
+ 'direction_redirect' => 0,
74
+ 'more_info' => 0,
75
+ 'store_url' => 0,
76
+ 'phone_url' => 0,
77
+ 'marker_streetview' => 0,
78
+ 'marker_zoom_to' => 0,
79
+ 'more_info_location' => 'info window',
80
+ 'mouse_focus' => 1,
81
+ 'start_marker' => 'red.png',
82
+ 'store_marker' => 'blue.png',
83
+ 'editor_country' => '',
84
+ 'editor_hours' => wpsl_default_opening_hours(),
85
+ 'editor_hour_input' => 'dropdown',
86
+ 'editor_hour_format' => 12,
87
+ 'editor_map_type' => 'roadmap',
88
+ 'hide_hours' => 0,
89
+ 'permalinks' => 0,
90
+ 'permalink_slug' => __( 'stores', 'wpsl' ),
91
+ 'category_slug' => __( 'store-category', 'wpsl' ),
92
+ 'infowindow_style' => 'default',
93
+ 'show_credits' => 0,
94
+ 'debug' => 0,
95
+ 'start_label' => __( 'Start location', 'wpsl' ),
96
+ 'search_label' => __( 'Your location', 'wpsl' ),
97
+ 'search_btn_label' => __( 'Search', 'wpsl' ),
98
+ 'preloader_label' => __( 'Searching...', 'wpsl' ),
99
+ 'radius_label' => __( 'Search radius', 'wpsl' ),
100
+ 'no_results_label' => __( 'No results found', 'wpsl' ),
101
+ 'results_label' => __( 'Results', 'wpsl' ),
102
+ 'more_label' => __( 'More info', 'wpsl' ),
103
+ 'directions_label' => __( 'Directions', 'wpsl' ),
104
+ 'no_directions_label' => __( 'No route could be found between the origin and destination', 'wpsl' ),
105
+ 'back_label' => __( 'Back', 'wpsl' ),
106
+ 'street_view_label' => __( 'Street view', 'wpsl' ),
107
+ 'zoom_here_label' => __( 'Zoom here', 'wpsl' ),
108
+ 'error_label' => __( 'Something went wrong, please try again!', 'wpsl' ),
109
+ 'limit_label' => __( 'API usage limit reached', 'wpsl' ),
110
+ 'phone_label' => __( 'Phone', 'wpsl' ),
111
+ 'fax_label' => __( 'Fax', 'wpsl' ),
112
+ 'email_label' => __( 'Email', 'wpsl' ),
113
+ 'url_label' => __( 'Url', 'wpsl' ),
114
+ 'hours_label' => __( 'Hours', 'wpsl' ),
115
+ 'category_label' => __( 'Category filter', 'wpsl' )
116
+ );
117
+
118
+ return $default_settings;
119
+ }
120
+
121
+ /**
122
+ * Get the current plugin settings.
123
+ *
124
+ * @since 1.0
125
+ * @return array $setting The current plugin settings
126
+ */
127
+ function wpsl_get_settings() {
128
+
129
+ $settings = get_option( 'wpsl_settings' );
130
+
131
+ if ( !$settings ) {
132
+ update_option( 'wpsl_settings', wpsl_get_default_settings() );
133
+ $settings = wpsl_get_default_settings();
134
+ }
135
+
136
+ return $settings;
137
+ }
138
+
139
+ /**
140
+ * Get a single value from the default settings.
141
+ *
142
+ * @since 1.0
143
+ * @param string $setting The value that should be restored
144
+ * @return string $wpsl_default_settings The default setting value
145
+ */
146
+ function wpsl_get_default_setting( $setting ) {
147
+
148
+ global $wpsl_default_settings;
149
+
150
+ return $wpsl_default_settings[$setting];
151
+ }
152
+
153
+ /**
154
+ * Set the default plugin settings.
155
+ *
156
+ * @since 1.0
157
+ * @return void
158
+ */
159
+ function wpsl_set_default_settings() {
160
+
161
+ $settings = get_option( 'wpsl_settings' );
162
+
163
+ if ( !$settings ) {
164
+ update_option( 'wpsl_settings', wpsl_get_default_settings() );
165
+ }
166
+ }
167
+
168
+ /**
169
+ * Return a list of the store templates.
170
+ *
171
+ * @since 1.2.20
172
+ * @return array $templates The list of default store templates
173
+ */
174
+ function wpsl_get_templates() {
175
+
176
+ $templates = array(
177
+ array(
178
+ 'id' => 'default',
179
+ 'name' => __( 'Default', 'wpsl' ),
180
+ 'path' => WPSL_PLUGIN_DIR . 'frontend/templates/default.php'
181
+ ),
182
+ array(
183
+ 'id' => 'below_map',
184
+ 'name' => __( 'Show the store list below the map', 'wpsl' ),
185
+ 'path' => WPSL_PLUGIN_DIR . 'frontend/templates/store-listings-below.php'
186
+ )
187
+ );
188
+
189
+ return apply_filters( 'wpsl_templates', $templates );
190
+ }
191
+
192
+ /**
193
+ * Return the days of the week.
194
+ *
195
+ * @since 2.0
196
+ * @return array $weekdays The days of the week
197
+ */
198
+ function wpsl_get_weekdays() {
199
+
200
+ $weekdays = array(
201
+ 'monday' => __( 'Monday', 'wpsl' ),
202
+ 'tuesday' => __( 'Tuesday', 'wpsl' ),
203
+ 'wednesday' => __( 'Wednesday', 'wpsl' ),
204
+ 'thursday' => __( 'Thursday', 'wpsl' ),
205
+ 'friday' => __( 'Friday', 'wpsl' ),
206
+ 'saturday' => __( 'Saturday', 'wpsl' ),
207
+ 'sunday' => __( 'Sunday' , 'wpsl' )
208
+ );
209
+
210
+ return $weekdays;
211
+ }
212
+
213
+ /**
214
+ * Get the default opening hours.
215
+ *
216
+ * @since 2.0
217
+ * @return array $opening_hours The default opening hours
218
+ */
219
+ function wpsl_default_opening_hours() {
220
+
221
+ $current_version = get_option( 'wpsl_version' );
222
+
223
+ $opening_hours = array(
224
+ 'dropdown' => array(
225
+ 'monday' => array( '9:00 AM,5:00 PM' ),
226
+ 'tuesday' => array( '9:00 AM,5:00 PM' ),
227
+ 'wednesday' => array( '9:00 AM,5:00 PM' ),
228
+ 'thursday' => array( '9:00 AM,5:00 PM' ),
229
+ 'friday' => array( '9:00 AM,5:00 PM' ),
230
+ 'saturday' => '',
231
+ 'sunday' => ''
232
+ )
233
+ );
234
+
235
+ /* Only add the textarea defaults for users that upgraded from 1.x */
236
+ if ( version_compare( $current_version, '2.0', '<' ) ) {
237
+ $opening_hours['textarea'] = sprintf( __( 'Mon %sTue %sWed %sThu %sFri %sSat Closed %sSun Closed', 'wpsl' ), '9:00 AM - 5:00 PM' . "\n", '9:00 AM - 5:00 PM' . "\n", '9:00 AM - 5:00 PM' . "\n", '9:00 AM - 5:00 PM' . "\n", '9:00 AM - 5:00 PM' . "\n", "\n" ); //cleaner way without repeating it 5 times??
238
+ }
239
+
240
+ return $opening_hours;
241
+ }
242
+
243
+ /**
244
+ * Get the available map types.
245
+ *
246
+ * @since 2.0
247
+ * @return array $map_types The available map types
248
+ */
249
+ function wpsl_get_map_types() {
250
+
251
+ $map_types = array(
252
+ 'roadmap' => __( 'Roadmap', 'wpsl' ),
253
+ 'satellite' => __( 'Satellite', 'wpsl' ),
254
+ 'hybrid' => __( 'Hybrid', 'wpsl' ),
255
+ 'terrain' => __( 'Terrain', 'wpsl' )
256
+ );
257
+
258
+ return $map_types;
259
+ }
260
+
261
+ /**
262
+ * Get the address formats.
263
+ *
264
+ * @since 2.0
265
+ * @return array $address_formats The address formats
266
+ */
267
+ function wpsl_get_address_formats() {
268
+
269
+ $address_formats = array(
270
+ 'city_state_zip' => __( '(city) (state) (zip code)', 'wpsl' ),
271
+ 'city_comma_state_zip' => __( '(city), (state) (zip code)', 'wpsl' ),
272
+ 'city_zip' => __( '(city) (zip code)', 'wpsl' ),
273
+ 'city_comma_zip' => __( '(city), (zip code)', 'wpsl' ),
274
+ 'zip_city_state' => __( '(zip code) (city) (state)', 'wpsl' ),
275
+ 'zip_city' => __( '(zip code) (city)', 'wpsl' )
276
+ );
277
+
278
+ return apply_filters( 'wpsl_address_formats', $address_formats );
279
+ }
280
+
281
+ /**
282
+ * Make sure the provided map type is valid.
283
+ *
284
+ * If the map type is invalid the default is used ( roadmap ).
285
+ *
286
+ * @since 2.0
287
+ * @param string $map_type The provided map type
288
+ * @return string $map_type A valid map type
289
+ */
290
+ function wpsl_valid_map_type( $map_type ) {
291
+
292
+ $allowed_map_types = wpsl_get_map_types();
293
+
294
+ if ( !array_key_exists( $map_type, $allowed_map_types ) ) {
295
+ $map_type = wpsl_get_default_setting( 'map_type' );
296
+ }
297
+
298
+ return $map_type;
299
+ }
300
+
301
+ /**
302
+ * Make sure the provided zoom level is valid.
303
+ *
304
+ * If the zoom level is invalid the default is used ( 3 ).
305
+ *
306
+ * @since 2.0
307
+ * @param string $zoom_level The provided zoom level
308
+ * @return string $zoom_level A valid zoom level
309
+ */
310
+ function wpsl_valid_zoom_level( $zoom_level ) {
311
+
312
+ $zoom_level = absint( $zoom_level );
313
+
314
+ if ( ( $zoom_level < 1 ) || ( $zoom_level > 21 ) ) {
315
+ $zoom_level = wpsl_get_default_setting( 'zoom_level' );
316
+ }
317
+
318
+ return $zoom_level;
319
+ }
320
+
321
+ /**
322
+ * Get the max auto zoom levels for the map.
323
+ *
324
+ * @since 2.0
325
+ * @return array $max_zoom_levels The array holding the min - max zoom levels
326
+ */
327
+ function wpsl_get_max_zoom_levels() {
328
+
329
+ $max_zoom_levels = array();
330
+ $zoom_level = array(
331
+ 'min' => 10,
332
+ 'max' => 21
333
+ );
334
+
335
+ $i = $zoom_level['min'];
336
+
337
+ while ( $i <= $zoom_level['max'] ) {
338
+ $max_zoom_levels[$i] = $i;
339
+ $i++;
340
+ }
341
+
342
+ return $max_zoom_levels;
343
+ }
344
+
345
+ /**
346
+ * The labels and the values that can be set through the settings page.
347
+ *
348
+ * @since 2.0
349
+ * @return array $labels The label names from the settings page.
350
+ */
351
+ function wpsl_labels() {
352
+
353
+ $labels = array(
354
+ 'search',
355
+ 'search_btn',
356
+ 'preloader',
357
+ 'radius',
358
+ 'no_results',
359
+ 'results',
360
+ 'more',
361
+ 'directions',
362
+ 'no_directions',
363
+ 'back',
364
+ 'street_view',
365
+ 'zoom_here',
366
+ 'error',
367
+ 'phone',
368
+ 'fax',
369
+ 'email',
370
+ 'url',
371
+ 'hours',
372
+ 'start',
373
+ 'limit',
374
+ 'category'
375
+ );
376
+
377
+ return $labels;
378
+ }
379
+
380
+ /**
381
+ * Callback for array_walk_recursive, sanitize items in a multidimensional array.
382
+ *
383
+ * @since 2.0
384
+ * @param string $item The value
385
+ * @param integer $key The key
386
+ */
387
+ function wpsl_sanitize_multi_array( &$item, $key ) {
388
+ $item = sanitize_text_field( $item );
389
+ }
390
+
391
+ /**
392
+ * Check whether the array is multidimensional.
393
+ *
394
+ * @since 2.0
395
+ * @param array $array The array to check
396
+ * @return boolean
397
+ */
398
+ function wpsl_is_multi_array( $array ) {
399
+
400
+ foreach ( $array as $value ) {
401
+ if ( is_array( $value ) ) return true;
402
+ }
403
+
404
+ return false;
405
+ }
js/infobox.js ADDED
@@ -0,0 +1,817 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @name InfoBox
3
+ * @version 1.1.13 [March 19, 2014]
4
+ * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google)
5
+ * @copyright Copyright 2010 Gary Little [gary at luxcentral.com]
6
+ * @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class.
7
+ * <p>
8
+ * An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several
9
+ * additional properties for advanced styling. An InfoBox can also be used as a map label.
10
+ * <p>
11
+ * An InfoBox also fires the same events as a <tt>google.maps.InfoWindow</tt>.
12
+ */
13
+
14
+ /*!
15
+ *
16
+ * Licensed under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License.
18
+ * You may obtain a copy of the License at
19
+ *
20
+ * http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software
23
+ * distributed under the License is distributed on an "AS IS" BASIS,
24
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25
+ * See the License for the specific language governing permissions and
26
+ * limitations under the License.
27
+ */
28
+
29
+ /*jslint browser:true */
30
+ /*global google */
31
+
32
+ /**
33
+ * @name InfoBoxOptions
34
+ * @class This class represents the optional parameter passed to the {@link InfoBox} constructor.
35
+ * @property {string|Node} content The content of the InfoBox (plain text or an HTML DOM node).
36
+ * @property {boolean} [disableAutoPan=false] Disable auto-pan on <tt>open</tt>.
37
+ * @property {number} maxWidth The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum.
38
+ * @property {Size} pixelOffset The offset (in pixels) from the top left corner of the InfoBox
39
+ * (or the bottom left corner if the <code>alignBottom</code> property is <code>true</code>)
40
+ * to the map pixel corresponding to <tt>position</tt>.
41
+ * @property {LatLng} position The geographic location at which to display the InfoBox.
42
+ * @property {number} zIndex The CSS z-index style value for the InfoBox.
43
+ * Note: This value overrides a zIndex setting specified in the <tt>boxStyle</tt> property.
44
+ * @property {string} [boxClass="infoBox"] The name of the CSS class defining the styles for the InfoBox container.
45
+ * @property {Object} [boxStyle] An object literal whose properties define specific CSS
46
+ * style values to be applied to the InfoBox. Style values defined here override those that may
47
+ * be defined in the <code>boxClass</code> style sheet. If this property is changed after the
48
+ * InfoBox has been created, all previously set styles (except those defined in the style sheet)
49
+ * are removed from the InfoBox before the new style values are applied.
50
+ * @property {string} closeBoxMargin The CSS margin style value for the close box.
51
+ * The default is "2px" (a 2-pixel margin on all sides).
52
+ * @property {string} closeBoxURL The URL of the image representing the close box.
53
+ * Note: The default is the URL for Google's standard close box.
54
+ * Set this property to "" if no close box is required.
55
+ * @property {Size} infoBoxClearance Minimum offset (in pixels) from the InfoBox to the
56
+ * map edge after an auto-pan.
57
+ * @property {boolean} [isHidden=false] Hide the InfoBox on <tt>open</tt>.
58
+ * [Deprecated in favor of the <tt>visible</tt> property.]
59
+ * @property {boolean} [visible=true] Show the InfoBox on <tt>open</tt>.
60
+ * @property {boolean} alignBottom Align the bottom left corner of the InfoBox to the <code>position</code>
61
+ * location (default is <tt>false</tt> which means that the top left corner of the InfoBox is aligned).
62
+ * @property {string} pane The pane where the InfoBox is to appear (default is "floatPane").
63
+ * Set the pane to "mapPane" if the InfoBox is being used as a map label.
64
+ * Valid pane names are the property names for the <tt>google.maps.MapPanes</tt> object.
65
+ * @property {boolean} enableEventPropagation Propagate mousedown, mousemove, mouseover, mouseout,
66
+ * mouseup, click, dblclick, touchstart, touchend, touchmove, and contextmenu events in the InfoBox
67
+ * (default is <tt>false</tt> to mimic the behavior of a <tt>google.maps.InfoWindow</tt>). Set
68
+ * this property to <tt>true</tt> if the InfoBox is being used as a map label.
69
+ */
70
+
71
+ /**
72
+ * Creates an InfoBox with the options specified in {@link InfoBoxOptions}.
73
+ * Call <tt>InfoBox.open</tt> to add the box to the map.
74
+ * @constructor
75
+ * @param {InfoBoxOptions} [opt_opts]
76
+ */
77
+ function InfoBox(opt_opts) {
78
+
79
+ opt_opts = opt_opts || {};
80
+
81
+ google.maps.OverlayView.apply(this, arguments);
82
+
83
+ // Standard options (in common with google.maps.InfoWindow):
84
+ //
85
+ this.content_ = opt_opts.content || "";
86
+ this.disableAutoPan_ = opt_opts.disableAutoPan || false;
87
+ this.maxWidth_ = opt_opts.maxWidth || 0;
88
+ this.pixelOffset_ = opt_opts.pixelOffset || new google.maps.Size(0, 0);
89
+ this.position_ = opt_opts.position || new google.maps.LatLng(0, 0);
90
+ this.zIndex_ = opt_opts.zIndex || null;
91
+
92
+ // Additional options (unique to InfoBox):
93
+ //
94
+ this.boxClass_ = opt_opts.boxClass || "infoBox";
95
+ this.boxStyle_ = opt_opts.boxStyle || {};
96
+ this.closeBoxMargin_ = opt_opts.closeBoxMargin || "2px";
97
+ this.closeBoxURL_ = opt_opts.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif";
98
+ if (opt_opts.closeBoxURL === "") {
99
+ this.closeBoxURL_ = "";
100
+ }
101
+ this.infoBoxClearance_ = opt_opts.infoBoxClearance || new google.maps.Size(1, 1);
102
+
103
+ if (typeof opt_opts.visible === "undefined") {
104
+ if (typeof opt_opts.isHidden === "undefined") {
105
+ opt_opts.visible = true;
106
+ } else {
107
+ opt_opts.visible = !opt_opts.isHidden;
108
+ }
109
+ }
110
+ this.isHidden_ = !opt_opts.visible;
111
+
112
+ this.alignBottom_ = opt_opts.alignBottom || false;
113
+ this.pane_ = opt_opts.pane || "floatPane";
114
+ this.enableEventPropagation_ = opt_opts.enableEventPropagation || false;
115
+
116
+ this.div_ = null;
117
+ this.closeListener_ = null;
118
+ this.moveListener_ = null;
119
+ this.contextListener_ = null;
120
+ this.eventListeners_ = null;
121
+ this.fixedWidthSet_ = null;
122
+ }
123
+
124
+ /* InfoBox extends OverlayView in the Google Maps API v3.
125
+ */
126
+ InfoBox.prototype = new google.maps.OverlayView();
127
+
128
+ /**
129
+ * Creates the DIV representing the InfoBox.
130
+ * @private
131
+ */
132
+ InfoBox.prototype.createInfoBoxDiv_ = function () {
133
+
134
+ var i;
135
+ var events;
136
+ var bw;
137
+ var me = this;
138
+
139
+ // This handler prevents an event in the InfoBox from being passed on to the map.
140
+ //
141
+ var cancelHandler = function (e) {
142
+ e.cancelBubble = true;
143
+ if (e.stopPropagation) {
144
+ e.stopPropagation();
145
+ }
146
+ };
147
+
148
+ // This handler ignores the current event in the InfoBox and conditionally prevents
149
+ // the event from being passed on to the map. It is used for the contextmenu event.
150
+ //
151
+ var ignoreHandler = function (e) {
152
+
153
+ e.returnValue = false;
154
+
155
+ if (e.preventDefault) {
156
+
157
+ e.preventDefault();
158
+ }
159
+
160
+ if (!me.enableEventPropagation_) {
161
+
162
+ cancelHandler(e);
163
+ }
164
+ };
165
+
166
+ if (!this.div_) {
167
+
168
+ this.div_ = document.createElement("div");
169
+
170
+ this.setBoxStyle_();
171
+
172
+ if (typeof this.content_.nodeType === "undefined") {
173
+ this.div_.innerHTML = this.getCloseBoxImg_() + this.content_;
174
+ } else {
175
+ this.div_.innerHTML = this.getCloseBoxImg_();
176
+ this.div_.appendChild(this.content_);
177
+ }
178
+
179
+ // Add the InfoBox DIV to the DOM
180
+ this.getPanes()[this.pane_].appendChild(this.div_);
181
+
182
+ this.addClickHandler_();
183
+
184
+ if (this.div_.style.width) {
185
+
186
+ this.fixedWidthSet_ = true;
187
+
188
+ } else {
189
+
190
+ if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) {
191
+
192
+ this.div_.style.width = this.maxWidth_;
193
+ this.div_.style.overflow = "auto";
194
+ this.fixedWidthSet_ = true;
195
+
196
+ } else { // The following code is needed to overcome problems with MSIE
197
+
198
+ bw = this.getBoxWidths_();
199
+
200
+ this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + "px";
201
+ this.fixedWidthSet_ = false;
202
+ }
203
+ }
204
+
205
+ this.panBox_(this.disableAutoPan_);
206
+
207
+ if (!this.enableEventPropagation_) {
208
+
209
+ this.eventListeners_ = [];
210
+
211
+ // Cancel event propagation.
212
+ //
213
+ // Note: mousemove not included (to resolve Issue 152)
214
+ events = ["mousedown", "mouseover", "mouseout", "mouseup",
215
+ "click", "dblclick", "touchstart", "touchend", "touchmove"];
216
+
217
+ for (i = 0; i < events.length; i++) {
218
+
219
+ this.eventListeners_.push(google.maps.event.addDomListener(this.div_, events[i], cancelHandler));
220
+ }
221
+
222
+ // Workaround for Google bug that causes the cursor to change to a pointer
223
+ // when the mouse moves over a marker underneath InfoBox.
224
+ this.eventListeners_.push(google.maps.event.addDomListener(this.div_, "mouseover", function (e) {
225
+ this.style.cursor = "default";
226
+ }));
227
+ }
228
+
229
+ this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler);
230
+
231
+ /**
232
+ * This event is fired when the DIV containing the InfoBox's content is attached to the DOM.
233
+ * @name InfoBox#domready
234
+ * @event
235
+ */
236
+ google.maps.event.trigger(this, "domready");
237
+ }
238
+ };
239
+
240
+ /**
241
+ * Returns the HTML <IMG> tag for the close box.
242
+ * @private
243
+ */
244
+ InfoBox.prototype.getCloseBoxImg_ = function () {
245
+
246
+ var img = "";
247
+
248
+ if (this.closeBoxURL_ !== "") {
249
+
250
+ img = "<img";
251
+ img += " src='" + this.closeBoxURL_ + "'";
252
+ img += " align=right"; // Do this because Opera chokes on style='float: right;'
253
+ img += " style='";
254
+ img += " position: relative;"; // Required by MSIE
255
+ img += " cursor: pointer;";
256
+ img += " margin: " + this.closeBoxMargin_ + ";";
257
+ img += "'>";
258
+ }
259
+
260
+ return img;
261
+ };
262
+
263
+ /**
264
+ * Adds the click handler to the InfoBox close box.
265
+ * @private
266
+ */
267
+ InfoBox.prototype.addClickHandler_ = function () {
268
+
269
+ var closeBox;
270
+
271
+ if (this.closeBoxURL_ !== "") {
272
+
273
+ closeBox = this.div_.firstChild;
274
+ this.closeListener_ = google.maps.event.addDomListener(closeBox, "click", this.getCloseClickHandler_());
275
+
276
+ } else {
277
+
278
+ this.closeListener_ = null;
279
+ }
280
+ };
281
+
282
+ /**
283
+ * Returns the function to call when the user clicks the close box of an InfoBox.
284
+ * @private
285
+ */
286
+ InfoBox.prototype.getCloseClickHandler_ = function () {
287
+
288
+ var me = this;
289
+
290
+ return function (e) {
291
+
292
+ // 1.0.3 fix: Always prevent propagation of a close box click to the map:
293
+ e.cancelBubble = true;
294
+
295
+ if (e.stopPropagation) {
296
+
297
+ e.stopPropagation();
298
+ }
299
+
300
+ /**
301
+ * This event is fired when the InfoBox's close box is clicked.
302
+ * @name InfoBox#closeclick
303
+ * @event
304
+ */
305
+ google.maps.event.trigger(me, "closeclick");
306
+
307
+ me.close();
308
+ };
309
+ };
310
+
311
+ /**
312
+ * Pans the map so that the InfoBox appears entirely within the map's visible area.
313
+ * @private
314
+ */
315
+ InfoBox.prototype.panBox_ = function (disablePan) {
316
+
317
+ var map;
318
+ var bounds;
319
+ var xOffset = 0, yOffset = 0;
320
+
321
+ if (!disablePan) {
322
+
323
+ map = this.getMap();
324
+
325
+ if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama
326
+
327
+ if (!map.getBounds().contains(this.position_)) {
328
+ // Marker not in visible area of map, so set center
329
+ // of map to the marker position first.
330
+ map.setCenter(this.position_);
331
+ }
332
+
333
+ bounds = map.getBounds();
334
+
335
+ var mapDiv = map.getDiv();
336
+ var mapWidth = mapDiv.offsetWidth;
337
+ var mapHeight = mapDiv.offsetHeight;
338
+ var iwOffsetX = this.pixelOffset_.width;
339
+ var iwOffsetY = this.pixelOffset_.height;
340
+ var iwWidth = this.div_.offsetWidth;
341
+ var iwHeight = this.div_.offsetHeight;
342
+ var padX = this.infoBoxClearance_.width;
343
+ var padY = this.infoBoxClearance_.height;
344
+ var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.position_);
345
+
346
+ if (pixPosition.x < (-iwOffsetX + padX)) {
347
+ xOffset = pixPosition.x + iwOffsetX - padX;
348
+ } else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) {
349
+ xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;
350
+ }
351
+ if (this.alignBottom_) {
352
+ if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) {
353
+ yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;
354
+ } else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) {
355
+ yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;
356
+ }
357
+ } else {
358
+ if (pixPosition.y < (-iwOffsetY + padY)) {
359
+ yOffset = pixPosition.y + iwOffsetY - padY;
360
+ } else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) {
361
+ yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;
362
+ }
363
+ }
364
+
365
+ if (!(xOffset === 0 && yOffset === 0)) {
366
+
367
+ // Move the map to the shifted center.
368
+ //
369
+ var c = map.getCenter();
370
+ map.panBy(xOffset, yOffset);
371
+ }
372
+ }
373
+ }
374
+ };
375
+
376
+ /**
377
+ * Sets the style of the InfoBox by setting the style sheet and applying
378
+ * other specific styles requested.
379
+ * @private
380
+ */
381
+ InfoBox.prototype.setBoxStyle_ = function () {
382
+
383
+ var i, boxStyle;
384
+
385
+ if (this.div_) {
386
+
387
+ // Apply style values from the style sheet defined in the boxClass parameter:
388
+ this.div_.className = this.boxClass_;
389
+
390
+ // Clear existing inline style values:
391
+ this.div_.style.cssText = "";
392
+
393
+ // Apply style values defined in the boxStyle parameter:
394
+ boxStyle = this.boxStyle_;
395
+ for (i in boxStyle) {
396
+
397
+ if (boxStyle.hasOwnProperty(i)) {
398
+
399
+ this.div_.style[i] = boxStyle[i];
400
+ }
401
+ }
402
+
403
+ // Fix for iOS disappearing InfoBox problem.
404
+ // See http://stackoverflow.com/questions/9229535/google-maps-markers-disappear-at-certain-zoom-level-only-on-iphone-ipad
405
+ this.div_.style.WebkitTransform = "translateZ(0)";
406
+
407
+ // Fix up opacity style for benefit of MSIE:
408
+ //
409
+ if (typeof this.div_.style.opacity !== "undefined" && this.div_.style.opacity !== "") {
410
+ // See http://www.quirksmode.org/css/opacity.html
411
+ this.div_.style.MsFilter = "\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + (this.div_.style.opacity * 100) + ")\"";
412
+ this.div_.style.filter = "alpha(opacity=" + (this.div_.style.opacity * 100) + ")";
413
+ }
414
+
415
+ // Apply required styles:
416
+ //
417
+ this.div_.style.position = "absolute";
418
+ this.div_.style.visibility = 'hidden';
419
+ if (this.zIndex_ !== null) {
420
+
421
+ this.div_.style.zIndex = this.zIndex_;
422
+ }
423
+ }
424
+ };
425
+
426
+ /**
427
+ * Get the widths of the borders of the InfoBox.
428
+ * @private
429
+ * @return {Object} widths object (top, bottom left, right)
430
+ */
431
+ InfoBox.prototype.getBoxWidths_ = function () {
432
+
433
+ var computedStyle;
434
+ var bw = {top: 0, bottom: 0, left: 0, right: 0};
435
+ var box = this.div_;
436
+
437
+ if (document.defaultView && document.defaultView.getComputedStyle) {
438
+
439
+ computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, "");
440
+
441
+ if (computedStyle) {
442
+
443
+ // The computed styles are always in pixel units (good!)
444
+ bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0;
445
+ bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;
446
+ bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0;
447
+ bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0;
448
+ }
449
+
450
+ } else if (document.documentElement.currentStyle) { // MSIE
451
+
452
+ if (box.currentStyle) {
453
+
454
+ // The current styles may not be in pixel units, but assume they are (bad!)
455
+ bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0;
456
+ bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0;
457
+ bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0;
458
+ bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0;
459
+ }
460
+ }
461
+
462
+ return bw;
463
+ };
464
+
465
+ /**
466
+ * Invoked when <tt>close</tt> is called. Do not call it directly.
467
+ */
468
+ InfoBox.prototype.onRemove = function () {
469
+
470
+ if (this.div_) {
471
+
472
+ this.div_.parentNode.removeChild(this.div_);
473
+ this.div_ = null;
474
+ }
475
+ };
476
+
477
+ /**
478
+ * Draws the InfoBox based on the current map projection and zoom level.
479
+ */
480
+ InfoBox.prototype.draw = function () {
481
+
482
+ this.createInfoBoxDiv_();
483
+
484
+ var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_);
485
+
486
+ this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + "px";
487
+
488
+ if (this.alignBottom_) {
489
+ this.div_.style.bottom = -(pixPosition.y + this.pixelOffset_.height) + "px";
490
+ } else {
491
+ this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + "px";
492
+ }
493
+
494
+ if (this.isHidden_) {
495
+
496
+ this.div_.style.visibility = "hidden";
497
+
498
+ } else {
499
+
500
+ this.div_.style.visibility = "visible";
501
+ }
502
+ };
503
+
504
+ /**
505
+ * Sets the options for the InfoBox. Note that changes to the <tt>maxWidth</tt>,
506
+ * <tt>closeBoxMargin</tt>, <tt>closeBoxURL</tt>, and <tt>enableEventPropagation</tt>
507
+ * properties have no affect until the current InfoBox is <tt>close</tt>d and a new one
508
+ * is <tt>open</tt>ed.
509
+ * @param {InfoBoxOptions} opt_opts
510
+ */
511
+ InfoBox.prototype.setOptions = function (opt_opts) {
512
+ if (typeof opt_opts.boxClass !== "undefined") { // Must be first
513
+
514
+ this.boxClass_ = opt_opts.boxClass;
515
+ this.setBoxStyle_();
516
+ }
517
+ if (typeof opt_opts.boxStyle !== "undefined") { // Must be second
518
+
519
+ this.boxStyle_ = opt_opts.boxStyle;
520
+ this.setBoxStyle_();
521
+ }
522
+ if (typeof opt_opts.content !== "undefined") {
523
+
524
+ this.setContent(opt_opts.content);
525
+ }
526
+ if (typeof opt_opts.disableAutoPan !== "undefined") {
527
+
528
+ this.disableAutoPan_ = opt_opts.disableAutoPan;
529
+ }
530
+ if (typeof opt_opts.maxWidth !== "undefined") {
531
+
532
+ this.maxWidth_ = opt_opts.maxWidth;
533
+ }
534
+ if (typeof opt_opts.pixelOffset !== "undefined") {
535
+
536
+ this.pixelOffset_ = opt_opts.pixelOffset;
537
+ }
538
+ if (typeof opt_opts.alignBottom !== "undefined") {
539
+
540
+ this.alignBottom_ = opt_opts.alignBottom;
541
+ }
542
+ if (typeof opt_opts.position !== "undefined") {
543
+
544
+ this.setPosition(opt_opts.position);
545
+ }
546
+ if (typeof opt_opts.zIndex !== "undefined") {
547
+
548
+ this.setZIndex(opt_opts.zIndex);
549
+ }
550
+ if (typeof opt_opts.closeBoxMargin !== "undefined") {
551
+
552
+ this.closeBoxMargin_ = opt_opts.closeBoxMargin;
553
+ }
554
+ if (typeof opt_opts.closeBoxURL !== "undefined") {
555
+
556
+ this.closeBoxURL_ = opt_opts.closeBoxURL;
557
+ }
558
+ if (typeof opt_opts.infoBoxClearance !== "undefined") {
559
+
560
+ this.infoBoxClearance_ = opt_opts.infoBoxClearance;
561
+ }
562
+ if (typeof opt_opts.isHidden !== "undefined") {
563
+
564
+ this.isHidden_ = opt_opts.isHidden;
565
+ }
566
+ if (typeof opt_opts.visible !== "undefined") {
567
+
568
+ this.isHidden_ = !opt_opts.visible;
569
+ }
570
+ if (typeof opt_opts.enableEventPropagation !== "undefined") {
571
+
572
+ this.enableEventPropagation_ = opt_opts.enableEventPropagation;
573
+ }
574
+
575
+ if (this.div_) {
576
+
577
+ this.draw();
578
+ }
579
+ };
580
+
581
+ /**
582
+ * Sets the content of the InfoBox.
583
+ * The content can be plain text or an HTML DOM node.
584
+ * @param {string|Node} content
585
+ */
586
+ InfoBox.prototype.setContent = function (content) {
587
+ this.content_ = content;
588
+
589
+ if (this.div_) {
590
+
591
+ if (this.closeListener_) {
592
+
593
+ google.maps.event.removeListener(this.closeListener_);
594
+ this.closeListener_ = null;
595
+ }
596
+
597
+ // Odd code required to make things work with MSIE.
598
+ //
599
+ if (!this.fixedWidthSet_) {
600
+
601
+ this.div_.style.width = "";
602
+ }
603
+
604
+ if (typeof content.nodeType === "undefined") {
605
+ this.div_.innerHTML = this.getCloseBoxImg_() + content;
606
+ } else {
607
+ this.div_.innerHTML = this.getCloseBoxImg_();
608
+ this.div_.appendChild(content);
609
+ }
610
+
611
+ // Perverse code required to make things work with MSIE.
612
+ // (Ensures the close box does, in fact, float to the right.)
613
+ //
614
+ if (!this.fixedWidthSet_) {
615
+ this.div_.style.width = this.div_.offsetWidth + "px";
616
+ if (typeof content.nodeType === "undefined") {
617
+ this.div_.innerHTML = this.getCloseBoxImg_() + content;
618
+ } else {
619
+ this.div_.innerHTML = this.getCloseBoxImg_();
620
+ this.div_.appendChild(content);
621
+ }
622
+ }
623
+
624
+ this.addClickHandler_();
625
+ }
626
+
627
+ /**
628
+ * This event is fired when the content of the InfoBox changes.
629
+ * @name InfoBox#content_changed
630
+ * @event
631
+ */
632
+ google.maps.event.trigger(this, "content_changed");
633
+ };
634
+
635
+ /**
636
+ * Sets the geographic location of the InfoBox.
637
+ * @param {LatLng} latlng
638
+ */
639
+ InfoBox.prototype.setPosition = function (latlng) {
640
+
641
+ this.position_ = latlng;
642
+
643
+ if (this.div_) {
644
+
645
+ this.draw();
646
+ }
647
+
648
+ /**
649
+ * This event is fired when the position of the InfoBox changes.
650
+ * @name InfoBox#position_changed
651
+ * @event
652
+ */
653
+ google.maps.event.trigger(this, "position_changed");
654
+ };
655
+
656
+ /**
657
+ * Sets the zIndex style for the InfoBox.
658
+ * @param {number} index
659
+ */
660
+ InfoBox.prototype.setZIndex = function (index) {
661
+
662
+ this.zIndex_ = index;
663
+
664
+ if (this.div_) {
665
+
666
+ this.div_.style.zIndex = index;
667
+ }
668
+
669
+ /**
670
+ * This event is fired when the zIndex of the InfoBox changes.
671
+ * @name InfoBox#zindex_changed
672
+ * @event
673
+ */
674
+ google.maps.event.trigger(this, "zindex_changed");
675
+ };
676
+
677
+ /**
678
+ * Sets the visibility of the InfoBox.
679
+ * @param {boolean} isVisible
680
+ */
681
+ InfoBox.prototype.setVisible = function (isVisible) {
682
+
683
+ this.isHidden_ = !isVisible;
684
+ if (this.div_) {
685
+ this.div_.style.visibility = (this.isHidden_ ? "hidden" : "visible");
686
+ }
687
+ };
688
+
689
+ /**
690
+ * Returns the content of the InfoBox.
691
+ * @returns {string}
692
+ */
693
+ InfoBox.prototype.getContent = function () {
694
+
695
+ return this.content_;
696
+ };
697
+
698
+ /**
699
+ * Returns the geographic location of the InfoBox.
700
+ * @returns {LatLng}
701
+ */
702
+ InfoBox.prototype.getPosition = function () {
703
+
704
+ return this.position_;
705
+ };
706
+
707
+ /**
708
+ * Returns the zIndex for the InfoBox.
709
+ * @returns {number}
710
+ */
711
+ InfoBox.prototype.getZIndex = function () {
712
+
713
+ return this.zIndex_;
714
+ };
715
+
716
+ /**
717
+ * Returns a flag indicating whether the InfoBox is visible.
718
+ * @returns {boolean}
719
+ */
720
+ InfoBox.prototype.getVisible = function () {
721
+
722
+ var isVisible;
723
+
724
+ if ((typeof this.getMap() === "undefined") || (this.getMap() === null)) {
725
+ isVisible = false;
726
+ } else {
727
+ isVisible = !this.isHidden_;
728
+ }
729
+ return isVisible;
730
+ };
731
+
732
+ /**
733
+ * Shows the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.]
734
+ */
735
+ InfoBox.prototype.show = function () {
736
+
737
+ this.isHidden_ = false;
738
+ if (this.div_) {
739
+ this.div_.style.visibility = "visible";
740
+ }
741
+ };
742
+
743
+ /**
744
+ * Hides the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.]
745
+ */
746
+ InfoBox.prototype.hide = function () {
747
+
748
+ this.isHidden_ = true;
749
+ if (this.div_) {
750
+ this.div_.style.visibility = "hidden";
751
+ }
752
+ };
753
+
754
+ /**
755
+ * Adds the InfoBox to the specified map or Street View panorama. If <tt>anchor</tt>
756
+ * (usually a <tt>google.maps.Marker</tt>) is specified, the position
757
+ * of the InfoBox is set to the position of the <tt>anchor</tt>. If the
758
+ * anchor is dragged to a new location, the InfoBox moves as well.
759
+ * @param {Map|StreetViewPanorama} map
760
+ * @param {MVCObject} [anchor]
761
+ */
762
+ InfoBox.prototype.open = function (map, anchor) {
763
+
764
+ var me = this;
765
+
766
+ if (anchor) {
767
+
768
+ this.position_ = anchor.getPosition();
769
+ this.moveListener_ = google.maps.event.addListener(anchor, "position_changed", function () {
770
+ me.setPosition(this.getPosition());
771
+ });
772
+ }
773
+
774
+ this.setMap(map);
775
+
776
+ if (this.div_) {
777
+
778
+ this.panBox_();
779
+ }
780
+ };
781
+
782
+ /**
783
+ * Removes the InfoBox from the map.
784
+ */
785
+ InfoBox.prototype.close = function () {
786
+
787
+ var i;
788
+
789
+ if (this.closeListener_) {
790
+
791
+ google.maps.event.removeListener(this.closeListener_);
792
+ this.closeListener_ = null;
793
+ }
794
+
795
+ if (this.eventListeners_) {
796
+
797
+ for (i = 0; i < this.eventListeners_.length; i++) {
798
+
799
+ google.maps.event.removeListener(this.eventListeners_[i]);
800
+ }
801
+ this.eventListeners_ = null;
802
+ }
803
+
804
+ if (this.moveListener_) {
805
+
806
+ google.maps.event.removeListener(this.moveListener_);
807
+ this.moveListener_ = null;
808
+ }
809
+
810
+ if (this.contextListener_) {
811
+
812
+ google.maps.event.removeListener(this.contextListener_);
813
+ this.contextListener_ = null;
814
+ }
815
+
816
+ this.setMap(null);
817
+ };
js/infobox.min.js ADDED
@@ -0,0 +1 @@
 
1
+ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 8(a){a=a||{};r.s.1R.2k(2,3d);2.Q=a.1v||"";2.1H=a.1B||J;2.S=a.1G||0;2.H=a.1z||1h r.s.1Y(0,0);2.B=a.U||1h r.s.2E(0,0);2.15=a.13||t;2.1p=a.1t||"2h";2.1m=a.F||{};2.1E=a.1C||"3g";2.P=a.1j||"3b://38.r.33/2Y/2T/2N/1r.2K";3(a.1j===""){2.P=""}2.1f=a.1x||1h r.s.1Y(1,1);3(q a.A==="p"){3(q a.18==="p"){a.A=L}v{a.A=!a.18}}2.w=!a.A;2.17=a.1n||J;2.1I=a.2g||"2e";2.16=a.1l||J;2.4=t;2.z=t;2.14=t;2.V=t;2.E=t;2.R=t}8.9=1h r.s.1R();8.9.25=7(){5 i;5 f;5 a;5 d=2;5 c=7(e){e.20=L;3(e.1i){e.1i()}};5 b=7(e){e.30=J;3(e.1Z){e.1Z()}3(!d.16){c(e)}};3(!2.4){2.4=1e.2S("2Q");2.1d();3(q 2.Q.1u==="p"){2.4.O=2.G()+2.Q}v{2.4.O=2.G();2.4.1a(2.Q)}2.2J()[2.1I].1a(2.4);2.1w();3(2.4.6.D){2.R=L}v{3(2.S!==0&&2.4.Z>2.S){2.4.6.D=2.S;2.4.6.2D="2A";2.R=L}v{a=2.1P();2.4.6.D=(2.4.Z-a.W-a.11)+"12";2.R=J}}2.1F(2.1H);3(!2.16){2.E=[];f=["2t","1O","2q","2p","1M","2o","2n","2m","2l"];1o(i=0;i<f.1L;i++){2.E.1K(r.s.u.19(2.4,f[i],c))}2.E.1K(r.s.u.19(2.4,"1O",7(e){2.6.1J="2j"}))}2.V=r.s.u.19(2.4,"2i",b);r.s.u.T(2,"2f")}};8.9.G=7(){5 a="";3(2.P!==""){a="<2d";a+=" 2c=\'"+2.P+"\'";a+=" 2b=11";a+=" 6=\'";a+=" U: 2a;";a+=" 1J: 29;";a+=" 28: "+2.1E+";";a+="\'>"}K a};8.9.1w=7(){5 a;3(2.P!==""){a=2.4.3n;2.z=r.s.u.19(a,"1M",2.27())}v{2.z=t}};8.9.27=7(){5 a=2;K 7(e){e.20=L;3(e.1i){e.1i()}r.s.u.T(a,"3m");a.1r()}};8.9.1F=7(d){5 m;5 n;5 e=0,I=0;3(!d){m=2.1D();3(m 3l r.s.3k){3(!m.26().3h(2.B)){m.3f(2.B)}n=m.26();5 a=m.3e();5 h=a.Z;5 f=a.24;5 k=2.H.D;5 l=2.H.1k;5 g=2.4.Z;5 b=2.4.24;5 i=2.1f.D;5 j=2.1f.1k;5 o=2.23().3c(2.B);3(o.x<(-k+i)){e=o.x+k-i}v 3((o.x+g+k+i)>h){e=o.x+g+k+i-h}3(2.17){3(o.y<(-l+j+b)){I=o.y+l-j-b}v 3((o.y+l+j)>f){I=o.y+l+j-f}}v{3(o.y<(-l+j)){I=o.y+l-j}v 3((o.y+b+l+j)>f){I=o.y+b+l+j-f}}3(!(e===0&&I===0)){5 c=m.3a();m.39(e,I)}}}};8.9.1d=7(){5 i,F;3(2.4){2.4.37=2.1p;2.4.6.36="";F=2.1m;1o(i 35 F){3(F.34(i)){2.4.6[i]=F[i]}}2.4.6.32="31(0)";3(q 2.4.6.X!=="p"&&2.4.6.X!==""){2.4.6.2Z="\\"2X:2W.2V.2U(2R="+(2.4.6.X*1X)+")\\"";2.4.6.2P="2O(X="+(2.4.6.X*1X)+")"}2.4.6.U="2M";2.4.6.M=\'1c\';3(2.15!==t){2.4.6.13=2.15}}};8.9.1P=7(){5 c;5 a={1b:0,1g:0,W:0,11:0};5 b=2.4;3(1e.1s&&1e.1s.1W){c=b.2L.1s.1W(b,"");3(c){a.1b=C(c.1V,10)||0;a.1g=C(c.1U,10)||0;a.W=C(c.1T,10)||0;a.11=C(c.1S,10)||0}}v 3(1e.2I.N){3(b.N){a.1b=C(b.N.1V,10)||0;a.1g=C(b.N.1U,10)||0;a.W=C(b.N.1T,10)||0;a.11=C(b.N.1S,10)||0}}K a};8.9.2H=7(){3(2.4){2.4.2G.2F(2.4);2.4=t}};8.9.1y=7(){2.25();5 a=2.23().2C(2.B);2.4.6.W=(a.x+2.H.D)+"12";3(2.17){2.4.6.1g=-(a.y+2.H.1k)+"12"}v{2.4.6.1b=(a.y+2.H.1k)+"12"}3(2.w){2.4.6.M="1c"}v{2.4.6.M="A"}};8.9.2B=7(a){3(q a.1t!=="p"){2.1p=a.1t;2.1d()}3(q a.F!=="p"){2.1m=a.F;2.1d()}3(q a.1v!=="p"){2.1Q(a.1v)}3(q a.1B!=="p"){2.1H=a.1B}3(q a.1G!=="p"){2.S=a.1G}3(q a.1z!=="p"){2.H=a.1z}3(q a.1n!=="p"){2.17=a.1n}3(q a.U!=="p"){2.1q(a.U)}3(q a.13!=="p"){2.22(a.13)}3(q a.1C!=="p"){2.1E=a.1C}3(q a.1j!=="p"){2.P=a.1j}3(q a.1x!=="p"){2.1f=a.1x}3(q a.18!=="p"){2.w=a.18}3(q a.A!=="p"){2.w=!a.A}3(q a.1l!=="p"){2.16=a.1l}3(2.4){2.1y()}};8.9.1Q=7(a){2.Q=a;3(2.4){3(2.z){r.s.u.Y(2.z);2.z=t}3(!2.R){2.4.6.D=""}3(q a.1u==="p"){2.4.O=2.G()+a}v{2.4.O=2.G();2.4.1a(a)}3(!2.R){2.4.6.D=2.4.Z+"12";3(q a.1u==="p"){2.4.O=2.G()+a}v{2.4.O=2.G();2.4.1a(a)}}2.1w()}r.s.u.T(2,"2z")};8.9.1q=7(a){2.B=a;3(2.4){2.1y()}r.s.u.T(2,"21")};8.9.22=7(a){2.15=a;3(2.4){2.4.6.13=a}r.s.u.T(2,"2y")};8.9.2x=7(a){2.w=!a;3(2.4){2.4.6.M=(2.w?"1c":"A")}};8.9.2w=7(){K 2.Q};8.9.1A=7(){K 2.B};8.9.2v=7(){K 2.15};8.9.2u=7(){5 a;3((q 2.1D()==="p")||(2.1D()===t)){a=J}v{a=!2.w}K a};8.9.3i=7(){2.w=J;3(2.4){2.4.6.M="A"}};8.9.3j=7(){2.w=L;3(2.4){2.4.6.M="1c"}};8.9.2s=7(c,b){5 a=2;3(b){2.B=b.1A();2.14=r.s.u.2r(b,"21",7(){a.1q(2.1A())})}2.1N(c);3(2.4){2.1F()}};8.9.1r=7(){5 i;3(2.z){r.s.u.Y(2.z);2.z=t}3(2.E){1o(i=0;i<2.E.1L;i++){r.s.u.Y(2.E[i])}2.E=t}3(2.14){r.s.u.Y(2.14);2.14=t}3(2.V){r.s.u.Y(2.V);2.V=t}2.1N(t)};',62,210,'||this|if|div_|var|style|function|InfoBox|prototype||||||||||||||||undefined|typeof|google|maps|null|event|else|isHidden_|||closeListener_|visible|position_|parseInt|width|eventListeners_|boxStyle|getCloseBoxImg_|pixelOffset_|yOffset|false|return|true|visibility|currentStyle|innerHTML|closeBoxURL_|content_|fixedWidthSet_|maxWidth_|trigger|position|contextListener_|left|opacity|removeListener|offsetWidth||right|px|zIndex|moveListener_|zIndex_|enableEventPropagation_|alignBottom_|isHidden|addDomListener|appendChild|top|hidden|setBoxStyle_|document|infoBoxClearance_|bottom|new|stopPropagation|closeBoxURL|height|enableEventPropagation|boxStyle_|alignBottom|for|boxClass_|setPosition|close|defaultView|boxClass|nodeType|content|addClickHandler_|infoBoxClearance|draw|pixelOffset|getPosition|disableAutoPan|closeBoxMargin|getMap|closeBoxMargin_|panBox_|maxWidth|disableAutoPan_|pane_|cursor|push|length|click|setMap|mouseover|getBoxWidths_|setContent|OverlayView|borderRightWidth|borderLeftWidth|borderBottomWidth|borderTopWidth|getComputedStyle|100|Size|preventDefault|cancelBubble|position_changed|setZIndex|getProjection|offsetHeight|createInfoBoxDiv_|getBounds|getCloseClickHandler_|margin|pointer|relative|align|src|img|floatPane|domready|pane|infoBox|contextmenu|default|apply|touchmove|touchend|touchstart|dblclick|mouseup|mouseout|addListener|open|mousedown|getVisible|getZIndex|getContent|setVisible|zindex_changed|content_changed|auto|setOptions|fromLatLngToDivPixel|overflow|LatLng|removeChild|parentNode|onRemove|documentElement|getPanes|gif|ownerDocument|absolute|mapfiles|alpha|filter|div|Opacity|createElement|en_us|Alpha|Microsoft|DXImageTransform|progid|intl|MsFilter|returnValue|translateZ|WebkitTransform|com|hasOwnProperty|in|cssText|className|www|panBy|getCenter|http|fromLatLngToContainerPixel|arguments|getDiv|setCenter|2px|contains|show|hide|Map|instanceof|closeclick|firstChild'.split('|'),0,{}))
js/markerclusterer.js CHANGED
@@ -192,7 +192,7 @@ function MarkerClusterer(map, opt_markers, opt_options) {
192
  * @private
193
  */
194
  MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ =
195
- 'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' +
196
  'images/m';
197
 
198
 
192
  * @private
193
  */
194
  MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ =
195
+ '//google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' +
196
  'images/m';
197
 
198
 
js/markerclusterer.min.js CHANGED
@@ -1,6 +1,6 @@
1
  function d(a){return function(b){this[a]=b}}function f(a){return function(){return this[a]}}var k;
2
  function l(a,b,c){this.extend(l,google.maps.OverlayView);this.b=a;this.a=[];this.f=[];this.da=[53,56,66,78,90];this.j=[];this.A=!1;c=c||{};this.g=c.gridSize||60;this.l=c.minimumClusterSize||2;this.K=c.maxZoom||null;this.j=c.styles||[];this.Y=c.imagePath||this.R;this.X=c.imageExtension||this.Q;this.P=!0;void 0!=c.zoomOnClick&&(this.P=c.zoomOnClick);this.r=!1;void 0!=c.averageCenter&&(this.r=c.averageCenter);m(this);this.setMap(a);this.L=this.b.getZoom();var e=this;google.maps.event.addListener(this.b,
3
- "zoom_changed",function(){var a=e.b.getZoom(),b=e.b.minZoom||0,c=Math.min(e.b.maxZoom||100,e.b.mapTypes[e.b.getMapTypeId()].maxZoom),a=Math.min(Math.max(a,b),c);e.L!=a&&(e.L=a,e.m())});google.maps.event.addListener(this.b,"idle",function(){e.i()});b&&(b.length||Object.keys(b).length)&&this.C(b,!1)}k=l.prototype;k.R="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m";k.Q="png";
4
  k.extend=function(a,b){return function(a){for(var b in a.prototype)this.prototype[b]=a.prototype[b];return this}.apply(a,[b])};k.onAdd=function(){this.A||(this.A=!0,p(this))};k.draw=function(){};function m(a){if(!a.j.length)for(var b=0,c;c=a.da[b];b++)a.j.push({url:a.Y+(b+1)+"."+a.X,height:c,width:c})}k.T=function(){for(var a=this.o(),b=new google.maps.LatLngBounds,c=0,e;e=a[c];c++)b.extend(e.getPosition());this.b.fitBounds(b)};k.w=f("j");k.o=f("a");k.W=function(){return this.a.length};k.ca=d("K");
5
  k.J=f("K");k.G=function(a,b){for(var c=0,e=a.length,g=e;0!==g;)g=parseInt(g/10,10),c++;c=Math.min(c,b);return{text:e,index:c}};k.aa=d("G");k.H=f("G");k.C=function(a,b){if(a.length)for(var c=0,e;e=a[c];c++)s(this,e);else if(Object.keys(a).length)for(e in a)s(this,a[e]);b||this.i()};function s(a,b){b.s=!1;b.draggable&&google.maps.event.addListener(b,"dragend",function(){b.s=!1;a.M()});a.a.push(b)}k.q=function(a,b){s(this,a);b||this.i()};
6
  function t(a,b){var c=-1;if(a.a.indexOf)c=a.a.indexOf(b);else for(var e=0,g;g=a.a[e];e++)if(g==b){c=e;break}if(-1==c)return!1;b.setMap(null);a.a.splice(c,1);return!0}k.Z=function(a,b){var c=t(this,a);return!b&&c?(this.m(),this.i(),!0):!1};k.$=function(a,b){for(var c=!1,e=0,g;g=a[e];e++)g=t(this,g),c=c||g;if(!b&&c)return this.m(),this.i(),!0};k.V=function(){return this.f.length};k.getMap=f("b");k.setMap=d("b");k.I=f("g");k.ba=d("g");
1
  function d(a){return function(b){this[a]=b}}function f(a){return function(){return this[a]}}var k;
2
  function l(a,b,c){this.extend(l,google.maps.OverlayView);this.b=a;this.a=[];this.f=[];this.da=[53,56,66,78,90];this.j=[];this.A=!1;c=c||{};this.g=c.gridSize||60;this.l=c.minimumClusterSize||2;this.K=c.maxZoom||null;this.j=c.styles||[];this.Y=c.imagePath||this.R;this.X=c.imageExtension||this.Q;this.P=!0;void 0!=c.zoomOnClick&&(this.P=c.zoomOnClick);this.r=!1;void 0!=c.averageCenter&&(this.r=c.averageCenter);m(this);this.setMap(a);this.L=this.b.getZoom();var e=this;google.maps.event.addListener(this.b,
3
+ "zoom_changed",function(){var a=e.b.getZoom(),b=e.b.minZoom||0,c=Math.min(e.b.maxZoom||100,e.b.mapTypes[e.b.getMapTypeId()].maxZoom),a=Math.min(Math.max(a,b),c);e.L!=a&&(e.L=a,e.m())});google.maps.event.addListener(this.b,"idle",function(){e.i()});b&&(b.length||Object.keys(b).length)&&this.C(b,!1)}k=l.prototype;k.R="//google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m";k.Q="png";
4
  k.extend=function(a,b){return function(a){for(var b in a.prototype)this.prototype[b]=a.prototype[b];return this}.apply(a,[b])};k.onAdd=function(){this.A||(this.A=!0,p(this))};k.draw=function(){};function m(a){if(!a.j.length)for(var b=0,c;c=a.da[b];b++)a.j.push({url:a.Y+(b+1)+"."+a.X,height:c,width:c})}k.T=function(){for(var a=this.o(),b=new google.maps.LatLngBounds,c=0,e;e=a[c];c++)b.extend(e.getPosition());this.b.fitBounds(b)};k.w=f("j");k.o=f("a");k.W=function(){return this.a.length};k.ca=d("K");
5
  k.J=f("K");k.G=function(a,b){for(var c=0,e=a.length,g=e;0!==g;)g=parseInt(g/10,10),c++;c=Math.min(c,b);return{text:e,index:c}};k.aa=d("G");k.H=f("G");k.C=function(a,b){if(a.length)for(var c=0,e;e=a[c];c++)s(this,e);else if(Object.keys(a).length)for(e in a)s(this,a[e]);b||this.i()};function s(a,b){b.s=!1;b.draggable&&google.maps.event.addListener(b,"dragend",function(){b.s=!1;a.M()});a.a.push(b)}k.q=function(a,b){s(this,a);b||this.i()};
6
  function t(a,b){var c=-1;if(a.a.indexOf)c=a.a.indexOf(b);else for(var e=0,g;g=a.a[e];e++)if(g==b){c=e;break}if(-1==c)return!1;b.setMap(null);a.a.splice(c,1);return!0}k.Z=function(a,b){var c=t(this,a);return!b&&c?(this.m(),this.i(),!0):!1};k.$=function(a,b){for(var c=!1,e=0,g;g=a[e];e++)g=t(this,g),c=c||g;if(!b&&c)return this.m(),this.i(),!0};k.V=function(){return this.f.length};k.getMap=f("b");k.setMap=d("b");k.I=f("g");k.ba=d("g");
js/wpsl-gmap.js CHANGED
@@ -1,126 +1,325 @@
1
  jQuery( document ).ready( function( $ ) {
2
- var geocoder, map, infoWindow, directionsDisplay, directionsService, geolocationLatlng, markerClusterer,
 
 
3
  markersArray = [],
4
  directionMarkerPosition = {},
5
  mapDefaults = {},
6
  resetMap = false,
7
  streetViewAvailable = false,
8
- startMarkerData,
9
- startAddress,
10
- startLatLng,
11
- autoLoad = wpslSettings.autoLoad;
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  /**
14
  * Initialize the map with the correct settings
15
  *
16
  * @since 1.0
 
 
17
  * @returns {void}
18
  */
19
- function initializeGmap() {
20
- var myOptions, zoomControlPosition, zoomControlStyle, latLng, zoomLevel, mapType,
21
- streetViewVisible = ( wpslSettings.streetView == 1 ) ? true : false;
22
 
23
- /* If no zoom location is defined, we show the entire world */
24
- if ( wpslSettings.zoomLatlng !== "" ) {
25
- latLng = wpslSettings.zoomLatlng.split( ',' );
26
- startLatLng = new google.maps.LatLng( latLng[0], latLng[1] );
27
- zoomLevel = parseInt( wpslSettings.zoomLevel );
28
- } else {
29
- startLatLng = new google.maps.LatLng( 0,0 );
30
- zoomLevel = 1;
31
- }
32
 
33
  geocoder = new google.maps.Geocoder();
34
- infoWindow = new google.maps.InfoWindow();
35
  directionsDisplay = new google.maps.DirectionsRenderer();
36
  directionsService = new google.maps.DirectionsService();
37
 
38
- /* Set correct the position of the controls */
39
- if ( wpslSettings.controlPosition == "right" ) {
40
- zoomControlPosition = google.maps.ControlPosition.RIGHT_TOP
41
- } else {
42
- zoomControlPosition = google.maps.ControlPosition.LEFT_TOP
43
- }
 
 
 
 
 
 
 
 
44
 
45
- /* Set correct control style */
46
- if ( wpslSettings.controlStyle == "small" ) {
47
- zoomControlStyle = google.maps.ZoomControlStyle.SMALL
48
- } else {
49
- zoomControlStyle = google.maps.ZoomControlStyle.LARGE
50
- }
51
 
52
- /* Set the selected map type */
53
- switch ( wpslSettings.mapType ) {
54
- case "roadmap":
55
- mapType = google.maps.MapTypeId.ROADMAP
56
- break;
57
- case "satellite":
58
- mapType = google.maps.MapTypeId.SATELLITE
59
- break;
60
- case "hybrid":
61
- mapType = google.maps.MapTypeId.HYBRID
62
- break;
63
- case "terrain":
64
- mapType = google.maps.MapTypeId.TERRAIN
65
- break;
66
- default:
67
- mapType = google.maps.MapTypeId.ROADMAP
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
- myOptions = {
71
- zoom: zoomLevel,
72
- center: startLatLng,
73
- mapTypeId: mapType,
74
- mapTypeControl: false,
75
- panControl: false,
76
- streetViewControl: streetViewVisible,
77
- zoomControlOptions: {
78
- style: zoomControlStyle,
79
- position: zoomControlPosition
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
- };
 
82
 
83
- map = new google.maps.Map( document.getElementById( "wpsl-gmap" ), myOptions );
84
 
85
- /* Not the most optimal solution, but we check the useragent if we should enable the easydropdown library.
86
- * We do this because several people have reported issues with it on iOS and Android devices. So on mobile
87
- * devices the dropdowns will be styled according to the browser styles on that device.
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  */
89
- if ( !checkMobileUserAgent() && $( ".wpsl-dropdown" ).length ) {
90
- createDropdowns();
91
- } else {
92
- $( "#wpsl-search-wrap select").show();
93
- $( "#wpsl-wrap" ).addClass( "wpsl-mobile" );
94
  }
95
-
96
- /* Check if we need to try and autolocate the user */
97
- if ( wpslSettings.autoLocate == 1 ) {
98
- checkGeolocation();
 
 
 
 
 
 
 
99
  } else {
100
- if ( wpslSettings.autoLoad == 1 ) {
101
- showStores();
102
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
-
105
- /* Move the mousecursor to the store search field if the focus option is enabled */
106
- if ( wpslSettings.mouseFocus == 1 ) {
107
- $( "#wpsl-search-input" ).focus();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  }
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * Add the start marker and call the function that inits the store search
113
  *
114
  * @since 1.1
 
 
115
  * @returns {void}
116
  */
117
- function showStores() {
118
  var startMarker = {
119
  store: wpslLabels.startPoint
120
  };
121
 
122
- addMarker( startLatLng, 0, startMarker, true ); // This marker is the 'start location' marker. With a storeId of 0, no name and is draggable
123
- findStoreLocations( startLatLng, resetMap, autoLoad );
124
  }
125
 
126
  /**
@@ -133,125 +332,273 @@ function checkMobileUserAgent() {
133
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent );
134
  }
135
 
136
- /* Check if Geolocation detection is supported.
 
137
  *
138
  * If there is an error / timeout with determining the users
139
  * location we use the 'start point' value from the settings as the start location through the showStores function.
140
  *
141
  * @since 1.0
 
 
142
  * @returns {void}
143
  */
144
- function checkGeolocation() {
 
145
  if ( navigator.geolocation ) {
146
- var keepStartMarker = false,
147
- locationTimeout = setTimeout( showStores, 3000 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
  navigator.geolocation.getCurrentPosition( function( position ) {
 
150
  clearTimeout( locationTimeout );
151
-
152
- /* If the timeout is triggerd, and the user later decides to enable the gelocation detection,
153
- * it gets messy with multiple start markers. So we first clear the map before adding new ones.
 
 
154
  */
155
  deleteOverlays( keepStartMarker );
156
- handleGeolocationQuery( position, resetMap );
157
  }, function( error ) {
158
- clearTimeout( locationTimeout );
159
- showStores();
160
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  } else {
162
- showStores();
 
163
  }
164
- };
 
 
 
 
 
165
 
166
- /* Check if Geolocation detection is supported.
 
167
  *
168
  * If there is an error / timeout determining the users location,
169
  * then we use the 'start point' value from the settings as the start location through the showStores function.
170
  *
171
  * @since 1.0
172
- * @param {object} position The latlng coordinates
173
- * @param {boolean} resetMap Whether we should reset the map or not
 
 
174
  * @returns {void}
175
  */
176
- function handleGeolocationQuery( position, resetMap ) {
177
 
178
  if ( typeof( position ) === "undefined" ) {
179
- showStores();
180
- } else {
181
  var latLng = new google.maps.LatLng( position.coords.latitude, position.coords.longitude );
182
 
183
  /* Store the latlng from the geolocation for when the user hits "reset" again
184
- * without having to ask for permission again
185
  */
186
  geolocationLatlng = position;
187
 
188
  reverseGeocode( latLng ); // Set the zipcode that belongs to the latlng in the input field
189
  map.setCenter( latLng );
190
  addMarker( latLng, 0, '', true ); // This marker is the 'start location' marker. With a storeId of 0, no name and is draggable
191
- findStoreLocations( latLng, resetMap, autoLoad );
192
  }
193
- };
194
 
195
- /* Handle clicks on the search button */
196
- $( "#wpsl-search-btn" ).on( "click", function() {
197
- var keepStartMarker = false;
198
- $( "#wpsl-search-input" ).removeClass();
199
-
200
- if ( !$( "#wpsl-search-input" ).val() ) {
201
- $( "#wpsl-search-input" ).addClass( "wpsl-error" ).focus();
202
- } else {
203
- $( "#wpsl-result-list ul" ).empty();
204
- $( "#wpsl-stores" ).show();
205
- $( ".wpsl-direction-before, .wpsl-direction-after" ).remove();
206
- $( "#wpsl-direction-details" ).hide();
207
- resetMap = false;
208
- deleteOverlays( keepStartMarker );
209
- deleteStartMarker();
210
- codeAddress();
211
- }
212
- });
213
 
214
- /* Handle clicks on the "Reset" button */
215
- $( "#wpsl-reset-map" ).on( "click", function() {
216
- var keepStartMarker = false,
217
- resetMap = true;
218
-
219
- /* When the start marker is dragged the autoload value is set to false.
220
- * So we need to check the correct value when the reset button is pushed before reloading the stores.
221
- */
222
- if ( wpslSettings.autoLoad == 1) {
223
- autoLoad = 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  }
225
-
226
- /* Check if the latlng or zoom has changed since pageload, if so there is something to reset */
227
- if ( ( ( ( map.getCenter().lat() !== mapDefaults.centerLatlng.lat() ) || ( map.getCenter().lng() !== mapDefaults.centerLatlng.lng() ) || ( map.getZoom() !== mapDefaults.zoomLevel ) ) ) ) {
228
- deleteOverlays( keepStartMarker );
229
- $( "#wpsl-search-input" ).val("").removeClass();
230
-
231
- /* If marker clusters exist, remove them from the map */
232
- if ( markerClusterer ) {
233
- markerClusterer.clearMarkers();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  }
235
-
236
- /* Remove the start marker */
237
- deleteStartMarker();
238
 
239
- /* Reset the dropdown values */
240
- resetDropdowns();
 
 
 
 
 
241
 
242
- if ( wpslSettings.autoLocate == 1 ) {
243
- handleGeolocationQuery( geolocationLatlng, resetMap );
244
- } else {
245
- showStores();
246
- }
247
- }
248
-
249
- /* Make sure the stores are shown and the direction details are hidden */
250
- $( "#wpsl-stores" ).show();
251
- $( "#wpsl-direction-details" ).hide();
252
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
 
254
- /* Remove the start marker from the map
 
255
  *
256
  * @since 1.2.12
257
  * @returns {void}
@@ -263,28 +610,52 @@ function deleteStartMarker() {
263
  }
264
  }
265
 
266
- /* Reset the dropdown values after the "reset" button is triggerd
 
 
267
  *
268
  * @since 1.1
269
  * @returns {void}
270
  */
271
  function resetDropdowns() {
272
- var i, arrayLength,
273
  defaultValues = [wpslSettings.searchRadius + ' ' + wpslSettings.distanceUnit, wpslSettings.maxResults],
274
  dropdowns = ["wpsl-radius", "wpsl-results"];
275
 
276
  for ( i = 0, arrayLength = dropdowns.length; i < arrayLength; i++ ) {
277
- $( "#" + dropdowns[i] + " .selected" ).html( defaultValues[i] );
278
  $( "#" + dropdowns[i] + " li" ).removeClass();
 
 
 
 
 
 
279
 
280
- $( "#" + dropdowns[i] + " li" ).each( function () {
281
  if ( $( this ).text() === defaultValues[i] ) {
282
- $( this ).addClass( "active" );
 
 
283
  }
284
  });
285
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  }
287
-
288
  /* Handle the click on the back button when the route directions are displayed */
289
  $( "#wpsl-result-list" ).on( "click", ".wpsl-back", function() {
290
  var i, len;
@@ -296,17 +667,17 @@ $( "#wpsl-result-list" ).on( "click", ".wpsl-back", function() {
296
  for ( i = 0, len = markersArray.length; i < len; i++ ) {
297
  markersArray[i].setMap( map );
298
  }
299
-
300
  /* Restore the start marker on the map */
301
  if ( ( typeof( startMarkerData ) !== "undefined" ) && ( startMarkerData !== "" ) ) {
302
  startMarkerData.setMap( map );
303
  }
304
 
305
- /* If marker clusters are enabled, then restore them */
306
  if ( markerClusterer ) {
307
  checkMarkerClusters();
308
  }
309
-
310
  map.setCenter( directionMarkerPosition.centerLatlng );
311
  map.setZoom( directionMarkerPosition.zoomLevel );
312
 
@@ -317,7 +688,8 @@ $( "#wpsl-result-list" ).on( "click", ".wpsl-back", function() {
317
  return false;
318
  });
319
 
320
- /* Show the driving directions
 
321
  *
322
  * @since 1.1
323
  * @param {object} e The clicked elemennt
@@ -325,13 +697,16 @@ $( "#wpsl-result-list" ).on( "click", ".wpsl-back", function() {
325
  */
326
  function renderDirections( e ) {
327
  var i, start, end, len, storeId;
 
 
 
328
 
329
  /*
330
  The storeId is placed on the li in the results list,
331
  but in the marker it will be on the wrapper div. So we check which one we need to target.
332
  */
333
- if ( e.parent( "li" ).length > 0 ) {
334
- storeId = e.parent( "li" ).data( "store-id" );
335
  } else {
336
  storeId = e.parents( ".wpsl-info-window" ).data( "store-id" );
337
  }
@@ -352,9 +727,9 @@ function renderDirections( e ) {
352
 
353
  /* Only continue if the start data is still empty or undefined */
354
  if ( ( markersArray[i].storeId == 0 ) && ( ( typeof( start ) === "undefined" ) || ( start === "" ) ) ) {
355
- start = markersArray[i].getPosition();
356
  } else if ( markersArray[i].storeId == storeId ) {
357
- end = markersArray[i].getPosition();
358
  }
359
  }
360
 
@@ -367,47 +742,64 @@ function renderDirections( e ) {
367
  }
368
  }
369
 
370
- /* Check if we need to enable the bouncing of markers when the user hovers over the result list */
371
- if ( wpslSettings.markerBounce == 1 ) {
372
- $( "#wpsl-stores" ).on( "mouseenter", "li", function() {
373
- letsBounce( $( this ).data( "store-id" ), "start" );
374
- });
375
-
376
- $( "#wpsl-stores" ).on( "mouseleave", "li", function() {
377
- letsBounce( $( this ).data( "store-id" ), "stop" );
378
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  }
380
 
381
- /* Let a single marker bounce
 
382
  *
383
  * @since 1.0
384
  * @param {number} storeId The storeId of the marker that we need to bounce on the map
385
- * @param {string} status Indicates whether we should stop or start the bouncing
386
  * @returns {void}
387
  */
388
  function letsBounce( storeId, status ) {
389
- var i, len, animation = "";
390
-
391
- if ( status == "start" ) {
392
- animation = google.maps.Animation.BOUNCE
393
- } else {
394
- animation = null;
395
- }
396
 
397
  /* Find the correct marker to bounce based on the storeId */
398
  for ( i = 0, len = markersArray.length; i < len; i++ ) {
399
  if ( markersArray[i].storeId == storeId ) {
400
  marker = markersArray[i];
401
- marker.setAnimation( animation );
 
 
 
 
 
402
  }
403
  }
404
  }
405
 
406
- /* Calculate the route from the start to the end
 
407
  *
408
  * @since 1.0
409
  * @param {object} start The latlng from the start point
410
- * @param {object} end The latlng from the end point
411
  * @returns {void}
412
  */
413
  function calcRoute( start, end ) {
@@ -416,16 +808,16 @@ function calcRoute( start, end ) {
416
  request = {};
417
 
418
  if ( wpslSettings.distanceUnit == "km" ) {
419
- distanceUnit = google.maps.UnitSystem.METRIC
420
  } else {
421
- distanceUnit = google.maps.UnitSystem.IMPERIAL
422
  }
423
 
424
  request = {
425
  origin: start,
426
  destination: end,
427
  travelMode: google.maps.DirectionsTravelMode.DRIVING,
428
- unitSystem: distanceUnit
429
  };
430
 
431
  directionsService.route( request, function( response, status ) {
@@ -447,7 +839,7 @@ function calcRoute( start, end ) {
447
  }
448
  }
449
 
450
- $( "#wpsl-direction-details ul" ).append( directionStops ).before( "<p class='wpsl-direction-before'><a class='wpsl-back' id='wpsl-direction-start' href='#'>" + wpslLabels.back + "</a>" + direction.legs[0].distance.text + " - " + direction.legs[0].duration.text + "</p>" ).after( "<p class='wpsl-direction-after'>" + response.routes[0].copyrights + "</p>" );
451
  $( "#wpsl-direction-details" ).show();
452
 
453
  /* Remove all single markers from the map */
@@ -461,7 +853,7 @@ function calcRoute( start, end ) {
461
  }
462
 
463
  /* Remove the start marker from the map */
464
- if ( ( typeof( startMarkerData ) !== "undefined" ) && ( startMarkerData !== "" ) ) {
465
  startMarkerData.setMap( null );
466
  }
467
 
@@ -479,12 +871,14 @@ function calcRoute( start, end ) {
479
  });
480
  }
481
 
482
- /* Geocode the user input
 
483
  *
484
  * @since 1.0
 
485
  * @returns {void}
486
  */
487
- function codeAddress() {
488
  var latLng,
489
  autoLoad = false,
490
  keepStartMarker = false,
@@ -496,20 +890,21 @@ function codeAddress() {
496
 
497
  /* Remove any previous markers and add a new one */
498
  deleteOverlays( keepStartMarker );
499
- addMarker( latLng, 0, '', true ); // This marker is the 'start location' marker. With a storeId of 0, no name and is draggable
500
 
501
  /* Try to find stores that match the radius, location criteria */
502
- findStoreLocations( latLng, resetMap, autoLoad );
503
  } else {
504
  geocodeErrors( status );
505
  }
506
  });
507
  }
508
 
509
- /* Geocode the user input and set the returned zipcode in the input field
 
510
  *
511
  * @since 1.0
512
- * @param {object} latlng The coordinates of the location that should be reverse geocoded
513
  * @returns {void}
514
  */
515
  function reverseGeocode( latLng ) {
@@ -528,7 +923,8 @@ function reverseGeocode( latLng ) {
528
  });
529
  }
530
 
531
- /* Filter out the zipcode from the response
 
532
  *
533
  * @since 1.0
534
  * @param {object} response The complete Google API response
@@ -551,30 +947,37 @@ function filterApiResponse( response ) {
551
  return zipcode;
552
  }
553
 
554
- /* Call the function to make the ajax request. But if we need to show the driving directions
555
- * on maps.google.com itself, we first need to geocode the start latlng into a formatted address.
 
 
 
556
  *
557
  * @since 1.0
558
- * @param {object} startLatLng The latlng used as the starting point
559
- * @param {boolean} resetMap Whether we should reset the map or not
560
- * @param {string} autoLoad Check if we need to autoload all the stores
 
561
  * @returns {void}
562
  */
563
- function findStoreLocations( startLatLng, resetMap, autoLoad ) {
 
564
  /* Check if we need to open a new window and show the route on the Google Maps site itself. */
565
  if ( wpslSettings.directionRedirect == 1 ) {
566
  findFormattedAddress( startLatLng, function() {
567
- makeAjaxRequest( startLatLng, resetMap, autoLoad );
568
  });
569
  } else {
570
- makeAjaxRequest( startLatLng, resetMap, autoLoad );
571
  }
572
  }
573
 
574
- /* Convert the latlng into a formatted address
 
575
  *
576
  * @since 1.0
577
- * @param {object} latlng The latlng to geocode
 
578
  * @returns {void}
579
  */
580
  function findFormattedAddress( latLng, callback ) {
@@ -588,54 +991,101 @@ function findFormattedAddress( latLng, callback ) {
588
  });
589
  }
590
 
591
- /* Make the Ajax request to load the store data
 
592
  *
593
  * @since 1.2
594
- * @param {object} startLatLng The latlng used as the starting point
595
- * @param {boolean} resetMap Whether we should reset the map or not
596
- * @param {string} autoLoad Check if we need to autoload all the stores
 
597
  * @returns {void}
598
  */
599
- function makeAjaxRequest( startLatLng, resetMap, autoLoad ) {
600
- var latLng,
601
- infoWindowData = {},
602
- storeData = "",
603
- draggable = false,
 
 
604
  $storeList = $( "#wpsl-stores ul" ),
605
- preloader = wpslSettings.path + "img/ajax-loader.gif",
606
- ajaxData = {
607
  action: "store_search",
608
  lat: startLatLng.lat(),
609
  lng: startLatLng.lng()
610
- },
611
- url = {
612
- src : "#wpsl-direction-start",
613
- target : ""
614
  };
615
-
616
- /* If we reset the map we use the default dropdown values instead of the selected values. */
 
 
617
  if ( resetMap ) {
618
  ajaxData.max_results = wpslSettings.maxResults;
619
  ajaxData.radius = wpslSettings.searchRadius;
620
  } else {
621
- if ( $( "#wpsl-wrap" ).hasClass( "wpsl-mobile" ) ) {
622
- ajaxData.max_results = $( "#wpsl-results .wpsl-dropdown" ).val();
623
- ajaxData.radius = $( "#wpsl-radius .wpsl-dropdown" ).val();
624
  } else {
625
- ajaxData.max_results = parseInt( $( "#wpsl-results .wpsl-selected-item" ).text() );
626
- ajaxData.radius = parseInt( $( "#wpsl-radius .wpsl-selected-item" ).text() );
627
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
628
  }
629
 
630
  /* Check if autoload all stores is enabled */
631
  if ( autoLoad == 1 ) {
632
- ajaxData.autoload = 1 ;
 
 
 
 
 
 
 
 
 
 
 
 
 
633
  }
634
 
635
  /* Add the preloader */
636
- $storeList.empty().append( "<li class='wpsl-preloader'><img src='" + preloader + "'/><span>" + wpslLabels.preloader + "</span></li>" );
637
 
638
- $.get( wpslSettings.ajaxurl, ajaxData, function( response ) {
639
 
640
  /* Remove the preloaders and no results msg */
641
  $( ".wpsl-preloader, .no-results" ).remove();
@@ -643,37 +1093,29 @@ function makeAjaxRequest( startLatLng, resetMap, autoLoad ) {
643
  if ( response.success !== false ) {
644
  if ( response.length > 0 ) {
645
 
 
646
  $.each( response, function( index ) {
647
- infoWindowData = {
648
- store: response[index].store,
649
- address: response[index].address,
650
- address2: response[index].address2,
651
- city: response[index].city,
652
- country: response[index].country,
653
- state: response[index].state,
654
- zip: response[index].zip,
655
- description: response[index].description,
656
- phone: response[index].phone,
657
- fax: response[index].fax,
658
- url: response[index].url,
659
- email: response[index].email,
660
- hours: response[index].hours,
661
- thumb: response[index].thumb
662
- };
663
-
664
  latLng = new google.maps.LatLng( response[index].lat, response[index].lng );
665
- addMarker( latLng, response[index].id, infoWindowData, draggable );
666
- storeData = storeData + storeHtml( response[index], url );
667
- $( "#wpsl-reset-map" ).show();
 
668
  });
669
-
670
  $( "#wpsl-result-list" ).off( "click", ".wpsl-directions" );
671
- $storeList.append( storeData );
672
 
673
- $( "#wpsl-result-list" ).on( "click", ".wpsl-directions", function() {
674
- /* Check if we need to disable the rendering of the direction on the map or not. */
 
 
 
 
675
  if ( wpslSettings.directionRedirect != 1 ) {
676
  renderDirections( $( this ) );
 
677
  return false;
678
  }
679
  });
@@ -683,30 +1125,48 @@ function makeAjaxRequest( startLatLng, resetMap, autoLoad ) {
683
 
684
  /* Make sure everything fits on the screen */
685
  fitBounds();
 
 
686
  } else {
687
  $storeList.html( "<li class='no-results'>" + wpslLabels.noResults + "</li>" );
688
  }
689
-
690
  } else {
691
  alert( wpslLabels.generalError );
692
  }
693
 
694
- /* If a reset button exists, store the default zoom and latlng values.
695
- * This way when a user clicks the reset button we can check if the zoom/latlng values have changed,
696
- * and if we actually have to reload the map.
 
 
 
697
  */
698
- if ( $( "#wpsl-reset-map" ).length > 0 ) {
699
  if ( $.isEmptyObject( mapDefaults ) ) {
700
- mapDefaults = {
701
- centerLatlng: map.getCenter(),
702
- zoomLevel: map.getZoom()
703
- };
 
 
 
 
 
 
 
 
 
 
 
 
704
  }
705
- }
 
 
706
  });
707
 
708
  /* Move the mousecursor to the store search field if the focus option is enabled */
709
- if ( wpslSettings.mouseFocus == 1 ) {
710
  $( "#wpsl-search-input" ).focus();
711
  }
712
  }
@@ -743,29 +1203,30 @@ function checkMarkerClusters() {
743
  * Add a new marker to the map based on the provided location (latlng)
744
  *
745
  * @since 1.0
746
- * @param {object} latLng
747
- * @param {number} storeId
748
- * @param {object} infoWindowData
749
- * @param {boolean} draggable
 
750
  * @return {void}
751
  */
752
- function addMarker( latLng, storeId, infoWindowData, draggable ) {
753
  var markerPath, mapIcon, marker,
754
  keepStartMarker = true;
755
-
756
  if ( storeId === 0 ) {
757
  markerPath = wpslSettings.path + "img/markers/" + wpslSettings.startMarker;
758
  } else {
759
  markerPath = wpslSettings.path + "img/markers/" + wpslSettings.storeMarker;
760
  }
761
-
762
  mapIcon = {
763
  url: markerPath,
764
  scaledSize: new google.maps.Size( 24,35 ), //retina format
765
  origin: new google.maps.Point( 0,0 ),
766
  anchor: new google.maps.Point( 12,35 )
767
  };
768
-
769
  marker = new google.maps.Marker({
770
  position: latLng,
771
  map: map,
@@ -776,103 +1237,198 @@ function addMarker( latLng, storeId, infoWindowData, draggable ) {
776
  icon: mapIcon
777
  });
778
 
779
- /* Store the marker for later use */
780
- markersArray.push( marker );
781
 
782
- google.maps.event.addListener( marker, "click", function() {
783
-
784
- /* The start marker will have a store id of 0, all others won't */
785
- if ( storeId != 0 ) {
786
 
787
- /* Check if streetview is available at the clicked location */
788
- if ( wpslSettings.markerStreetView == 1) {
789
- checkStreetViewStatus( latLng, function() {
790
- setInfoWindowContent( marker, createInfoWindowHtml( infoWindowData, storeId, streetViewAvailable ) );
791
- });
 
 
 
 
 
 
792
  } else {
793
- setInfoWindowContent( marker, createInfoWindowHtml( infoWindowData, storeId, streetViewAvailable ) );
794
- }
795
- } else {
796
- setInfoWindowContent( marker, wpslLabels.startPoint );
797
- }
798
 
799
- google.maps.event.addListener( infoWindow, "domready", function() {
800
- infoWindowActions( marker, latLng );
801
- });
802
- });
 
 
803
 
 
804
  if ( draggable ) {
805
  google.maps.event.addListener( marker, "dragend", function( event ) {
806
  deleteOverlays( keepStartMarker );
807
  map.setCenter( event.latLng );
808
  reverseGeocode( event.latLng );
809
- findStoreLocations( event.latLng, resetMap, autoLoad = false );
810
  });
811
  }
812
  }
813
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  /**
815
- * Set the correct infowindow content for the marker
816
  *
817
  * @since 1.2.20
818
- * @param {object} marker Marker data
819
- * @param {string} InfoWindowContent The infowindow content
 
 
820
  * @returns {void}
821
  */
822
- function setInfoWindowContent( marker, InfoWindowContent ) {
823
- infoWindow.setContent( InfoWindowContent );
824
- infoWindow.open( map, marker );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
825
  }
826
 
827
  /**
828
- * Handle clicks for the different infowindow actions like,
829
  * direction, streetview and zoom here.
830
  *
831
  * @since 1.2.20
832
- * @param {object} marker Holds the marker data
833
- * @param {object} activelatLng The latng of the clicked marker
 
834
  * @returns {void}
835
  */
836
- function infoWindowActions( marker, activelatLng ) {
837
- $( ".wpsl-info-actions a" ).on( "click", function() {
 
 
 
 
838
  if ( $( this ).hasClass( "wpsl-directions" ) ) {
839
 
840
  /* Check if we need to show the direction on the map
841
  * or send the users to maps.google.com
842
  */
843
- if ( wpslSettings.directionRedirect != 1 ) {
 
 
844
  renderDirections( $( this ) );
845
-
846
- return false;
847
  }
848
  } else if ( $( this ).hasClass( "wpsl-streetview" ) ) {
849
- activateStreetView( marker );
850
-
851
- return false;
852
  } else if ( $( this ).hasClass( "wpsl-zoom-here" ) ) {
853
- map.setCenter( activelatLng );
854
- map.setZoom( 15 );
855
-
856
- return false;
857
  }
 
 
858
  });
859
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
860
 
861
  /**
862
  * Activate streetview for the clicked location
863
  *
864
  * @since 1.2.20
865
- * @param {object} marker The current marker
 
866
  * @returns {void}
867
  */
868
- function activateStreetView( marker ) {
869
- var panorama = map.getStreetView();
870
  panorama.setPosition( marker.getPosition() );
871
  panorama.setVisible( true );
872
 
873
- $( "#wpsl-reset-map" ).hide();
874
 
875
- StreetViewListener( panorama );
876
  }
877
 
878
  /**
@@ -883,17 +1439,19 @@ function activateStreetView( marker ) {
883
  * info at tijmensmit.com
884
  *
885
  * @since 1.2.20
886
- * @param {object} panorama The streetview object
 
887
  * @returns {void}
888
  */
889
- function StreetViewListener( panorama ) {
890
- google.maps.event.addListener( panorama, 'visible_changed', function() {
891
  if ( !panorama.getVisible() ) {
892
- var currentZoomLevel = map.getZoom();
893
- $( "#wpsl-reset-map" ).show();
894
 
895
- map.setZoom( currentZoomLevel-1 );
896
- map.setZoom( currentZoomLevel );
 
 
897
  }
898
  });
899
  }
@@ -904,12 +1462,13 @@ function StreetViewListener( panorama ) {
904
  * Make sure that a streetview exists for the latlng
905
  *
906
  * @since 1.2.20
907
- * @param {object} latLng The latlng coordinates
 
908
  * @returns {void}
909
  */
910
  function checkStreetViewStatus( latLng, callback ) {
911
  var service = new google.maps.StreetViewService();
912
-
913
  service.getPanoramaByLocation( latLng, 50, function( result, status ) {
914
  streetViewAvailable = ( status == google.maps.StreetViewStatus.OK ) ? true : false;
915
  callback();
@@ -917,290 +1476,147 @@ function checkStreetViewStatus( latLng, callback ) {
917
  }
918
 
919
  /**
920
- * Create the data for the infowindows on Google Maps
921
  *
922
- * @since 1.0
923
- * @param {object} infoWindowData The data that is shown in the infowindow (address, url, phone etc)
924
- * @param {number} storeId The ID of the store
925
- * @param {boolean} streetViewAvailable Indicates whether or not we should show the streetview link
926
- * @returns {string} windowContent The html content that is placed in the infowindow
927
  */
928
- function createInfoWindowHtml( infoWindowData, storeId, streetViewAvailable ) {
929
- var storeHeader, url,
930
- address2 = "",
931
- newWindow = "",
932
- streetView = "",
933
- zoomTo = "",
934
- windowContent = "<div data-store-id='" + storeId + "' class='wpsl-info-window'>";
935
-
936
- /* Check if we need to turn the store name into a link or not */
937
- if ( ( typeof( infoWindowData.url ) !== "undefined" ) && ( infoWindowData.url !== "" ) ) {
938
- if ( wpslSettings.newWindow == 1 ) {
939
- newWindow = "target='_blank'";
940
  }
941
-
942
- storeHeader = "<a " + newWindow + " href='" + infoWindowData.url + "'><strong>" + infoWindowData.store + "</strong></a>";
943
- } else {
944
- storeHeader = "<strong>" + infoWindowData.store + "</strong>";
945
- }
946
-
947
- if ( ( typeof( infoWindowData.address2 ) !== "undefined" ) && ( infoWindowData.address2 !== "" ) ) {
948
- address2 = "<span>" + infoWindowData.address2 + "</span>";
949
- }
950
-
951
- windowContent += "<p>" + storeHeader + "<span>" + infoWindowData.address + "</span>" + address2 + "<span>" + infoWindowData.city + "</span></p>";
952
-
953
- if ( ( typeof( infoWindowData.description ) !== "undefined" ) && ( infoWindowData.description !== "" ) ) {
954
- windowContent += "<p>" + infoWindowData.description + "</p>";
955
- }
956
 
957
- /* If no data exist for either the phone / fax / email then we just don't show them */
958
- if ( ( typeof( infoWindowData.phone ) !== "undefined" ) && ( infoWindowData.phone !== "" ) ) {
959
- windowContent += "<span><strong>" + wpslLabels.phone + "</strong>: " + formatPhoneNumber( infoWindowData.phone ) + "</span>";
960
- }
961
-
962
- if ( ( typeof( infoWindowData.fax ) !== "undefined" ) && ( infoWindowData.fax !== "" ) ) {
963
- windowContent += "<span><strong>" + wpslLabels.fax + "</strong>: " + infoWindowData.fax + "</span>";
964
- }
965
-
966
- if ( ( typeof( infoWindowData.email ) !== "undefined" ) && ( infoWindowData.email !== "" ) ) {
967
- windowContent += "<span><strong>Email</strong>: " + infoWindowData.email + "</span>";
968
- }
969
-
970
- if ( ( typeof( infoWindowData.hours ) !== "undefined" ) && ( infoWindowData.hours !== "" ) ) {
971
- windowContent += "<div class='wpsl-store-hours'><strong>" + wpslLabels.hours + "</strong> " + infoWindowData.hours + "</div>";
972
- }
973
-
974
- if ( wpslSettings.directionRedirect == 1 ) {
975
- url = createDirectionUrl( infoWindowData.address, infoWindowData.city, infoWindowData.zip, infoWindowData.country );
976
- } else {
977
- url = {
978
- src : "#",
979
- target : ""
980
- };
981
- }
982
-
983
- if ( streetViewAvailable ) {
984
- streetView = "<a class='wpsl-streetview' href='#'>" + wpslLabels.streetView + "</a>";
985
- }
986
-
987
- if ( wpslSettings.markerZoomTo == 1 ) {
988
- zoomTo = "<a class='wpsl-zoom-here' href='#'>" + wpslLabels.zoomHere + "</a>";
989
- }
990
-
991
- windowContent += "<div class='wpsl-info-actions'><a class='wpsl-directions' " + url.target + " href='" + url.src + "'>" + wpslLabels.directions + "</a>" + streetView + zoomTo + "</div>";
992
- windowContent += "</div>";
993
-
994
- return windowContent;
995
- }
996
-
997
- /**
998
- * Make the phone number clickable if we are dealing with a mobile useragent
999
- *
1000
- * @since 1.2.20
1001
- * @param {string} phoneNumber The phone number
1002
- * @returns {string} phoneNumber Either just the plain number, or with a link wrapped around it with tel:
1003
- */
1004
- function formatPhoneNumber( phoneNumber ) {
1005
- if ( ( wpslSettings.phoneUrl == 1 ) && ( checkMobileUserAgent() ) ) {
1006
- phoneNumber = "<a href='tel:" + formatClickablePhoneNumber( phoneNumber ) + "'>" + phoneNumber + "</a>";
1007
- }
1008
-
1009
- return phoneNumber;
1010
- }
1011
-
1012
- /**
1013
- * Replace spaces - . and () from phone numbers.
1014
- * Also if the number starts with a + we check for a (0) and remove it.
1015
- *
1016
- * @since 1.2.20
1017
- * @param {string} phoneNumber The phone number
1018
- * @returns {string} phoneNumber The 'cleaned' number
1019
- */
1020
- function formatClickablePhoneNumber( phoneNumber ) {
1021
- if ( ( phoneNumber.indexOf( "+" ) != -1 ) && ( phoneNumber.indexOf( "(0)" ) != -1 ) ) {
1022
- phoneNumber = phoneNumber.replace( '(0)', '' );
1023
- }
1024
-
1025
- return phoneNumber.replace( /(-| |\(|\)|\.|)/g, '' );
1026
- }
1027
 
1028
- /**
1029
- * Create the html for the more info data
1030
- *
1031
- * @since 1.2.12
1032
- * @param {object} storeData The store details shown in the more info section
1033
- * @returns {string} moreInfoContent The html that is used to show the more info content
1034
- */
1035
- function createMoreInfoListing( storeData ) {
1036
- var newWindow = "",
1037
- moreInfoContent = "<div id='wpsl-id-" + storeData.id + "' class='wpsl-more-info-listings'>";
1038
-
1039
- if ( ( typeof( storeData.description ) !== "undefined" ) && ( storeData.description !== "" ) ) {
1040
- moreInfoContent += "<p>" + storeData.description + "</p>";
1041
- }
1042
-
1043
- moreInfoContent += "<p>";
1044
-
1045
- /* If no data exist for either the phone / fax / email then just don't show them */
1046
- if ( ( typeof( storeData.phone ) !== "undefined" ) && ( storeData.phone !== "" ) ) {
1047
- moreInfoContent += "<span><strong>" + wpslLabels.phone + "</strong>: " + formatPhoneNumber( storeData.phone ) + "</span>";
1048
- }
1049
 
1050
- if ( ( typeof( storeData.fax ) !== "undefined" ) && ( storeData.fax !== "" ) ) {
1051
- moreInfoContent += "<span><strong>" + wpslLabels.fax + "</strong>: " + storeData.fax + "</span>";
1052
- }
1053
 
1054
- if ( ( typeof( storeData.email ) !== "undefined" ) && ( storeData.email !== "" ) ) {
1055
- moreInfoContent += "<span><strong>Email</strong>: " + storeData.email + "</span>";
1056
- }
1057
-
1058
- if ( ( typeof( storeData.url ) !== "undefined" ) && ( storeData.url !== "" ) ) {
1059
- if ( wpslSettings.newWindow == 1 ) {
1060
- newWindow = "target='_blank'";
1061
  }
1062
-
1063
- moreInfoContent += "<span><strong>Url</strong>: <a " + newWindow + " href='" + storeData.url + "'>" + storeData.url + "</a></span>";
1064
- }
1065
-
1066
- moreInfoContent += "</p>";
1067
-
1068
- if ( ( typeof( storeData.hours ) !== "undefined" ) && ( storeData.hours !== "" ) ) {
1069
- moreInfoContent += "<div class='wpsl-store-hours'><strong>" + wpslLabels.hours + "</strong> " + storeData.hours + "</div>";
1070
- }
1071
 
1072
- moreInfoContent += "</div>";
1073
-
1074
- return moreInfoContent;
1075
- }
 
 
 
 
 
 
 
 
 
1076
 
1077
- /**
1078
- * Create the url that takes the user to the maps.google.com page
1079
- * and shows the correct driving directions.
1080
- *
1081
- * @since 1.0
1082
- * @param {string} address The store address
1083
- * @param {string} city The store city
1084
- * @param {string} zip The store zipcode
1085
- * @param {string} country The store country
1086
- * @returns {string} url The full maps.google.com url with the encoded start + end address
1087
- */
1088
- function createDirectionUrl( address, city, zip, country ) {
1089
- var destinationAddress, url;
1090
-
1091
- /* If we somehow failed to determine the start address, just set it to empty */
1092
- if ( typeof( startAddress ) === 'undefined' ) {
1093
- startAddress = '';
1094
- }
1095
 
1096
- destinationAddress = address + ', ' + city + ', ' + zip + ', ' + country;
 
 
 
 
 
 
 
 
 
 
1097
 
1098
- url = {
1099
- src : "https://maps.google.com/maps?saddr=" + rfc3986EncodeURIComponent( startAddress ) + "&daddr=" + rfc3986EncodeURIComponent( destinationAddress ) + "",
1100
- target : "target='_blank'"
1101
- };
 
 
1102
 
1103
- return url;
1104
- }
 
 
 
 
 
 
 
 
1105
 
1106
- /**
1107
- * Make the URI encoding compatible with RFC 3986
1108
- *
1109
- * !, ', (, ), and * will be escaped, otherwise they break the string
1110
- *
1111
- * @since 1.2.20
1112
- * @param {string} str The string to encode
1113
- * @returns {string} The encoded string
1114
- */
1115
- function rfc3986EncodeURIComponent( str ) {
1116
- return encodeURIComponent( str ).replace( /[!'()*]/g, escape );
1117
- }
 
 
 
 
 
1118
 
1119
  /**
1120
- * Create the html for the <li> elem in the store listing
1121
  *
1122
  * @since 1.0
1123
- * @param {object} response The store details shown in the more info section
1124
- * @param {object} url The directions url
1125
- * @returns {string} html The html with the store details
1126
  */
1127
- function storeHtml( response, url ) {
1128
- var html = "",
1129
- moreInfoData,
1130
- storeImg = "",
1131
- storeUrlTarget = "",
1132
- moreInfo = "",
1133
- moreInfoUrl = "#",
1134
- id = response.id,
1135
- store = response.store,
1136
- address = response.address,
1137
- address2 = "",
1138
- city = response.city,
1139
- state = response.state,
1140
- zip = response.zip,
1141
- thumb = response.thumb,
1142
- country = response.country,
1143
- distance = parseFloat( response.distance ).toFixed(1) + " " + wpslSettings.distanceUnit;
1144
-
1145
- if ( ( typeof( thumb ) !== "undefined" ) && ( thumb !== "" ) ) {
1146
- storeImg = "<img class='wpsl-store-thumb' src='" + thumb + "' width='48' height='48' alt='" + store + "' />";
1147
- }
1148
-
1149
- /* Check if we need to create an url that sends the user to maps.google.com for driving directions */
1150
- if ( wpslSettings.directionRedirect == 1 ) {
1151
- url = createDirectionUrl( address, city, zip, country );
1152
- }
1153
-
1154
- /* Check if we need to show the 'more info' link in the store listings */
1155
- if ( wpslSettings.moreInfo == 1 ) {
1156
-
1157
- /* If we show the store listings under the map, we do want to jump to the
1158
- * top of the map to focus on the opened infowindow
1159
- */
1160
- if ( ( wpslSettings.templateId == 1 ) && ( wpslSettings.moreInfoLocation == 'info window' ) ) {
1161
- moreInfoUrl = '#wpsl-search-wrap';
1162
- }
1163
-
1164
- /* Do we need to show the 'more info' data under the store details,
1165
- * or should we only add a link which will trigger the infowindow?
1166
- */
1167
- if ( wpslSettings.moreInfoLocation == "store listings" ) {
1168
-
1169
- /* Only create the 'more info' link if there is data to show */
1170
- if ( ( ( typeof( response.description ) !== "undefined" ) && ( response.description !== "" ) ) ||
1171
- ( ( typeof( response.phone ) !== "undefined" ) && ( response.phone !== "" ) ) ||
1172
- ( ( typeof( response.fax ) !== "undefined" ) && ( response.fax !== "" ) ) ||
1173
- ( ( typeof( response.email ) !== "undefined" ) && ( response.email !== "" ) ) ||
1174
- ( ( typeof( response.hours ) !== "undefined" ) && ( response.hours !== "" ) ) ) {
1175
- moreInfoData = createMoreInfoListing( response );
1176
- moreInfo = "<p><a class='wpsl-store-details wpsl-store-listing' href=" + moreInfoUrl + "wpsl-id-" + id + ">" + wpslLabels.moreInfo + "</a>" + moreInfoData + "</p>";
1177
- }
1178
- } else {
1179
- moreInfo = "<p><a class='wpsl-store-details' href=" + moreInfoUrl + ">" + wpslLabels.moreInfo + "</a></p>";
1180
- }
1181
- }
1182
-
1183
- /* Check if we need to make the store name clickable */
1184
- if ( wpslSettings.storeUrl == 1) {
1185
- if ( ( typeof( response.url ) !== "undefined" ) && ( response.url !== "" ) ) {
1186
-
1187
- /* Do we need to open the url in a new window? */
1188
- if ( wpslSettings.newWindow == 1 ) {
1189
- storeUrlTarget = "target='_blank'";
1190
- }
1191
-
1192
- store = "<a " + storeUrlTarget + " href='" + response.url + "'>" + store + "</a>";
1193
- }
1194
- }
1195
 
1196
- /* If we have a second address line, we add it */
1197
- if ( ( typeof( response.address2 ) !== "undefined" ) && ( response.address2 !== "" ) ) {
1198
- address2 = "<span class='wpsl-street'>" + response.address2 + "</span>";
 
1199
  }
1200
 
1201
- html = "<li data-store-id='" + id + "'><div><p>" + storeImg + "<strong>" + store + "</strong><span class='wpsl-street'>" + address + "</span>" + address2 + city + " " + state + " " + zip + "<span class='wpsl-country'>" + country + "</span></p>" + moreInfo + "</div>" + distance + "<a class='wpsl-directions' " + url.target + " href='" + url.src + "'>" + wpslLabels.directions + "</a></li>";
1202
 
1203
- return html;
1204
  }
1205
 
1206
  /**
@@ -1211,9 +1627,9 @@ function storeHtml( response, url ) {
1211
  */
1212
  function fitBounds() {
1213
  var i, markerLen,
1214
- maxZoom = 12,
1215
- bounds = new google.maps.LatLngBounds();
1216
-
1217
  /* Make sure we don't zoom to far */
1218
  google.maps.event.addListenerOnce( map, "bounds_changed", function( event ) {
1219
  if ( this.getZoom() > maxZoom ) {
@@ -1229,7 +1645,7 @@ function fitBounds() {
1229
  }
1230
 
1231
  /**
1232
- * Remove all existing markers and route lines from the map
1233
  *
1234
  * @since 1.0
1235
  * @param {boolean} keepStartMarker Whether or not to keep the start marker while removing all the other markers from the map
@@ -1237,6 +1653,7 @@ function fitBounds() {
1237
  */
1238
  function deleteOverlays( keepStartMarker ) {
1239
  var markerLen, i;
 
1240
  directionsDisplay.setMap( null );
1241
 
1242
  /* Remove all the markers from the map, and empty the array */
@@ -1323,11 +1740,10 @@ $( "#wpsl-search-input" ).keydown( function ( event ) {
1323
  }
1324
  });
1325
 
1326
- /* Handle clicks on the store details link */
1327
  $( "#wpsl-stores" ).on( "click", ".wpsl-store-details", function() {
1328
  var i, len,
1329
  $parentLi = $( this ).parents( "li" ),
1330
- storeId = $parentLi.data( "store-id" );
1331
 
1332
  /* Check if we should show the 'more info' details */
1333
  if ( wpslSettings.moreInfoLocation == "info window" ) {
@@ -1353,7 +1769,7 @@ $( "#wpsl-stores" ).on( "click", ".wpsl-store-details", function() {
1353
  /* If we show the store listings under the map, we do want to jump to the
1354
  * top of the map to focus on the opened infowindow
1355
  */
1356
- if ( wpslSettings.templateId != 1 || wpslSettings.moreInfoLocation == "store listings" ) {
1357
  return false;
1358
  }
1359
  });
@@ -1387,11 +1803,12 @@ function createDropdowns() {
1387
  } else {
1388
  active = '';
1389
  }
1390
-
1391
- $this.$dropdown.append( "<li " + active + ">" + $( this ).text() + "</li>" );
1392
  });
1393
 
1394
- $this.$dropdownElem.before( "<span class='wpsl-selected-item'>" + $this.find( ":selected" ).text() + "</span>" );
 
1395
  $this.$dropdownItem = $this.$dropdownElem.find( "li" );
1396
 
1397
  /* Listen for clicks on the 'wpsl-dropdown' div */
@@ -1401,7 +1818,7 @@ function createDropdowns() {
1401
  $( this ).toggleClass( "wpsl-active" );
1402
  maxHeight = 0;
1403
 
1404
- /* Either calculate the correct height for the <ul> or set it to 0 to hide it */
1405
  if ( $( this ).hasClass( "wpsl-active" ) ) {
1406
  $this.$dropdownItem.each( function( index ) {
1407
  maxHeight += $( this ).outerHeight();
@@ -1419,8 +1836,8 @@ function createDropdowns() {
1419
  $this.$dropdownItem.on( "click", function( e ) {
1420
 
1421
  /* Set the correct value as the selected item */
1422
- $this.$dropdownWrap.find( $( ".wpsl-selected-item" ) ).html( $( this ).text() );
1423
-
1424
  /* Apply the class to the correct item to make it bold */
1425
  $this.$dropdownItem.removeClass( "wpsl-selected-dropdown" );
1426
  $( this ).addClass( "wpsl-selected-dropdown" );
@@ -1447,8 +1864,42 @@ function closeDropdowns() {
1447
  $( ".wpsl-dropdown div" ).css( "height", 0 );
1448
  }
1449
 
1450
- if ( $( "#wpsl-gmap" ).length ) {
1451
- google.maps.event.addDomListener( window, "load", initializeGmap );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1452
  }
1453
 
1454
  });
1
  jQuery( document ).ready( function( $ ) {
2
+ var geocoder, map, directionsDisplay, directionsService, geolocationLatlng,
3
+ activeWindowMarkerId, infoWindow, markerClusterer, startMarkerData, startAddress,
4
+ openInfoWindow = [],
5
  markersArray = [],
6
  directionMarkerPosition = {},
7
  mapDefaults = {},
8
  resetMap = false,
9
  streetViewAvailable = false,
10
+ autoLoad = ( typeof wpslSettings !== "undefined" ) ? wpslSettings.autoLoad : "";
11
+
12
+ /* Only continue if a map is present */
13
+ if ( $( ".wpsl-gmap-canvas" ).length ) {
14
+ $( "<img />" ).attr( "src", wpslSettings.path + "img/ajax-loader.gif" );
15
+
16
+ /* The [wpsl] shortcode can only exist once on a page,
17
+ * but the [wpsl_map] shortcode can exist multiple times.
18
+ *
19
+ * So to make sure we init all the maps we loop over them.
20
+ */
21
+ $( ".wpsl-gmap-canvas" ).each( function( mapIndex ) {
22
+ var mapId = $( this ).attr( "id" );
23
+
24
+ initializeGmap( mapId, mapIndex );
25
+ });
26
+ }
27
 
28
  /**
29
  * Initialize the map with the correct settings
30
  *
31
  * @since 1.0
32
+ * @param {string} mapId The id of the map div
33
+ * @param {number} mapIndex Number of the map
34
  * @returns {void}
35
  */
36
+ function initializeGmap( mapId, mapIndex ) {
37
+ var mapOptions, settings, infoWindow, latLng, bounds, mapData, locationCount,
38
+ maxZoom = Number( wpslSettings.autoZoomLevel );
39
 
40
+ /* Get the settings that belong to the map */
41
+ settings = getMapSettings( mapIndex );
42
+
43
+ /* Create a new infoWindow, either with the infobox libray or use the default one */
44
+ infoWindow = newInfoWindow();
 
 
 
 
45
 
46
  geocoder = new google.maps.Geocoder();
 
47
  directionsDisplay = new google.maps.DirectionsRenderer();
48
  directionsService = new google.maps.DirectionsService();
49
 
50
+ /* Set the map options */
51
+ mapOptions = {
52
+ zoom: Number( settings.zoomLevel ),
53
+ center: settings.startLatLng,
54
+ mapTypeId: google.maps.MapTypeId[ settings.mapType.toUpperCase() ],
55
+ mapTypeControl: Number( settings.mapTypeControl ) ? true : false,
56
+ panControl: Number( settings.panControls ) ? true : false,
57
+ scrollwheel: Number( settings.scrollWheel ) ? true : false,
58
+ streetViewControl: Number( settings.streetView ) ? true : false,
59
+ zoomControlOptions: {
60
+ style: google.maps.ZoomControlStyle[ settings.controlStyle.toUpperCase() ],
61
+ position: google.maps.ControlPosition[ settings.controlPosition.toUpperCase() + '_TOP' ]
62
+ }
63
+ };
64
 
65
+ map = new google.maps.Map( document.getElementById( mapId ), mapOptions );
 
 
 
 
 
66
 
67
+ /* Check if we need to apply a map style */
68
+ maybeApplyMapStyle( settings.mapStyle );
69
+
70
+ if ( ( typeof window[ "wpslMap_" + mapIndex ] !== "undefined" ) && ( typeof window[ "wpslMap_" + mapIndex ].locations !== "undefined" ) ) {
71
+ bounds = new google.maps.LatLngBounds(),
72
+ mapData = window[ "wpslMap_" + mapIndex ].locations,
73
+ locationCount = mapData.length;
74
+
75
+ /* Loop over the map data, create the infowindow object and add each marker */
76
+ $.each( mapData, function( index ) {
77
+ latLng = new google.maps.LatLng( mapData[index].lat, mapData[index].lng );
78
+ addMarker( latLng, mapData[index].id, mapData[index], false, infoWindow );
79
+ bounds.extend( latLng );
80
+ });
81
+
82
+ /* Make all the markers fit on the map */
83
+ map.fitBounds( bounds );
84
+
85
+ /* Make sure we don't zoom to far */
86
+ google.maps.event.addListenerOnce( map, "bounds_changed", ( function( currentMap ) {
87
+ return function() {
88
+ if ( currentMap.getZoom() > maxZoom ) {
89
+ currentMap.setZoom( maxZoom );
90
+ }
91
+ };
92
+ }( map ) ) );
93
+ }
94
+
95
+ /* Only run this part if the store locator exist and we don't just have a basic map */
96
+ if ( $( "#wpsl-gmap" ).length ) {
97
+
98
+ /* Not the most optimal solution, but we check the useragent if we should enable the styled dropdowns.
99
+ *
100
+ * We do this because several people have reported issues with the styled dropdowns on
101
+ * iOS and Android devices. So on mobile devices the dropdowns will be styled according
102
+ * to the browser styles on that device.
103
+ */
104
+ if ( !checkMobileUserAgent() && $( ".wpsl-dropdown" ).length ) {
105
+ createDropdowns();
106
+ } else {
107
+ $( "#wpsl-search-wrap select").show();
108
+ $( "#wpsl-wrap" ).addClass( "wpsl-mobile" );
109
+ }
110
+
111
+ /* Check if we need to autolocate the user, or autoload the store locations */
112
+ if ( wpslSettings.autoLocate == 1 ) {
113
+ checkGeolocation( settings.startLatLng, infoWindow );
114
+ } else if ( wpslSettings.autoLoad == 1 ) {
115
+ showStores( settings.startLatLng, infoWindow );
116
+ }
117
+
118
+ /* Move the mousecursor to the store search field if the focus option is enabled */
119
+ if ( wpslSettings.mouseFocus == 1 && !checkMobileUserAgent() ) {
120
+ $( "#wpsl-search-input" ).focus();
121
+ }
122
+
123
+ /* Bind store search button */
124
+ searchLocationBtn( infoWindow );
125
+
126
+ /* Add the 'reload' and 'find location' icon to the map */
127
+ mapControlIcons( settings, map, infoWindow );
128
+ }
129
+
130
+ /* Bind the zoom_changed listener */
131
+ zoomChangedListener();
132
+ }
133
+
134
+ /**
135
+ * Make sure that the 'Zoom here' link in the info window
136
+ * doesn't zoom past the max auto zoom level.
137
+ *
138
+ * The 'max auto zoom level' is set on the settings page.
139
+ *
140
+ * @since 2.0
141
+ * @returns {void}
142
+ */
143
+ function zoomChangedListener() {
144
+
145
+ if ( typeof wpslSettings.markerZoomTo !== "undefined" && wpslSettings.markerZoomTo == 1 ) {
146
+ google.maps.event.addListener( map, "zoom_changed", function() {
147
+ checkMaxZoomLevel();
148
+ });
149
+ }
150
+ }
151
 
152
+ /**
153
+ * Get the correct map settings
154
+ *
155
+ * @since 2.0
156
+ * @param {number} mapIndex Number of the map
157
+ * @returns {object} mapSettings The map settings either set through a shortcode or the default settings
158
+ */
159
+ function getMapSettings( mapIndex ) {
160
+ var j, len, shortCodeVal,
161
+ settingOptions = [ "zoomLevel", "mapType", "mapTypeControl", "mapStyle", "streetView", "panControls", "scrollWheel", "controlPosition", "controlStyle" ],
162
+ mapSettings = {
163
+ zoomLevel: wpslSettings.zoomLevel,
164
+ mapType: wpslSettings.mapType,
165
+ mapTypeControl: wpslSettings.mapTypeControl,
166
+ mapStyle: wpslSettings.mapStyle,
167
+ streetView: wpslSettings.streetView,
168
+ panControls: wpslSettings.panControls,
169
+ scrollWheel: wpslSettings.scrollWheel,
170
+ controlPosition: wpslSettings.controlPosition,
171
+ controlStyle: wpslSettings.controlStyle
172
+ };
173
+
174
+ /* If there are settings that are set through the shortcode, then we use them instead of the default ones */
175
+ if ( ( typeof window[ "wpslMap_" + mapIndex ] !== "undefined" ) && ( typeof window[ "wpslMap_" + mapIndex ].shortCode !== "undefined" ) ) {
176
+ for ( j = 0, len = settingOptions.length; j < len; j++ ) {
177
+ shortCodeVal = window[ "wpslMap_" + mapIndex ].shortCode[ settingOptions[j] ];
178
+
179
+ /* If the value is set through the shortcode, we overwrite the default value */
180
+ if ( typeof shortCodeVal !== "undefined" ) {
181
+ mapSettings[ settingOptions[j] ] = shortCodeVal;
182
  }
183
+ }
184
+ }
185
 
186
+ mapSettings.startLatLng = getStartLatlng( mapIndex );
187
 
188
+ return mapSettings;
189
+ }
190
+
191
+ /**
192
+ * Get the latlng coordinates that are used to init the map
193
+ *
194
+ * @since 2.0
195
+ * @param {number} mapIndex Number of the map
196
+ * @returns {object} startLatLng The latlng value where the map will initially focus on
197
+ */
198
+ function getStartLatlng( mapIndex ) {
199
+ var startLatLng, latLng,
200
+ firstLocation = "";
201
+
202
+ /* Maps that are added with the [wpsl_map] shortcode will have the locations key set.
203
+ * If it exists we use the coordinates from the first location to center the map on.
204
  */
205
+ if ( ( typeof window[ "wpslMap_" + mapIndex ] !== "undefined" ) && ( typeof window[ "wpslMap_" + mapIndex ].locations !== "undefined" ) ) {
206
+ firstLocation = window[ "wpslMap_" + mapIndex ].locations[0];
 
 
 
207
  }
208
+
209
+ /* Either use the coordinates from the first location as the start coordinates
210
+ * or the default start point defined on the settings page.
211
+ *
212
+ * If both are not available we set it to 0,0
213
+ */
214
+ if ( ( typeof firstLocation !== "undefined" && typeof firstLocation.lat !== "undefined" ) && ( typeof firstLocation.lng !== "undefined" ) ) {
215
+ startLatLng = new google.maps.LatLng( firstLocation.lat, firstLocation.lng );
216
+ } else if ( wpslSettings.zoomLatlng !== "" ) {
217
+ latLng = wpslSettings.zoomLatlng.split( "," );
218
+ startLatLng = new google.maps.LatLng( latLng[0], latLng[1] );
219
  } else {
220
+ startLatLng = new google.maps.LatLng( 0,0 );
221
+ }
222
+
223
+ return startLatLng;
224
+ }
225
+
226
+ /**
227
+ * Create a new infoWindow object
228
+ *
229
+ * Either use the default infoWindow or use the infobox library
230
+ *
231
+ * @since 2.0
232
+ * @return {object} infoWindow The infoWindow object
233
+ */
234
+ function newInfoWindow() {
235
+ var boxClearance, boxPixelOffset,
236
+ infoBoxOptions = {};
237
+
238
+ /* Do we need to use the infobox script or use the default info windows? */
239
+ if ( ( typeof wpslSettings.infoWindowStyle !== "undefined" ) && ( wpslSettings.infoWindowStyle == "infobox" ) ) {
240
+
241
+ /* See http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html */
242
+ boxClearance = wpslSettings.infoBoxClearance.split( "," );
243
+ boxPixelOffset = wpslSettings.infoBoxPixelOffset.split( "," );
244
+ infoBoxOptions = {
245
+ alignBottom: true,
246
+ boxClass: wpslSettings.infoBoxClass,
247
+ closeBoxMargin: wpslSettings.infoBoxCloseMargin,
248
+ closeBoxURL: wpslSettings.infoBoxCloseUrl,
249
+ content: "",
250
+ disableAutoPan: ( Number( wpslSettings.infoBoxDisableAutoPan ) ) ? true : false,
251
+ enableEventPropagation: ( Number( wpslSettings.infoBoxEnableEventPropagation ) ) ? true : false,
252
+ infoBoxClearance: new google.maps.Size( Number( boxClearance[0] ), Number( boxClearance[1] ) ),
253
+ pixelOffset: new google.maps.Size( Number( boxPixelOffset[0] ), Number( boxPixelOffset[1] ) ),
254
+ zIndex: Number( wpslSettings.infoBoxZindex )
255
+ };
256
+
257
+ infoWindow = new InfoBox( infoBoxOptions );
258
+ } else {
259
+ infoWindow = new google.maps.InfoWindow();
260
  }
261
+
262
+ return infoWindow;
263
+ }
264
+
265
+ /**
266
+ * Check if we have a map style that we need to apply to the map
267
+ *
268
+ * @since 2.0
269
+ * @param {string} mapStyle The id of the map
270
+ * @return {void}
271
+ */
272
+ function maybeApplyMapStyle( mapStyle ) {
273
+
274
+ /* Make sure the JSON is valid before applying it as a map style */
275
+ mapStyle = tryParseJSON( mapStyle );
276
+
277
+ if ( mapStyle ) {
278
+ map.setOptions({ styles: mapStyle });
279
  }
280
  }
281
 
282
+ /**
283
+ * Make sure the JSON is valid.
284
+ *
285
+ * @since 2.0
286
+ * @see http://stackoverflow.com/a/20392392/1065294
287
+ * @param {string} jsonString The JSON data
288
+ * @return {object|boolean} The JSON string or false if it's invalid json.
289
+ */
290
+ function tryParseJSON( jsonString ) {
291
+
292
+ try {
293
+ var o = JSON.parse( jsonString );
294
+
295
+ // Handle non-exception-throwing cases:
296
+ // Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking,
297
+ // but... JSON.parse(null) returns 'null', and typeof null === "object",
298
+ // so we must check for that, too.
299
+ if ( o && typeof o === "object" && o !== null ) {
300
+ return o;
301
+ }
302
+ }
303
+ catch ( e ) { }
304
+
305
+ return false;
306
+ }
307
+
308
  /**
309
  * Add the start marker and call the function that inits the store search
310
  *
311
  * @since 1.1
312
+ * @param {object} startLatLng The start coordinates
313
+ * @param {object} infoWindow The infoWindow object
314
  * @returns {void}
315
  */
316
+ function showStores( startLatLng, infoWindow ) {
317
  var startMarker = {
318
  store: wpslLabels.startPoint
319
  };
320
 
321
+ addMarker( startLatLng, 0, startMarker, true, infoWindow ); // This marker is the 'start location' marker. With a storeId of 0, no name and is draggable
322
+ findStoreLocations( startLatLng, resetMap, autoLoad, infoWindow );
323
  }
324
 
325
  /**
332
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent );
333
  }
334
 
335
+ /**
336
+ * Check if Geolocation detection is supported.
337
  *
338
  * If there is an error / timeout with determining the users
339
  * location we use the 'start point' value from the settings as the start location through the showStores function.
340
  *
341
  * @since 1.0
342
+ * @param {object} startLatLng The start coordinates
343
+ * @param {object} infoWindow The infoWindow object
344
  * @returns {void}
345
  */
346
+ function checkGeolocation( startLatLng, infoWindow ) {
347
+
348
  if ( navigator.geolocation ) {
349
+ var geolocationInProgress, locationTimeout,
350
+ keepStartMarker = false,
351
+ timeout = Number( wpslSettings.geoLocationTimout );
352
+
353
+ /* Make the direction icon flash every 600ms to indicate the geolocation attempt is in progress. */
354
+ geolocationInProgress = setInterval( function() {
355
+ $( ".wpsl-icon-direction" ).toggleClass( "wpsl-active-icon" );
356
+ }, 600 );
357
+
358
+ /* If the user doesn't approve the geolocation request within the value set in
359
+ * wpslSettings.geoLocationTimout, then the default map is loaded.
360
+ *
361
+ * You can increase the timeout value with the wpsl_geolocation_timeout filter.
362
+ */
363
+ locationTimeout = setTimeout( function() {
364
+ geolocationFinished( geolocationInProgress );
365
+ showStores( startLatLng, infoWindow );
366
+ }, timeout );
367
 
368
  navigator.geolocation.getCurrentPosition( function( position ) {
369
+ geolocationFinished( geolocationInProgress );
370
  clearTimeout( locationTimeout );
371
+
372
+ /* If the timeout is triggerd and the user later decides to enable
373
+ * the geolocation detection again, it gets messy with multiple start markers.
374
+ *
375
+ * So we first clear the map before adding new ones.
376
  */
377
  deleteOverlays( keepStartMarker );
378
+ handleGeolocationQuery( startLatLng, position, resetMap, infoWindow );
379
  }, function( error ) {
380
+
381
+ /* Only show the geocode errors if the user actually clicked on the direction icon.
382
+ *
383
+ * Otherwise if the "Attempt to auto-locate the user" option is enabled on the settings page
384
+ * and the geolocation attempt fails for whatever reason ( blocked in browser, unavailable etc ).
385
+ * Then the first thing the visitor will see on pageload is an alert box, which isn't very userfriendly.
386
+ *
387
+ * If an error occurs on pageload without the user clicking on the direction icon
388
+ * the default map is shown without any alert boxes.
389
+ */
390
+ if ( $( ".wpsl-icon-direction" ).hasClass( "wpsl-user-activated") ) {
391
+ switch ( error.code ) {
392
+ case error.PERMISSION_DENIED:
393
+ alert( wpslGeolocationErrors.denied );
394
+ break;
395
+ case error.POSITION_UNAVAILABLE:
396
+ alert( wpslGeolocationErrors.unavailable );
397
+ break;
398
+ case error.TIMEOUT:
399
+ alert( wpslGeolocationErrors.timeout );
400
+ break;
401
+ default:
402
+ alert( wpslGeolocationErrors.generalError );
403
+ break;
404
+ }
405
+
406
+ $( ".wpsl-icon-direction" ).removeClass( "wpsl-active-icon" );
407
+ } else {
408
+ clearTimeout( locationTimeout );
409
+ showStores( startLatLng, infoWindow );
410
+ }
411
+ },
412
+ { maximumAge: 60000, timeout: timeout, enableHighAccuracy: true } );
413
  } else {
414
+ alert( wpslGeolocationErrors.unavailable );
415
+ showStores( startLatLng, infoWindow );
416
  }
417
+ }
418
+
419
+ function geolocationFinished( geolocationInProgress ) {
420
+ clearInterval( geolocationInProgress );
421
+ $( ".wpsl-icon-direction" ).removeClass( "wpsl-active-icon" );
422
+ }
423
 
424
+ /**
425
+ * Handle the data returned from the Geolocation API
426
  *
427
  * If there is an error / timeout determining the users location,
428
  * then we use the 'start point' value from the settings as the start location through the showStores function.
429
  *
430
  * @since 1.0
431
+ * @param {object} startLatLng The start coordinates
432
+ * @param {object} position The latlng coordinates from the geolocation attempt
433
+ * @param {boolean} resetMap Whether we should reset the map or not
434
+ * @param {object} infoWindow The infoWindow object
435
  * @returns {void}
436
  */
437
+ function handleGeolocationQuery( startLatLng, position, resetMap, infoWindow ) {
438
 
439
  if ( typeof( position ) === "undefined" ) {
440
+ showStores( startLatLng, infoWindow );
441
+ } else {
442
  var latLng = new google.maps.LatLng( position.coords.latitude, position.coords.longitude );
443
 
444
  /* Store the latlng from the geolocation for when the user hits "reset" again
445
+ * without having to ask for permission again.
446
  */
447
  geolocationLatlng = position;
448
 
449
  reverseGeocode( latLng ); // Set the zipcode that belongs to the latlng in the input field
450
  map.setCenter( latLng );
451
  addMarker( latLng, 0, '', true ); // This marker is the 'start location' marker. With a storeId of 0, no name and is draggable
452
+ findStoreLocations( latLng, resetMap, autoLoad, infoWindow );
453
  }
454
+ }
455
 
456
+ /**
457
+ * Handle clicks on the store locator search button
458
+ *
459
+ * @since 1.0
460
+ * @param {object} infoWindow The infoWindow object
461
+ * @returns {void}
462
+ */
463
+ function searchLocationBtn( infoWindow ) {
464
+ $( "#wpsl-search-btn" ).on( "click", function() {
465
+ var keepStartMarker = false;
 
 
 
 
 
 
 
 
466
 
467
+ $( "#wpsl-search-input" ).removeClass();
468
+
469
+ if ( !$( "#wpsl-search-input" ).val() ) {
470
+ $( "#wpsl-search-input" ).addClass( "wpsl-error" ).focus();
471
+ } else {
472
+ $( "#wpsl-result-list ul" ).empty();
473
+ $( "#wpsl-stores" ).show();
474
+ $( ".wpsl-direction-before, .wpsl-direction-after" ).remove();
475
+ $( "#wpsl-direction-details" ).hide();
476
+
477
+ resetMap = false;
478
+
479
+ /* Force the open InfoBox info window to close. */
480
+ closeInfoBoxWindow();
481
+
482
+ deleteOverlays( keepStartMarker );
483
+ deleteStartMarker();
484
+ codeAddress( infoWindow );
485
+ }
486
+ });
487
+ }
488
+
489
+ /**
490
+ * Force the open InfoBox info window to close
491
+ *
492
+ * This is required if the user makes a new search,
493
+ * or clicks on the "Directions" link.
494
+ *
495
+ * @since 2.0
496
+ * @return {void}
497
+ */
498
+ function closeInfoBoxWindow() {
499
+ if ( ( typeof wpslSettings.infoWindowStyle !== "undefined" ) && ( wpslSettings.infoWindowStyle == "infobox" ) && typeof openInfoWindow[0] !== "undefined" ) {
500
+ openInfoWindow[0].close();
501
  }
502
+ }
503
+
504
+ /**
505
+ * Add the 'reload' and 'find location' icon to the map
506
+ *
507
+ * @since 2.0
508
+ * @param {object} settings Map settings
509
+ * @param {object} map The map object
510
+ * @param {object} infoWindow The info window object
511
+ * @return {void}
512
+ */
513
+ function mapControlIcons( settings, map, infoWindow ) {
514
+
515
+ /* Once the map has finished loading include the map control button(s). */
516
+ google.maps.event.addListenerOnce( map, "tilesloaded", function() {
517
+
518
+ /* Add the html for the map controls to the map */
519
+ $( ".gm-style" ).append( wpslSettings.mapControls );
520
+
521
+ if ( $( ".wpsl-icon-reset, #wpsl-reset-map" ).length > 0 ) {
522
+
523
+ /* Bind the reset map button */
524
+ resetMapBtn( settings.startLatLng, infoWindow );
525
+
526
+ /* Hide it to prevent users from clicking it before
527
+ * the store location are placed on the map.
528
+ */
529
+ $( ".wpsl-icon-reset" ).hide();
530
  }
 
 
 
531
 
532
+ /* Bind the direction button to trigger a new geolocation request */
533
+ $( ".wpsl-icon-direction" ).on( "click", function() {
534
+ $( this ).addClass( "wpsl-user-activated" );
535
+ checkGeolocation( settings.startLatLng, infoWindow );
536
+ });
537
+ });
538
+ }
539
 
540
+ /**
541
+ * Handle clicks on the "Reset" button
542
+ *
543
+ * @since 1.0
544
+ * @param {object} startLatLng The start coordinates
545
+ * @param {object} infoWindow The infoWindow object
546
+ * @returns {void}
547
+ */
548
+ function resetMapBtn( startLatLng, infoWindow ) {
549
+ $( ".wpsl-icon-reset, #wpsl-reset-map" ).on( "click", function() {
550
+ var keepStartMarker = false,
551
+ resetMap = true;
552
+
553
+ /* Check if a map reset is already in progress,
554
+ * if so prevent another one from starting.
555
+ */
556
+ if ( $( this ).hasClass( "wpsl-in-progress" ) ) {
557
+ return;
558
+ }
559
+
560
+ /* When the start marker is dragged the autoload value is set to false.
561
+ * So we need to check the correct value when the reset button is pushed before reloading the stores.
562
+ */
563
+ if ( wpslSettings.autoLoad == 1 ) {
564
+ autoLoad = 1;
565
+ }
566
+
567
+ /* Check if the latlng or zoom has changed since pageload, if so there is something to reset */
568
+ if ( ( ( ( map.getCenter().lat() !== mapDefaults.centerLatlng.lat() ) || ( map.getCenter().lng() !== mapDefaults.centerLatlng.lng() ) || ( map.getZoom() !== mapDefaults.zoomLevel ) ) ) ) {
569
+ deleteOverlays( keepStartMarker );
570
+
571
+ $( "#wpsl-search-input" ).val( "" ).removeClass();
572
+
573
+ /* We use this to prevent multiple reset request */
574
+ $( ".wpsl-icon-reset" ).addClass( "wpsl-in-progress" );
575
+
576
+ /* If marker clusters exist, remove them from the map */
577
+ if ( markerClusterer ) {
578
+ markerClusterer.clearMarkers();
579
+ }
580
+
581
+ /* Remove the start marker */
582
+ deleteStartMarker();
583
+
584
+ /* Reset the dropdown values */
585
+ resetDropdowns();
586
+
587
+ if ( wpslSettings.autoLocate == 1 ) {
588
+ handleGeolocationQuery( startLatLng, geolocationLatlng, resetMap, infoWindow );
589
+ } else {
590
+ showStores( startLatLng, infoWindow );
591
+ }
592
+ }
593
+
594
+ /* Make sure the stores are shown and the direction details are hidden */
595
+ $( "#wpsl-stores" ).show();
596
+ $( "#wpsl-direction-details" ).hide();
597
+ });
598
+ }
599
 
600
+ /**
601
+ * Remove the start marker from the map
602
  *
603
  * @since 1.2.12
604
  * @returns {void}
610
  }
611
  }
612
 
613
+ /**
614
+ * Reset the dropdown values for the max results,
615
+ * and search radius after the "reset" button is triggerd.
616
  *
617
  * @since 1.1
618
  * @returns {void}
619
  */
620
  function resetDropdowns() {
621
+ var i, arrayLength, dataValue, catText,
622
  defaultValues = [wpslSettings.searchRadius + ' ' + wpslSettings.distanceUnit, wpslSettings.maxResults],
623
  dropdowns = ["wpsl-radius", "wpsl-results"];
624
 
625
  for ( i = 0, arrayLength = dropdowns.length; i < arrayLength; i++ ) {
626
+ $( "#" + dropdowns[i] + " select" ).val( parseInt( defaultValues[i] ) );
627
  $( "#" + dropdowns[i] + " li" ).removeClass();
628
+
629
+ if ( dropdowns[i] == "wpsl-radius" ) {
630
+ dataValue = wpslSettings.searchRadius;
631
+ } else if ( dropdowns[i] == "wpsl-results" ) {
632
+ dataValue = wpslSettings.maxResults;
633
+ }
634
 
635
+ $( "#" + dropdowns[i] + " li" ).each( function() {
636
  if ( $( this ).text() === defaultValues[i] ) {
637
+ $( this ).addClass( "wpsl-selected-dropdown" );
638
+
639
+ $( "#" + dropdowns[i] + " .wpsl-selected-item" ).html( defaultValues[i] ).attr( "data-value", dataValue );
640
  }
641
  });
642
+ }
643
+
644
+ /**
645
+ * Reset the category dropdown
646
+ * @todo look for other way to do this in combination with above code. Maybe allow users to define a default cat on the settings page?
647
+ */
648
+ if ( $( "#wpsl-category" ).length ) {
649
+ $( "#wpsl-category select" ).val( 0 );
650
+ $( "#wpsl-category li" ).removeClass();
651
+ $( "#wpsl-category li:first-child" ).addClass( "wpsl-selected-dropdown" );
652
+
653
+ catText = $( "#wpsl-category li:first-child").text();
654
+
655
+ $( "#wpsl-category .wpsl-selected-item" ).html( catText ).attr( "data-value", 0 );
656
+ }
657
  }
658
+
659
  /* Handle the click on the back button when the route directions are displayed */
660
  $( "#wpsl-result-list" ).on( "click", ".wpsl-back", function() {
661
  var i, len;
667
  for ( i = 0, len = markersArray.length; i < len; i++ ) {
668
  markersArray[i].setMap( map );
669
  }
670
+
671
  /* Restore the start marker on the map */
672
  if ( ( typeof( startMarkerData ) !== "undefined" ) && ( startMarkerData !== "" ) ) {
673
  startMarkerData.setMap( map );
674
  }
675
 
676
+ /* If marker clusters are enabled, restore them */
677
  if ( markerClusterer ) {
678
  checkMarkerClusters();
679
  }
680
+
681
  map.setCenter( directionMarkerPosition.centerLatlng );
682
  map.setZoom( directionMarkerPosition.zoomLevel );
683
 
688
  return false;
689
  });
690
 
691
+ /**
692
+ * Show the driving directions
693
  *
694
  * @since 1.1
695
  * @param {object} e The clicked elemennt
697
  */
698
  function renderDirections( e ) {
699
  var i, start, end, len, storeId;
700
+
701
+ /* Force the open InfoBox info window to close. */
702
+ closeInfoBoxWindow();
703
 
704
  /*
705
  The storeId is placed on the li in the results list,
706
  but in the marker it will be on the wrapper div. So we check which one we need to target.
707
  */
708
+ if ( e.parents( "li" ).length > 0 ) {
709
+ storeId = e.parents( "li" ).data( "store-id" );
710
  } else {
711
  storeId = e.parents( ".wpsl-info-window" ).data( "store-id" );
712
  }
727
 
728
  /* Only continue if the start data is still empty or undefined */
729
  if ( ( markersArray[i].storeId == 0 ) && ( ( typeof( start ) === "undefined" ) || ( start === "" ) ) ) {
730
+ start = markersArray[i].getPosition();
731
  } else if ( markersArray[i].storeId == storeId ) {
732
+ end = markersArray[i].getPosition();
733
  }
734
  }
735
 
742
  }
743
  }
744
 
745
+ /**
746
+ * Check what effect is triggerd once a user hovers over the store list.
747
+ * Either bounce the corresponding marker up and down, open the info window or ignore it.
748
+ */
749
+ if ( $( "#wpsl-gmap" ).length ) {
750
+ if ( wpslSettings.markerEffect == 'bounce' ) {
751
+ $( "#wpsl-stores" ).on( "mouseenter", "li", function() {
752
+ letsBounce( $( this ).data( "store-id" ), "start" );
753
+ });
754
+
755
+ $( "#wpsl-stores" ).on( "mouseleave", "li", function() {
756
+ letsBounce( $( this ).data( "store-id" ), "stop" );
757
+ });
758
+ } else if ( wpslSettings.markerEffect == 'info_window' ) {
759
+ $( "#wpsl-stores" ).on( "mouseenter", "li", function() {
760
+ var i, len;
761
+
762
+ for ( i = 0, len = markersArray.length; i < len; i++ ) {
763
+ if ( markersArray[i].storeId == $( this ).data( "store-id" ) ) {
764
+ google.maps.event.trigger( markersArray[i], "click" );
765
+ map.setCenter( markersArray[i].position );
766
+ }
767
+ }
768
+ });
769
+ }
770
  }
771
 
772
+ /**
773
+ * Let a single marker bounce
774
  *
775
  * @since 1.0
776
  * @param {number} storeId The storeId of the marker that we need to bounce on the map
777
+ * @param {string} status Indicates whether we should stop or start the bouncing
778
  * @returns {void}
779
  */
780
  function letsBounce( storeId, status ) {
781
+ var i, len, marker;
 
 
 
 
 
 
782
 
783
  /* Find the correct marker to bounce based on the storeId */
784
  for ( i = 0, len = markersArray.length; i < len; i++ ) {
785
  if ( markersArray[i].storeId == storeId ) {
786
  marker = markersArray[i];
787
+
788
+ if ( status == "start" ) {
789
+ marker.setAnimation( google.maps.Animation.BOUNCE );
790
+ } else {
791
+ marker.setAnimation( null );
792
+ }
793
  }
794
  }
795
  }
796
 
797
+ /**
798
+ * Calculate the route from the start to the end
799
  *
800
  * @since 1.0
801
  * @param {object} start The latlng from the start point
802
+ * @param {object} end The latlng from the end point
803
  * @returns {void}
804
  */
805
  function calcRoute( start, end ) {
808
  request = {};
809
 
810
  if ( wpslSettings.distanceUnit == "km" ) {
811
+ distanceUnit = 'METRIC';
812
  } else {
813
+ distanceUnit = 'IMPERIAL';
814
  }
815
 
816
  request = {
817
  origin: start,
818
  destination: end,
819
  travelMode: google.maps.DirectionsTravelMode.DRIVING,
820
+ unitSystem: google.maps.UnitSystem[ distanceUnit ]
821
  };
822
 
823
  directionsService.route( request, function( response, status ) {
839
  }
840
  }
841
 
842
+ $( "#wpsl-direction-details ul" ).append( directionStops ).before( "<div class='wpsl-direction-before'><a class='wpsl-back' id='wpsl-direction-start' href='#'>" + wpslLabels.back + "</a><div><span class='wpsl-total-distance'>" + direction.legs[0].distance.text + "</span> - <span class='wpsl-total-durations'>" + direction.legs[0].duration.text + "</span></div></div>" ).after( "<p class='wpsl-direction-after'>" + response.routes[0].copyrights + "</p>" );
843
  $( "#wpsl-direction-details" ).show();
844
 
845
  /* Remove all single markers from the map */
853
  }
854
 
855
  /* Remove the start marker from the map */
856
+ if ( ( typeof( startMarkerData ) !== "undefined" ) && ( startMarkerData !== "" ) ) {
857
  startMarkerData.setMap( null );
858
  }
859
 
871
  });
872
  }
873
 
874
+ /**
875
+ * Geocode the user input
876
  *
877
  * @since 1.0
878
+ * @param {object} infoWindow The infoWindow object
879
  * @returns {void}
880
  */
881
+ function codeAddress( infoWindow ) {
882
  var latLng,
883
  autoLoad = false,
884
  keepStartMarker = false,
890
 
891
  /* Remove any previous markers and add a new one */
892
  deleteOverlays( keepStartMarker );
893
+ addMarker( latLng, 0, '', true, infoWindow ); // This marker is the 'start location' marker. With a storeId of 0, no name and is draggable
894
 
895
  /* Try to find stores that match the radius, location criteria */
896
+ findStoreLocations( latLng, resetMap, autoLoad, infoWindow );
897
  } else {
898
  geocodeErrors( status );
899
  }
900
  });
901
  }
902
 
903
+ /**
904
+ * Geocode the user input and set the returned zipcode in the input field
905
  *
906
  * @since 1.0
907
+ * @param {object} latLng The coordinates of the location that should be reverse geocoded
908
  * @returns {void}
909
  */
910
  function reverseGeocode( latLng ) {
923
  });
924
  }
925
 
926
+ /**
927
+ * Filter out the zipcode from the response
928
  *
929
  * @since 1.0
930
  * @param {object} response The complete Google API response
947
  return zipcode;
948
  }
949
 
950
+ /**
951
+ * Call the function to make the ajax request to load the store locations.
952
+ *
953
+ * If we need to show the driving directions on maps.google.com itself,
954
+ * we first need to geocode the start latlng into a formatted address.
955
  *
956
  * @since 1.0
957
+ * @param {object} startLatLng The latlng used as the starting point
958
+ * @param {boolean} resetMap Whether we should reset the map or not
959
+ * @param {string} autoLoad Check if we need to autoload all the stores
960
+ * @param {object} infoWindow The infoWindow object
961
  * @returns {void}
962
  */
963
+ function findStoreLocations( startLatLng, resetMap, autoLoad, infoWindow ) {
964
+
965
  /* Check if we need to open a new window and show the route on the Google Maps site itself. */
966
  if ( wpslSettings.directionRedirect == 1 ) {
967
  findFormattedAddress( startLatLng, function() {
968
+ makeAjaxRequest( startLatLng, resetMap, autoLoad, infoWindow );
969
  });
970
  } else {
971
+ makeAjaxRequest( startLatLng, resetMap, autoLoad, infoWindow );
972
  }
973
  }
974
 
975
+ /**
976
+ * Convert the latlng into a formatted address
977
  *
978
  * @since 1.0
979
+ * @param {object} latLng The latlng to geocode
980
+ * @param {callback} callback
981
  * @returns {void}
982
  */
983
  function findFormattedAddress( latLng, callback ) {
991
  });
992
  }
993
 
994
+ /**
995
+ * Make the Ajax request to load the store data
996
  *
997
  * @since 1.2
998
+ * @param {object} startLatLng The latlng used as the starting point
999
+ * @param {boolean} resetMap Whether we should reset the map or not
1000
+ * @param {string} autoLoad Check if we need to autoload all the stores
1001
+ * @param {object} infoWindow The infoWindow object
1002
  * @returns {void}
1003
  */
1004
+ function makeAjaxRequest( startLatLng, resetMap, autoLoad, infoWindow ) {
1005
+ var latLng, maxResult, radius,
1006
+ storeData = "",
1007
+ categoryId = "",
1008
+ draggable = false,
1009
+ isMobile = $( "#wpsl-wrap" ).hasClass( "wpsl-mobile" ),
1010
+ template = $( "#wpsl-listing-template" ).html(),
1011
  $storeList = $( "#wpsl-stores ul" ),
1012
+ preloader = wpslSettings.path + "img/ajax-loader.gif",
1013
+ ajaxData = {
1014
  action: "store_search",
1015
  lat: startLatLng.lat(),
1016
  lng: startLatLng.lng()
 
 
 
 
1017
  };
1018
+
1019
+ /* If we reset the map we use the default dropdown values instead of the selected values.
1020
+ * Otherwise we first make sure the filter val is valid before including the radius / max_results param
1021
+ */
1022
  if ( resetMap ) {
1023
  ajaxData.max_results = wpslSettings.maxResults;
1024
  ajaxData.radius = wpslSettings.searchRadius;
1025
  } else {
1026
+ if ( isMobile ) {
1027
+ maxResult = parseInt( $( "#wpsl-results .wpsl-dropdown" ).val() );
1028
+ radius = parseInt( $( "#wpsl-radius .wpsl-dropdown" ).val() );
1029
  } else {
1030
+ maxResult = parseInt( $( "#wpsl-results .wpsl-selected-item" ).attr( "data-value" ) );
1031
+ radius = parseInt( $( "#wpsl-radius .wpsl-selected-item" ).attr( "data-value" ) );
1032
  }
1033
+
1034
+ /* If the max resuls or radius filter values are NaN, then we use the default value */
1035
+ if ( isNaN( maxResult ) ) {
1036
+ ajaxData.max_results = wpslSettings.maxResults;
1037
+ } else {
1038
+ ajaxData.max_results = maxResult;
1039
+ }
1040
+
1041
+ if ( isNaN( radius ) ) {
1042
+ ajaxData.radius = wpslSettings.searchRadius;
1043
+ } else {
1044
+ ajaxData.radius = radius;
1045
+ }
1046
+
1047
+ /* If the category dropdown exist get the id */
1048
+ if ( $( "#wpsl-category" ).length > 0 ) {
1049
+ if ( isMobile ) {
1050
+ categoryId = parseInt( $( "#wpsl-category .wpsl-dropdown" ).val() );
1051
+ } else {
1052
+ categoryId = parseInt( $( "#wpsl-category .wpsl-selected-item" ).attr( "data-value" ) );
1053
+ }
1054
+
1055
+ if ( ( !isNaN( categoryId ) && ( categoryId !== 0 ) ) ) {
1056
+ ajaxData.filter = categoryId;
1057
+ }
1058
+ }
1059
+
1060
+ /* @TODO: Look into adding support for extra user defined dropdowns?
1061
+ *
1062
+ * Create a check that will automatically include data from
1063
+ * any additional dropdowns in the Ajax request.
1064
+ */
1065
  }
1066
 
1067
  /* Check if autoload all stores is enabled */
1068
  if ( autoLoad == 1 ) {
1069
+ ajaxData.autoload = 1;
1070
+
1071
+ /**
1072
+ * Check if the included latlng is based on a geolocation attempt.
1073
+ *
1074
+ * If this is the case, then we should not use the transient cache
1075
+ * to return nearby store locations.
1076
+ *
1077
+ * Otherwise the user will see results based on the start location
1078
+ * from the settings page, instead of the users actual location.
1079
+ */
1080
+ if ( typeof geolocationLatlng !== "undefined" ) {
1081
+ ajaxData.skip_cache = 1;
1082
+ }
1083
  }
1084
 
1085
  /* Add the preloader */
1086
+ $storeList.empty().append( "<li class='wpsl-preloader'><img src='" + preloader + "'/>" + wpslLabels.preloader + "</li>" );
1087
 
1088
+ $.get( wpslSettings.ajaxurl, ajaxData, function( response ) {
1089
 
1090
  /* Remove the preloaders and no results msg */
1091
  $( ".wpsl-preloader, .no-results" ).remove();
1093
  if ( response.success !== false ) {
1094
  if ( response.length > 0 ) {
1095
 
1096
+ /* Loop over the returned locations */
1097
  $.each( response, function( index ) {
1098
+ _.extend( response[index], templateHelpers );
1099
+
1100
+ /* Add the location maker to the map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1101
  latLng = new google.maps.LatLng( response[index].lat, response[index].lng );
1102
+ addMarker( latLng, response[index].id, response[index], draggable, infoWindow );
1103
+
1104
+ /* Create the html output with help from underscore js */
1105
+ storeData = storeData + _.template( template, response[index] );
1106
  });
1107
+
1108
  $( "#wpsl-result-list" ).off( "click", ".wpsl-directions" );
 
1109
 
1110
+ /* Add the html for the store listing to the <ul> */
1111
+ $storeList.append( storeData );
1112
+
1113
+ $( "#wpsl-result-list" ).on( "click", ".wpsl-directions", function() {
1114
+
1115
+ /* Check if we need to render the direction on the map. */
1116
  if ( wpslSettings.directionRedirect != 1 ) {
1117
  renderDirections( $( this ) );
1118
+
1119
  return false;
1120
  }
1121
  });
1125
 
1126
  /* Make sure everything fits on the screen */
1127
  fitBounds();
1128
+
1129
+ $( "#wpsl-result-list p:empty" ).remove();
1130
  } else {
1131
  $storeList.html( "<li class='no-results'>" + wpslLabels.noResults + "</li>" );
1132
  }
 
1133
  } else {
1134
  alert( wpslLabels.generalError );
1135
  }
1136
 
1137
+ /* Store the default zoom and latlng values the first time
1138
+ * all the stores are added to the map.
1139
+ *
1140
+ * This way when a user clicks the reset button we can check if the
1141
+ * zoom/latlng values have changed, and if they have, then we know we
1142
+ * need to reload the map.
1143
  */
1144
+ if ( wpslSettings.resetMap == 1 ) {
1145
  if ( $.isEmptyObject( mapDefaults ) ) {
1146
+ google.maps.event.addListenerOnce( map, "tilesloaded", function() {
1147
+ mapDefaults = {
1148
+ centerLatlng: map.getCenter(),
1149
+ zoomLevel: map.getZoom()
1150
+ };
1151
+
1152
+ /* Because the reset icon exists, we need to adjust
1153
+ * the styling of the direction icon.
1154
+ */
1155
+ $( ".wpsl-icon-direction" ).addClass( "wpsl-reset-exists" );
1156
+
1157
+ /* The reset initialy is set to hidden to prevent
1158
+ * users from clicking it before the map is loaded.
1159
+ */
1160
+ $( ".wpsl-icon-reset, #wpsl-reset-map" ).show();
1161
+ });
1162
  }
1163
+
1164
+ $( ".wpsl-icon-reset" ).removeClass( "wpsl-in-progress" );
1165
+ }
1166
  });
1167
 
1168
  /* Move the mousecursor to the store search field if the focus option is enabled */
1169
+ if ( wpslSettings.mouseFocus == 1 && !checkMobileUserAgent() ) {
1170
  $( "#wpsl-search-input" ).focus();
1171
  }
1172
  }
1203
  * Add a new marker to the map based on the provided location (latlng)
1204
  *
1205
  * @since 1.0
1206
+ * @param {object} latLng The coordinates
1207
+ * @param {number} storeId The store id
1208
+ * @param {object} infoWindowData The data we need to show in the info window
1209
+ * @param {boolean} draggable Should me marker be draggable
1210
+ * @param {object} infoWindow The infoWindow object
1211
  * @return {void}
1212
  */
1213
+ function addMarker( latLng, storeId, infoWindowData, draggable, infoWindow ) {
1214
  var markerPath, mapIcon, marker,
1215
  keepStartMarker = true;
1216
+
1217
  if ( storeId === 0 ) {
1218
  markerPath = wpslSettings.path + "img/markers/" + wpslSettings.startMarker;
1219
  } else {
1220
  markerPath = wpslSettings.path + "img/markers/" + wpslSettings.storeMarker;
1221
  }
1222
+
1223
  mapIcon = {
1224
  url: markerPath,
1225
  scaledSize: new google.maps.Size( 24,35 ), //retina format
1226
  origin: new google.maps.Point( 0,0 ),
1227
  anchor: new google.maps.Point( 12,35 )
1228
  };
1229
+
1230
  marker = new google.maps.Marker({
1231
  position: latLng,
1232
  map: map,
1237
  icon: mapIcon
1238
  });
1239
 
1240
+ /* Store the marker for later use */
1241
+ markersArray.push( marker );
1242
 
1243
+ google.maps.event.addListener( marker, "click",( function( currentMap ) {
1244
+ return function() {
 
 
1245
 
1246
+ /* The start marker will have a store id of 0, all others won't */
1247
+ if ( storeId != 0 ) {
1248
+
1249
+ /* Check if streetview is available at the clicked location */
1250
+ if ( typeof wpslSettings.markerStreetView !== "undefined" && wpslSettings.markerStreetView == 1 ) {
1251
+ checkStreetViewStatus( latLng, function() {
1252
+ setInfoWindowContent( marker, createInfoWindowHtml( infoWindowData ), infoWindow, currentMap );
1253
+ });
1254
+ } else {
1255
+ setInfoWindowContent( marker, createInfoWindowHtml( infoWindowData ), infoWindow, currentMap );
1256
+ }
1257
  } else {
1258
+ setInfoWindowContent( marker, wpslLabels.startPoint, infoWindow, currentMap );
1259
+ }
 
 
 
1260
 
1261
+ google.maps.event.addListener( infoWindow, "domready", function() {
1262
+ infoWindowClickActions( marker, latLng, currentMap );
1263
+ checkMaxZoomLevel();
1264
+ });
1265
+ };
1266
+ }( map ) ) );
1267
 
1268
+ /* Only the start marker will be draggable */
1269
  if ( draggable ) {
1270
  google.maps.event.addListener( marker, "dragend", function( event ) {
1271
  deleteOverlays( keepStartMarker );
1272
  map.setCenter( event.latLng );
1273
  reverseGeocode( event.latLng );
1274
+ findStoreLocations( event.latLng, resetMap, autoLoad = false, infoWindow );
1275
  });
1276
  }
1277
  }
1278
 
1279
+ /* Check if we are using both the infobox for the info windows and have marker clusters */
1280
+ if ( typeof wpslSettings.infoWindowStyle !== "undefined" && wpslSettings.infoWindowStyle == "infobox" && wpslSettings.markerClusters == 1 ) {
1281
+ var clusters, clusterLen, markerLen, i, j;
1282
+
1283
+ /* We need to listen to both zoom_changed and idle.
1284
+ *
1285
+ * If the zoom level changes the marker clusters either merges nearby
1286
+ * markers, or changes into individual markers. Which is the moment we
1287
+ * either show or hide the opened info window.
1288
+ *
1289
+ * "idle" is necessary to make sure the getClusters() is up
1290
+ * to date with the correct cluster data.
1291
+ */
1292
+ google.maps.event.addListener( map, "zoom_changed", function() {
1293
+ google.maps.event.addListenerOnce( map, "idle", function() {
1294
+
1295
+ if ( typeof markerClusterer !== "undefined" ) {
1296
+ clusters = markerClusterer.clusters_;
1297
+
1298
+ if ( clusters.length ) {
1299
+ for ( i = 0, clusterLen = clusters.length; i < clusterLen; i++ ) {
1300
+ for ( j = 0, markerLen = clusters[i].markers_.length; j < markerLen; j++ ) {
1301
+
1302
+ /* Match the storeId from the cluster marker with the marker id that was set when the info window was opened */
1303
+ if ( clusters[i].markers_[j].storeId == activeWindowMarkerId ) {
1304
+
1305
+ /* If there is a visible info window but the markers_[j].map is null ( hidden )
1306
+ * it means the info window belongs to a marker that is part of a marker cluster.
1307
+ *
1308
+ * If that is the case then we hide the info window ( the individual marker isn't visible ).
1309
+
1310
+ * The default info window script handles this automatically, but the
1311
+ * infobox library in combination with the marker clusters doesn't.
1312
+ */
1313
+ if ( infoWindow.getVisible() && clusters[i].markers_[j].map === null ) {
1314
+ infoWindow.setVisible( false );
1315
+ } else if ( !infoWindow.getVisible() && clusters[i].markers_[j].map !== null ) {
1316
+ infoWindow.setVisible( true );
1317
+ }
1318
+
1319
+ break;
1320
+ }
1321
+ }
1322
+ }
1323
+ }
1324
+ }
1325
+ });
1326
+ });
1327
+ }
1328
+
1329
  /**
1330
+ * Set the correct info window content for the marker
1331
  *
1332
  * @since 1.2.20
1333
+ * @param {object} marker Marker data
1334
+ * @param {string} infoWindowContent The infoWindow content
1335
+ * @param {object} infoWindow The infoWindow object
1336
+ * @param {object} currentMap The map object
1337
  * @returns {void}
1338
  */
1339
+ function setInfoWindowContent( marker, infoWindowContent, infoWindow, currentMap ) {
1340
+ openInfoWindow.length = 0;
1341
+
1342
+ infoWindow.setContent( infoWindowContent );
1343
+ infoWindow.open( currentMap, marker );
1344
+
1345
+ openInfoWindow.push( infoWindow );
1346
+
1347
+ /* Store the marker id if both the marker clusters and the infobox are enabled.
1348
+ *
1349
+ * With the normal info window script the info window is automatically closed once a user
1350
+ * zooms out and the marker clusters are enabled, but this doesn't happen with the infobox library.
1351
+ *
1352
+ * So we need to show/hide it manually when the user zooms out, and for this to work we need to know which marker to target.
1353
+ */
1354
+ if ( typeof wpslSettings.infoWindowStyle !== "undefined" && wpslSettings.infoWindowStyle == "infobox" && wpslSettings.markerClusters == 1 ) {
1355
+ activeWindowMarkerId = marker.storeId;
1356
+ infoWindow.setVisible( true );
1357
+ }
1358
  }
1359
 
1360
  /**
1361
+ * Handle clicks for the different info window actions like,
1362
  * direction, streetview and zoom here.
1363
  *
1364
  * @since 1.2.20
1365
+ * @param {object} marker Holds the marker data
1366
+ * @param {object} activelatLng The latlng of the clicked marker
1367
+ * @param {object} currentMap The map object
1368
  * @returns {void}
1369
  */
1370
+ function infoWindowClickActions( marker, activelatLng, currentMap ) {
1371
+ $( ".wpsl-info-actions a" ).on( "click", function( e ) {
1372
+ var maxZoom = Number( wpslSettings.autoZoomLevel );
1373
+
1374
+ e.stopImmediatePropagation();
1375
+
1376
  if ( $( this ).hasClass( "wpsl-directions" ) ) {
1377
 
1378
  /* Check if we need to show the direction on the map
1379
  * or send the users to maps.google.com
1380
  */
1381
+ if ( wpslSettings.directionRedirect == 1 ) {
1382
+ return true;
1383
+ } else {
1384
  renderDirections( $( this ) );
 
 
1385
  }
1386
  } else if ( $( this ).hasClass( "wpsl-streetview" ) ) {
1387
+ activateStreetView( marker, currentMap );
 
 
1388
  } else if ( $( this ).hasClass( "wpsl-zoom-here" ) ) {
1389
+ currentMap.setCenter( activelatLng );
1390
+ currentMap.setZoom( maxZoom );
 
 
1391
  }
1392
+
1393
+ return false;
1394
  });
1395
  }
1396
+
1397
+ /**
1398
+ * Check if have reached the max auto zoom level.
1399
+ *
1400
+ * If so we hide the 'Zoom here' text in the info window,
1401
+ * otherwise we show it.
1402
+ *
1403
+ * @since 2.0
1404
+ * @returns {void}
1405
+ */
1406
+ function checkMaxZoomLevel() {
1407
+ var zoomLevel = map.getZoom();
1408
+
1409
+ if ( zoomLevel >= wpslSettings.autoZoomLevel ) {
1410
+ $( ".wpsl-zoom-here" ).hide();
1411
+ } else {
1412
+ $( ".wpsl-zoom-here" ).show();
1413
+ }
1414
+ }
1415
 
1416
  /**
1417
  * Activate streetview for the clicked location
1418
  *
1419
  * @since 1.2.20
1420
+ * @param {object} marker The current marker
1421
+ * @param {object} currentMap The map object
1422
  * @returns {void}
1423
  */
1424
+ function activateStreetView( marker, currentMap ) {
1425
+ var panorama = currentMap.getStreetView();
1426
  panorama.setPosition( marker.getPosition() );
1427
  panorama.setVisible( true );
1428
 
1429
+ $( "#wpsl-map-controls" ).hide();
1430
 
1431
+ StreetViewListener( panorama, currentMap );
1432
  }
1433
 
1434
  /**
1439
  * info at tijmensmit.com
1440
  *
1441
  * @since 1.2.20
1442
+ * @param {object} panorama The streetview object
1443
+ * @param {object} currentMap The map object
1444
  * @returns {void}
1445
  */
1446
+ function StreetViewListener( panorama, currentMap ) {
1447
+ google.maps.event.addListener( panorama, "visible_changed", function() {
1448
  if ( !panorama.getVisible() ) {
1449
+ var currentZoomLevel = currentMap.getZoom();
 
1450
 
1451
+ $( "#wpsl-map-controls" ).show();
1452
+
1453
+ currentMap.setZoom( currentZoomLevel-1 );
1454
+ currentMap.setZoom( currentZoomLevel );
1455
  }
1456
  });
1457
  }
1462
  * Make sure that a streetview exists for the latlng
1463
  *
1464
  * @since 1.2.20
1465
+ * @param {object} latLng The latlng coordinates
1466
+ * @param {callback} callback
1467
  * @returns {void}
1468
  */
1469
  function checkStreetViewStatus( latLng, callback ) {
1470
  var service = new google.maps.StreetViewService();
1471
+
1472
  service.getPanoramaByLocation( latLng, 50, function( result, status ) {
1473
  streetViewAvailable = ( status == google.maps.StreetViewStatus.OK ) ? true : false;
1474
  callback();
1476
  }
1477
 
1478
  /**
1479
+ * Helper methods for the underscore templates
1480
  *
1481
+ * @since 2.0
 
 
 
 
1482
  */
1483
+ var templateHelpers = {
1484
+ /**
1485
+ * Make the phone number clickable if we are dealing with a mobile useragent
1486
+ *
1487
+ * @since 1.2.20
1488
+ * @param {string} phoneNumber The phone number
1489
+ * @returns {string} phoneNumber Either just the plain number, or with a link wrapped around it with tel:
1490
+ */
1491
+ formatPhoneNumber: function( phoneNumber ) {
1492
+ if ( ( wpslSettings.phoneUrl == 1 ) && ( checkMobileUserAgent() ) ) {
1493
+ phoneNumber = "<a href='tel:" + templateHelpers.formatClickablePhoneNumber( phoneNumber ) + "'>" + phoneNumber + "</a>";
 
1494
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1495
 
1496
+ return phoneNumber;
1497
+ },
1498
+ /**
1499
+ * Replace spaces - . and () from phone numbers.
1500
+ * Also if the number starts with a + we check for a (0) and remove it.
1501
+ *
1502
+ * @since 1.2.20
1503
+ * @param {string} phoneNumber The phone number
1504
+ * @returns {string} phoneNumber The 'cleaned' number
1505
+ */
1506
+ formatClickablePhoneNumber: function( phoneNumber ) {
1507
+ if ( ( phoneNumber.indexOf( "+" ) != -1 ) && ( phoneNumber.indexOf( "(0)" ) != -1 ) ) {
1508
+ phoneNumber = phoneNumber.replace( "(0)", "" );
1509
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1510
 
1511
+ return phoneNumber.replace( /(-| |\(|\)|\.|)/g, "" );
1512
+ },
1513
+ /**
1514
+ * Create the html for the info window action
1515
+ *
1516
+ * @since 2.0
1517
+ * @param {string} id The store id
1518
+ * @returns {string} output The html for the info window actions
1519
+ */
1520
+ createInfoWindowActions: function( id ) {
1521
+ var output,
1522
+ streetView = "",
1523
+ zoomTo = "";
1524
+
1525
+ if ( $( "#wpsl-gmap" ).length ) {
1526
+ if ( streetViewAvailable ) {
1527
+ streetView = "<a class='wpsl-streetview' href='#'>" + wpslLabels.streetView + "</a>";
1528
+ }
 
 
 
1529
 
1530
+ if ( wpslSettings.markerZoomTo == 1 ) {
1531
+ zoomTo = "<a class='wpsl-zoom-here' href='#'>" + wpslLabels.zoomHere + "</a>";
1532
+ }
1533
 
1534
+ output = "<div class='wpsl-info-actions'>" + templateHelpers.createDirectionUrl( id ) + streetView + zoomTo + "</div>";
 
 
 
 
 
 
1535
  }
 
 
 
 
 
 
 
 
 
1536
 
1537
+ return output;
1538
+ },
1539
+ /**
1540
+ * Create the url that takes the user to the maps.google.com page
1541
+ * and shows the correct driving directions.
1542
+ *
1543
+ * @since 1.0
1544
+ * @param {string} id The store id
1545
+ * @returns {string} directionUrl The full maps.google.com url with the encoded start + end address
1546
+ */
1547
+ createDirectionUrl: function( id ) {
1548
+ var directionUrl, destinationAddress, zip,
1549
+ url = {};
1550
 
1551
+ if ( wpslSettings.directionRedirect == 1 ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1552
 
1553
+ /* If we somehow failed to determine the start address, just set it to empty. */
1554
+ if ( typeof startAddress === "undefined" ) {
1555
+ startAddress = "";
1556
+ }
1557
+
1558
+ url.target = "target='_blank'";
1559
+
1560
+ /* If the id exists the user clicked on a marker we get the direction url from the search results. */
1561
+ if ( typeof id !== "undefined" ) {
1562
+ url.src = $( "[data-store-id=" + id + "] .wpsl-directions" ).attr( "href" );
1563
+ } else {
1564
 
1565
+ /* Only add a , after the zip if the zip value exists. */
1566
+ if ( this.zip ) {
1567
+ zip = this.zip + ", ";
1568
+ } else {
1569
+ zip = "";
1570
+ }
1571
 
1572
+ destinationAddress = this.address + ", " + this.city + ", " + zip + this.country;
1573
+
1574
+ url.src = "https://maps.google.com/maps?saddr=" + templateHelpers.rfc3986EncodeURIComponent( startAddress ) + "&daddr=" + templateHelpers.rfc3986EncodeURIComponent( destinationAddress ) + "";
1575
+ }
1576
+ } else {
1577
+ url = {
1578
+ src: "#",
1579
+ target: ""
1580
+ };
1581
+ }
1582
 
1583
+ directionUrl = "<a class='wpsl-directions' " + url.target + " href='" + url.src + "'>" + wpslLabels.directions + "</a>";
1584
+
1585
+ return directionUrl;
1586
+ },
1587
+ /**
1588
+ * Make the URI encoding compatible with RFC 3986
1589
+ *
1590
+ * !, ', (, ), and * will be escaped, otherwise they break the string
1591
+ *
1592
+ * @since 1.2.20
1593
+ * @param {string} str The string to encode
1594
+ * @returns {string} The encoded string
1595
+ */
1596
+ rfc3986EncodeURIComponent: function( str ) {
1597
+ return encodeURIComponent( str ).replace( /[!'()*]/g, escape );
1598
+ }
1599
+ };
1600
 
1601
  /**
1602
+ * Create the html template used in the info windows on the map
1603
  *
1604
  * @since 1.0
1605
+ * @param {object} infoWindowData The data that is shown in the info window (address, url, phone etc)
1606
+ * @returns {string} windowContent The html content that is placed in the info window
 
1607
  */
1608
+ function createInfoWindowHtml( infoWindowData ) {
1609
+ var windowContent, template;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1610
 
1611
+ if ( $( "#wpsl-base-gmap_0" ).length ) {
1612
+ template = $( "#wpsl-cpt-info-window-template" ).html();
1613
+ } else {
1614
+ template = $( "#wpsl-info-window-template" ).html();
1615
  }
1616
 
1617
+ windowContent = _.template( template, infoWindowData ); //see http://underscorejs.org/#template
1618
 
1619
+ return windowContent;
1620
  }
1621
 
1622
  /**
1627
  */
1628
  function fitBounds() {
1629
  var i, markerLen,
1630
+ maxZoom = Number( wpslSettings.autoZoomLevel ),
1631
+ bounds = new google.maps.LatLngBounds();
1632
+
1633
  /* Make sure we don't zoom to far */
1634
  google.maps.event.addListenerOnce( map, "bounds_changed", function( event ) {
1635
  if ( this.getZoom() > maxZoom ) {
1645
  }
1646
 
1647
  /**
1648
+ * Remove all existing markers from the map
1649
  *
1650
  * @since 1.0
1651
  * @param {boolean} keepStartMarker Whether or not to keep the start marker while removing all the other markers from the map
1653
  */
1654
  function deleteOverlays( keepStartMarker ) {
1655
  var markerLen, i;
1656
+
1657
  directionsDisplay.setMap( null );
1658
 
1659
  /* Remove all the markers from the map, and empty the array */
1740
  }
1741
  });
1742
 
 
1743
  $( "#wpsl-stores" ).on( "click", ".wpsl-store-details", function() {
1744
  var i, len,
1745
  $parentLi = $( this ).parents( "li" ),
1746
+ storeId = $parentLi.data( "store-id" );
1747
 
1748
  /* Check if we should show the 'more info' details */
1749
  if ( wpslSettings.moreInfoLocation == "info window" ) {
1769
  /* If we show the store listings under the map, we do want to jump to the
1770
  * top of the map to focus on the opened infowindow
1771
  */
1772
+ if ( wpslSettings.templateId != "default" || wpslSettings.moreInfoLocation == "store listings" ) {
1773
  return false;
1774
  }
1775
  });
1803
  } else {
1804
  active = '';
1805
  }
1806
+
1807
+ $this.$dropdown.append( "<li data-value=" + $( this ).val() + " " + active + ">" + $( this ).text() + "</li>" );
1808
  });
1809
 
1810
+
1811
+ $this.$dropdownElem.before( "<span data-value=" + $this.find( ":selected" ).val() + " class='wpsl-selected-item'>" + $this.find( ":selected" ).text() + "</span>" );
1812
  $this.$dropdownItem = $this.$dropdownElem.find( "li" );
1813
 
1814
  /* Listen for clicks on the 'wpsl-dropdown' div */
1818
  $( this ).toggleClass( "wpsl-active" );
1819
  maxHeight = 0;
1820
 
1821
+ /* Either calculate the correct height for the <ul>, or set it to 0 to hide it */
1822
  if ( $( this ).hasClass( "wpsl-active" ) ) {
1823
  $this.$dropdownItem.each( function( index ) {
1824
  maxHeight += $( this ).outerHeight();
1836
  $this.$dropdownItem.on( "click", function( e ) {
1837
 
1838
  /* Set the correct value as the selected item */
1839
+ $this.$dropdownWrap.find( $( ".wpsl-selected-item" ) ).html( $( this ).text() ).attr( "data-value", $( this ).attr( "data-value" ) );
1840
+
1841
  /* Apply the class to the correct item to make it bold */
1842
  $this.$dropdownItem.removeClass( "wpsl-selected-dropdown" );
1843
  $( this ).addClass( "wpsl-selected-dropdown" );
1864
  $( ".wpsl-dropdown div" ).css( "height", 0 );
1865
  }
1866
 
1867
+ /**
1868
+ * This code prevents the map from showing a large grey area if
1869
+ * the store locator is placed in a tab, and that tab is actived.
1870
+ *
1871
+ * For this to code to work the #wpsl-map-tab anchor is required in the Store Locator tab.
1872
+ *
1873
+ * Note: If the "Attempt to auto-locate the user" option is enabled,
1874
+ * and the user quickly switches to the store locator tab, before the
1875
+ * Geolocation timeout is reached, then the map is sometimes centered in the ocean.
1876
+ *
1877
+ * I haven't really figured out why this happens. The only option to fix this
1878
+ * is to simply disable the "Attempt to auto-locate the user" option if
1879
+ * you use the store locator in a tab.
1880
+ *
1881
+ * @see http://stackoverflow.com/questions/9458215/google-maps-not-working-in-jquery-tabs
1882
+ * @since 2.0
1883
+ */
1884
+ if ( $( "a[href='#wpsl-map-tab']" ).length ) {
1885
+ var mapZoom, mapCenter,
1886
+ $wpsl_tab = $( "a[href='#wpsl-map-tab']" );
1887
+
1888
+ $wpsl_tab.on( "click", function() {
1889
+ setTimeout( function() {
1890
+ mapZoom = map.getZoom();
1891
+ mapCenter = map.getCenter();
1892
+
1893
+ google.maps.event.trigger( map, "resize" );
1894
+
1895
+ map.setZoom( mapZoom );
1896
+ map.setCenter( mapCenter );
1897
+
1898
+ fitBounds();
1899
+ }, 50 );
1900
+
1901
+ return false;
1902
+ });
1903
  }
1904
 
1905
  });
js/wpsl-gmap.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(e){function t(t,n){var a,c,w,u,m,h,v,S=Number(wpslSettings.autoZoomLevel);c=o(n),w=l(),G=new google.maps.Geocoder,K=new google.maps.DirectionsRenderer,F=new google.maps.DirectionsService,a={zoom:Number(c.zoomLevel),center:c.startLatLng,mapTypeId:google.maps.MapTypeId[c.mapType.toUpperCase()],mapTypeControl:Number(c.mapTypeControl)?!0:!1,panControl:Number(c.panControls)?!0:!1,scrollwheel:Number(c.scrollWheel)?!0:!1,streetViewControl:Number(c.streetView)?!0:!1,zoomControlOptions:{style:google.maps.ZoomControlStyle[c.controlStyle.toUpperCase()],position:google.maps.ControlPosition[c.controlPosition.toUpperCase()+"_TOP"]}},j=new google.maps.Map(document.getElementById(t),a),i(c.mapStyle),"undefined"!=typeof window["wpslMap_"+n]&&"undefined"!=typeof window["wpslMap_"+n].locations&&(m=new google.maps.LatLngBounds,h=window["wpslMap_"+n].locations,v=h.length,e.each(h,function(e){u=new google.maps.LatLng(h[e].lat,h[e].lng),N(u,h[e].id,h[e],!1,w),m.extend(u)}),j.fitBounds(m),google.maps.event.addListenerOnce(j,"bounds_changed",function(e){return function(){e.getZoom()>S&&e.setZoom(S)}}(j))),e("#wpsl-gmap").length&&(!p()&&e(".wpsl-dropdown").length?A():(e("#wpsl-search-wrap select").show(),e("#wpsl-wrap").addClass("wpsl-mobile")),1==wpslSettings.autoLocate?d(c.startLatLng,w):1==wpslSettings.autoLoad&&r(c.startLatLng,w),1!=wpslSettings.mouseFocus||p()||e("#wpsl-search-input").focus(),g(w),f(c,j,w)),s()}function s(){"undefined"!=typeof wpslSettings.markerZoomTo&&1==wpslSettings.markerZoomTo&&google.maps.event.addListener(j,"zoom_changed",function(){R()})}function o(e){var t,s,o,l=["zoomLevel","mapType","mapTypeControl","mapStyle","streetView","panControls","scrollWheel","controlPosition","controlStyle"],i={zoomLevel:wpslSettings.zoomLevel,mapType:wpslSettings.mapType,mapTypeControl:wpslSettings.mapTypeControl,mapStyle:wpslSettings.mapStyle,streetView:wpslSettings.streetView,panControls:wpslSettings.panControls,scrollWheel:wpslSettings.scrollWheel,controlPosition:wpslSettings.controlPosition,controlStyle:wpslSettings.controlStyle};if("undefined"!=typeof window["wpslMap_"+e]&&"undefined"!=typeof window["wpslMap_"+e].shortCode)for(t=0,s=l.length;s>t;t++)o=window["wpslMap_"+e].shortCode[l[t]],"undefined"!=typeof o&&(i[l[t]]=o);return i.startLatLng=n(e),i}function n(e){var t,s,o="";return"undefined"!=typeof window["wpslMap_"+e]&&"undefined"!=typeof window["wpslMap_"+e].locations&&(o=window["wpslMap_"+e].locations[0]),"undefined"!=typeof o&&"undefined"!=typeof o.lat&&"undefined"!=typeof o.lng?t=new google.maps.LatLng(o.lat,o.lng):""!==wpslSettings.zoomLatlng?(s=wpslSettings.zoomLatlng.split(","),t=new google.maps.LatLng(s[0],s[1])):t=new google.maps.LatLng(0,0),t}function l(){var e,t,s={};return"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle?(e=wpslSettings.infoBoxClearance.split(","),t=wpslSettings.infoBoxPixelOffset.split(","),s={alignBottom:!0,boxClass:wpslSettings.infoBoxClass,closeBoxMargin:wpslSettings.infoBoxCloseMargin,closeBoxURL:wpslSettings.infoBoxCloseUrl,content:"",disableAutoPan:Number(wpslSettings.infoBoxDisableAutoPan)?!0:!1,enableEventPropagation:Number(wpslSettings.infoBoxEnableEventPropagation)?!0:!1,infoBoxClearance:new google.maps.Size(Number(e[0]),Number(e[1])),pixelOffset:new google.maps.Size(Number(t[0]),Number(t[1])),zIndex:Number(wpslSettings.infoBoxZindex)},q=new InfoBox(s)):q=new google.maps.InfoWindow,q}function i(e){e=a(e),e&&j.setOptions({styles:e})}function a(e){try{var t=JSON.parse(e);if(t&&"object"==typeof t&&null!==t)return t}catch(s){}return!1}function r(e,t){var s={store:wpslLabels.startPoint};N(e,0,s,!0,t),I(e,nt,it,t)}function p(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function d(t,s){if(navigator.geolocation){var o,n,l=!1,i=Number(wpslSettings.geoLocationTimout);o=setInterval(function(){e(".wpsl-icon-direction").toggleClass("wpsl-active-icon")},600),n=setTimeout(function(){c(o),r(t,s)},i),navigator.geolocation.getCurrentPosition(function(e){c(o),clearTimeout(n),U(l),w(t,e,nt,s)},function(o){if(e(".wpsl-icon-direction").hasClass("wpsl-user-activated")){switch(o.code){case o.PERMISSION_DENIED:alert(wpslGeolocationErrors.denied);break;case o.POSITION_UNAVAILABLE:alert(wpslGeolocationErrors.unavailable);break;case o.TIMEOUT:alert(wpslGeolocationErrors.timeout);break;default:alert(wpslGeolocationErrors.generalError)}e(".wpsl-icon-direction").removeClass("wpsl-active-icon")}else clearTimeout(n),r(t,s)},{maximumAge:6e4,timeout:i,enableHighAccuracy:!0})}else alert(wpslGeolocationErrors.unavailable),r(t,s)}function c(t){clearInterval(t),e(".wpsl-icon-direction").removeClass("wpsl-active-icon")}function w(e,t,s,o){if("undefined"==typeof t)r(e,o);else{var n=new google.maps.LatLng(t.coords.latitude,t.coords.longitude);H=t,C(n),j.setCenter(n),N(n,0,"",!0),I(n,s,it,o)}}function g(t){e("#wpsl-search-btn").on("click",function(){var s=!1;e("#wpsl-search-input").removeClass(),e("#wpsl-search-input").val()?(e("#wpsl-result-list ul").empty(),e("#wpsl-stores").show(),e(".wpsl-direction-before, .wpsl-direction-after").remove(),e("#wpsl-direction-details").hide(),nt=!1,u(),U(s),h(),y(t)):e("#wpsl-search-input").addClass("wpsl-error").focus()})}function u(){"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&"undefined"!=typeof et[0]&&et[0].close()}function f(t,s,o){google.maps.event.addListenerOnce(s,"tilesloaded",function(){e(".gm-style").append(wpslSettings.mapControls),e(".wpsl-icon-reset, #wpsl-reset-map").length>0&&(m(t.startLatLng,o),e(".wpsl-icon-reset").hide()),e(".wpsl-icon-direction").on("click",function(){e(this).addClass("wpsl-user-activated"),d(t.startLatLng,o)})})}function m(t,s){e(".wpsl-icon-reset, #wpsl-reset-map").on("click",function(){var o=!1,n=!0;e(this).hasClass("wpsl-in-progress")||(1==wpslSettings.autoLoad&&(it=1),(j.getCenter().lat()!==ot.centerLatlng.lat()||j.getCenter().lng()!==ot.centerLatlng.lng()||j.getZoom()!==ot.zoomLevel)&&(U(o),e("#wpsl-search-input").val("").removeClass(),e(".wpsl-icon-reset").addClass("wpsl-in-progress"),Y&&Y.clearMarkers(),h(),v(),1==wpslSettings.autoLocate?w(t,H,n,s):r(t,s)),e("#wpsl-stores").show(),e("#wpsl-direction-details").hide())})}function h(){"undefined"!=typeof J&&""!==J&&(J.setMap(null),J="")}function v(){var t,s,o,n,l=[wpslSettings.searchRadius+" "+wpslSettings.distanceUnit,wpslSettings.maxResults],i=["wpsl-radius","wpsl-results"];for(t=0,s=i.length;s>t;t++)e("#"+i[t]+" select").val(parseInt(l[t])),e("#"+i[t]+" li").removeClass(),"wpsl-radius"==i[t]?o=wpslSettings.searchRadius:"wpsl-results"==i[t]&&(o=wpslSettings.maxResults),e("#"+i[t]+" li").each(function(){e(this).text()===l[t]&&(e(this).addClass("wpsl-selected-dropdown"),e("#"+i[t]+" .wpsl-selected-item").html(l[t]).attr("data-value",o))});e("#wpsl-category").length&&(e("#wpsl-category select").val(0),e("#wpsl-category li").removeClass(),e("#wpsl-category li:first-child").addClass("wpsl-selected-dropdown"),n=e("#wpsl-category li:first-child").text(),e("#wpsl-category .wpsl-selected-item").html(n).attr("data-value",0))}function S(t){var s,o,n,l,i;for(u(),i=t.parents("li").length>0?t.parents("li").data("store-id"):t.parents(".wpsl-info-window").data("store-id"),"undefined"!=typeof J&&""!==J&&(o=J.getPosition()),st={centerLatlng:j.getCenter(),zoomLevel:j.getZoom()},s=0,l=tt.length;l>s;s++)0!=tt[s].storeId||"undefined"!=typeof o&&""!==o?tt[s].storeId==i&&(n=tt[s].getPosition()):o=tt[s].getPosition();o&&n?(e("#wpsl-direction-details ul").empty(),e(".wpsl-direction-before, .wpsl-direction-after").remove(),b(o,n)):alert(wpslLabels.generalError)}function L(e,t){var s,o,n;for(s=0,o=tt.length;o>s;s++)tt[s].storeId==e&&(n=tt[s],n.setAnimation("start"==t?google.maps.Animation.BOUNCE:null))}function b(t,s){var o,n,l,i,a,r,p,d,c,w="",g={};d="km"==wpslSettings.distanceUnit?"METRIC":"IMPERIAL",g={origin:t,destination:s,travelMode:google.maps.DirectionsTravelMode.DRIVING,unitSystem:google.maps.UnitSystem[d]},F.route(g,function(t,s){if(s==google.maps.DirectionsStatus.OK){if(K.setMap(j),K.setDirections(t),t.routes.length>0){for(a=t.routes[0],r=0;r<a.legs.length;r++)for(o=a.legs[r],p=0,n=o.steps.length;n>p;p++)l=o.steps[p],i=p+1,w=w+"<li><div class='wpsl-direction-index'>"+i+"</div><div class='wpsl-direction-txt'>"+l.instructions+"</div><div class='wpsl-direction-distance'>"+l.distance.text+"</div></li>";for(e("#wpsl-direction-details ul").append(w).before("<div class='wpsl-direction-before'><a class='wpsl-back' id='wpsl-direction-start' href='#'>"+wpslLabels.back+"</a><div><span class='wpsl-total-distance'>"+a.legs[0].distance.text+"</span> - <span class='wpsl-total-durations'>"+a.legs[0].duration.text+"</span></div></div>").after("<p class='wpsl-direction-after'>"+t.routes[0].copyrights+"</p>"),e("#wpsl-direction-details").show(),r=0,n=tt.length;n>r;r++)tt[r].setMap(null);Y&&Y.clearMarkers(),"undefined"!=typeof J&&""!==J&&J.setMap(null),e("#wpsl-stores").hide(),1==wpslSettings.templateId&&(c=e("#wpsl-gmap").offset(),e(window).scrollTop(c.top))}}else W(s)})}function y(t){var s,o=!1,n=!1,l=e("#wpsl-search-input").val();G.geocode({address:l},function(e,l){l==google.maps.GeocoderStatus.OK?(s=e[0].geometry.location,U(n),N(s,0,"",!0,t),I(s,nt,o,t)):$(l)})}function C(t){var s;G.geocode({latLng:t},function(t,o){o==google.maps.GeocoderStatus.OK?(s=k(t),""!==s&&e("#wpsl-search-input").val(s)):$(o)})}function k(e){var t,s,o,n=e[0].address_components.length;for(o=0;n>o;o++)s=e[0].address_components[o].types,(/^postal_code$/.test(s)||/^postal_code_prefix,postal_code$/.test(s))&&(t=e[0].address_components[o].long_name);return t}function I(e,t,s,o){1==wpslSettings.directionRedirect?x(e,function(){E(e,t,s,o)}):E(e,t,s,o)}function x(e,t){G.geocode({latLng:e},function(e,s){s==google.maps.GeocoderStatus.OK?(X=e[0].formatted_address,t()):$(s)})}function E(t,s,o,n){var l,i,a,r="",d="",c=!1,w=e("#wpsl-wrap").hasClass("wpsl-mobile"),g=e("#wpsl-listing-template").html(),u=e("#wpsl-stores ul"),f=wpslSettings.path+"img/ajax-loader.gif",m={action:"store_search",lat:t.lat(),lng:t.lng()};s?(m.max_results=wpslSettings.maxResults,m.radius=wpslSettings.searchRadius):(w?(i=parseInt(e("#wpsl-results .wpsl-dropdown").val()),a=parseInt(e("#wpsl-radius .wpsl-dropdown").val())):(i=parseInt(e("#wpsl-results .wpsl-selected-item").attr("data-value")),a=parseInt(e("#wpsl-radius .wpsl-selected-item").attr("data-value"))),m.max_results=isNaN(i)?wpslSettings.maxResults:i,m.radius=isNaN(a)?wpslSettings.searchRadius:a,e("#wpsl-category").length>0&&(d=parseInt(w?e("#wpsl-category .wpsl-dropdown").val():e("#wpsl-category .wpsl-selected-item").attr("data-value")),isNaN(d)||0===d||(m.filter=d))),1==o&&(m.autoload=1,"undefined"!=typeof H&&(m.skip_cache=1)),u.empty().append("<li class='wpsl-preloader'><img src='"+f+"'/>"+wpslLabels.preloader+"</li>"),e.get(wpslSettings.ajaxurl,m,function(t){e(".wpsl-preloader, .no-results").remove(),t.success!==!1?t.length>0?(e.each(t,function(e){_.extend(t[e],wt),l=new google.maps.LatLng(t[e].lat,t[e].lng),N(l,t[e].id,t[e],c,n),r+=_.template(g,t[e])}),e("#wpsl-result-list").off("click",".wpsl-directions"),u.append(r),e("#wpsl-result-list").on("click",".wpsl-directions",function(){return 1!=wpslSettings.directionRedirect?(S(e(this)),!1):void 0}),M(),B(),e("#wpsl-result-list p:empty").remove()):u.html("<li class='no-results'>"+wpslLabels.noResults+"</li>"):alert(wpslLabels.generalError),1==wpslSettings.resetMap&&(e.isEmptyObject(ot)&&google.maps.event.addListenerOnce(j,"tilesloaded",function(){ot={centerLatlng:j.getCenter(),zoomLevel:j.getZoom()},e(".wpsl-icon-direction").addClass("wpsl-reset-exists"),e(".wpsl-icon-reset, #wpsl-reset-map").show()}),e(".wpsl-icon-reset").removeClass("wpsl-in-progress"))}),1!=wpslSettings.mouseFocus||p()||e("#wpsl-search-input").focus()}function M(){if(1==wpslSettings.markerClusters){var e=Number(wpslSettings.clusterZoom),t=Number(wpslSettings.clusterSize);isNaN(e)&&(e=""),isNaN(t)&&(t=""),Y=new MarkerClusterer(j,tt,{gridSize:t,maxZoom:e})}}function N(e,t,s,o,n){var l,i,a,r=!0;l=0===t?wpslSettings.path+"img/markers/"+wpslSettings.startMarker:wpslSettings.path+"img/markers/"+wpslSettings.storeMarker,i={url:l,scaledSize:new google.maps.Size(24,35),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(12,35)},a=new google.maps.Marker({position:e,map:j,optimized:!1,title:s.store,draggable:o,storeId:t,icon:i}),tt.push(a),google.maps.event.addListener(a,"click",function(o){return function(){0!=t?"undefined"!=typeof wpslSettings.markerStreetView&&1==wpslSettings.markerStreetView?Z(e,function(){P(a,V(s),n,o)}):P(a,V(s),n,o):P(a,wpslLabels.startPoint,n,o),google.maps.event.addListener(n,"domready",function(){O(a,e,o),R()})}}(j)),o&&google.maps.event.addListener(a,"dragend",function(e){U(r),j.setCenter(e.latLng),C(e.latLng),I(e.latLng,nt,it=!1,n)})}function P(e,t,s,o){et.length=0,s.setContent(t),s.open(o,e),et.push(s),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters&&(Q=e.storeId,s.setVisible(!0))}function O(t,s,o){e(".wpsl-info-actions a").on("click",function(n){var l=Number(wpslSettings.autoZoomLevel);if(n.stopImmediatePropagation(),e(this).hasClass("wpsl-directions")){if(1==wpslSettings.directionRedirect)return!0;S(e(this))}else e(this).hasClass("wpsl-streetview")?T(t,o):e(this).hasClass("wpsl-zoom-here")&&(o.setCenter(s),o.setZoom(l));return!1})}function R(){var t=j.getZoom();t>=wpslSettings.autoZoomLevel?e(".wpsl-zoom-here").hide():e(".wpsl-zoom-here").show()}function T(t,s){var o=s.getStreetView();o.setPosition(t.getPosition()),o.setVisible(!0),e("#wpsl-map-controls").hide(),z(o,s)}function z(t,s){google.maps.event.addListener(t,"visible_changed",function(){if(!t.getVisible()){var o=s.getZoom();e("#wpsl-map-controls").show(),s.setZoom(o-1),s.setZoom(o)}})}function Z(e,t){var s=new google.maps.StreetViewService;s.getPanoramaByLocation(e,50,function(e,s){lt=s==google.maps.StreetViewStatus.OK?!0:!1,t()})}function V(t){var s,o;return o=e("#wpsl-base-gmap_0").length?e("#wpsl-cpt-info-window-template").html():e("#wpsl-info-window-template").html(),s=_.template(o,t)}function B(){var e,t,s=Number(wpslSettings.autoZoomLevel),o=new google.maps.LatLngBounds;for(google.maps.event.addListenerOnce(j,"bounds_changed",function(){this.getZoom()>s&&this.setZoom(s)}),e=0,t=tt.length;t>e;e++)o.extend(tt[e].position);j.fitBounds(o)}function U(e){var t,s;if(K.setMap(null),tt){for(s=0,t=tt.length;t>s;s++)e?1!=tt[s].draggable?tt[s].setMap(null):J=tt[s]:tt[s].setMap(null);tt.length=0}Y&&Y.clearMarkers()}function $(e){var t;switch(e){case"ZERO_RESULTS":t=wpslLabels.noResults;break;case"OVER_QUERY_LIMIT":t=wpslLabels.queryLimit;break;default:t=wpslLabels.generalError}alert(t)}function W(e){var t;switch(e){case"NOT_FOUND":case"ZERO_RESULTS":t=wpslLabels.noDirectionsFound;break;case"OVER_QUERY_LIMIT":t=wpslLabels.queryLimit;break;default:t=wpslLabels.generalError}alert(t)}function A(){e(".wpsl-dropdown").each(function(){var t,s,o=e(this);o.$dropdownWrap=o.wrap("<div class='wpsl-dropdown'></div>").parent(),o.$selectedVal=o.val(),o.$dropdownElem=e("<div><ul/></div>").appendTo(o.$dropdownWrap),o.$dropdown=o.$dropdownElem.find("ul"),o.$options=o.$dropdownWrap.find("option"),o.hide().removeClass("wpsl-dropdown"),e.each(o.$options,function(){t=e(this).val()==o.$selectedVal?'class="wpsl-selected-dropdown"':"",o.$dropdown.append("<li data-value="+e(this).val()+" "+t+">"+e(this).text()+"</li>")}),o.$dropdownElem.before("<span data-value="+o.find(":selected").val()+" class='wpsl-selected-item'>"+o.find(":selected").text()+"</span>"),o.$dropdownItem=o.$dropdownElem.find("li"),o.$dropdownWrap.on("click",function(t){D(),e(this).toggleClass("wpsl-active"),s=0,e(this).hasClass("wpsl-active")?(o.$dropdownItem.each(function(){s+=e(this).outerHeight()}),o.$dropdownElem.css("height",s+2+"px")):o.$dropdownElem.css("height",0),t.stopPropagation()}),o.$dropdownItem.on("click",function(t){o.$dropdownWrap.find(e(".wpsl-selected-item")).html(e(this).text()).attr("data-value",e(this).attr("data-value")),o.$dropdownItem.removeClass("wpsl-selected-dropdown"),e(this).addClass("wpsl-selected-dropdown"),D(),t.stopPropagation()})}),e(document).click(function(){D()})}function D(){e(".wpsl-dropdown").removeClass("wpsl-active"),e(".wpsl-dropdown div").css("height",0)}var G,j,K,F,H,Q,q,Y,J,X,et=[],tt=[],st={},ot={},nt=!1,lt=!1,it="undefined"!=typeof wpslSettings?wpslSettings.autoLoad:"";if(e(".wpsl-gmap-canvas").length&&(e("<img />").attr("src",wpslSettings.path+"img/ajax-loader.gif"),e(".wpsl-gmap-canvas").each(function(s){var o=e(this).attr("id");t(o,s)})),e("#wpsl-result-list").on("click",".wpsl-back",function(){var t,s;for(K.setMap(null),t=0,s=tt.length;s>t;t++)tt[t].setMap(j);return"undefined"!=typeof J&&""!==J&&J.setMap(j),Y&&M(),j.setCenter(st.centerLatlng),j.setZoom(st.zoomLevel),e(".wpsl-direction-before, .wpsl-direction-after").remove(),e("#wpsl-stores").show(),e("#wpsl-direction-details").hide(),!1}),e("#wpsl-gmap").length&&("bounce"==wpslSettings.markerEffect?(e("#wpsl-stores").on("mouseenter","li",function(){L(e(this).data("store-id"),"start")}),e("#wpsl-stores").on("mouseleave","li",function(){L(e(this).data("store-id"),"stop")})):"info_window"==wpslSettings.markerEffect&&e("#wpsl-stores").on("mouseenter","li",function(){var t,s;for(t=0,s=tt.length;s>t;t++)tt[t].storeId==e(this).data("store-id")&&(google.maps.event.trigger(tt[t],"click"),j.setCenter(tt[t].position))})),"undefined"!=typeof wpslSettings.infoWindowStyle&&"infobox"==wpslSettings.infoWindowStyle&&1==wpslSettings.markerClusters){var at,rt,pt,dt,ct;google.maps.event.addListener(j,"zoom_changed",function(){google.maps.event.addListenerOnce(j,"idle",function(){if("undefined"!=typeof Y&&(at=Y.clusters_,at.length))for(dt=0,rt=at.length;rt>dt;dt++)for(ct=0,pt=at[dt].markers_.length;pt>ct;ct++)if(at[dt].markers_[ct].storeId==Q){q.getVisible()&&null===at[dt].markers_[ct].map?q.setVisible(!1):q.getVisible()||null===at[dt].markers_[ct].map||q.setVisible(!0);break}})})}var wt={formatPhoneNumber:function(e){return 1==wpslSettings.phoneUrl&&p()&&(e="<a href='tel:"+wt.formatClickablePhoneNumber(e)+"'>"+e+"</a>"),e},formatClickablePhoneNumber:function(e){return-1!=e.indexOf("+")&&-1!=e.indexOf("(0)")&&(e=e.replace("(0)","")),e.replace(/(-| |\(|\)|\.|)/g,"")},createInfoWindowActions:function(t){var s,o="",n="";return e("#wpsl-gmap").length&&(lt&&(o="<a class='wpsl-streetview' href='#'>"+wpslLabels.streetView+"</a>"),1==wpslSettings.markerZoomTo&&(n="<a class='wpsl-zoom-here' href='#'>"+wpslLabels.zoomHere+"</a>"),s="<div class='wpsl-info-actions'>"+wt.createDirectionUrl(t)+o+n+"</div>"),s},createDirectionUrl:function(t){var s,o,n,l={};return 1==wpslSettings.directionRedirect?("undefined"==typeof X&&(X=""),l.target="target='_blank'","undefined"!=typeof t?l.src=e("[data-store-id="+t+"] .wpsl-directions").attr("href"):(n=this.zip?this.zip+", ":"",o=this.address+", "+this.city+", "+n+this.country,l.src="https://maps.google.com/maps?saddr="+wt.rfc3986EncodeURIComponent(X)+"&daddr="+wt.rfc3986EncodeURIComponent(o))):l={src:"#",target:""},s="<a class='wpsl-directions' "+l.target+" href='"+l.src+"'>"+wpslLabels.directions+"</a>"},rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)}};if(e("#wpsl-search-input").keydown(function(t){var s=t.keyCode||t.which;13==s&&e("#wpsl-search-btn").trigger("click")}),e("#wpsl-stores").on("click",".wpsl-store-details",function(){var t,s,o=e(this).parents("li"),n=o.data("store-id");if("info window"==wpslSettings.moreInfoLocation)for(t=0,s=tt.length;s>t;t++)tt[t].storeId==n&&google.maps.event.trigger(tt[t],"click");else o.find(".wpsl-more-info-listings").is(":visible")?e(this).removeClass("wpsl-active-details"):e(this).addClass("wpsl-active-details"),o.siblings().find(".wpsl-store-details").removeClass("wpsl-active-details"),o.siblings().find(".wpsl-more-info-listings").hide(),o.find(".wpsl-more-info-listings").toggle();return"default"!=wpslSettings.templateId||"store listings"==wpslSettings.moreInfoLocation?!1:void 0}),e("a[href='#wpsl-map-tab']").length){var gt,ut,ft=e("a[href='#wpsl-map-tab']");ft.on("click",function(){return setTimeout(function(){gt=j.getZoom(),ut=j.getCenter(),google.maps.event.trigger(j,"resize"),j.setZoom(gt),j.setCenter(ut),B()},50),!1})}});
languages/wpsl-nl_NL.mo CHANGED
Binary file
languages/wpsl-nl_NL.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WP Store Locator v1.2.20\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-05-11 20:54+0100\n"
6
- "PO-Revision-Date: 2014-05-13 12:03+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "Language: nl_NL\n"
@@ -11,1945 +11,2710 @@ msgstr ""
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
- "X-Generator: Poedit 1.6.5\n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
18
  "X-Poedit-Basepath: ../\n"
19
  "X-Textdomain-Support: yes\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
 
22
- #: admin/class-admin.php:128 wp-store-locator.php:268
23
- msgid "More info"
24
- msgstr "Meer info"
25
-
26
- #: admin/class-admin.php:144
27
- msgid "info window"
28
- msgstr "info window"
29
-
30
- #: admin/class-admin.php:149 wp-store-locator.php:271
31
- msgid "Back"
32
- msgstr "Terug"
33
-
34
- #: admin/class-admin.php:154 wp-store-locator.php:272
35
- msgid "Reset"
36
- msgstr "Herstel"
37
-
38
- #: admin/class-admin.php:211 wp-store-locator.php:273
39
- msgid "Street view"
40
- msgstr "Street view"
41
 
42
- #: admin/class-admin.php:215 wp-store-locator.php:274
43
- msgid "Zoom here"
44
- msgstr "Zoom hier"
 
 
 
 
 
45
 
46
- #: admin/class-admin.php:219 wp-store-locator.php:270
47
- msgid "No route could be found between the origin and destination"
48
- msgstr "Er kon geen route gevonden worden tussen het begin en eindpunt"
49
 
50
- #: admin/class-admin.php:247
51
- msgid "Store Locator"
52
- msgstr "Store Locator"
53
 
54
- #: admin/class-admin.php:248
55
- msgid "Manage Stores"
56
- msgstr "Beheer Locaties"
57
 
58
- #: admin/class-admin.php:249 admin/class-admin.php:574
59
- #: admin/templates/add-store.php:107
60
- msgid "Add Store"
61
- msgstr "Locatie Toevoegen"
62
 
63
- #: admin/class-admin.php:250 admin/class-admin.php:575
64
- #: admin/templates/map-settings.php:2
65
- msgid "Settings"
66
- msgstr "Instellingen"
67
 
68
- #: admin/class-admin.php:251 admin/templates/faq.php:2
69
- msgid "FAQ"
70
- msgstr "FAQ"
 
 
71
 
72
- #: admin/class-admin.php:267 admin/class-store-overview.php:31
73
- msgid "Stores"
74
- msgstr "Locaties"
 
75
 
76
- #: admin/class-admin.php:436
77
- msgid "There was a problem updating the store details, please try again."
78
- msgstr "De locatie data kon niet worden gewijzigd, probeer het nog een keer."
79
 
80
- #: admin/class-admin.php:440
81
- msgid "Store details updated."
82
- msgstr "Locatie data bijgewerkt."
83
 
84
- #: admin/class-admin.php:486
85
- msgid "There was a problem saving the new store details, please try again."
86
- msgstr "De locatie data kon niet worden opgeslagen, probeer het nog een keer."
87
 
88
- #: admin/class-admin.php:490
89
- msgid "Store succesfully added."
90
- msgstr "Locatie succesvol toegevoegd."
91
 
92
- #: admin/class-admin.php:521
93
- msgid "Please fill in all the required fields."
94
- msgstr "Vul alle verplichte velden in."
95
 
96
- #: admin/class-admin.php:573
97
- msgid "Current Stores"
98
- msgstr "Huidige Locaties"
 
99
 
100
- #: admin/class-admin.php:610
101
  msgid ""
102
- "The max results field cannot be empty, the default value has been restored."
 
103
  msgstr ""
104
- "Het max zoek resulaten veld kan niet leeg zijn, de standaard waarde is "
105
- "hersteld."
106
 
107
- #: admin/class-admin.php:613
 
108
  msgid ""
109
- "The search radius field cannot be empty, the default value has been restored."
 
110
  msgstr ""
111
- "Het zoek radius veld kan niet leeg zijn, de standaard waarde is hersteld."
 
112
 
113
- #: admin/class-admin.php:616
114
  msgid ""
115
- "One of the label fields was left empty, the default value for that field has "
116
- "been restored."
117
- msgstr "Een van de label velden was leeg, de standaard waarde is hersteld."
118
 
119
- #: admin/class-admin.php:619
120
- msgid ""
121
- "Please provide the name of a city or country that can be used as a starting "
122
- "point under \"Map Settings\". This will only be used if auto-locating the "
123
- "user fails, or the option itself is disabled."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  msgstr ""
125
- "Geef de naam van een stad of land op als start locatie onder de \"Kaart "
126
- "Instellingen\". Deze locatie wordt alleen maar gebruikt als het automatische "
127
- "achterhalen van de gebruikers locatie mislukt, of het automatische "
128
- "achterhalen is uitgeschakeld."
 
129
 
130
- #: admin/class-admin.php:634
131
  #, php-format
132
  msgid ""
133
- "Before adding the [wpsl] shortcode to a page, please don't forget to define "
134
- "a start point on the %ssettings%s page."
135
  msgstr ""
136
- "Vergeet niet voordat je de [wpsl] shortcode op een pagina plaatst, om een "
137
- "start locatie op te geven op de %sinstellingen%s pagina."
138
 
139
- #: admin/class-admin.php:634
140
- msgid "Dismiss"
141
- msgstr "Sluiten"
142
 
143
- #: admin/class-admin.php:886
144
- msgid ""
145
- "The Google Geocoding API returned no results for the store location. Please "
146
- "change the location and try again."
147
- msgstr ""
148
- "De Google Geocoding API gaf geen resultaten terug voor deze locatie. Wijzig "
149
- "de locatie details en probeer het nog een keer."
 
 
 
 
150
 
151
- #: admin/class-admin.php:889
152
  #, php-format
153
- msgid ""
154
- "You have reached the daily allowed geocoding limit, you can read more <a "
155
- "href=\"%s\">here</a>."
156
- msgstr ""
157
- "Je hebt de dagelijkse toegestane geocoding limiet bereikt, je kan er <a href="
158
- "\"%s\">hier</a> meer over lezen."
159
 
160
- #: admin/class-admin.php:892
161
- msgid ""
162
- "The Google Geocoding API failed to return valid data, please try again later."
163
- msgstr ""
164
- "De Google Geocoding API geeft ongeldige data terug, probeer het nog een keer."
165
 
166
- #: admin/class-admin.php:972
167
- msgid "Start location marker:"
168
- msgstr "Start locatie marker:"
169
 
170
- #: admin/class-admin.php:974
171
- msgid "Store location marker:"
172
- msgstr "Winkel locatie marker:"
173
 
174
- #: admin/class-admin.php:1134 wp-store-locator.php:313
175
- msgid "Default"
176
- msgstr "Standaard"
 
177
 
178
- #: admin/class-admin.php:1242
179
- msgid "In the store listings"
180
- msgstr "In the locatie lijst"
181
 
182
- #: admin/class-admin.php:1243
183
- msgid "In the info window on the map"
184
- msgstr "In de info window op de kaart"
 
 
 
 
185
 
186
- #: admin/class-admin.php:1269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  msgid "Select your language"
188
  msgstr "Kies uw taal"
189
 
190
- #: admin/class-admin.php:1270
191
  msgid "English"
192
  msgstr "Engels"
193
 
194
- #: admin/class-admin.php:1271
195
  msgid "Arabic"
196
  msgstr "Arabisch"
197
 
198
- #: admin/class-admin.php:1272
199
  msgid "Basque"
200
  msgstr "Bask"
201
 
202
- #: admin/class-admin.php:1273
203
  msgid "Bulgarian"
204
  msgstr "Bulgaars"
205
 
206
- #: admin/class-admin.php:1274
207
  msgid "Bengali"
208
  msgstr "Bengali"
209
 
210
- #: admin/class-admin.php:1275
211
  msgid "Catalan"
212
  msgstr "Catalaans"
213
 
214
- #: admin/class-admin.php:1276
215
  msgid "Czech"
216
- msgstr "Tjechische"
217
 
218
- #: admin/class-admin.php:1277
219
  msgid "Danish"
220
  msgstr "Deens"
221
 
222
- #: admin/class-admin.php:1278
223
  msgid "German"
224
  msgstr "Duits"
225
 
226
- #: admin/class-admin.php:1279
227
  msgid "Greek"
228
  msgstr "Grieks"
229
 
230
- #: admin/class-admin.php:1280
231
  msgid "English (Australian)"
232
  msgstr "Engels (Australisch)"
233
 
234
- #: admin/class-admin.php:1281
235
  msgid "English (Great Britain)"
236
- msgstr "Engels (Verenigd Koningkrijk)"
237
 
238
- #: admin/class-admin.php:1282
239
  msgid "Spanish"
240
  msgstr "Spaans"
241
 
242
- #: admin/class-admin.php:1283
243
  msgid "Farsi"
244
  msgstr "Farsi"
245
 
246
- #: admin/class-admin.php:1284
247
  msgid "Finnish"
248
  msgstr "Fins"
249
 
250
- #: admin/class-admin.php:1285
251
  msgid "Filipino"
252
  msgstr "Filipijns"
253
 
254
- #: admin/class-admin.php:1286
255
  msgid "French"
256
  msgstr "Frans"
257
 
258
- #: admin/class-admin.php:1287
259
  msgid "Galician"
260
  msgstr "Gallisch"
261
 
262
- #: admin/class-admin.php:1288
263
  msgid "Gujarati"
264
  msgstr "Gujurati"
265
 
266
- #: admin/class-admin.php:1289
267
  msgid "Hindi"
268
  msgstr "Hindi"
269
 
270
- #: admin/class-admin.php:1290
271
  msgid "Croatian"
272
- msgstr "Kroaats"
273
 
274
- #: admin/class-admin.php:1291
275
  msgid "Hungarian"
276
  msgstr "Hongaars"
277
 
278
- #: admin/class-admin.php:1292
279
  msgid "Indonesian"
280
  msgstr "Indonesisch"
281
 
282
- #: admin/class-admin.php:1293
283
  msgid "Italian"
284
  msgstr "Italiaans"
285
 
286
- #: admin/class-admin.php:1294
287
  msgid "Hebrew"
288
- msgstr "Hebreeuwse"
289
 
290
- #: admin/class-admin.php:1295
291
  msgid "Japanese"
292
  msgstr "Japans"
293
 
294
- #: admin/class-admin.php:1296
295
  msgid "Kannada"
296
  msgstr "Kannada"
297
 
298
- #: admin/class-admin.php:1297
299
  msgid "Korean"
300
  msgstr "Koreaans"
301
 
302
- #: admin/class-admin.php:1298
303
  msgid "Lithuanian"
304
  msgstr "Litouws"
305
 
306
- #: admin/class-admin.php:1299
307
  msgid "Latvian"
308
  msgstr "Lets"
309
 
310
- #: admin/class-admin.php:1300
311
  msgid "Malayalam"
312
  msgstr "Malayalam"
313
 
314
- #: admin/class-admin.php:1301
315
  msgid "Marathi"
316
  msgstr "Marathi"
317
 
318
- #: admin/class-admin.php:1302
319
  msgid "Dutch"
320
  msgstr "Nederlands"
321
 
322
- #: admin/class-admin.php:1303
323
  msgid "Norwegian"
324
  msgstr "Noors"
325
 
326
- #: admin/class-admin.php:1304
327
  msgid "Norwegian Nynorsk"
328
  msgstr "Noors Nynorsk"
329
 
330
- #: admin/class-admin.php:1305
331
  msgid "Polish"
332
  msgstr "Pools"
333
 
334
- #: admin/class-admin.php:1306
335
  msgid "Portuguese"
336
  msgstr "Portugees"
337
 
338
- #: admin/class-admin.php:1307
339
  msgid "Portuguese (Brazil)"
340
  msgstr "Portugees (Brazilië)"
341
 
342
- #: admin/class-admin.php:1308
343
  msgid "Portuguese (Portugal)"
344
  msgstr "Portugees (Portugal)"
345
 
346
- #: admin/class-admin.php:1309
347
  msgid "Romanian"
348
  msgstr "Roemeens"
349
 
350
- #: admin/class-admin.php:1310
351
  msgid "Russian"
352
  msgstr "Russisch"
353
 
354
- #: admin/class-admin.php:1311
355
  msgid "Slovak"
356
  msgstr "Slowaaks"
357
 
358
- #: admin/class-admin.php:1312
359
  msgid "Slovenian"
360
  msgstr "Sloveens"
361
 
362
- #: admin/class-admin.php:1313
363
  msgid "Serbian"
364
  msgstr "Servisch"
365
 
366
- #: admin/class-admin.php:1314
367
  msgid "Swedish"
368
  msgstr "Zweeds"
369
 
370
- #: admin/class-admin.php:1315
371
  msgid "Tagalog"
372
  msgstr "Tagalog"
373
 
374
- #: admin/class-admin.php:1316
375
  msgid "Tamil"
376
  msgstr "Tamil"
377
 
378
- #: admin/class-admin.php:1317
379
  msgid "Telugu"
380
  msgstr "Telugu"
381
 
382
- #: admin/class-admin.php:1318
383
  msgid "Thai"
384
  msgstr "Thai"
385
 
386
- #: admin/class-admin.php:1319
387
  msgid "Turkish"
388
  msgstr "Turks"
389
 
390
- #: admin/class-admin.php:1320
391
  msgid "Ukrainian"
392
  msgstr "Oekraïens"
393
 
394
- #: admin/class-admin.php:1321
395
  msgid "Vietnamese"
396
  msgstr "Vietnamees"
397
 
398
- #: admin/class-admin.php:1322
399
  msgid "Chinese (Simplified)"
400
  msgstr "Chinees (Vereenvoudigd)"
401
 
402
- #: admin/class-admin.php:1323
403
  msgid "Chinese (Traditional)"
404
  msgstr "Chinees (Traditioneel)"
405
 
406
- #: admin/class-admin.php:1328
407
  msgid "Select your region"
408
  msgstr "Kies uw regio"
409
 
410
- #: admin/class-admin.php:1329
411
  msgid "Afghanistan"
412
  msgstr "Afghanistan"
413
 
414
- #: admin/class-admin.php:1330
415
  msgid "Albania"
416
  msgstr "Albanië"
417
 
418
- #: admin/class-admin.php:1331
419
  msgid "Algeria"
420
- msgstr "Algerian"
421
 
422
- #: admin/class-admin.php:1332
423
  msgid "American Samoa"
424
  msgstr "Amerikaans Samoa"
425
 
426
- #: admin/class-admin.php:1333
427
  msgid "Andorra"
428
  msgstr "Andorra"
429
 
430
- #: admin/class-admin.php:1334
431
  msgid "Anguilla"
432
  msgstr "Anguilla"
433
 
434
- #: admin/class-admin.php:1335
435
  msgid "Angola"
436
  msgstr "Angola"
437
 
438
- #: admin/class-admin.php:1336
439
  msgid "Antigua and Barbuda"
440
  msgstr "Antigua en Barbuda"
441
 
442
- #: admin/class-admin.php:1337
443
  msgid "Argentina"
444
  msgstr "Argentinië"
445
 
446
- #: admin/class-admin.php:1338
447
  msgid "Armenia"
448
  msgstr "Armenia"
449
 
450
- #: admin/class-admin.php:1339
451
  msgid "Aruba"
452
  msgstr "Aruba"
453
 
454
- #: admin/class-admin.php:1340
455
  msgid "Australia"
456
  msgstr "Australië"
457
 
458
- #: admin/class-admin.php:1341
459
  msgid "Austria"
460
  msgstr "Oostenrijk"
461
 
462
- #: admin/class-admin.php:1342
463
  msgid "Azerbaijan"
464
  msgstr "Azerbeidzjan"
465
 
466
- #: admin/class-admin.php:1343
467
  msgid "Bahamas"
468
  msgstr "Bahamas"
469
 
470
- #: admin/class-admin.php:1344
471
  msgid "Bahrain"
472
  msgstr "Bahrein"
473
 
474
- #: admin/class-admin.php:1345
475
  msgid "Bangladesh"
476
  msgstr "Bangladesh"
477
 
478
- #: admin/class-admin.php:1346
479
  msgid "Barbados"
480
  msgstr "Barbados"
481
 
482
- #: admin/class-admin.php:1347
483
  msgid "Belarus"
484
  msgstr "Wit-Rusland"
485
 
486
- #: admin/class-admin.php:1348
487
  msgid "Belgium"
488
  msgstr "België"
489
 
490
- #: admin/class-admin.php:1349
491
  msgid "Belize"
492
  msgstr "Belize"
493
 
494
- #: admin/class-admin.php:1350
495
  msgid "Benin"
496
  msgstr "Benin"
497
 
498
- #: admin/class-admin.php:1351
499
  msgid "Bermuda"
500
  msgstr "Bermuda"
501
 
502
- #: admin/class-admin.php:1352
503
  msgid "Bhutan"
504
  msgstr "Bhutan"
505
 
506
- #: admin/class-admin.php:1353
507
  msgid "Bolivia"
508
  msgstr "Bolivia"
509
 
510
- #: admin/class-admin.php:1354
511
  msgid "Bosnia and Herzegovina"
512
  msgstr "Bosnia en Herzegovina"
513
 
514
- #: admin/class-admin.php:1355
515
  msgid "Botswana"
516
  msgstr "Botswana"
517
 
518
- #: admin/class-admin.php:1356
519
  msgid "Brazil"
520
  msgstr "Brazilië"
521
 
522
- #: admin/class-admin.php:1357
523
  msgid "British Indian Ocean Territory"
524
  msgstr "Brits Indische Oceaanterritorium"
525
 
526
- #: admin/class-admin.php:1358
527
  msgid "Brunei"
528
  msgstr "Brunei"
529
 
530
- #: admin/class-admin.php:1359
531
  msgid "Bulgaria"
532
  msgstr "Bulgarije"
533
 
534
- #: admin/class-admin.php:1360
535
  msgid "Burkina Faso"
536
  msgstr "Burkina Faso"
537
 
538
- #: admin/class-admin.php:1361
539
  msgid "Burundi"
540
  msgstr "Burundi"
541
 
542
- #: admin/class-admin.php:1362
543
  msgid "Cambodia"
544
  msgstr "Cambodja"
545
 
546
- #: admin/class-admin.php:1363
547
  msgid "Cameroon"
548
  msgstr "Kameroen"
549
 
550
- #: admin/class-admin.php:1364
551
  msgid "Canada"
552
  msgstr "Canada"
553
 
554
- #: admin/class-admin.php:1365
555
  msgid "Cape Verde"
556
  msgstr "Kaapverdië"
557
 
558
- #: admin/class-admin.php:1366
559
  msgid "Cayman Islands"
560
  msgstr "Kaaimaneilanden"
561
 
562
- #: admin/class-admin.php:1367
563
  msgid "Central African Republic"
564
  msgstr "Centraal-Afrikaanse Republiek"
565
 
566
- #: admin/class-admin.php:1368
567
  msgid "Chad"
568
  msgstr "Chad"
569
 
570
- #: admin/class-admin.php:1369
571
  msgid "Chile"
572
  msgstr "Chili"
573
 
574
- #: admin/class-admin.php:1370
575
  msgid "China"
576
  msgstr "China"
577
 
578
- #: admin/class-admin.php:1371
579
  msgid "Christmas Island"
580
  msgstr "Christmaseiland"
581
 
582
- #: admin/class-admin.php:1372
583
  msgid "Cocos Islands"
584
  msgstr "Cocoseilanden"
585
 
586
- #: admin/class-admin.php:1373
587
  msgid "Colombia"
588
  msgstr "Colombia"
589
 
590
- #: admin/class-admin.php:1374
591
  msgid "Comoros"
592
  msgstr "Comoren"
593
 
594
- #: admin/class-admin.php:1375
595
  msgid "Congo"
596
  msgstr "Congo"
597
 
598
- #: admin/class-admin.php:1376
599
  msgid "Costa Rica"
600
  msgstr "Costa Rica"
601
 
602
- #: admin/class-admin.php:1377
603
  msgid "Côte d'Ivoire"
604
  msgstr "Ivoorkust"
605
 
606
- #: admin/class-admin.php:1378
607
  msgid "Croatia"
608
  msgstr "Kroatië"
609
 
610
- #: admin/class-admin.php:1379
611
  msgid "Cuba"
612
  msgstr "Cuba"
613
 
614
- #: admin/class-admin.php:1380
615
  msgid "Czech Republic"
616
  msgstr "Tsjechië"
617
 
618
- #: admin/class-admin.php:1381
619
  msgid "Denmark"
620
  msgstr "Denemarken"
621
 
622
- #: admin/class-admin.php:1382
623
  msgid "Djibouti"
624
  msgstr "Djibouti"
625
 
626
- #: admin/class-admin.php:1383
627
  msgid "Democratic Republic of the Congo"
628
  msgstr "Democratische Republiek Congo"
629
 
630
- #: admin/class-admin.php:1384
631
  msgid "Dominica"
632
  msgstr "Dominica"
633
 
634
- #: admin/class-admin.php:1385
635
  msgid "Dominican Republic"
636
  msgstr "Dominicaanse Republiek"
637
 
638
- #: admin/class-admin.php:1386
639
  msgid "Ecuador"
640
  msgstr "Ecuador"
641
 
642
- #: admin/class-admin.php:1387
643
  msgid "Egypt"
644
  msgstr "Egypte"
645
 
646
- #: admin/class-admin.php:1388
647
  msgid "El Salvador"
648
  msgstr "El Salvador"
649
 
650
- #: admin/class-admin.php:1389
651
  msgid "Equatorial Guinea"
652
  msgstr "Equatoriaal-Guinea"
653
 
654
- #: admin/class-admin.php:1390
655
  msgid "Eritrea"
656
  msgstr "Eritrea"
657
 
658
- #: admin/class-admin.php:1391
659
  msgid "Estonia"
660
  msgstr "Estland"
661
 
662
- #: admin/class-admin.php:1392
663
  msgid "Ethiopia"
664
  msgstr "Ethiopië"
665
 
666
- #: admin/class-admin.php:1393
667
  msgid "Fiji"
668
  msgstr "Fiji"
669
 
670
- #: admin/class-admin.php:1394
671
  msgid "Finland"
672
  msgstr "Finland"
673
 
674
- #: admin/class-admin.php:1395
675
  msgid "France"
676
  msgstr "Frankrijk"
677
 
678
- #: admin/class-admin.php:1396
679
  msgid "French Guiana"
680
  msgstr "Frans Guyana"
681
 
682
- #: admin/class-admin.php:1397
683
  msgid "Gabon"
684
  msgstr "Gabon"
685
 
686
- #: admin/class-admin.php:1398
687
  msgid "Gambia"
688
  msgstr "Gambia"
689
 
690
- #: admin/class-admin.php:1399
691
  msgid "Germany"
692
  msgstr "Duitsland"
693
 
694
- #: admin/class-admin.php:1400
695
  msgid "Ghana"
696
  msgstr "Ghana"
697
 
698
- #: admin/class-admin.php:1401
699
  msgid "Greenland"
700
  msgstr "Groenland"
701
 
702
- #: admin/class-admin.php:1402
703
  msgid "Greece"
704
  msgstr "Griekenland"
705
 
706
- #: admin/class-admin.php:1403
707
  msgid "Grenada"
708
  msgstr "Grenada"
709
 
710
- #: admin/class-admin.php:1404
711
  msgid "Guam"
712
  msgstr "Guam"
713
 
714
- #: admin/class-admin.php:1405
715
  msgid "Guadeloupe"
716
  msgstr "Guadeloupe"
717
 
718
- #: admin/class-admin.php:1406
719
  msgid "Guatemala"
720
  msgstr "Guatemala"
721
 
722
- #: admin/class-admin.php:1407
723
  msgid "Guinea"
724
  msgstr "Guinee"
725
 
726
- #: admin/class-admin.php:1408
727
  msgid "Guinea-Bissau"
728
  msgstr "Guinee-Bissau"
729
 
730
- #: admin/class-admin.php:1409
731
  msgid "Haiti"
732
  msgstr "Haïti"
733
 
734
- #: admin/class-admin.php:1410
735
  msgid "Honduras"
736
  msgstr "Honduras"
737
 
738
- #: admin/class-admin.php:1411
739
  msgid "Hong Kong"
740
  msgstr "Hong Kong"
741
 
742
- #: admin/class-admin.php:1412
743
  msgid "Hungary"
744
  msgstr "Hongarije"
745
 
746
- #: admin/class-admin.php:1413
747
  msgid "Iceland"
748
  msgstr "IJsland"
749
 
750
- #: admin/class-admin.php:1414
751
  msgid "India"
752
  msgstr "India"
753
 
754
- #: admin/class-admin.php:1415
755
  msgid "Indonesia"
756
  msgstr "Indonesië"
757
 
758
- #: admin/class-admin.php:1416
759
  msgid "Iran"
760
  msgstr "Iran"
761
 
762
- #: admin/class-admin.php:1417
763
  msgid "Iraq"
764
  msgstr "Irak"
765
 
766
- #: admin/class-admin.php:1418
767
  msgid "Ireland"
768
  msgstr "Ierland"
769
 
770
- #: admin/class-admin.php:1419
771
  msgid "Israel"
772
  msgstr "Israël"
773
 
774
- #: admin/class-admin.php:1420
775
  msgid "Italy"
776
  msgstr "Italië"
777
 
778
- #: admin/class-admin.php:1421
779
  msgid "Jamaica"
780
  msgstr "Jamaica"
781
 
782
- #: admin/class-admin.php:1422
783
  msgid "Japan"
784
  msgstr "Japan"
785
 
786
- #: admin/class-admin.php:1423
787
  msgid "Jordan"
788
  msgstr "Jordanië"
789
 
790
- #: admin/class-admin.php:1424
791
  msgid "Kazakhstan"
792
  msgstr "Kazachstan"
793
 
794
- #: admin/class-admin.php:1425
795
  msgid "Kenya"
796
  msgstr "Kenia"
797
 
798
- #: admin/class-admin.php:1426
799
  msgid "Kuwait"
800
  msgstr "Koeweit"
801
 
802
- #: admin/class-admin.php:1427
803
  msgid "Kyrgyzstan"
804
  msgstr "Kirgizië"
805
 
806
- #: admin/class-admin.php:1428
807
  msgid "Laos"
808
  msgstr "Laos"
809
 
810
- #: admin/class-admin.php:1429
811
  msgid "Latvia"
812
  msgstr "Letland"
813
 
814
- #: admin/class-admin.php:1430
815
  msgid "Lebanon"
816
  msgstr "Libanon"
817
 
818
- #: admin/class-admin.php:1431
819
  msgid "Lesotho"
820
  msgstr "Lesotho"
821
 
822
- #: admin/class-admin.php:1432
823
  msgid "Liberia"
824
  msgstr "Liberia"
825
 
826
- #: admin/class-admin.php:1433
827
  msgid "Libya"
828
  msgstr "Libië"
829
 
830
- #: admin/class-admin.php:1434
831
  msgid "Liechtenstein"
832
  msgstr "Liechtenstein"
833
 
834
- #: admin/class-admin.php:1435
835
  msgid "Lithuania"
836
  msgstr "Litouwen"
837
 
838
- #: admin/class-admin.php:1436
839
  msgid "Luxembourg"
840
  msgstr "Luxemburg"
841
 
842
- #: admin/class-admin.php:1437
843
  msgid "Macau"
844
  msgstr "Macau"
845
 
846
- #: admin/class-admin.php:1438
847
  msgid "Macedonia"
848
  msgstr "Macedonië"
849
 
850
- #: admin/class-admin.php:1439
851
  msgid "Madagascar"
852
  msgstr "Madagascar"
853
 
854
- #: admin/class-admin.php:1440
855
  msgid "Malawi"
856
  msgstr "Malawi"
857
 
858
- #: admin/class-admin.php:1441
859
  msgid "Malaysia "
860
  msgstr "Maleisie"
861
 
862
- #: admin/class-admin.php:1442
863
  msgid "Mali"
864
  msgstr "Mali"
865
 
866
- #: admin/class-admin.php:1443
867
  msgid "Marshall Islands"
868
  msgstr "Marshalleilanden"
869
 
870
- #: admin/class-admin.php:1444
871
  msgid "Martinique"
872
  msgstr "Martinique"
873
 
874
- #: admin/class-admin.php:1445
875
  msgid "Mauritania"
876
  msgstr "Mauritanië"
877
 
878
- #: admin/class-admin.php:1446
879
  msgid "Mauritius"
880
  msgstr "Mauritius"
881
 
882
- #: admin/class-admin.php:1447
883
  msgid "Mexico"
884
  msgstr "Mexico"
885
 
886
- #: admin/class-admin.php:1448
887
  msgid "Micronesia"
888
  msgstr "Micronesia"
889
 
890
- #: admin/class-admin.php:1449
891
  msgid "Moldova"
892
  msgstr "Moldavië"
893
 
894
- #: admin/class-admin.php:1450
895
  msgid "Monaco"
896
  msgstr "Monaco"
897
 
898
- #: admin/class-admin.php:1451
899
  msgid "Mongolia"
900
  msgstr "Mongolië"
901
 
902
- #: admin/class-admin.php:1452
903
  msgid "Montenegro"
904
  msgstr "Montenegro"
905
 
906
- #: admin/class-admin.php:1453
907
  msgid "Montserrat"
908
  msgstr "Montserrat "
909
 
910
- #: admin/class-admin.php:1454
911
  msgid "Morocco"
912
  msgstr "Marokko"
913
 
914
- #: admin/class-admin.php:1455
915
  msgid "Mozambique"
916
  msgstr "Mozambique"
917
 
918
- #: admin/class-admin.php:1456
919
  msgid "Myanmar"
920
  msgstr "Myanmar"
921
 
922
- #: admin/class-admin.php:1457
923
  msgid "Namibia"
924
  msgstr "Namibië"
925
 
926
- #: admin/class-admin.php:1458
927
  msgid "Nauru"
928
  msgstr "Nauru"
929
 
930
- #: admin/class-admin.php:1459
931
  msgid "Nepal"
932
  msgstr "Nepal"
933
 
934
- #: admin/class-admin.php:1460
935
  msgid "Netherlands"
936
  msgstr "Nederland"
937
 
938
- #: admin/class-admin.php:1461
939
  msgid "Netherlands Antilles"
940
  msgstr "Nederlandse Antillen"
941
 
942
- #: admin/class-admin.php:1462
943
  msgid "New Zealand"
944
  msgstr "Nieuw Zeeland"
945
 
946
- #: admin/class-admin.php:1463
947
  msgid "Nicaragua"
948
  msgstr "Nicaragua"
949
 
950
- #: admin/class-admin.php:1464
951
  msgid "Niger"
952
  msgstr "Niger"
953
 
954
- #: admin/class-admin.php:1465
955
  msgid "Nigeria"
956
  msgstr "Nigeria"
957
 
958
- #: admin/class-admin.php:1466
959
  msgid "Niue"
960
  msgstr "Niue"
961
 
962
- #: admin/class-admin.php:1467
963
  msgid "Northern Mariana Islands"
964
  msgstr "Noordelijke Marianen"
965
 
966
- #: admin/class-admin.php:1468
967
  msgid "Norway"
968
  msgstr "Noorwegen"
969
 
970
- #: admin/class-admin.php:1469
971
  msgid "Oman"
972
  msgstr "Oman"
973
 
974
- #: admin/class-admin.php:1470
975
  msgid "Pakistan"
976
  msgstr "Pakistan"
977
 
978
- #: admin/class-admin.php:1471
979
  msgid "Panama"
980
  msgstr "Panama"
981
 
982
- #: admin/class-admin.php:1472
983
  msgid "Papua New Guinea"
984
  msgstr "Papoea-Nieuw-Guinea"
985
 
986
- #: admin/class-admin.php:1473
987
  msgid "Paraguay"
988
  msgstr "Paraguay"
989
 
990
- #: admin/class-admin.php:1474
991
  msgid "Peru"
992
  msgstr "Peru"
993
 
994
- #: admin/class-admin.php:1475
995
  msgid "Philippines"
996
  msgstr "Filipijnen"
997
 
998
- #: admin/class-admin.php:1476
999
  msgid "Pitcairn Islands"
1000
  msgstr "Pitcairneilanden"
1001
 
1002
- #: admin/class-admin.php:1477
1003
  msgid "Poland"
1004
  msgstr "Polen"
1005
 
1006
- #: admin/class-admin.php:1478
1007
  msgid "Portugal"
1008
  msgstr "Portugal"
1009
 
1010
- #: admin/class-admin.php:1479
1011
  msgid "Qatar"
1012
  msgstr "Qatar"
1013
 
1014
- #: admin/class-admin.php:1480
1015
  msgid "Reunion"
1016
  msgstr "Réunion"
1017
 
1018
- #: admin/class-admin.php:1481
1019
  msgid "Romania"
1020
  msgstr "Roemenië"
1021
 
1022
- #: admin/class-admin.php:1482
1023
  msgid "Russia"
1024
  msgstr "Rusland"
1025
 
1026
- #: admin/class-admin.php:1483
1027
  msgid "Rwanda"
1028
  msgstr "Rwanda"
1029
 
1030
- #: admin/class-admin.php:1484
1031
  msgid "Saint Helena"
1032
  msgstr "Sint-Helena"
1033
 
1034
- #: admin/class-admin.php:1485
1035
  msgid "Saint Kitts and Nevis"
1036
  msgstr "Saint Kitts en Nevis"
1037
 
1038
- #: admin/class-admin.php:1486
1039
  msgid "Saint Vincent and the Grenadines"
1040
  msgstr "Saint Vincent en de Grenadines"
1041
 
1042
- #: admin/class-admin.php:1487
1043
  msgid "Saint Lucia"
1044
  msgstr "Saint Lucia"
1045
 
1046
- #: admin/class-admin.php:1488
1047
  msgid "Samoa"
1048
  msgstr "Samoa"
1049
 
1050
- #: admin/class-admin.php:1489
1051
  msgid "San Marino"
1052
  msgstr "San Marino"
1053
 
1054
- #: admin/class-admin.php:1490
1055
  msgid "São Tomé and Príncipe"
1056
  msgstr "Sao Tomé en Principe"
1057
 
1058
- #: admin/class-admin.php:1491
1059
  msgid "Saudi Arabia"
1060
  msgstr "Saoedi-Arabië"
1061
 
1062
- #: admin/class-admin.php:1492
1063
  msgid "Senegal"
1064
  msgstr "Senegal"
1065
 
1066
- #: admin/class-admin.php:1493
1067
  msgid "Serbia"
1068
  msgstr "Servië"
1069
 
1070
- #: admin/class-admin.php:1494
1071
  msgid "Seychelles"
1072
  msgstr "Seychellen"
1073
 
1074
- #: admin/class-admin.php:1495
1075
  msgid "Sierra Leone"
1076
  msgstr "Sierra Leone"
1077
 
1078
- #: admin/class-admin.php:1496
1079
  msgid "Singapore"
1080
  msgstr "Singapore"
1081
 
1082
- #: admin/class-admin.php:1497
1083
  msgid "Slovakia"
1084
  msgstr "Slowakije"
1085
 
1086
- #: admin/class-admin.php:1498
1087
  msgid "Solomon Islands"
1088
  msgstr "Salomonseilanden"
1089
 
1090
- #: admin/class-admin.php:1499
1091
  msgid "Somalia"
1092
  msgstr "Somalie"
1093
 
1094
- #: admin/class-admin.php:1500
1095
  msgid "South Africa"
1096
  msgstr "Zuid Afrika"
1097
 
1098
- #: admin/class-admin.php:1501
1099
  msgid "South Korea"
1100
  msgstr "Zuid Korea"
1101
 
1102
- #: admin/class-admin.php:1502
1103
  msgid "Spain"
1104
  msgstr "Spanje"
1105
 
1106
- #: admin/class-admin.php:1503
1107
  msgid "Sri Lanka"
1108
  msgstr "Sri Lanka"
1109
 
1110
- #: admin/class-admin.php:1504
1111
  msgid "Sudan"
1112
  msgstr "Sudan"
1113
 
1114
- #: admin/class-admin.php:1505
1115
  msgid "Swaziland"
1116
  msgstr "Swaziland "
1117
 
1118
- #: admin/class-admin.php:1506
1119
  msgid "Sweden"
1120
  msgstr "Zweden"
1121
 
1122
- #: admin/class-admin.php:1507
1123
  msgid "Switzerland"
1124
  msgstr "Zwitserland"
1125
 
1126
- #: admin/class-admin.php:1508
1127
  msgid "Syria"
1128
  msgstr "Syrië"
1129
 
1130
- #: admin/class-admin.php:1509
1131
  msgid "Taiwan"
1132
  msgstr "Taiwan"
1133
 
1134
- #: admin/class-admin.php:1510
1135
  msgid "Tajikistan"
1136
  msgstr "Tajikistan"
1137
 
1138
- #: admin/class-admin.php:1511
1139
  msgid "Tanzania"
1140
  msgstr "Tanzania"
1141
 
1142
- #: admin/class-admin.php:1512
1143
  msgid "Thailand"
1144
  msgstr "Thailand"
1145
 
1146
- #: admin/class-admin.php:1513
1147
  msgid "Timor-Leste"
1148
  msgstr "Oost-Timor"
1149
 
1150
- #: admin/class-admin.php:1514
1151
  msgid "Tokelau"
1152
  msgstr "Tokelau"
1153
 
1154
- #: admin/class-admin.php:1515
1155
  msgid "Togo"
1156
  msgstr "Togo"
1157
 
1158
- #: admin/class-admin.php:1516
1159
  msgid "Tonga"
1160
  msgstr "Tonga"
1161
 
1162
- #: admin/class-admin.php:1517
1163
  msgid "Trinidad and Tobago"
1164
  msgstr "Trinidad en Tobago"
1165
 
1166
- #: admin/class-admin.php:1518
1167
  msgid "Tunisia"
1168
  msgstr "Tunesië"
1169
 
1170
- #: admin/class-admin.php:1519
1171
  msgid "Turkey"
1172
  msgstr "Turkije"
1173
 
1174
- #: admin/class-admin.php:1520
1175
  msgid "Turkmenistan"
1176
  msgstr "Turkmenistan"
1177
 
1178
- #: admin/class-admin.php:1521
1179
  msgid "Tuvalu"
1180
  msgstr "Tuvalu"
1181
 
1182
- #: admin/class-admin.php:1522
1183
  msgid "Uganda"
1184
  msgstr "Uganda"
1185
 
1186
- #: admin/class-admin.php:1523
1187
  msgid "Ukraine"
1188
  msgstr "Oekraïne"
1189
 
1190
- #: admin/class-admin.php:1524
1191
  msgid "United Arab Emirates"
1192
  msgstr "Verenigde Arabische Emiraten"
1193
 
1194
- #: admin/class-admin.php:1525
1195
  msgid "United Kingdom"
1196
  msgstr "Verenigd Koninkrijk"
1197
 
1198
- #: admin/class-admin.php:1526
1199
  msgid "United States"
1200
  msgstr "Verenigde Staten"
1201
 
1202
- #: admin/class-admin.php:1527
1203
  msgid "Uruguay"
1204
  msgstr "Uruguay"
1205
 
1206
- #: admin/class-admin.php:1528
1207
  msgid "Uzbekistan"
1208
  msgstr "Uzbekistan"
1209
 
1210
- #: admin/class-admin.php:1529
1211
  msgid "Wallis Futuna"
1212
  msgstr "Wallis en Futuna"
1213
 
1214
- #: admin/class-admin.php:1530
1215
  msgid "Venezuela"
1216
  msgstr "Venezuela"
1217
 
1218
- #: admin/class-admin.php:1531
1219
  msgid "Vietnam"
1220
  msgstr "Vietnam"
1221
 
1222
- #: admin/class-admin.php:1532
1223
  msgid "Yemen"
1224
  msgstr "Yemen"
1225
 
1226
- #: admin/class-admin.php:1533
1227
  msgid "Zambia"
1228
  msgstr "Zambia"
1229
 
1230
- #: admin/class-admin.php:1534
1231
  msgid "Zimbabwe"
1232
  msgstr "Zimbabwe"
1233
 
1234
- #: admin/class-admin.php:1607
1235
- msgid "Cannot determine the address at this location."
1236
- msgstr "Er kan geen adres gevonden worden voor deze locatie."
1237
 
1238
- #: admin/class-admin.php:1608
1239
- msgid "Geocode was not successful for the following reason: "
1240
- msgstr "Geocode was niet succesvol om de volgende reden:"
 
1241
 
1242
- #: admin/class-admin.php:1609
1243
- msgid "Security check failed, reload the page and try again."
1244
- msgstr ""
1245
- "Beveiligings controle mislukt, herlaad de pagina en probeer het nog een keer."
1246
 
1247
- #: admin/class-store-overview.php:30
1248
- msgid "Store"
1249
- msgstr "Locatie"
1250
 
1251
- #: admin/class-store-overview.php:65
1252
- msgid "No stores found"
1253
- msgstr "Geen locaties gevonden"
1254
 
1255
- #: admin/class-store-overview.php:95
1256
- msgid "Active"
1257
- msgstr "Actief"
1258
 
1259
- #: admin/class-store-overview.php:95
1260
- msgid "Inactive"
1261
- msgstr "Niet actief"
1262
 
1263
- #: admin/class-store-overview.php:97
1264
- msgid "Edit"
1265
- msgstr "Bewerk"
1266
 
1267
- #: admin/class-store-overview.php:97 admin/class-store-overview.php:171
1268
- #: admin/class-store-overview.php:420
1269
- msgid "Delete"
1270
- msgstr "Verwijder"
1271
 
1272
- #: admin/class-store-overview.php:135
1273
- msgid "ID"
1274
- msgstr "ID"
1275
 
1276
- #: admin/class-store-overview.php:136
1277
- msgid "Thumbnail"
1278
- msgstr "Afbeelding"
1279
 
1280
- #: admin/class-store-overview.php:137
1281
- msgid "Name"
1282
- msgstr "Naam"
1283
 
1284
- #: admin/class-store-overview.php:138
1285
- msgid "Address"
1286
- msgstr "Adres"
1287
 
1288
- #: admin/class-store-overview.php:139
1289
- msgid "City"
1290
- msgstr "Stad"
1291
 
1292
- #: admin/class-store-overview.php:140
1293
- msgid "State"
1294
- msgstr "Provincie"
1295
 
1296
- #: admin/class-store-overview.php:141
1297
- msgid "Zip"
1298
- msgstr "Postcode"
1299
 
1300
- #: admin/class-store-overview.php:142
1301
- msgid "Status"
1302
- msgstr "Status"
1303
 
1304
- #: admin/class-store-overview.php:143
1305
- msgid "Actions"
1306
- msgstr "Acties"
 
 
 
 
 
1307
 
1308
- #: admin/class-store-overview.php:172
1309
- msgid "Activate"
1310
- msgstr "Activeer"
1311
 
1312
- #: admin/class-store-overview.php:173
1313
- msgid "Deactivate"
1314
- msgstr "Deactiveer"
1315
 
1316
- #: admin/class-store-overview.php:193
1317
- msgid "deactivated"
1318
- msgstr "gedeactiveerd"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1319
 
1320
- #: admin/class-store-overview.php:194
1321
- msgid "deactivating"
1322
- msgstr "gedeactiveerd"
1323
 
1324
- #: admin/class-store-overview.php:197
1325
- msgid "activated"
1326
- msgstr "geactiveerd"
1327
 
1328
- #: admin/class-store-overview.php:198
1329
- msgid "activating"
1330
- msgstr "activeren"
1331
 
1332
- #: admin/class-store-overview.php:205
 
 
 
 
 
 
 
 
 
 
 
 
1333
  #, php-format
1334
- msgid "There was a problem %s the store(s), please try again."
 
 
 
1335
  msgstr ""
1336
- "Er is een probleem met het %s van de locatie(s), probeer het nog een keer."
 
 
 
 
1337
 
1338
- #: admin/class-store-overview.php:209
 
 
 
 
1339
  #, php-format
1340
- msgid "Store(s) successfully %s."
1341
- msgstr "Locatie(s) succesvol %s."
 
 
 
 
 
 
1342
 
1343
- #: admin/class-store-overview.php:230
1344
- msgid "There was a problem removing the store(s), please try again."
1345
- msgstr "De locatie(s) konden niet worden verwijderd, probeer het nog een keer."
1346
 
1347
- #: admin/class-store-overview.php:233
1348
- msgid "Store(s) successfully removed."
1349
- msgstr "Locatie(s) succesvol verwijderd."
1350
 
1351
- #: admin/class-store-overview.php:418
1352
- msgid "Are you sure you want to delete this store?"
1353
- msgstr "Weet je zeker dat je deze locatie wilt verwijderen?"
 
 
 
 
 
 
 
 
1354
 
1355
- #: admin/class-store-overview.php:421
1356
- msgid "Cancel"
1357
- msgstr "Annuleer"
1358
 
1359
- #: admin/templates/add-store.php:13 admin/templates/edit-store.php:23
1360
- msgid "Store details"
1361
- msgstr "Locatie details"
1362
 
1363
- #: admin/templates/add-store.php:16 admin/templates/edit-store.php:35
1364
- msgid "Store Name:"
1365
- msgstr "Naam:"
1366
 
1367
- #: admin/templates/add-store.php:20 admin/templates/edit-store.php:39
1368
- msgid "Address:"
1369
- msgstr "Adres:"
1370
 
1371
- #: admin/templates/add-store.php:24 admin/templates/edit-store.php:43
1372
- msgid "Address 2:"
1373
- msgstr "Adres 2:"
1374
 
1375
- #: admin/templates/add-store.php:28 admin/templates/edit-store.php:47
1376
- msgid "City:"
1377
- msgstr "Stad:"
1378
 
1379
- #: admin/templates/add-store.php:32 admin/templates/edit-store.php:51
1380
- msgid "State / Province:"
1381
- msgstr "Provincie:"
1382
 
1383
- #: admin/templates/add-store.php:36 admin/templates/edit-store.php:55
1384
- msgid "Zip Code:"
1385
- msgstr "Postcode:"
1386
 
1387
- #: admin/templates/add-store.php:40 admin/templates/edit-store.php:59
1388
- msgid "Country:"
1389
- msgstr "Land:"
1390
 
1391
- #: admin/templates/add-store.php:45 admin/templates/edit-store.php:64
1392
- msgid "Latitude:"
1393
- msgstr "Breedtegraad:"
1394
 
1395
- #: admin/templates/add-store.php:49 admin/templates/edit-store.php:68
1396
- msgid "Longitude:"
1397
- msgstr "Lengtegraad:"
1398
 
1399
- #: admin/templates/add-store.php:53 admin/templates/edit-store.php:72
1400
- msgid "Preview location on the map"
1401
- msgstr "Bekijk voorbeeld op de kaart"
1402
 
1403
- #: admin/templates/add-store.php:54 admin/templates/edit-store.php:73
1404
- msgid "You can adjust the location by dragging the marker around"
1405
- msgstr "Je kan de locatie aanpassen door de marker te verslepen"
 
 
 
 
1406
 
1407
- #: admin/templates/add-store.php:65 admin/templates/edit-store.php:84
1408
- msgid "Extra details"
1409
- msgstr "Extra informatie"
 
 
 
 
 
 
 
1410
 
1411
- #: admin/templates/add-store.php:68 admin/templates/edit-store.php:87
1412
- #: admin/templates/map-settings.php:277
1413
- msgid "Phone:"
1414
- msgstr "Telefoon:"
 
 
 
 
1415
 
1416
- #: admin/templates/add-store.php:72 admin/templates/edit-store.php:91
1417
- #: admin/templates/map-settings.php:281
1418
- msgid "Fax:"
1419
- msgstr "Fax:"
 
 
 
1420
 
1421
- #: admin/templates/add-store.php:76 admin/templates/edit-store.php:95
1422
- msgid "Email:"
1423
- msgstr "E-mail:"
 
 
 
1424
 
1425
- #: admin/templates/add-store.php:80 admin/templates/edit-store.php:99
1426
- msgid "Url:"
1427
- msgstr "Url:"
1428
 
1429
- #: admin/templates/add-store.php:84 admin/templates/edit-store.php:103
1430
- msgid "Description:"
1431
- msgstr "Omschrijving:"
1432
 
1433
- #: admin/templates/add-store.php:88 admin/templates/edit-store.php:107
1434
- msgid "Operation Hours:"
1435
- msgstr "Openings- tijden:"
1436
 
1437
- #: admin/templates/add-store.php:94 admin/templates/edit-store.php:113
1438
- msgid "Thumbnail:"
1439
- msgstr "Afbeelding:"
1440
 
1441
- #: admin/templates/add-store.php:98 admin/templates/edit-store.php:125
1442
- msgid "Change thumbnail"
1443
- msgstr "Wijzig afbeelding"
1444
 
1445
- #: admin/templates/add-store.php:99 admin/templates/edit-store.php:126
1446
- msgid "Remove"
1447
- msgstr "Verwijder"
1448
 
1449
- #: admin/templates/edit-store.php:14
1450
- msgid "Edit "
1451
- msgstr "Bewerk "
 
 
 
 
 
1452
 
1453
- #: admin/templates/edit-store.php:26
1454
- msgid "Status:"
1455
- msgstr "Status:"
1456
 
1457
- #: admin/templates/edit-store.php:29
1458
- msgid "active"
1459
- msgstr "actief"
1460
 
1461
- #: admin/templates/edit-store.php:31
1462
- msgid "inactive"
1463
- msgstr "niet actief"
1464
 
1465
- #: admin/templates/edit-store.php:135
1466
- msgid "Update Store"
1467
- msgstr "Locatie Bijwerken"
 
 
 
 
1468
 
1469
- #: admin/templates/faq.php:6
1470
- msgid "How do I show the store locator on my page?"
1471
- msgstr "Hoe plaatst ik de store locator op een pagina?"
1472
 
1473
- #: admin/templates/faq.php:8
 
1474
  msgid ""
1475
- "Add this shortcode <code>[wpsl]</code> to the page where you want to show "
1476
- "the store locator."
 
 
1477
  msgstr ""
1478
- "Voeg deze shortcode <code>[wpsl]</code> toe aan de pagina waar je de store "
1479
- "locator wil tonen."
 
 
 
 
 
 
 
 
 
 
1480
 
1481
- #: admin/templates/faq.php:12
 
1482
  msgid ""
1483
- "The map doesn't display properly. It's either broken in half or doesn't load "
1484
- "at all."
1485
  msgstr ""
1486
- "De kaart is niet goed zichtbaar. Hij wordt niet geladen, of is maar voor de "
1487
- "helft zichtbaar."
 
 
 
 
1488
 
1489
- #: admin/templates/faq.php:14
1490
  msgid ""
1491
- "Make sure you have defined a start point for the map under settings -> map "
1492
- "settings."
1493
  msgstr ""
1494
- "Zorg dat er een start locatie is opgegeven op de instellingen pagina -> "
1495
- "kaart instellingen."
1496
 
1497
- #: admin/templates/faq.php:18
 
1498
  msgid ""
1499
- "I get an error saying the \"sensor\" parameter specified in the request must "
1500
- "be set to either \"true\" or \"false\"."
 
1501
  msgstr ""
1502
- "Ik krijg de volgende foutmelding, the \"sensor\" parameter specified in the "
1503
- "request must be set to either \"true\" or \"false\"."
 
 
 
 
 
 
1504
 
1505
- #: admin/templates/faq.php:20
 
1506
  msgid ""
1507
- "Make sure you don't have any security plugins, or custom functions running "
1508
- "that strip away version numbers from file paths."
1509
  msgstr ""
1510
- "Zorg ervoor dat je geen beveiligings plugins, of custom functies hebt die "
1511
- "versie nummers van de bestands paden weghalen."
1512
 
1513
- #: admin/templates/faq.php:24
1514
- msgid "The store locator doesn't load, it only shows the number 1?"
1515
- msgstr "De store locator laadt niet, het toont alleen een '1'?"
 
1516
 
1517
- #: admin/templates/faq.php:26
 
1518
  msgid ""
1519
- "This is most likely caused by your theme using ajax navigation ( the loading "
1520
- "of content without reloading the page ), or a conflict with another plugin. "
1521
- "Try to disable the ajax navigation in the theme settings, or deactivate the "
1522
- "plugin that enables it to see if that solves the problem."
1523
  msgstr ""
1524
- "Dit wordt waarschijnlijk veroorzaakt doordat je theme ajax navigatie "
1525
- "gebruikt ( het laden van nieuwe content zonder dat de pagina zelf opnieuw "
1526
- "geladen wordt ), of door een conflict met een andere plugin. Probeer de ajax "
1527
- "navigatie in je theme uit te zetten, of deactiveer de plugin die de "
1528
- "functionaliteit toevoegd om te kijken ofdat dat het probleem oplost."
1529
 
1530
- #: admin/templates/faq.php:27
 
 
 
 
 
1531
  msgid ""
1532
- "If you don't use ajax navigation, but do see the number 1 it's probably a "
1533
- "conflict with another plugin. Try to disable the plugins one by one to see "
1534
- "if one of them is causing a conflict."
 
 
 
 
 
 
 
 
 
 
 
1535
  msgstr ""
1536
- "Als je geen ajax navigatie gebruikt, maar wel het getal '1' ziet dan is het "
1537
- "waarschijnlijk een conflict met een andere plugin. Probeer alle plugins een "
1538
- "voor een te deactiveren om te kijken welke plugin het probleem veroorzaakt."
1539
 
1540
- #: admin/templates/faq.php:28
1541
  #, php-format
1542
  msgid ""
1543
- "If you find a plugin or theme that causes a conflict, please report it on "
1544
- "the <a href=\"%s\">support page</a>."
 
 
 
1545
  msgstr ""
1546
- "Als je een plugin of theme tegenkomt dat een probleem veroorzaakt, meld het "
1547
- "dan op de <a href=\"%s\">support pagina</a>."
 
 
 
1548
 
1549
- #: admin/templates/faq.php:32
1550
- msgid "Why does it show the location I searched for in the wrong country?"
1551
- msgstr "Waarom toont het de locatie waar ik op zocht in het verkeerde land?"
1552
 
1553
- #: admin/templates/faq.php:34
 
1554
  msgid ""
1555
- "Some location names exist in more then one country, and Google will guess "
1556
- "which one you mean. This can be fixed by setting the correct \"Map Region\" "
1557
- "on the settings page -> \"API Settings\"."
1558
  msgstr ""
1559
- "Sommige locatie namen komen in meerdere landen voor, en daardoor kan het "
1560
- "gebeuren dat Google de locatie in het verkeerde land kiest. Dit kan opgelost "
1561
- "worden door de juiste \"Kaart regio\" in te stellen op de instellingen "
1562
- "pagina onder \"API Instellingen\"."
1563
 
1564
- #: admin/templates/map-settings.php:16
1565
- msgid "API Settings"
1566
- msgstr "API Instellingen"
1567
 
1568
- #: admin/templates/map-settings.php:19
1569
- msgid "API key:"
1570
- msgstr "API sleutel:"
1571
 
1572
- #: admin/templates/map-settings.php:20
1573
- msgid "Optional"
1574
- msgstr "Optioneel"
1575
 
1576
- #: admin/templates/map-settings.php:23
1577
- msgid "Map language:"
1578
- msgstr "Kaart taal:"
1579
 
1580
- #: admin/templates/map-settings.php:29
1581
- msgid "Map region:"
1582
- msgstr "Kaart regio:"
 
 
 
 
1583
 
1584
- #: admin/templates/map-settings.php:34
 
 
 
 
1585
  #, php-format
1586
  msgid ""
1587
- "* A valid <a href=\"%s\">API key</a> allows you to monitor the API usage "
1588
- "<br> and is required if you need to purchase additional quota."
1589
  msgstr ""
1590
- "* Een geldige <a href=\"%s\">API sleutel</a> maakt het mogelijk om het "
1591
- "gebruik van de API in de gaten te houden, en is verplicht als je de API "
1592
- "limiet wil verhogen."
 
 
 
 
1593
 
1594
- #: admin/templates/map-settings.php:43
1595
- msgid "Search Settings"
1596
- msgstr "Zoek Instellingen"
1597
 
1598
- #: admin/templates/map-settings.php:46
1599
- msgid "Distance unit:"
1600
- msgstr "Afstands eenheid:"
1601
 
1602
- #: admin/templates/map-settings.php:50
1603
- msgid "Max search results:"
1604
- msgstr "Max zoek resultaten:"
1605
 
1606
- #: admin/templates/map-settings.php:54
1607
- msgid "Search radius options:"
1608
- msgstr "Zoek radius opties:"
1609
 
1610
- #: admin/templates/map-settings.php:58
 
1611
  msgid ""
1612
- "If a user hovers over the search results, the corresponding marker will "
1613
- "bounce?"
1614
  msgstr ""
1615
- "Als een gebruiker over de zoekresultaten beweegt met zijn muis, dan beweegt "
1616
- "de bijbehorende marker? "
1617
 
1618
- #: admin/templates/map-settings.php:61
1619
- msgid "* The default value is set between the ( )"
1620
- msgstr "* De standaard waarde staat tussen de ( )"
1621
 
1622
- #: admin/templates/map-settings.php:70
1623
- msgid "Map Settings"
1624
- msgstr "Kaart Instellingen"
1625
 
1626
- #: admin/templates/map-settings.php:73
1627
- msgid "Attempt to auto-locate the user:"
1628
- msgstr "Probeer de locatie van de gebruiker automatische te achterhalen:"
 
 
 
 
 
 
1629
 
1630
- #: admin/templates/map-settings.php:77
1631
- msgid "Load all stores on page load:"
1632
- msgstr "Toon all locaties op de kaart zodra de pagina geladen is:"
1633
 
1634
- #: admin/templates/map-settings.php:81
1635
- msgid "Start point: *"
1636
- msgstr "Start locatie: *"
1637
 
1638
- #: admin/templates/map-settings.php:86
1639
- msgid "Zoom level:"
1640
- msgstr "Zoom niveau:"
1641
 
1642
- #: admin/templates/map-settings.php:90
1643
- msgid "Map type:"
1644
- msgstr "Kaart type:"
1645
 
1646
- #: admin/templates/map-settings.php:94
1647
- msgid "Show the street view controls?"
1648
- msgstr "Toon de street view controls?"
 
1649
 
1650
- #: admin/templates/map-settings.php:98
1651
- msgid "Show the pan controls?"
1652
- msgstr "Toon de pan controls?"
1653
 
1654
- #: admin/templates/map-settings.php:102
1655
- msgid "Position of the map controls:"
1656
- msgstr "Positie van de kaart opties:"
 
 
1657
 
1658
- #: admin/templates/map-settings.php:105
1659
- msgid "Left"
1660
- msgstr "links"
 
 
1661
 
1662
- #: admin/templates/map-settings.php:107
1663
- msgid "Right"
1664
- msgstr "rechts"
 
1665
 
1666
- #: admin/templates/map-settings.php:111
1667
- msgid "Zoom control style:"
1668
- msgstr "Zoom control style:"
1669
 
1670
- #: admin/templates/map-settings.php:114
1671
- msgid "Small"
1672
- msgstr "klein"
 
1673
 
1674
- #: admin/templates/map-settings.php:116
1675
- msgid "Large"
1676
- msgstr "groot"
 
 
1677
 
1678
- #: admin/templates/map-settings.php:119
1679
- msgid ""
1680
- "* Required field. If auto-locating the user is disabled or fails, the center "
1681
- "of the provided city or country will be used as the initial starting point "
1682
- "for the user."
1683
- msgstr ""
1684
- "* Verplicht veld. Als het automatische achterhalen van de gebruikers locatie "
1685
- "is uitgeschakeld of mislukt, dan wordt het middelpunt van de opgegeven "
1686
- "locatie als begin punt gebruikt."
1687
 
1688
- #: admin/templates/map-settings.php:128
1689
- msgid "Design Settings"
1690
- msgstr "Design Instellingen"
1691
 
1692
- #: admin/templates/map-settings.php:131
1693
- msgid "Store Locator height"
1694
- msgstr "Store Locator hoogte"
 
 
 
1695
 
1696
- #: admin/templates/map-settings.php:135
1697
- msgid "Max width for the infowindow"
1698
- msgstr "Max breedte voor de infowindow"
 
 
1699
 
1700
- #: admin/templates/map-settings.php:139
1701
- msgid "Search field width"
1702
- msgstr "Zoekveld breedte"
 
1703
 
1704
- #: admin/templates/map-settings.php:143
1705
- msgid "Search and radius label width *"
1706
- msgstr "Zoek en radius label breedte *"
1707
 
1708
- #: admin/templates/map-settings.php:147
1709
- msgid "Select template"
1710
- msgstr "Selecteer template"
 
1711
 
1712
- #: admin/templates/map-settings.php:151
1713
- msgid "Hide the scrollbar?"
1714
- msgstr "Verberg de scrollbar?"
1715
 
1716
- #: admin/templates/map-settings.php:155
1717
- msgid "Show the limit results dropdown?"
1718
- msgstr "Toon de limiteer resultaten dropdown?"
 
1719
 
1720
- #: admin/templates/map-settings.php:159
1721
- msgid "Open links in a new window?"
1722
- msgstr "Open links in een nieuw venster?"
 
 
1723
 
1724
- #: admin/templates/map-settings.php:163
1725
- msgid "Show a reset map button?"
1726
- msgstr "Toon een knop om de kaart te resetten?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1727
 
1728
- #: admin/templates/map-settings.php:167
 
1729
  msgid ""
1730
- "When a user clicks on \"Directions\", open a new window and show the route "
1731
- "on maps.google.com"
1732
  msgstr ""
1733
- "Zodra een gebruiker op \"Route\" klikt, open een nieuwe venster en toon de "
1734
- "route op maps.google.com"
1735
 
1736
- #: admin/templates/map-settings.php:171
1737
- msgid "Show a \"More info\" link in the store listings?"
1738
- msgstr "Toon een \"Meer info\" link in de locatie lijst?"
 
1739
 
1740
- #: admin/templates/map-settings.php:175
1741
- msgid "Where do you want to show the \"More info\" details?"
1742
- msgstr "Waar wil je de \"Meer info\" details tonen?"
1743
 
1744
- #: admin/templates/map-settings.php:179
1745
- msgid "If a store url exists, make the store name clickable?"
1746
- msgstr "Als een locatie url bestaat, maak de locatie naam dan klikbaar?"
1747
 
1748
- #: admin/templates/map-settings.php:183
1749
- msgid "Make the phone number clickable on mobile devices?"
1750
- msgstr "Maak het telefoonnummer klikbaar op mobiele apparaten?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1751
 
1752
- #: admin/templates/map-settings.php:187
 
 
 
 
 
 
 
 
 
 
 
 
 
1753
  msgid ""
1754
- "If available for the current location, show a link to enable street view "
1755
- "from the infowindow?"
1756
  msgstr ""
1757
- "Als voor de huidge locatie street view beschikbaar is, toon dan een link om "
1758
- "het vanuit de infowindow te activeren?"
1759
 
1760
- #: admin/templates/map-settings.php:191
1761
- msgid "Show a \"zoom to\" link in the infowindow?"
1762
- msgstr "Toon een \"zoom hier\" link in de infowindow?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1763
 
1764
- #: admin/templates/map-settings.php:195
1765
- msgid "On pageload move the mousecursor to the input field. **"
 
 
1766
  msgstr ""
1767
- "Als de pagina wordt geladen, verplaats de muiscursor dan naar het invul "
1768
- "veld. **"
1769
 
1770
- #: admin/templates/map-settings.php:198
1771
  msgid ""
1772
- "* This is the text that is placed before the search input and radius dropdown"
 
1773
  msgstr ""
1774
- "* Dit is de tekst die voor het zoekveld en radius dropdown geplaatst wordt."
 
1775
 
1776
- #: admin/templates/map-settings.php:199
1777
  msgid ""
1778
- "** If the store locator is not placed at the top of the page, enabling this "
1779
- "feature can result in the page sliding down."
1780
  msgstr ""
1781
- "** Als de store locator niet bovenaan de pagina geplaatst wordt, dan kan "
1782
- "deze instelling ervoor zorgen dat de pagina naar benenden schuift tijden het "
1783
- "laden."
1784
 
1785
- #: admin/templates/map-settings.php:208
1786
- msgid "Markers"
1787
- msgstr "Markers"
1788
 
1789
- #: admin/templates/map-settings.php:212
1790
- msgid "Enable marker clusters? *"
1791
- msgstr "Activeer marker clusters? *"
 
1792
 
1793
- #: admin/templates/map-settings.php:216
1794
- msgid "Max zoom level:"
1795
- msgstr "Max zoom niveau:"
1796
 
1797
- #: admin/templates/map-settings.php:220
1798
- msgid "Cluster size:"
1799
- msgstr "Cluster grote:"
1800
 
1801
- #: admin/templates/map-settings.php:223
1802
- msgid "* Recommended for maps with a large amounts of markers."
1803
- msgstr "* Aan te raden voor kaarten met grote hoeveelheden markers."
1804
 
1805
- #: admin/templates/map-settings.php:232
1806
- msgid "Store Editor Settings"
1807
- msgstr "Locatie Editor Instellingen"
 
 
1808
 
1809
- #: admin/templates/map-settings.php:235
1810
- msgid "Default country that will be used on the \"Add Store\" page."
1811
- msgstr ""
1812
- "Het land dat standaard gebruikt wordt op de \"Locatie Toevoegen\" pagina."
1813
 
1814
- #: admin/templates/map-settings.php:246
1815
- msgid "Labels"
1816
- msgstr "Labels"
1817
 
1818
- #: admin/templates/map-settings.php:249
1819
- msgid "Your location:"
1820
- msgstr "Uw locatie:"
1821
 
1822
- #: admin/templates/map-settings.php:253
1823
- msgid "Search radius:"
1824
- msgstr "Zoek radius:"
 
1825
 
1826
- #: admin/templates/map-settings.php:257
1827
- msgid "No results found:"
1828
- msgstr "Geen locaties gevonden:"
 
1829
 
1830
- #: admin/templates/map-settings.php:261
1831
- msgid "Search:"
1832
- msgstr "Zoek:"
 
1833
 
1834
- #: admin/templates/map-settings.php:265
1835
- msgid "Searching (preloader text):"
1836
- msgstr "Aan het zoeken (preloader tekst):"
 
1837
 
1838
- #: admin/templates/map-settings.php:269
1839
- msgid "Results:"
1840
- msgstr "Resultaten:"
 
1841
 
1842
- #: admin/templates/map-settings.php:273
1843
- msgid "More info:"
1844
- msgstr "Meer info:"
 
1845
 
1846
- #: admin/templates/map-settings.php:285
1847
- msgid "Hours:"
1848
- msgstr "Openingstijden:"
 
1849
 
1850
- #: admin/templates/map-settings.php:289
1851
- msgid "Start location:"
1852
- msgstr "Start locatie:"
 
1853
 
1854
- #: admin/templates/map-settings.php:293
1855
- msgid "Get directions:"
1856
- msgstr "Toon route:"
1857
 
1858
- #: admin/templates/map-settings.php:297
1859
- msgid "No directions found:"
1860
- msgstr "Geen route gevonden:"
1861
 
1862
- #: admin/templates/map-settings.php:301
1863
- msgid "Back:"
1864
- msgstr "Terug:"
1865
 
1866
- #: admin/templates/map-settings.php:305
1867
- msgid "Reset:"
1868
- msgstr "Herstel:"
1869
 
1870
- #: admin/templates/map-settings.php:309
1871
- msgid "Street view:"
1872
- msgstr "Street view:"
1873
 
1874
- #: admin/templates/map-settings.php:313
1875
- msgid "Zoom here:"
1876
- msgstr "Zoom hier:"
1877
 
1878
- #: admin/templates/map-settings.php:317
1879
- msgid "General error:"
1880
- msgstr "Foutmelding:"
1881
 
1882
- #: admin/templates/map-settings.php:321
1883
- msgid "Query limit error:"
1884
- msgstr "Query limit foutmelding:"
1885
 
1886
- #: admin/templates/map-settings.php:324
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1887
  #, php-format
1888
- msgid ""
1889
- "* You can raise the <a href=\"%s\">usage limit</a> by obtaining an API <a "
1890
- "href=\"%s\">key</a>, <br> and fill in the \"API key\" field at the top of "
1891
- "this page."
1892
- msgstr ""
1893
- "* Je kan de <a href=\"%s\">gebruiks limiet</a> verhogen door een API <a href="
1894
- "\"%s\">sleutel</a> aan te vragen, <br> en die in het \"API sleutel\" veld "
1895
- "bovenaan de pagina in te vullen."
1896
 
1897
- #: admin/templates/map-settings.php:330
1898
- msgid "Update Settings"
1899
- msgstr "Instellingen Bijwerken"
1900
 
1901
- #: wp-store-locator.php:261
1902
- msgid "Start location"
1903
- msgstr "Start locatie"
1904
 
1905
- #: wp-store-locator.php:262
1906
- msgid "Your location"
1907
- msgstr "Uw locatie"
1908
 
1909
- #: wp-store-locator.php:263
1910
- msgid "Search"
1911
- msgstr "Zoek"
1912
 
1913
- #: wp-store-locator.php:264
1914
- msgid "Searching..."
1915
- msgstr "Zoeken..."
1916
 
1917
- #: wp-store-locator.php:265
1918
- msgid "Search radius"
1919
- msgstr "Zoek radius"
1920
 
1921
- #: wp-store-locator.php:266
1922
- msgid "No results found"
1923
- msgstr "Geen locaties gevonden"
1924
 
1925
- #: wp-store-locator.php:267
1926
- msgid "Results"
1927
- msgstr "Resultaten"
1928
 
1929
- #: wp-store-locator.php:269
1930
- msgid "Directions"
1931
- msgstr "Toon route"
1932
 
1933
- #: wp-store-locator.php:275
1934
- msgid "Something went wrong, please try again!"
1935
- msgstr "Er ging iets fout, probeer het nog een keer!"
1936
 
1937
- #: wp-store-locator.php:276
1938
- msgid "API usage limit reached"
1939
- msgstr "API gebruikslimiet bereikt"
1940
 
1941
- #: wp-store-locator.php:277
1942
- msgid "Phone"
1943
- msgstr "Telefoon"
1944
 
1945
- #: wp-store-locator.php:278
1946
- msgid "Fax"
1947
- msgstr "Fax"
1948
 
1949
- #: wp-store-locator.php:279
1950
- msgid "Hours"
1951
- msgstr "Openingstijden"
1952
 
1953
- #: wp-store-locator.php:317
1954
- msgid "Show the store list below the map"
1955
- msgstr "Toon the locatie lijst onder de kaart"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WP Store Locator 2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-09-01 13:50+0100\n"
6
+ "PO-Revision-Date: 2015-09-01 19:01+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "Language: nl_NL\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Generator: Poedit 1.7.4\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
18
  "X-Poedit-Basepath: ../\n"
19
  "X-Textdomain-Support: yes\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
 
22
+ #: admin/class-admin.php:118
23
+ #, php-format
24
+ msgid ""
25
+ "Before adding the [wpsl] shortcode to a page, please don't forget to define "
26
+ "a %sstart point%s. %sDismiss%s"
27
+ msgstr ""
28
+ "Vergeet niet voordat je de [wpsl] shortcode op een pagina plaatst, om een "
29
+ "%sstart locatie%s op te geven. %sSluit%s"
 
 
 
 
 
 
 
 
 
 
 
30
 
31
+ #: admin/class-admin.php:120
32
+ #, php-format
33
+ msgid ""
34
+ "Before adding the [wpsl] shortcode to a page, please don't forget to define "
35
+ "a start point on the %ssettings%s page. %sDismiss%s"
36
+ msgstr ""
37
+ "Vergeet niet voordat je de [wpsl] shortcode op een pagina plaatst, om een "
38
+ "start locatie op te geven op de %sinstellingen%s pagina. %sSluit%s"
39
 
40
+ #: admin/class-admin.php:150 admin/templates/map-settings.php:4
41
+ msgid "Settings"
42
+ msgstr "Instellingen"
43
 
44
+ #: admin/class-admin.php:264
45
+ msgid "Cannot determine the address at this location."
46
+ msgstr "Er kan geen adres gevonden worden voor deze locatie."
47
 
48
+ #: admin/class-admin.php:265
49
+ msgid "Geocode was not successful for the following reason"
50
+ msgstr "Geocode was niet succesvol om de volgende reden"
51
 
52
+ #: admin/class-admin.php:266 admin/upgrade.php:393
53
+ msgid "Security check failed, reload the page and try again."
54
+ msgstr ""
55
+ "Beveiligings controle mislukt, herlaad de pagina en probeer het nog een keer."
56
 
57
+ #: admin/class-admin.php:267
58
+ msgid "Please fill in all the required store details."
59
+ msgstr "Vul alle verplichte velden in."
 
60
 
61
+ #: admin/class-admin.php:268
62
+ msgid "The map preview requires all the location details."
63
+ msgstr ""
64
+ "Alle locatie details moeten zijn ingevuld voordat de locatie op de kaart "
65
+ "getoond kan worden."
66
 
67
+ #: admin/class-admin.php:269 admin/class-metaboxes.php:504
68
+ #: frontend/class-frontend.php:483
69
+ msgid "Closed"
70
+ msgstr "gesloten"
71
 
72
+ #: admin/class-admin.php:270
73
+ msgid "The code for the map style is invalid."
74
+ msgstr "De code voor de map stijl is ongeldig."
75
 
76
+ #: admin/class-admin.php:361
77
+ msgid "Welcome to WP Store Locator"
78
+ msgstr "Welkom bij WP Store Locator"
79
 
80
+ #: admin/class-admin.php:362
81
+ msgid "Sign up for the latest plugin updates and announcements."
82
+ msgstr "Meld je aan voor de nieuwsbrief en ontvang het laatste nieuws."
83
 
84
+ #: admin/class-admin.php:406
85
+ msgid "Documentation"
86
+ msgstr "Documentatie"
87
 
88
+ #: admin/class-admin.php:409
89
+ msgid "General Settings"
90
+ msgstr "Instellingen"
91
 
92
+ #: admin/class-admin.php:429
93
+ #, php-format
94
+ msgid "If you like this plugin please leave us a %s5 star%s rating."
95
+ msgstr "Als je tevreden bent met deze plugin geef het dan %s5 sterren%s."
96
 
97
+ #: admin/class-geocode.php:73
98
  msgid ""
99
+ "The Google Geocoding API returned no results for the supplied address. "
100
+ "Please change the address and try again."
101
  msgstr ""
102
+ "De Google Geocoding API gaf geen resultaten terug voor deze locatie. Wijzig "
103
+ "de locatie details en probeer het nog een keer."
104
 
105
+ #: admin/class-geocode.php:76
106
+ #, php-format
107
  msgid ""
108
+ "You have reached the daily allowed geocoding limit, you can read more %shere"
109
+ "%s."
110
  msgstr ""
111
+ "Je hebt de dagelijkse toegestane geocoding limiet bereikt, je kan er %shier"
112
+ "%s meer over lezen."
113
 
114
+ #: admin/class-geocode.php:79 admin/class-geocode.php:105
115
  msgid ""
116
+ "The Google Geocoding API failed to return valid data, please try again later."
117
+ msgstr ""
118
+ "De Google Geocoding API geeft ongeldige data terug, probeer het nog een keer."
119
 
120
+ #: admin/class-metaboxes.php:33
121
+ msgid "Store Details"
122
+ msgstr "Winkel details"
123
+
124
+ #: admin/class-metaboxes.php:34
125
+ msgid "Store Map"
126
+ msgstr "Winkel kaart"
127
+
128
+ #: admin/class-metaboxes.php:48
129
+ msgid "Location"
130
+ msgstr "Locatie"
131
+
132
+ #: admin/class-metaboxes.php:50 inc/class-post-types.php:162
133
+ msgid "Address"
134
+ msgstr "Adres"
135
+
136
+ #: admin/class-metaboxes.php:54
137
+ msgid "Address 2"
138
+ msgstr "Adres 2"
139
+
140
+ #: admin/class-metaboxes.php:57 inc/class-post-types.php:163
141
+ msgid "City"
142
+ msgstr "Stad"
143
+
144
+ #: admin/class-metaboxes.php:61 inc/class-post-types.php:164
145
+ msgid "State"
146
+ msgstr "Provincie"
147
+
148
+ #: admin/class-metaboxes.php:64
149
+ msgid "Zip Code"
150
+ msgstr "Postcode"
151
+
152
+ #: admin/class-metaboxes.php:67
153
+ msgid "Country"
154
+ msgstr "Land"
155
+
156
+ #: admin/class-metaboxes.php:74
157
+ msgid "Latitude"
158
+ msgstr "breedtegraad"
159
+
160
+ #: admin/class-metaboxes.php:77
161
+ msgid "Longitude"
162
+ msgstr "Lengtegraad"
163
+
164
+ #: admin/class-metaboxes.php:80 admin/class-metaboxes.php:129
165
+ #: admin/class-metaboxes.php:144
166
+ msgid "Opening Hours"
167
+ msgstr "Openingstijden"
168
+
169
+ #: admin/class-metaboxes.php:82 admin/templates/map-settings.php:419
170
+ #: admin/templates/map-settings.php:420 frontend/underscore-functions.php:133
171
+ #: inc/wpsl-functions.php:114
172
+ msgid "Hours"
173
+ msgstr "Uren"
174
+
175
+ #: admin/class-metaboxes.php:86
176
+ msgid "Additional Information"
177
+ msgstr "Extra informatie"
178
+
179
+ #: admin/class-metaboxes.php:88
180
+ msgid "Tel"
181
+ msgstr "Tel."
182
+
183
+ #: admin/class-metaboxes.php:91 admin/templates/map-settings.php:407
184
+ #: admin/templates/map-settings.php:408 frontend/class-frontend.php:665
185
+ #: frontend/underscore-functions.php:32 frontend/underscore-functions.php:124
186
+ #: inc/wpsl-functions.php:111
187
+ msgid "Fax"
188
+ msgstr "Fax"
189
+
190
+ #: admin/class-metaboxes.php:94 admin/templates/map-settings.php:411
191
+ #: admin/templates/map-settings.php:412 admin/upgrade.php:210
192
+ #: frontend/class-frontend.php:669 frontend/underscore-functions.php:35
193
+ #: frontend/underscore-functions.php:127 inc/wpsl-functions.php:112
194
+ msgid "Email"
195
+ msgstr "E-mail"
196
+
197
+ #: admin/class-metaboxes.php:97 admin/templates/map-settings.php:415
198
+ #: admin/templates/map-settings.php:416 admin/upgrade.php:214
199
+ #: frontend/class-frontend.php:674 inc/wpsl-functions.php:113
200
+ msgid "Url"
201
+ msgstr "Url"
202
+
203
+ #: admin/class-metaboxes.php:426
204
+ msgid "Hour format"
205
+ msgstr "Uur formaat"
206
+
207
+ #: admin/class-metaboxes.php:433
208
+ msgid "Days"
209
+ msgstr "Dagen"
210
+
211
+ #: admin/class-metaboxes.php:434
212
+ msgid "Opening Periods"
213
+ msgstr "Openingstijden"
214
+
215
+ #: admin/class-metaboxes.php:681
216
+ msgid "Failed to publish the store. Please fill in the required store details."
217
  msgstr ""
218
+ "Het publiceren van de winkel is mislukt. Vul alle verplichte velden in."
219
+
220
+ #: admin/class-metaboxes.php:816
221
+ msgid "Preview Location"
222
+ msgstr "Bekijk voorbeeld"
223
 
224
+ #: admin/class-metaboxes.php:817
225
  #, php-format
226
  msgid ""
227
+ "The map preview is based on the provided address, city and country details. "
228
+ "%s It will ignore any custom latitude or longitude values."
229
  msgstr ""
230
+ "Het voorbeeld is gebaseerd op het adres, de stad en het opgegeven land. %s "
231
+ "De opgegeven lengte en breedtegraad worden niet gebruikt."
232
 
233
+ #: admin/class-metaboxes.php:818
234
+ msgid "You can drag the marker to adjust the exact location of the marker."
235
+ msgstr "Je kunt de locatie aanpassen door de marker te verslepen."
236
 
237
+ #: admin/class-metaboxes.php:838 admin/class-metaboxes.php:841
238
+ msgid "Store updated."
239
+ msgstr "Winkel bijgewerkt."
240
+
241
+ #: admin/class-metaboxes.php:839
242
+ msgid "Custom field updated."
243
+ msgstr "Custom veld bijgewerkt."
244
+
245
+ #: admin/class-metaboxes.php:840
246
+ msgid "Custom field deleted."
247
+ msgstr "Custom veld verwijderd."
248
 
249
+ #: admin/class-metaboxes.php:842
250
  #, php-format
251
+ msgid "Store restored to revision from %s"
252
+ msgstr "Winkel hersteld naar revisie %s"
 
 
 
 
253
 
254
+ #: admin/class-metaboxes.php:843
255
+ msgid "Store published."
256
+ msgstr "Winkel gepubliceerd."
 
 
257
 
258
+ #: admin/class-metaboxes.php:844
259
+ msgid "Store saved."
260
+ msgstr "Winkel opgeslagen."
261
 
262
+ #: admin/class-metaboxes.php:845
263
+ msgid "Store submitted."
264
+ msgstr "Winkel ingediend."
265
 
266
+ #: admin/class-metaboxes.php:847
267
+ #, php-format
268
+ msgid "Store scheduled for: <strong>%1$s</strong>."
269
+ msgstr "Winkel ingepland voor: <strong>%1$s</strong>. "
270
 
271
+ #: admin/class-metaboxes.php:848
272
+ msgid "M j, Y @ G:i"
273
+ msgstr "M j, Y @ G:i"
274
 
275
+ #: admin/class-metaboxes.php:850
276
+ msgid "Store draft updated."
277
+ msgstr "Winkel concept bijgewerkt."
278
+
279
+ #: admin/class-metaboxes.php:856
280
+ msgid "View store"
281
+ msgstr "Bekijk winkel"
282
 
283
+ #: admin/class-metaboxes.php:862
284
+ msgid "Preview store"
285
+ msgstr "Winkel voorbeeld"
286
+
287
+ #: admin/class-settings.php:38
288
+ msgid "WP Store Locator Transients Cleared"
289
+ msgstr "WP Store Locator transients verwijderd"
290
+
291
+ #: admin/class-settings.php:370
292
+ msgid ""
293
+ "The max results field cannot be empty, the default value has been restored."
294
+ msgstr ""
295
+ "Het max zoek resulaten veld kan niet leeg zijn, de standaard waarde is "
296
+ "hersteld."
297
+
298
+ #: admin/class-settings.php:373
299
+ msgid ""
300
+ "The search radius field cannot be empty, the default value has been restored."
301
+ msgstr ""
302
+ "Het zoek radius veld kan niet leeg zijn, de standaard waarde is hersteld."
303
+
304
+ #: admin/class-settings.php:376
305
+ #, php-format
306
+ msgid ""
307
+ "Please provide the name of a city or country that can be used as a starting "
308
+ "point under \"Map Settings\". %s This will only be used if auto-locating the "
309
+ "user fails, or the option itself is disabled."
310
+ msgstr ""
311
+ "Geef de naam van een stad of land op als start locatie onder de \"Kaart "
312
+ "Instellingen\". %s Deze locatie wordt alleen maar gebruikt als het "
313
+ "automatische achterhalen van de gebruikers locatie mislukt, of het "
314
+ "automatische achterhalen is uitgeschakeld."
315
+
316
+ #: admin/class-settings.php:397
317
  msgid "Select your language"
318
  msgstr "Kies uw taal"
319
 
320
+ #: admin/class-settings.php:398
321
  msgid "English"
322
  msgstr "Engels"
323
 
324
+ #: admin/class-settings.php:399
325
  msgid "Arabic"
326
  msgstr "Arabisch"
327
 
328
+ #: admin/class-settings.php:400
329
  msgid "Basque"
330
  msgstr "Bask"
331
 
332
+ #: admin/class-settings.php:401
333
  msgid "Bulgarian"
334
  msgstr "Bulgaars"
335
 
336
+ #: admin/class-settings.php:402
337
  msgid "Bengali"
338
  msgstr "Bengali"
339
 
340
+ #: admin/class-settings.php:403
341
  msgid "Catalan"
342
  msgstr "Catalaans"
343
 
344
+ #: admin/class-settings.php:404
345
  msgid "Czech"
346
+ msgstr "Tjechisch"
347
 
348
+ #: admin/class-settings.php:405
349
  msgid "Danish"
350
  msgstr "Deens"
351
 
352
+ #: admin/class-settings.php:406
353
  msgid "German"
354
  msgstr "Duits"
355
 
356
+ #: admin/class-settings.php:407
357
  msgid "Greek"
358
  msgstr "Grieks"
359
 
360
+ #: admin/class-settings.php:408
361
  msgid "English (Australian)"
362
  msgstr "Engels (Australisch)"
363
 
364
+ #: admin/class-settings.php:409
365
  msgid "English (Great Britain)"
366
+ msgstr "Engels (Verenigd Koninkrijk)"
367
 
368
+ #: admin/class-settings.php:410
369
  msgid "Spanish"
370
  msgstr "Spaans"
371
 
372
+ #: admin/class-settings.php:411
373
  msgid "Farsi"
374
  msgstr "Farsi"
375
 
376
+ #: admin/class-settings.php:412
377
  msgid "Finnish"
378
  msgstr "Fins"
379
 
380
+ #: admin/class-settings.php:413
381
  msgid "Filipino"
382
  msgstr "Filipijns"
383
 
384
+ #: admin/class-settings.php:414
385
  msgid "French"
386
  msgstr "Frans"
387
 
388
+ #: admin/class-settings.php:415
389
  msgid "Galician"
390
  msgstr "Gallisch"
391
 
392
+ #: admin/class-settings.php:416
393
  msgid "Gujarati"
394
  msgstr "Gujurati"
395
 
396
+ #: admin/class-settings.php:417
397
  msgid "Hindi"
398
  msgstr "Hindi"
399
 
400
+ #: admin/class-settings.php:418
401
  msgid "Croatian"
402
+ msgstr "Kroatisch"
403
 
404
+ #: admin/class-settings.php:419
405
  msgid "Hungarian"
406
  msgstr "Hongaars"
407
 
408
+ #: admin/class-settings.php:420
409
  msgid "Indonesian"
410
  msgstr "Indonesisch"
411
 
412
+ #: admin/class-settings.php:421
413
  msgid "Italian"
414
  msgstr "Italiaans"
415
 
416
+ #: admin/class-settings.php:422
417
  msgid "Hebrew"
418
+ msgstr "Hebreeuws"
419
 
420
+ #: admin/class-settings.php:423
421
  msgid "Japanese"
422
  msgstr "Japans"
423
 
424
+ #: admin/class-settings.php:424
425
  msgid "Kannada"
426
  msgstr "Kannada"
427
 
428
+ #: admin/class-settings.php:425
429
  msgid "Korean"
430
  msgstr "Koreaans"
431
 
432
+ #: admin/class-settings.php:426
433
  msgid "Lithuanian"
434
  msgstr "Litouws"
435
 
436
+ #: admin/class-settings.php:427
437
  msgid "Latvian"
438
  msgstr "Lets"
439
 
440
+ #: admin/class-settings.php:428
441
  msgid "Malayalam"
442
  msgstr "Malayalam"
443
 
444
+ #: admin/class-settings.php:429
445
  msgid "Marathi"
446
  msgstr "Marathi"
447
 
448
+ #: admin/class-settings.php:430
449
  msgid "Dutch"
450
  msgstr "Nederlands"
451
 
452
+ #: admin/class-settings.php:431
453
  msgid "Norwegian"
454
  msgstr "Noors"
455
 
456
+ #: admin/class-settings.php:432
457
  msgid "Norwegian Nynorsk"
458
  msgstr "Noors Nynorsk"
459
 
460
+ #: admin/class-settings.php:433
461
  msgid "Polish"
462
  msgstr "Pools"
463
 
464
+ #: admin/class-settings.php:434
465
  msgid "Portuguese"
466
  msgstr "Portugees"
467
 
468
+ #: admin/class-settings.php:435
469
  msgid "Portuguese (Brazil)"
470
  msgstr "Portugees (Brazilië)"
471
 
472
+ #: admin/class-settings.php:436
473
  msgid "Portuguese (Portugal)"
474
  msgstr "Portugees (Portugal)"
475
 
476
+ #: admin/class-settings.php:437
477
  msgid "Romanian"
478
  msgstr "Roemeens"
479
 
480
+ #: admin/class-settings.php:438
481
  msgid "Russian"
482
  msgstr "Russisch"
483
 
484
+ #: admin/class-settings.php:439
485
  msgid "Slovak"
486
  msgstr "Slowaaks"
487
 
488
+ #: admin/class-settings.php:440
489
  msgid "Slovenian"
490
  msgstr "Sloveens"
491
 
492
+ #: admin/class-settings.php:441
493
  msgid "Serbian"
494
  msgstr "Servisch"
495
 
496
+ #: admin/class-settings.php:442
497
  msgid "Swedish"
498
  msgstr "Zweeds"
499
 
500
+ #: admin/class-settings.php:443
501
  msgid "Tagalog"
502
  msgstr "Tagalog"
503
 
504
+ #: admin/class-settings.php:444
505
  msgid "Tamil"
506
  msgstr "Tamil"
507
 
508
+ #: admin/class-settings.php:445
509
  msgid "Telugu"
510
  msgstr "Telugu"
511
 
512
+ #: admin/class-settings.php:446
513
  msgid "Thai"
514
  msgstr "Thai"
515
 
516
+ #: admin/class-settings.php:447
517
  msgid "Turkish"
518
  msgstr "Turks"
519
 
520
+ #: admin/class-settings.php:448
521
  msgid "Ukrainian"
522
  msgstr "Oekraïens"
523
 
524
+ #: admin/class-settings.php:449
525
  msgid "Vietnamese"
526
  msgstr "Vietnamees"
527
 
528
+ #: admin/class-settings.php:450
529
  msgid "Chinese (Simplified)"
530
  msgstr "Chinees (Vereenvoudigd)"
531
 
532
+ #: admin/class-settings.php:451
533
  msgid "Chinese (Traditional)"
534
  msgstr "Chinees (Traditioneel)"
535
 
536
+ #: admin/class-settings.php:456
537
  msgid "Select your region"
538
  msgstr "Kies uw regio"
539
 
540
+ #: admin/class-settings.php:457
541
  msgid "Afghanistan"
542
  msgstr "Afghanistan"
543
 
544
+ #: admin/class-settings.php:458
545
  msgid "Albania"
546
  msgstr "Albanië"
547
 
548
+ #: admin/class-settings.php:459
549
  msgid "Algeria"
550
+ msgstr "Algerije"
551
 
552
+ #: admin/class-settings.php:460
553
  msgid "American Samoa"
554
  msgstr "Amerikaans Samoa"
555
 
556
+ #: admin/class-settings.php:461
557
  msgid "Andorra"
558
  msgstr "Andorra"
559
 
560
+ #: admin/class-settings.php:462
561
  msgid "Anguilla"
562
  msgstr "Anguilla"
563
 
564
+ #: admin/class-settings.php:463
565
  msgid "Angola"
566
  msgstr "Angola"
567
 
568
+ #: admin/class-settings.php:464
569
  msgid "Antigua and Barbuda"
570
  msgstr "Antigua en Barbuda"
571
 
572
+ #: admin/class-settings.php:465
573
  msgid "Argentina"
574
  msgstr "Argentinië"
575
 
576
+ #: admin/class-settings.php:466
577
  msgid "Armenia"
578
  msgstr "Armenia"
579
 
580
+ #: admin/class-settings.php:467
581
  msgid "Aruba"
582
  msgstr "Aruba"
583
 
584
+ #: admin/class-settings.php:468
585
  msgid "Australia"
586
  msgstr "Australië"
587
 
588
+ #: admin/class-settings.php:469
589
  msgid "Austria"
590
  msgstr "Oostenrijk"
591
 
592
+ #: admin/class-settings.php:470
593
  msgid "Azerbaijan"
594
  msgstr "Azerbeidzjan"
595
 
596
+ #: admin/class-settings.php:471
597
  msgid "Bahamas"
598
  msgstr "Bahamas"
599
 
600
+ #: admin/class-settings.php:472
601
  msgid "Bahrain"
602
  msgstr "Bahrein"
603
 
604
+ #: admin/class-settings.php:473
605
  msgid "Bangladesh"
606
  msgstr "Bangladesh"
607
 
608
+ #: admin/class-settings.php:474
609
  msgid "Barbados"
610
  msgstr "Barbados"
611
 
612
+ #: admin/class-settings.php:475
613
  msgid "Belarus"
614
  msgstr "Wit-Rusland"
615
 
616
+ #: admin/class-settings.php:476
617
  msgid "Belgium"
618
  msgstr "België"
619
 
620
+ #: admin/class-settings.php:477
621
  msgid "Belize"
622
  msgstr "Belize"
623
 
624
+ #: admin/class-settings.php:478
625
  msgid "Benin"
626
  msgstr "Benin"
627
 
628
+ #: admin/class-settings.php:479
629
  msgid "Bermuda"
630
  msgstr "Bermuda"
631
 
632
+ #: admin/class-settings.php:480
633
  msgid "Bhutan"
634
  msgstr "Bhutan"
635
 
636
+ #: admin/class-settings.php:481
637
  msgid "Bolivia"
638
  msgstr "Bolivia"
639
 
640
+ #: admin/class-settings.php:482
641
  msgid "Bosnia and Herzegovina"
642
  msgstr "Bosnia en Herzegovina"
643
 
644
+ #: admin/class-settings.php:483
645
  msgid "Botswana"
646
  msgstr "Botswana"
647
 
648
+ #: admin/class-settings.php:484
649
  msgid "Brazil"
650
  msgstr "Brazilië"
651
 
652
+ #: admin/class-settings.php:485
653
  msgid "British Indian Ocean Territory"
654
  msgstr "Brits Indische Oceaanterritorium"
655
 
656
+ #: admin/class-settings.php:486
657
  msgid "Brunei"
658
  msgstr "Brunei"
659
 
660
+ #: admin/class-settings.php:487
661
  msgid "Bulgaria"
662
  msgstr "Bulgarije"
663
 
664
+ #: admin/class-settings.php:488
665
  msgid "Burkina Faso"
666
  msgstr "Burkina Faso"
667
 
668
+ #: admin/class-settings.php:489
669
  msgid "Burundi"
670
  msgstr "Burundi"
671
 
672
+ #: admin/class-settings.php:490
673
  msgid "Cambodia"
674
  msgstr "Cambodja"
675
 
676
+ #: admin/class-settings.php:491
677
  msgid "Cameroon"
678
  msgstr "Kameroen"
679
 
680
+ #: admin/class-settings.php:492
681
  msgid "Canada"
682
  msgstr "Canada"
683
 
684
+ #: admin/class-settings.php:493
685
  msgid "Cape Verde"
686
  msgstr "Kaapverdië"
687
 
688
+ #: admin/class-settings.php:494
689
  msgid "Cayman Islands"
690
  msgstr "Kaaimaneilanden"
691
 
692
+ #: admin/class-settings.php:495
693
  msgid "Central African Republic"
694
  msgstr "Centraal-Afrikaanse Republiek"
695
 
696
+ #: admin/class-settings.php:496
697
  msgid "Chad"
698
  msgstr "Chad"
699
 
700
+ #: admin/class-settings.php:497
701
  msgid "Chile"
702
  msgstr "Chili"
703
 
704
+ #: admin/class-settings.php:498
705
  msgid "China"
706
  msgstr "China"
707
 
708
+ #: admin/class-settings.php:499
709
  msgid "Christmas Island"
710
  msgstr "Christmaseiland"
711
 
712
+ #: admin/class-settings.php:500
713
  msgid "Cocos Islands"
714
  msgstr "Cocoseilanden"
715
 
716
+ #: admin/class-settings.php:501
717
  msgid "Colombia"
718
  msgstr "Colombia"
719
 
720
+ #: admin/class-settings.php:502
721
  msgid "Comoros"
722
  msgstr "Comoren"
723
 
724
+ #: admin/class-settings.php:503
725
  msgid "Congo"
726
  msgstr "Congo"
727
 
728
+ #: admin/class-settings.php:504
729
  msgid "Costa Rica"
730
  msgstr "Costa Rica"
731
 
732
+ #: admin/class-settings.php:505
733
  msgid "Côte d'Ivoire"
734
  msgstr "Ivoorkust"
735
 
736
+ #: admin/class-settings.php:506
737
  msgid "Croatia"
738
  msgstr "Kroatië"
739
 
740
+ #: admin/class-settings.php:507
741
  msgid "Cuba"
742
  msgstr "Cuba"
743
 
744
+ #: admin/class-settings.php:508
745
  msgid "Czech Republic"
746
  msgstr "Tsjechië"
747
 
748
+ #: admin/class-settings.php:509
749
  msgid "Denmark"
750
  msgstr "Denemarken"
751
 
752
+ #: admin/class-settings.php:510
753
  msgid "Djibouti"
754
  msgstr "Djibouti"
755
 
756
+ #: admin/class-settings.php:511
757
  msgid "Democratic Republic of the Congo"
758
  msgstr "Democratische Republiek Congo"
759
 
760
+ #: admin/class-settings.php:512
761
  msgid "Dominica"
762
  msgstr "Dominica"
763
 
764
+ #: admin/class-settings.php:513
765
  msgid "Dominican Republic"
766
  msgstr "Dominicaanse Republiek"
767
 
768
+ #: admin/class-settings.php:514
769
  msgid "Ecuador"
770
  msgstr "Ecuador"
771
 
772
+ #: admin/class-settings.php:515
773
  msgid "Egypt"
774
  msgstr "Egypte"
775
 
776
+ #: admin/class-settings.php:516
777
  msgid "El Salvador"
778
  msgstr "El Salvador"
779
 
780
+ #: admin/class-settings.php:517
781
  msgid "Equatorial Guinea"
782
  msgstr "Equatoriaal-Guinea"
783
 
784
+ #: admin/class-settings.php:518
785
  msgid "Eritrea"
786
  msgstr "Eritrea"
787
 
788
+ #: admin/class-settings.php:519
789
  msgid "Estonia"
790
  msgstr "Estland"
791
 
792
+ #: admin/class-settings.php:520
793
  msgid "Ethiopia"
794
  msgstr "Ethiopië"
795
 
796
+ #: admin/class-settings.php:521
797
  msgid "Fiji"
798
  msgstr "Fiji"
799
 
800
+ #: admin/class-settings.php:522
801
  msgid "Finland"
802
  msgstr "Finland"
803
 
804
+ #: admin/class-settings.php:523
805
  msgid "France"
806
  msgstr "Frankrijk"
807
 
808
+ #: admin/class-settings.php:524
809
  msgid "French Guiana"
810
  msgstr "Frans Guyana"
811
 
812
+ #: admin/class-settings.php:525
813
  msgid "Gabon"
814
  msgstr "Gabon"
815
 
816
+ #: admin/class-settings.php:526
817
  msgid "Gambia"
818
  msgstr "Gambia"
819
 
820
+ #: admin/class-settings.php:527
821
  msgid "Germany"
822
  msgstr "Duitsland"
823
 
824
+ #: admin/class-settings.php:528
825
  msgid "Ghana"
826
  msgstr "Ghana"
827
 
828
+ #: admin/class-settings.php:529
829
  msgid "Greenland"
830
  msgstr "Groenland"
831
 
832
+ #: admin/class-settings.php:530
833
  msgid "Greece"
834
  msgstr "Griekenland"
835
 
836
+ #: admin/class-settings.php:531
837
  msgid "Grenada"
838
  msgstr "Grenada"
839
 
840
+ #: admin/class-settings.php:532
841
  msgid "Guam"
842
  msgstr "Guam"
843
 
844
+ #: admin/class-settings.php:533
845
  msgid "Guadeloupe"
846
  msgstr "Guadeloupe"
847
 
848
+ #: admin/class-settings.php:534
849
  msgid "Guatemala"
850
  msgstr "Guatemala"
851
 
852
+ #: admin/class-settings.php:535
853
  msgid "Guinea"
854
  msgstr "Guinee"
855
 
856
+ #: admin/class-settings.php:536
857
  msgid "Guinea-Bissau"
858
  msgstr "Guinee-Bissau"
859
 
860
+ #: admin/class-settings.php:537
861
  msgid "Haiti"
862
  msgstr "Haïti"
863
 
864
+ #: admin/class-settings.php:538
865
  msgid "Honduras"
866
  msgstr "Honduras"
867
 
868
+ #: admin/class-settings.php:539
869
  msgid "Hong Kong"
870
  msgstr "Hong Kong"
871
 
872
+ #: admin/class-settings.php:540
873
  msgid "Hungary"
874
  msgstr "Hongarije"
875
 
876
+ #: admin/class-settings.php:541
877
  msgid "Iceland"
878
  msgstr "IJsland"
879
 
880
+ #: admin/class-settings.php:542
881
  msgid "India"
882
  msgstr "India"
883
 
884
+ #: admin/class-settings.php:543
885
  msgid "Indonesia"
886
  msgstr "Indonesië"
887
 
888
+ #: admin/class-settings.php:544
889
  msgid "Iran"
890
  msgstr "Iran"
891
 
892
+ #: admin/class-settings.php:545
893
  msgid "Iraq"
894
  msgstr "Irak"
895
 
896
+ #: admin/class-settings.php:546
897
  msgid "Ireland"
898
  msgstr "Ierland"
899
 
900
+ #: admin/class-settings.php:547
901
  msgid "Israel"
902
  msgstr "Israël"
903
 
904
+ #: admin/class-settings.php:548
905
  msgid "Italy"
906
  msgstr "Italië"
907
 
908
+ #: admin/class-settings.php:549
909
  msgid "Jamaica"
910
  msgstr "Jamaica"
911
 
912
+ #: admin/class-settings.php:550
913
  msgid "Japan"
914
  msgstr "Japan"
915
 
916
+ #: admin/class-settings.php:551
917
  msgid "Jordan"
918
  msgstr "Jordanië"
919
 
920
+ #: admin/class-settings.php:552
921
  msgid "Kazakhstan"
922
  msgstr "Kazachstan"
923
 
924
+ #: admin/class-settings.php:553
925
  msgid "Kenya"
926
  msgstr "Kenia"
927
 
928
+ #: admin/class-settings.php:554
929
  msgid "Kuwait"
930
  msgstr "Koeweit"
931
 
932
+ #: admin/class-settings.php:555
933
  msgid "Kyrgyzstan"
934
  msgstr "Kirgizië"
935
 
936
+ #: admin/class-settings.php:556
937
  msgid "Laos"
938
  msgstr "Laos"
939
 
940
+ #: admin/class-settings.php:557
941
  msgid "Latvia"
942
  msgstr "Letland"
943
 
944
+ #: admin/class-settings.php:558
945
  msgid "Lebanon"
946
  msgstr "Libanon"
947
 
948
+ #: admin/class-settings.php:559
949
  msgid "Lesotho"
950
  msgstr "Lesotho"
951
 
952
+ #: admin/class-settings.php:560
953
  msgid "Liberia"
954
  msgstr "Liberia"
955
 
956
+ #: admin/class-settings.php:561
957
  msgid "Libya"
958
  msgstr "Libië"
959
 
960
+ #: admin/class-settings.php:562
961
  msgid "Liechtenstein"
962
  msgstr "Liechtenstein"
963
 
964
+ #: admin/class-settings.php:563
965
  msgid "Lithuania"
966
  msgstr "Litouwen"
967
 
968
+ #: admin/class-settings.php:564
969
  msgid "Luxembourg"
970
  msgstr "Luxemburg"
971
 
972
+ #: admin/class-settings.php:565
973
  msgid "Macau"
974
  msgstr "Macau"
975
 
976
+ #: admin/class-settings.php:566
977
  msgid "Macedonia"
978
  msgstr "Macedonië"
979
 
980
+ #: admin/class-settings.php:567
981
  msgid "Madagascar"
982
  msgstr "Madagascar"
983
 
984
+ #: admin/class-settings.php:568
985
  msgid "Malawi"
986
  msgstr "Malawi"
987
 
988
+ #: admin/class-settings.php:569
989
  msgid "Malaysia "
990
  msgstr "Maleisie"
991
 
992
+ #: admin/class-settings.php:570
993
  msgid "Mali"
994
  msgstr "Mali"
995
 
996
+ #: admin/class-settings.php:571
997
  msgid "Marshall Islands"
998
  msgstr "Marshalleilanden"
999
 
1000
+ #: admin/class-settings.php:572
1001
  msgid "Martinique"
1002
  msgstr "Martinique"
1003
 
1004
+ #: admin/class-settings.php:573
1005
  msgid "Mauritania"
1006
  msgstr "Mauritanië"
1007
 
1008
+ #: admin/class-settings.php:574
1009
  msgid "Mauritius"
1010
  msgstr "Mauritius"
1011
 
1012
+ #: admin/class-settings.php:575
1013
  msgid "Mexico"
1014
  msgstr "Mexico"
1015
 
1016
+ #: admin/class-settings.php:576
1017
  msgid "Micronesia"
1018
  msgstr "Micronesia"
1019
 
1020
+ #: admin/class-settings.php:577
1021
  msgid "Moldova"
1022
  msgstr "Moldavië"
1023
 
1024
+ #: admin/class-settings.php:578
1025
  msgid "Monaco"
1026
  msgstr "Monaco"
1027
 
1028
+ #: admin/class-settings.php:579
1029
  msgid "Mongolia"
1030
  msgstr "Mongolië"
1031
 
1032
+ #: admin/class-settings.php:580
1033
  msgid "Montenegro"
1034
  msgstr "Montenegro"
1035
 
1036
+ #: admin/class-settings.php:581
1037
  msgid "Montserrat"
1038
  msgstr "Montserrat "
1039
 
1040
+ #: admin/class-settings.php:582
1041
  msgid "Morocco"
1042
  msgstr "Marokko"
1043
 
1044
+ #: admin/class-settings.php:583
1045
  msgid "Mozambique"
1046
  msgstr "Mozambique"
1047
 
1048
+ #: admin/class-settings.php:584
1049
  msgid "Myanmar"
1050
  msgstr "Myanmar"
1051
 
1052
+ #: admin/class-settings.php:585
1053
  msgid "Namibia"
1054
  msgstr "Namibië"
1055
 
1056
+ #: admin/class-settings.php:586
1057
  msgid "Nauru"
1058
  msgstr "Nauru"
1059
 
1060
+ #: admin/class-settings.php:587
1061
  msgid "Nepal"
1062
  msgstr "Nepal"
1063
 
1064
+ #: admin/class-settings.php:588
1065
  msgid "Netherlands"
1066
  msgstr "Nederland"
1067
 
1068
+ #: admin/class-settings.php:589
1069
  msgid "Netherlands Antilles"
1070
  msgstr "Nederlandse Antillen"
1071
 
1072
+ #: admin/class-settings.php:590
1073
  msgid "New Zealand"
1074
  msgstr "Nieuw Zeeland"
1075
 
1076
+ #: admin/class-settings.php:591
1077
  msgid "Nicaragua"
1078
  msgstr "Nicaragua"
1079
 
1080
+ #: admin/class-settings.php:592
1081
  msgid "Niger"
1082
  msgstr "Niger"
1083
 
1084
+ #: admin/class-settings.php:593
1085
  msgid "Nigeria"
1086
  msgstr "Nigeria"
1087
 
1088
+ #: admin/class-settings.php:594
1089
  msgid "Niue"
1090
  msgstr "Niue"
1091
 
1092
+ #: admin/class-settings.php:595
1093
  msgid "Northern Mariana Islands"
1094
  msgstr "Noordelijke Marianen"
1095
 
1096
+ #: admin/class-settings.php:596
1097
  msgid "Norway"
1098
  msgstr "Noorwegen"
1099
 
1100
+ #: admin/class-settings.php:597
1101
  msgid "Oman"
1102
  msgstr "Oman"
1103
 
1104
+ #: admin/class-settings.php:598
1105
  msgid "Pakistan"
1106
  msgstr "Pakistan"
1107
 
1108
+ #: admin/class-settings.php:599
1109
  msgid "Panama"
1110
  msgstr "Panama"
1111
 
1112
+ #: admin/class-settings.php:600
1113
  msgid "Papua New Guinea"
1114
  msgstr "Papoea-Nieuw-Guinea"
1115
 
1116
+ #: admin/class-settings.php:601
1117
  msgid "Paraguay"
1118
  msgstr "Paraguay"
1119
 
1120
+ #: admin/class-settings.php:602
1121
  msgid "Peru"
1122
  msgstr "Peru"
1123
 
1124
+ #: admin/class-settings.php:603
1125
  msgid "Philippines"
1126
  msgstr "Filipijnen"
1127
 
1128
+ #: admin/class-settings.php:604
1129
  msgid "Pitcairn Islands"
1130
  msgstr "Pitcairneilanden"
1131
 
1132
+ #: admin/class-settings.php:605
1133
  msgid "Poland"
1134
  msgstr "Polen"
1135
 
1136
+ #: admin/class-settings.php:606
1137
  msgid "Portugal"
1138
  msgstr "Portugal"
1139
 
1140
+ #: admin/class-settings.php:607
1141
  msgid "Qatar"
1142
  msgstr "Qatar"
1143
 
1144
+ #: admin/class-settings.php:608
1145
  msgid "Reunion"
1146
  msgstr "Réunion"
1147
 
1148
+ #: admin/class-settings.php:609
1149
  msgid "Romania"
1150
  msgstr "Roemenië"
1151
 
1152
+ #: admin/class-settings.php:610
1153
  msgid "Russia"
1154
  msgstr "Rusland"
1155
 
1156
+ #: admin/class-settings.php:611
1157
  msgid "Rwanda"
1158
  msgstr "Rwanda"
1159
 
1160
+ #: admin/class-settings.php:612
1161
  msgid "Saint Helena"
1162
  msgstr "Sint-Helena"
1163
 
1164
+ #: admin/class-settings.php:613
1165
  msgid "Saint Kitts and Nevis"
1166
  msgstr "Saint Kitts en Nevis"
1167
 
1168
+ #: admin/class-settings.php:614
1169
  msgid "Saint Vincent and the Grenadines"
1170
  msgstr "Saint Vincent en de Grenadines"
1171
 
1172
+ #: admin/class-settings.php:615
1173
  msgid "Saint Lucia"
1174
  msgstr "Saint Lucia"
1175
 
1176
+ #: admin/class-settings.php:616
1177
  msgid "Samoa"
1178
  msgstr "Samoa"
1179
 
1180
+ #: admin/class-settings.php:617
1181
  msgid "San Marino"
1182
  msgstr "San Marino"
1183
 
1184
+ #: admin/class-settings.php:618
1185
  msgid "São Tomé and Príncipe"
1186
  msgstr "Sao Tomé en Principe"
1187
 
1188
+ #: admin/class-settings.php:619
1189
  msgid "Saudi Arabia"
1190
  msgstr "Saoedi-Arabië"
1191
 
1192
+ #: admin/class-settings.php:620
1193
  msgid "Senegal"
1194
  msgstr "Senegal"
1195
 
1196
+ #: admin/class-settings.php:621
1197
  msgid "Serbia"
1198
  msgstr "Servië"
1199
 
1200
+ #: admin/class-settings.php:622
1201
  msgid "Seychelles"
1202
  msgstr "Seychellen"
1203
 
1204
+ #: admin/class-settings.php:623
1205
  msgid "Sierra Leone"
1206
  msgstr "Sierra Leone"
1207
 
1208
+ #: admin/class-settings.php:624
1209
  msgid "Singapore"
1210
  msgstr "Singapore"
1211
 
1212
+ #: admin/class-settings.php:625
1213
  msgid "Slovakia"
1214
  msgstr "Slowakije"
1215
 
1216
+ #: admin/class-settings.php:626
1217
  msgid "Solomon Islands"
1218
  msgstr "Salomonseilanden"
1219
 
1220
+ #: admin/class-settings.php:627
1221
  msgid "Somalia"
1222
  msgstr "Somalie"
1223
 
1224
+ #: admin/class-settings.php:628
1225
  msgid "South Africa"
1226
  msgstr "Zuid Afrika"
1227
 
1228
+ #: admin/class-settings.php:629
1229
  msgid "South Korea"
1230
  msgstr "Zuid Korea"
1231
 
1232
+ #: admin/class-settings.php:630
1233
  msgid "Spain"
1234
  msgstr "Spanje"
1235
 
1236
+ #: admin/class-settings.php:631
1237
  msgid "Sri Lanka"
1238
  msgstr "Sri Lanka"
1239
 
1240
+ #: admin/class-settings.php:632
1241
  msgid "Sudan"
1242
  msgstr "Sudan"
1243
 
1244
+ #: admin/class-settings.php:633
1245
  msgid "Swaziland"
1246
  msgstr "Swaziland "
1247
 
1248
+ #: admin/class-settings.php:634
1249
  msgid "Sweden"
1250
  msgstr "Zweden"
1251
 
1252
+ #: admin/class-settings.php:635
1253
  msgid "Switzerland"
1254
  msgstr "Zwitserland"
1255
 
1256
+ #: admin/class-settings.php:636
1257
  msgid "Syria"
1258
  msgstr "Syrië"
1259
 
1260
+ #: admin/class-settings.php:637
1261
  msgid "Taiwan"
1262
  msgstr "Taiwan"
1263
 
1264
+ #: admin/class-settings.php:638
1265
  msgid "Tajikistan"
1266
  msgstr "Tajikistan"
1267
 
1268
+ #: admin/class-settings.php:639
1269
  msgid "Tanzania"
1270
  msgstr "Tanzania"
1271
 
1272
+ #: admin/class-settings.php:640
1273
  msgid "Thailand"
1274
  msgstr "Thailand"
1275
 
1276
+ #: admin/class-settings.php:641
1277
  msgid "Timor-Leste"
1278
  msgstr "Oost-Timor"
1279
 
1280
+ #: admin/class-settings.php:642
1281
  msgid "Tokelau"
1282
  msgstr "Tokelau"
1283
 
1284
+ #: admin/class-settings.php:643
1285
  msgid "Togo"
1286
  msgstr "Togo"
1287
 
1288
+ #: admin/class-settings.php:644
1289
  msgid "Tonga"
1290
  msgstr "Tonga"
1291
 
1292
+ #: admin/class-settings.php:645
1293
  msgid "Trinidad and Tobago"
1294
  msgstr "Trinidad en Tobago"
1295
 
1296
+ #: admin/class-settings.php:646
1297
  msgid "Tunisia"
1298
  msgstr "Tunesië"
1299
 
1300
+ #: admin/class-settings.php:647
1301
  msgid "Turkey"
1302
  msgstr "Turkije"
1303
 
1304
+ #: admin/class-settings.php:648
1305
  msgid "Turkmenistan"
1306
  msgstr "Turkmenistan"
1307
 
1308
+ #: admin/class-settings.php:649
1309
  msgid "Tuvalu"
1310
  msgstr "Tuvalu"
1311
 
1312
+ #: admin/class-settings.php:650
1313
  msgid "Uganda"
1314
  msgstr "Uganda"
1315
 
1316
+ #: admin/class-settings.php:651
1317
  msgid "Ukraine"
1318
  msgstr "Oekraïne"
1319
 
1320
+ #: admin/class-settings.php:652
1321
  msgid "United Arab Emirates"
1322
  msgstr "Verenigde Arabische Emiraten"
1323
 
1324
+ #: admin/class-settings.php:653
1325
  msgid "United Kingdom"
1326
  msgstr "Verenigd Koninkrijk"
1327
 
1328
+ #: admin/class-settings.php:654
1329
  msgid "United States"
1330
  msgstr "Verenigde Staten"
1331
 
1332
+ #: admin/class-settings.php:655
1333
  msgid "Uruguay"
1334
  msgstr "Uruguay"
1335
 
1336
+ #: admin/class-settings.php:656
1337
  msgid "Uzbekistan"
1338
  msgstr "Uzbekistan"
1339
 
1340
+ #: admin/class-settings.php:657
1341
  msgid "Wallis Futuna"
1342
  msgstr "Wallis en Futuna"
1343
 
1344
+ #: admin/class-settings.php:658
1345
  msgid "Venezuela"
1346
  msgstr "Venezuela"
1347
 
1348
+ #: admin/class-settings.php:659
1349
  msgid "Vietnam"
1350
  msgstr "Vietnam"
1351
 
1352
+ #: admin/class-settings.php:660
1353
  msgid "Yemen"
1354
  msgstr "Yemen"
1355
 
1356
+ #: admin/class-settings.php:661
1357
  msgid "Zambia"
1358
  msgstr "Zambia"
1359
 
1360
+ #: admin/class-settings.php:662
1361
  msgid "Zimbabwe"
1362
  msgstr "Zimbabwe"
1363
 
1364
+ #: admin/class-settings.php:705
1365
+ msgid "World view"
1366
+ msgstr "wereldkaart"
1367
 
1368
+ #: admin/class-settings.php:708 admin/class-settings.php:821
1369
+ #: inc/wpsl-functions.php:179
1370
+ msgid "Default"
1371
+ msgstr "standaard"
1372
 
1373
+ #: admin/class-settings.php:711 inc/wpsl-functions.php:252
1374
+ msgid "Roadmap"
1375
+ msgstr "wegenkaart"
 
1376
 
1377
+ #: admin/class-settings.php:851
1378
+ msgid "Start location marker"
1379
+ msgstr "Start locatie marker"
1380
 
1381
+ #: admin/class-settings.php:853
1382
+ msgid "Store location marker"
1383
+ msgstr "Winkel locatie marker"
1384
 
1385
+ #: admin/class-settings.php:934
1386
+ msgid "Textarea"
1387
+ msgstr "tekstvlak"
1388
 
1389
+ #: admin/class-settings.php:935
1390
+ msgid "Dropdowns (recommended)"
1391
+ msgstr "dropdown (aangeraden)"
1392
 
1393
+ #: admin/class-settings.php:943
1394
+ msgid "Bounces up and down"
1395
+ msgstr "beweegt op en neer"
1396
 
1397
+ #: admin/class-settings.php:944
1398
+ msgid "Will open the info window"
1399
+ msgstr "opent de info window"
 
1400
 
1401
+ #: admin/class-settings.php:945
1402
+ msgid "Does not respond"
1403
+ msgstr "reageert niet"
1404
 
1405
+ #: admin/class-settings.php:953
1406
+ msgid "In the store listings"
1407
+ msgstr "In de locatie lijst"
1408
 
1409
+ #: admin/class-settings.php:954
1410
+ msgid "In the info window on the map"
1411
+ msgstr "In de info window op de kaart"
1412
 
1413
+ #: admin/class-settings.php:1010
1414
+ msgid "12 Hours"
1415
+ msgstr "12 uur"
1416
 
1417
+ #: admin/class-settings.php:1011
1418
+ msgid "24 Hours"
1419
+ msgstr "24 uur"
1420
 
1421
+ #: admin/roles.php:20
1422
+ msgid "Store Locator Manager"
1423
+ msgstr "Store Locator Beheerder"
1424
 
1425
+ #: admin/templates/map-settings.php:12
1426
+ msgid "Google Maps API"
1427
+ msgstr "Google Maps API"
1428
 
1429
+ #: admin/templates/map-settings.php:15
1430
+ msgid "API key"
1431
+ msgstr "API sleutel"
1432
 
1433
+ #: admin/templates/map-settings.php:15
1434
+ #, php-format
1435
+ msgid ""
1436
+ "A valid %sAPI key%s allows you to monitor the API usage and is required if "
1437
+ "you need to purchase additional quota."
1438
+ msgstr ""
1439
+ "Een geldige %sAPI sleutel%s maakt het mogelijk om het gebruik van de API in "
1440
+ "de gaten te houden en is verplicht als je de API limiet wil verhogen."
1441
 
1442
+ #: admin/templates/map-settings.php:16
1443
+ msgid "Optional"
1444
+ msgstr "Optioneel"
1445
 
1446
+ #: admin/templates/map-settings.php:19
1447
+ msgid "Map language"
1448
+ msgstr "Kaart taal"
1449
 
1450
+ #: admin/templates/map-settings.php:19
1451
+ msgid "If no map language is selected the browser's prefered language is used."
1452
+ msgstr ""
1453
+ "Als er geen kaart taal is geselecteerd, dan word de standaard browser taal "
1454
+ "gebruikt."
1455
+
1456
+ #: admin/templates/map-settings.php:25
1457
+ msgid "Map region"
1458
+ msgstr "Kaart regio"
1459
+
1460
+ #: admin/templates/map-settings.php:25
1461
+ #, php-format
1462
+ msgid ""
1463
+ "This will bias the geocoding results towards the selected region. %s If no "
1464
+ "region is selected the bias is set to the United States."
1465
+ msgstr ""
1466
+ "Dit zorgt er voor dat de geocode resultaten uit de geselecteerde regio "
1467
+ "voorkeur krijgen over resultaten uit andere regio's . %s Als er geen regio "
1468
+ "is geselecteerd dan gaat de voorkeur uit naar de Verenigde Staten."
1469
+
1470
+ #: admin/templates/map-settings.php:31 admin/templates/map-settings.php:73
1471
+ #: admin/templates/map-settings.php:163 admin/templates/map-settings.php:256
1472
+ #: admin/templates/map-settings.php:282 admin/templates/map-settings.php:332
1473
+ #: admin/templates/map-settings.php:358 admin/templates/map-settings.php:455
1474
+ #: admin/templates/map-settings.php:476
1475
+ msgid "Save Changes"
1476
+ msgstr "Wijzigingen opslaan"
1477
+
1478
+ #: admin/templates/map-settings.php:41 admin/templates/map-settings.php:383
1479
+ #: admin/templates/map-settings.php:384 frontend/templates/default.php:43
1480
+ #: frontend/templates/store-listings-below.php:43 inc/wpsl-functions.php:97
1481
+ msgid "Search"
1482
+ msgstr "Zoek"
1483
+
1484
+ #: admin/templates/map-settings.php:44
1485
+ msgid "Show the max results dropdown?"
1486
+ msgstr "Toon de max resultaten dropdown?"
1487
+
1488
+ #: admin/templates/map-settings.php:48
1489
+ msgid "Show the search radius dropdown?"
1490
+ msgstr "Toon de zoek radius dropdown?"
1491
+
1492
+ #: admin/templates/map-settings.php:52
1493
+ msgid "Show the category dropdown?"
1494
+ msgstr "Toon de categorie dropdown?"
1495
+
1496
+ #: admin/templates/map-settings.php:56
1497
+ msgid "Distance unit"
1498
+ msgstr "Afstands eenheid"
1499
+
1500
+ #: admin/templates/map-settings.php:59
1501
+ msgid "km"
1502
+ msgstr "km"
1503
+
1504
+ #: admin/templates/map-settings.php:61
1505
+ msgid "mi"
1506
+ msgstr "mi"
1507
+
1508
+ #: admin/templates/map-settings.php:65
1509
+ msgid "Max search results"
1510
+ msgstr "Max zoek resultaten"
1511
 
1512
+ #: admin/templates/map-settings.php:65 admin/templates/map-settings.php:69
1513
+ msgid "The default value is set between the [ ]."
1514
+ msgstr "* De standaard waarde staat tussen de []."
1515
 
1516
+ #: admin/templates/map-settings.php:69
1517
+ msgid "Search radius options"
1518
+ msgstr "Zoek radius opties"
1519
 
1520
+ #: admin/templates/map-settings.php:83
1521
+ msgid "Map"
1522
+ msgstr "Kaart"
1523
 
1524
+ #: admin/templates/map-settings.php:86
1525
+ msgid "Attempt to auto-locate the user"
1526
+ msgstr "Probeer de locatie van de gebruiker automatische te achterhalen"
1527
+
1528
+ #: admin/templates/map-settings.php:90
1529
+ msgid "Load locations on page load"
1530
+ msgstr "Toon alle locaties op de kaart zodra de pagina geladen is"
1531
+
1532
+ #: admin/templates/map-settings.php:94
1533
+ msgid "Number of locations to show"
1534
+ msgstr "Aantal getoonde locaties"
1535
+
1536
+ #: admin/templates/map-settings.php:94
1537
  #, php-format
1538
+ msgid ""
1539
+ "Although the location data is cached after the first load, a lower number "
1540
+ "will result in the map being more responsive. %s If this field is left empty "
1541
+ "or set to 0, then all locations are loaded."
1542
  msgstr ""
1543
+ "Ondanks dat de winkel data in het cache worden opgeslagen, is het aan te "
1544
+ "raden om het aantal winkels wat tegelijk geladen wordt niet te groot te "
1545
+ "laten worden. Dit zorgt er voor dat de kaart vloeiender blijft reageren. %s "
1546
+ "Als het veld leeg blijft of er wordt 0 ingevuld, dan worden alle locaties "
1547
+ "geladen."
1548
 
1549
+ #: admin/templates/map-settings.php:98
1550
+ msgid "Start point"
1551
+ msgstr "Start locatie"
1552
+
1553
+ #: admin/templates/map-settings.php:98
1554
  #, php-format
1555
+ msgid ""
1556
+ "%sRequired field.%s %s If auto-locating the user is disabled or fails, the "
1557
+ "center of the provided city or country will be used as the initial starting "
1558
+ "point for the user."
1559
+ msgstr ""
1560
+ "%sVerplicht veld.%s %s Als het automatische achterhalen van de gebruikers "
1561
+ "locatie is uitgeschakeld of mislukt, dan wordt het middelpunt van de "
1562
+ "opgegeven locatie als begin punt gebruikt."
1563
 
1564
+ #: admin/templates/map-settings.php:103
1565
+ msgid "Initial zoom level"
1566
+ msgstr "Start zoom niveau"
1567
 
1568
+ #: admin/templates/map-settings.php:107
1569
+ msgid "Max auto zoom level"
1570
+ msgstr "Max zoom niveau"
1571
 
1572
+ #: admin/templates/map-settings.php:107
1573
+ #, php-format
1574
+ msgid ""
1575
+ "This value sets the zoom level for the \"Zoom here\" link in the info "
1576
+ "window. %s It is also used to limit the zooming when the viewport of the map "
1577
+ "is changed to make all the markers fit on the screen."
1578
+ msgstr ""
1579
+ "Deze waarde word gebruikt om het zoom niveau te bepalen voor de \"Zoom hier"
1580
+ "\" link in de info window. %s Het wordt ook gebruikt om het zoom niveau te "
1581
+ "limiteren als de viewport van de kaart verandert, wanneer geprobeerd wordt "
1582
+ "om alle markers op het scherm te laten passen."
1583
 
1584
+ #: admin/templates/map-settings.php:111
1585
+ msgid "Show the street view controls?"
1586
+ msgstr "Toon de street view controls?"
1587
 
1588
+ #: admin/templates/map-settings.php:115
1589
+ msgid "Show the pan controls?"
1590
+ msgstr "Toon de pan controls?"
1591
 
1592
+ #: admin/templates/map-settings.php:119
1593
+ msgid "Show the map type control?"
1594
+ msgstr "Toon de kaart type controls?"
1595
 
1596
+ #: admin/templates/map-settings.php:123
1597
+ msgid "Enable scroll wheel zooming?"
1598
+ msgstr "Activeer het inzoomen met je scrollwheel?"
1599
 
1600
+ #: admin/templates/map-settings.php:127
1601
+ msgid "Zoom control position"
1602
+ msgstr "Zoom bediening positie"
1603
 
1604
+ #: admin/templates/map-settings.php:130
1605
+ msgid "Left"
1606
+ msgstr "links"
1607
 
1608
+ #: admin/templates/map-settings.php:132
1609
+ msgid "Right"
1610
+ msgstr "rechts"
1611
 
1612
+ #: admin/templates/map-settings.php:136
1613
+ msgid "Zoom control style"
1614
+ msgstr "Zoom bediening stijl"
1615
 
1616
+ #: admin/templates/map-settings.php:139
1617
+ msgid "Small"
1618
+ msgstr "klein"
1619
 
1620
+ #: admin/templates/map-settings.php:141
1621
+ msgid "Large"
1622
+ msgstr "groot"
1623
 
1624
+ #: admin/templates/map-settings.php:145
1625
+ msgid "Map type"
1626
+ msgstr "Kaart soort"
1627
 
1628
+ #: admin/templates/map-settings.php:149
1629
+ msgid "Map style"
1630
+ msgstr "Kaart stijl"
1631
 
1632
+ #: admin/templates/map-settings.php:149
1633
+ msgid ""
1634
+ "Custom map styles only work if the map type is set to \"Roadmap\" or "
1635
+ "\"Terrain\"."
1636
+ msgstr ""
1637
+ "Custom map stijlen werken alleen maar als de kaart soort op \"Wegenkaart\" "
1638
+ "of \"Terrein\" is gezet."
1639
 
1640
+ #: admin/templates/map-settings.php:152
1641
+ #, php-format
1642
+ msgid ""
1643
+ "You can use existing map styles from %sSnazzy Maps%s or %sMap Stylr%s and "
1644
+ "paste it in the textarea below, or you can generate a custom map style "
1645
+ "through the %sMap Style Editor%s or %sStyled Maps Wizard%s."
1646
+ msgstr ""
1647
+ "Je kan bestaande map stijlen van %sSnazzy Maps%s of %sMap Stylr%s kopieren "
1648
+ "en in het onderstaande tekstvlak plaatsen. Of je kan de map stijl genereren "
1649
+ "via de %sMap Style Editor%s of de %sStyled Maps Wizard%s."
1650
 
1651
+ #: admin/templates/map-settings.php:153
1652
+ #, php-format
1653
+ msgid ""
1654
+ "If you like to write the style code yourself, then you can find the "
1655
+ "documentation from Google %shere%s."
1656
+ msgstr ""
1657
+ "Als je zelf de stijl code wil schrijven dan kun je de documentatie %shier%s "
1658
+ "vinden."
1659
 
1660
+ #: admin/templates/map-settings.php:155
1661
+ msgid "Preview Map Style"
1662
+ msgstr "Map stijl voorbeeld"
1663
+
1664
+ #: admin/templates/map-settings.php:159
1665
+ msgid "Show credits?"
1666
+ msgstr "Toon credits?"
1667
 
1668
+ #: admin/templates/map-settings.php:159
1669
+ msgid ""
1670
+ "This will place a \"Search provided by WP Store Locator\" backlink below the "
1671
+ "map."
1672
+ msgstr ""
1673
+ "Dit plaatst een \"Ondersteund door WP Store Locator\" link onder de kaart."
1674
 
1675
+ #: admin/templates/map-settings.php:173
1676
+ msgid "User Experience"
1677
+ msgstr "Gebruikers ervaring"
1678
 
1679
+ #: admin/templates/map-settings.php:176
1680
+ msgid "Store Locator height"
1681
+ msgstr "Store Locator hoogte"
1682
 
1683
+ #: admin/templates/map-settings.php:180
1684
+ msgid "Max width for the info window content"
1685
+ msgstr "Max breedte voor de info window inhoud"
1686
 
1687
+ #: admin/templates/map-settings.php:184
1688
+ msgid "Search field width"
1689
+ msgstr "Zoekveld breedte"
1690
 
1691
+ #: admin/templates/map-settings.php:188
1692
+ msgid "Search and radius label width"
1693
+ msgstr "Zoek en radius label breedte"
1694
 
1695
+ #: admin/templates/map-settings.php:192
1696
+ msgid "Store Locator template"
1697
+ msgstr "Store locator template"
1698
 
1699
+ #: admin/templates/map-settings.php:192
1700
+ #, php-format
1701
+ msgid ""
1702
+ "The selected template is used with the [wpsl] shortcode. %s You can add a "
1703
+ "custom template with the %swpsl_templates%s filter."
1704
+ msgstr ""
1705
+ "De geselecteerde template wordt gebruikt bij de [wpsl] shortcode. %s Je kunt "
1706
+ "een custom template gebruiken met behulp van de %swpsl_templates%s filter."
1707
 
1708
+ #: admin/templates/map-settings.php:196
1709
+ msgid "Hide the scrollbar?"
1710
+ msgstr "Verberg de scrollbar?"
1711
 
1712
+ #: admin/templates/map-settings.php:200
1713
+ msgid "Open links in a new window?"
1714
+ msgstr "Open links in een nieuw venster?"
1715
 
1716
+ #: admin/templates/map-settings.php:204
1717
+ msgid "Show a reset map button?"
1718
+ msgstr "Toon een knop om de kaart te resetten?"
1719
 
1720
+ #: admin/templates/map-settings.php:208
1721
+ msgid ""
1722
+ "When a user clicks on \"Directions\", open a new window, and show the route "
1723
+ "on google.com/maps ?"
1724
+ msgstr ""
1725
+ "Zodra een gebruiker op \"Route\" klikt, open een nieuwe venster en toon de "
1726
+ "route op google.com/maps?"
1727
 
1728
+ #: admin/templates/map-settings.php:212
1729
+ msgid "Show a \"More info\" link in the store listings?"
1730
+ msgstr "Toon een \"Meer info\" link in de locatie lijst?"
1731
 
1732
+ #: admin/templates/map-settings.php:212
1733
+ #, php-format
1734
  msgid ""
1735
+ "This places a \"More Info\" link below the address and will show the phone, "
1736
+ "fax, email, opening hours and description once the link is clicked. %s If "
1737
+ "you for example want the contact details to always be visible, then please "
1738
+ "follow the instructions on %sthis%s page."
1739
  msgstr ""
1740
+ "Dit plaatst een \"Meer info\" link onder het adres, en toont zodra er op de "
1741
+ "link geklikt wordt het telefoon / fax numer, email, openingstijden en "
1742
+ "omschrijving. %s Als je bijvoorbeeld de contact gegevens altijd wil tonen, "
1743
+ "volg dan de instructies op %sdeze%s pagina."
1744
+
1745
+ #: admin/templates/map-settings.php:216
1746
+ msgid "Where do you want to show the \"More info\" details?"
1747
+ msgstr "Waar wil je de \"Meer info\" details tonen?"
1748
+
1749
+ #: admin/templates/map-settings.php:220
1750
+ msgid "Make the store name clickable if a store URL exists?"
1751
+ msgstr "Als een winkel url bestaat, maak de winkel naam dan klikbaar?"
1752
 
1753
+ #: admin/templates/map-settings.php:220
1754
+ #, php-format
1755
  msgid ""
1756
+ "If %spermalinks%s are enabled, the store name will always link to the store "
1757
+ "page."
1758
  msgstr ""
1759
+ "Als de %spermalinks%s zijn ingeschakeld dan zal de winkel naam altijd linken "
1760
+ "naar de winkel pagina."
1761
+
1762
+ #: admin/templates/map-settings.php:224
1763
+ msgid "Make the phone number clickable on mobile devices?"
1764
+ msgstr "Maak het telefoonnummer klikbaar op mobiele apparaten?"
1765
 
1766
+ #: admin/templates/map-settings.php:228
1767
  msgid ""
1768
+ "If street view is available for the current location, then show a \"Street "
1769
+ "view\" link in the info window?"
1770
  msgstr ""
1771
+ "Als voor de huidge locatie street view beschikbaar is, toon dan een \"Street "
1772
+ "view\" link om vanuit de info window?"
1773
 
1774
+ #: admin/templates/map-settings.php:228
1775
+ #, php-format
1776
  msgid ""
1777
+ "Enabling this option can sometimes result in a small delay in the opening of "
1778
+ "the info window. %s This happens because an API request is made to Google "
1779
+ "Maps to check if street view is available for the current location."
1780
  msgstr ""
1781
+ "Het activeren van deze optie kan er soms toe leiden dat er een kleine "
1782
+ "vertraging optreed bij het openen van de info window. %s Dit gebeurt omdat "
1783
+ "er een verzoek naar de Google Maps API word gemaakt om te controleren ofdat "
1784
+ "street view wel beschikbaar is voor de huidige locatie."
1785
+
1786
+ #: admin/templates/map-settings.php:232
1787
+ msgid "Show a \"Zoom here\" link in the info window?"
1788
+ msgstr "Toon een \"zoom hier\" link in de info window?"
1789
 
1790
+ #: admin/templates/map-settings.php:232
1791
+ #, php-format
1792
  msgid ""
1793
+ "Clicking this link will make the map zoom in to the %s max auto zoom level "
1794
+ "%s."
1795
  msgstr ""
1796
+ "Als er op deze link geklikt word dan zoomt de kaart in totdat de %s max auto "
1797
+ "zoom level %s bereikt is."
1798
 
1799
+ #: admin/templates/map-settings.php:236
1800
+ msgid "On page load move the mouse cursor to the search field?"
1801
+ msgstr ""
1802
+ "Als de pagina wordt geladen, verplaats de muiscursor dan naar het invulveld?"
1803
 
1804
+ #: admin/templates/map-settings.php:236
1805
+ #, php-format
1806
  msgid ""
1807
+ "If the store locator is not placed at the top of the page, enabling this "
1808
+ "feature can result in the page scrolling down. %s %sThis option is disabled "
1809
+ "on mobile devices.%s"
 
1810
  msgstr ""
1811
+ "Als de store locator niet bovenaan de pagina geplaatst wordt, dan kan deze "
1812
+ "instelling ervoor zorgen dat de pagina naar benenden schuift tijden het "
1813
+ "laden. %s %sDeze optie staat uit op mobiele apparaten.%s"
 
 
1814
 
1815
+ #: admin/templates/map-settings.php:240
1816
+ msgid "Use the default style for the info window?"
1817
+ msgstr "Gebruik de standaard style voor de info window?"
1818
+
1819
+ #: admin/templates/map-settings.php:240
1820
+ #, php-format
1821
  msgid ""
1822
+ "If the default style is disabled the %sInfoBox%s library will be used "
1823
+ "instead. %s This enables you to easily change the look and feel of the info "
1824
+ "window through the .wpsl-infobox css class."
1825
+ msgstr ""
1826
+ "Als de standaard stijl is uitgeschakeld dan wordt het %sInfoBox%s script "
1827
+ "gebruikt. %s Dit script maakt het mogelijk om makkelijk het ontwerp te "
1828
+ "wijzigen met behulp van de .wpsl-infobox css class."
1829
+
1830
+ #: admin/templates/map-settings.php:244
1831
+ msgid "Hide the distance in the search results?"
1832
+ msgstr "Verberg de afstand in de zoek resultaten?"
1833
+
1834
+ #: admin/templates/map-settings.php:248
1835
+ msgid "If a user hovers over the search results the store marker"
1836
  msgstr ""
1837
+ "Als een gebruiker over de zoekresultaten beweegt met zijn muis de "
1838
+ "bijbehorende marker"
 
1839
 
1840
+ #: admin/templates/map-settings.php:248
1841
  #, php-format
1842
  msgid ""
1843
+ "If marker clusters are enabled this option will not work as expected as long "
1844
+ "as the markers are clustered. %s The bouncing of the marker won't be visible "
1845
+ "at all unless a user zooms in far enough for the marker cluster to change "
1846
+ "back in to individual markers. %s The info window will open as expected, but "
1847
+ "it won't be clear to which marker it belongs to. "
1848
  msgstr ""
1849
+ "Als de marker cluster optie actief is en de markers op de kaart als cluster "
1850
+ "te zien zijn, dan werkt deze optie niet als verwacht. %s Het op en neer gaan "
1851
+ "van de markers is niet zichtbaar totdat een gebruiker ver genoeg inzoomt, en "
1852
+ "de marker cluster wordt omgezet naar losse markers. %s De info window wordt "
1853
+ "wel geopend, maar het is niet duidelijk bij welke marker het hoort."
1854
 
1855
+ #: admin/templates/map-settings.php:252
1856
+ msgid "Address format"
1857
+ msgstr "Adres formaat"
1858
 
1859
+ #: admin/templates/map-settings.php:252
1860
+ #, php-format
1861
  msgid ""
1862
+ "You can add custom address formats with the %swpsl_address_formats%s filter."
 
 
1863
  msgstr ""
1864
+ "Je kunt een nieuwe adres formaat toevoegen met de %swpsl_address_formats%s "
1865
+ "filter."
 
 
1866
 
1867
+ #: admin/templates/map-settings.php:266
1868
+ msgid "Markers"
1869
+ msgstr "Markers"
1870
 
1871
+ #: admin/templates/map-settings.php:270
1872
+ msgid "Enable marker clusters?"
1873
+ msgstr "Activeer marker clusters?"
1874
 
1875
+ #: admin/templates/map-settings.php:270
1876
+ msgid "Recommended for maps with a large amount of markers."
1877
+ msgstr "Aan te raden voor kaarten met grote hoeveelheden markers."
1878
 
1879
+ #: admin/templates/map-settings.php:274
1880
+ msgid "Max zoom level"
1881
+ msgstr "Max zoom niveau"
1882
 
1883
+ #: admin/templates/map-settings.php:274
1884
+ msgid ""
1885
+ "If this zoom level is reached or exceeded, then all markers are moved out of "
1886
+ "the marker cluster and shown as individual markers."
1887
+ msgstr ""
1888
+ "Als dit zoom niveau bereikt is of gepasseerd, dan worden alle markers uit de "
1889
+ "marker cluster gehaald en als losse markers getoond."
1890
 
1891
+ #: admin/templates/map-settings.php:278
1892
+ msgid "Cluster size"
1893
+ msgstr "Cluster grote"
1894
+
1895
+ #: admin/templates/map-settings.php:278
1896
  #, php-format
1897
  msgid ""
1898
+ "The grid size of a cluster in pixels. %s A larger number will result in a "
1899
+ "lower amount of clusters and also make the algorithm run faster."
1900
  msgstr ""
1901
+ "Het grid formaat van een cluster in pixels. %s Een hoger nummer zorgt er "
1902
+ "voor dat er minder clusters zichtbaar zijn en het algoritme dus ook sneller "
1903
+ "klaar is."
1904
+
1905
+ #: admin/templates/map-settings.php:292
1906
+ msgid "Store Editor"
1907
+ msgstr "Winkel editor"
1908
 
1909
+ #: admin/templates/map-settings.php:295
1910
+ msgid "Default country"
1911
+ msgstr "Standaard land"
1912
 
1913
+ #: admin/templates/map-settings.php:299
1914
+ msgid "Map type for the location preview"
1915
+ msgstr "Kaart type voor het lokatie voorbeeld"
1916
 
1917
+ #: admin/templates/map-settings.php:303
1918
+ msgid "Hide the opening hours?"
1919
+ msgstr "Verberg de openingstijden?"
1920
 
1921
+ #: admin/templates/map-settings.php:309
1922
+ msgid "Opening hours input type"
1923
+ msgstr "Openingstijden formaat"
1924
 
1925
+ #: admin/templates/map-settings.php:313
1926
+ #, php-format
1927
  msgid ""
1928
+ "Opening hours created in version 1.x %sare not%s automatically converted to "
1929
+ "the new dropdown format."
1930
  msgstr ""
1931
+ "De openingstijden die zijn aangemaakt in versie 1.x %sworden niet%s "
1932
+ "automatische omgezet naar het dropdown formaat."
1933
 
1934
+ #: admin/templates/map-settings.php:316 admin/templates/map-settings.php:325
1935
+ msgid "The default opening hours"
1936
+ msgstr "De standaard openingstijden"
1937
 
1938
+ #: admin/templates/map-settings.php:322
1939
+ msgid "Opening hours format"
1940
+ msgstr "Openingstijden formaat"
1941
 
1942
+ #: admin/templates/map-settings.php:329
1943
+ msgid ""
1944
+ "The default country and opening hours are only used when a new store is "
1945
+ "created. So changing the default values will have no effect on existing "
1946
+ "store locations."
1947
+ msgstr ""
1948
+ "De standaard waardes voor het land en de openingstijden worden alleen "
1949
+ "gebruikt als een nieuwe locatie wordt aangemaakt. Het wijzigen van deze "
1950
+ "waardes heeft dus geen enkele invloed op de bestaande locaties."
1951
 
1952
+ #: admin/templates/map-settings.php:342
1953
+ msgid "Permalink"
1954
+ msgstr "Permalink"
1955
 
1956
+ #: admin/templates/map-settings.php:345
1957
+ msgid "Enable permalink?"
1958
+ msgstr "Activeer permalink?"
1959
 
1960
+ #: admin/templates/map-settings.php:349
1961
+ msgid "Store slug"
1962
+ msgstr "Winkel slug"
1963
 
1964
+ #: admin/templates/map-settings.php:353
1965
+ msgid "Category slug"
1966
+ msgstr "Categorie slug"
1967
 
1968
+ #: admin/templates/map-settings.php:356
1969
+ #, php-format
1970
+ msgid "The permalink slugs %smust be unique%s on your site."
1971
+ msgstr "De permalink slug %smoet uniek%s zijn op je site."
1972
 
1973
+ #: admin/templates/map-settings.php:368
1974
+ msgid "Labels"
1975
+ msgstr "Labels"
1976
 
1977
+ #: admin/templates/map-settings.php:371 admin/templates/map-settings.php:372
1978
+ #: frontend/templates/default.php:11
1979
+ #: frontend/templates/store-listings-below.php:11 inc/wpsl-functions.php:96
1980
+ msgid "Your location"
1981
+ msgstr "Uw locatie"
1982
 
1983
+ #: admin/templates/map-settings.php:375 admin/templates/map-settings.php:376
1984
+ #: frontend/templates/default.php:20
1985
+ #: frontend/templates/store-listings-below.php:20 inc/wpsl-functions.php:99
1986
+ msgid "Search radius"
1987
+ msgstr "Zoek radius"
1988
 
1989
+ #: admin/templates/map-settings.php:379 admin/templates/map-settings.php:380
1990
+ #: frontend/class-frontend.php:1296 inc/wpsl-functions.php:100
1991
+ msgid "No results found"
1992
+ msgstr "Geen resultaten gevonden"
1993
 
1994
+ #: admin/templates/map-settings.php:387
1995
+ msgid "Searching (preloader text)"
1996
+ msgstr "Aan het zoeken (preloader tekst)"
1997
 
1998
+ #: admin/templates/map-settings.php:388 frontend/class-frontend.php:1295
1999
+ #: inc/wpsl-functions.php:98
2000
+ msgid "Searching..."
2001
+ msgstr "Zoeken..."
2002
 
2003
+ #: admin/templates/map-settings.php:391 admin/templates/map-settings.php:392
2004
+ #: frontend/templates/default.php:29
2005
+ #: frontend/templates/store-listings-below.php:29 inc/wpsl-functions.php:101
2006
+ msgid "Results"
2007
+ msgstr "Resultaten"
2008
 
2009
+ #: admin/templates/map-settings.php:395 admin/upgrade.php:218
2010
+ #: inc/wpsl-functions.php:115
2011
+ msgid "Category filter"
2012
+ msgstr "Categorie filter"
 
 
 
 
 
2013
 
2014
+ #: admin/templates/map-settings.php:396 frontend/class-frontend.php:1082
2015
+ msgid "Category"
2016
+ msgstr "Categorie"
2017
 
2018
+ #: admin/templates/map-settings.php:399 admin/templates/map-settings.php:400
2019
+ #: admin/upgrade.php:66 frontend/class-frontend.php:1297
2020
+ #: frontend/underscore-functions.php:114 frontend/underscore-functions.php:141
2021
+ #: inc/wpsl-functions.php:102
2022
+ msgid "More info"
2023
+ msgstr "Meer info"
2024
 
2025
+ #: admin/templates/map-settings.php:403 admin/templates/map-settings.php:404
2026
+ #: frontend/class-frontend.php:661 frontend/underscore-functions.php:29
2027
+ #: frontend/underscore-functions.php:121 inc/wpsl-functions.php:110
2028
+ msgid "Phone"
2029
+ msgstr "Telefoon"
2030
 
2031
+ #: admin/templates/map-settings.php:423 admin/templates/map-settings.php:424
2032
+ #: frontend/class-frontend.php:1302 inc/wpsl-functions.php:95
2033
+ msgid "Start location"
2034
+ msgstr "Start locatie"
2035
 
2036
+ #: admin/templates/map-settings.php:427
2037
+ msgid "Get directions"
2038
+ msgstr "Toon routebeschrijving"
2039
 
2040
+ #: admin/templates/map-settings.php:428 frontend/class-frontend.php:1300
2041
+ #: inc/wpsl-functions.php:103
2042
+ msgid "Directions"
2043
+ msgstr "Routebeschrijving"
2044
 
2045
+ #: admin/templates/map-settings.php:431
2046
+ msgid "No directions found"
2047
+ msgstr "Geen routebeschrijving beschikbaar"
2048
 
2049
+ #: admin/templates/map-settings.php:432 admin/upgrade.php:163
2050
+ #: frontend/class-frontend.php:1301 inc/wpsl-functions.php:104
2051
+ msgid "No route could be found between the origin and destination"
2052
+ msgstr "Er kon geen route gevonden worden tussen het begin- en eindpunt"
2053
 
2054
+ #: admin/templates/map-settings.php:435 admin/templates/map-settings.php:436
2055
+ #: admin/upgrade.php:87 frontend/class-frontend.php:1303
2056
+ #: inc/wpsl-functions.php:105
2057
+ msgid "Back"
2058
+ msgstr "Terug"
2059
 
2060
+ #: admin/templates/map-settings.php:439 admin/templates/map-settings.php:440
2061
+ #: admin/upgrade.php:155 frontend/class-frontend.php:1304
2062
+ #: inc/wpsl-functions.php:106
2063
+ msgid "Street view"
2064
+ msgstr "Street view"
2065
+
2066
+ #: admin/templates/map-settings.php:443 admin/templates/map-settings.php:444
2067
+ #: admin/upgrade.php:159 frontend/class-frontend.php:1305
2068
+ #: inc/wpsl-functions.php:107
2069
+ msgid "Zoom here"
2070
+ msgstr "Zoom hier"
2071
+
2072
+ #: admin/templates/map-settings.php:447
2073
+ msgid "General error"
2074
+ msgstr "Foutmelding"
2075
+
2076
+ #: admin/templates/map-settings.php:448 frontend/class-frontend.php:1298
2077
+ #: inc/wpsl-functions.php:108
2078
+ msgid "Something went wrong, please try again!"
2079
+ msgstr "Er ging iets fout, probeer het nog een keer!"
2080
+
2081
+ #: admin/templates/map-settings.php:451
2082
+ msgid "Query limit error"
2083
+ msgstr "Query limit foutmelding"
2084
 
2085
+ #: admin/templates/map-settings.php:451
2086
+ #, php-format
2087
  msgid ""
2088
+ "You can raise the %susage limit%s by obtaining an API %skey%s, and fill in "
2089
+ "the \"API key\" field at the top of this page."
2090
  msgstr ""
2091
+ "Je kan de %sgebruiks limiet%s verhogen door een API %ssleutel%s aan te "
2092
+ "vragen en die in het \"API sleutel\" veld bovenaan de pagina in te vullen."
2093
 
2094
+ #: admin/templates/map-settings.php:452 frontend/class-frontend.php:1299
2095
+ #: inc/wpsl-functions.php:109
2096
+ msgid "API usage limit reached"
2097
+ msgstr "API gebruikslimiet bereikt"
2098
 
2099
+ #: admin/templates/map-settings.php:465
2100
+ msgid "Tools"
2101
+ msgstr "Tools"
2102
 
2103
+ #: admin/templates/map-settings.php:468
2104
+ msgid "Enable store locator debug?"
2105
+ msgstr "Activeer store locator debug?"
2106
 
2107
+ #: admin/templates/map-settings.php:468
2108
+ #, php-format
2109
+ msgid ""
2110
+ "This disables the WPSL transient cache. %sThe transient cache is only used "
2111
+ "if the %sLoad locations on page load%s option is enabled."
2112
+ msgstr ""
2113
+ "Dit schakelt het WPSL transient cache uit. %sHet transient cache wordt "
2114
+ "alleen gebruikt als de %sToon alle locaties op de kaart zodra de pagina "
2115
+ "geladen is%s optie is geactiveerd."
2116
+
2117
+ #: admin/templates/map-settings.php:472
2118
+ msgid "WPSL transients"
2119
+ msgstr "WPSL transients"
2120
+
2121
+ #: admin/templates/map-settings.php:473
2122
+ msgid "Clear store locator transient cache"
2123
+ msgstr "Verwijder het store locator transient cache."
2124
+
2125
+ #: admin/upgrade.php:82
2126
+ msgid "info window"
2127
+ msgstr "info window"
2128
 
2129
+ #: admin/upgrade.php:92
2130
+ msgid "Reset"
2131
+ msgstr "Herstel"
2132
+
2133
+ #: admin/upgrade.php:186 inc/wpsl-functions.php:90
2134
+ msgid "stores"
2135
+ msgstr "winkels"
2136
+
2137
+ #: admin/upgrade.php:190 inc/wpsl-functions.php:91
2138
+ msgid "store-category"
2139
+ msgstr "winkel-categorie"
2140
+
2141
+ #: admin/upgrade.php:371
2142
+ #, php-format
2143
  msgid ""
2144
+ "Because you updated WP Store Locator from version 1.x, the %s current store "
2145
+ "locations need to be %sconverted%s to custom post types."
2146
  msgstr ""
2147
+ "Doordat je WP Store Locator update van versie 1.x, de %s huidige winkel "
2148
+ "locaties moeten worden %somgezet%s naar custom post types."
2149
 
2150
+ #: admin/upgrade.php:392
2151
+ #, php-format
2152
+ msgid ""
2153
+ "The script converting the locations timed out. %s You can click the \"Start "
2154
+ "Converting\" button again to restart the script. %s If there are thousands "
2155
+ "of store locations left to convert and you keep seeing this message, then "
2156
+ "you can try to contact your host and ask if they can increase the maximum "
2157
+ "execution time. %s The plugin tried to disable the maximum execution time, "
2158
+ "but if you are reading this then that failed."
2159
+ msgstr ""
2160
+ "Het script wat de winkel locaties omzet timed out. %s Je kunt op de \"Begin "
2161
+ "met omzetten\" knop klikken om het script opnieuw te starten. %s Als er "
2162
+ "duizenden winkel locaties zijn die nog omgezet moeten worden en je blijft "
2163
+ "deze boodschap zien dan kun je proberen om contact op te nemen met je host "
2164
+ "en vragen ofdat ze de maximum execution time kunnen verhogen. %s De plugin "
2165
+ "heeft al geprobeerd om de maximum execution time uit te zetten, maar als je "
2166
+ "dit leest dan is dat mislukt."
2167
+
2168
+ #: admin/upgrade.php:413
2169
+ msgid "Store locations to convert:"
2170
+ msgstr "Locaties die omgezet worden:"
2171
+
2172
+ #: admin/upgrade.php:415
2173
+ msgid "Start Converting"
2174
+ msgstr "Begin met omzetten"
2175
+
2176
+ #: admin/upgrade.php:537
2177
+ #, php-format
2178
+ msgid ""
2179
+ "All the store locations are now converted to custom post types. %s You can "
2180
+ "view them on the %sAll Stores%s page."
2181
+ msgstr ""
2182
+ "Alle winkel locaties zijn nu omgezet naar custom post types. %s Je kunt ze "
2183
+ "bekijken op de %sAlle Winkels%s pagina."
2184
 
2185
+ #: frontend/class-frontend.php:599
2186
+ msgid ""
2187
+ "If you use the [wpsl_address] shortcode outside a store page you need to set "
2188
+ "the ID attribute."
2189
  msgstr ""
2190
+ "Als je de [wpsl_address] shortcode op een pagina gebruikt die geen winkel "
2191
+ "pagina is dan is de ID attribute verplicht."
2192
 
2193
+ #: frontend/class-frontend.php:710
2194
  msgid ""
2195
+ "If you use the [wpsl_hours] shortcode outside a store page you need to set "
2196
+ "the ID attribute."
2197
  msgstr ""
2198
+ "Als je de [wpsl_hours] shortcode op een pagina gebruikt die geen winkel "
2199
+ "pagina is dan is de ID attribute verplicht."
2200
 
2201
+ #: frontend/class-frontend.php:759
2202
  msgid ""
2203
+ "If you use the [wpsl_map] shortcode outside a store page you need to set the "
2204
+ "ID attribute."
2205
  msgstr ""
2206
+ "Als je de [wpsl_map] shortcode op een pagina gebruikt die geen winkel pagina "
2207
+ "is dan is de ID attribute verplicht."
 
2208
 
2209
+ #: frontend/class-frontend.php:1084
2210
+ msgid "Any"
2211
+ msgstr "Alle"
2212
 
2213
+ #: frontend/class-frontend.php:1197
2214
+ msgid "The application does not have permission to use the Geolocation API."
2215
+ msgstr ""
2216
+ "Deze applicatie heeft geen toestemming om de Geolocation API te gebruiken."
2217
 
2218
+ #: frontend/class-frontend.php:1198
2219
+ msgid "Location information is unavailable."
2220
+ msgstr "Informatie over de huidige locatie is niet beschikbaar."
2221
 
2222
+ #: frontend/class-frontend.php:1199
2223
+ msgid "The geolocation request timed out."
2224
+ msgstr "Het geolocation verzoek timed out."
2225
 
2226
+ #: frontend/class-frontend.php:1200
2227
+ msgid "An unknown error occurred."
2228
+ msgstr " Er heeft zich een onbekende fout voorgedaan."
2229
 
2230
+ #: frontend/templates/default.php:60
2231
+ #: frontend/templates/store-listings-below.php:66
2232
+ #, php-format
2233
+ msgid "Search provided by %sWP Store Locator%s"
2234
+ msgstr "Ondersteund door %sWP Store Locator%s"
2235
 
2236
+ #: inc/class-post-types.php:50
2237
+ msgid "Store"
2238
+ msgstr "winkel"
 
2239
 
2240
+ #: inc/class-post-types.php:51
2241
+ msgid "Stores"
2242
+ msgstr "winkels"
2243
 
2244
+ #: inc/class-post-types.php:55
2245
+ msgid "Store Locator"
2246
+ msgstr "Store Locator"
2247
 
2248
+ #: inc/class-post-types.php:56
2249
+ #, php-format
2250
+ msgid "All %s"
2251
+ msgstr "Alle %s"
2252
 
2253
+ #: inc/class-post-types.php:58 inc/class-post-types.php:61
2254
+ #, php-format
2255
+ msgid "New %s"
2256
+ msgstr "Nieuwe %s"
2257
 
2258
+ #: inc/class-post-types.php:59
2259
+ #, php-format
2260
+ msgid "Add New %s"
2261
+ msgstr "Nieuwe %s"
2262
 
2263
+ #: inc/class-post-types.php:60
2264
+ #, php-format
2265
+ msgid "Edit %s"
2266
+ msgstr "Bewerk %s"
2267
 
2268
+ #: inc/class-post-types.php:62
2269
+ #, php-format
2270
+ msgid "View %s"
2271
+ msgstr "Bekijk %s"
2272
 
2273
+ #: inc/class-post-types.php:63
2274
+ #, php-format
2275
+ msgid "Search %s"
2276
+ msgstr "Zoek %s"
2277
 
2278
+ #: inc/class-post-types.php:64
2279
+ #, php-format
2280
+ msgid "No %s found"
2281
+ msgstr "Geen %s gevonden"
2282
 
2283
+ #: inc/class-post-types.php:65
2284
+ #, php-format
2285
+ msgid "No %s found in trash"
2286
+ msgstr "Geen %s gevonden in de prullenbak"
2287
 
2288
+ #: inc/class-post-types.php:107 inc/class-post-types.php:117
2289
+ msgid "Store Categories"
2290
+ msgstr "Winkel categorieën"
2291
 
2292
+ #: inc/class-post-types.php:108
2293
+ msgid "Store Category"
2294
+ msgstr "Winkel categorie"
2295
 
2296
+ #: inc/class-post-types.php:109
2297
+ msgid "Search Store Categories"
2298
+ msgstr "Zoek winkel categorieën"
2299
 
2300
+ #: inc/class-post-types.php:110
2301
+ msgid "All Store Categories"
2302
+ msgstr "Alle winkel categorieën"
2303
 
2304
+ #: inc/class-post-types.php:111
2305
+ msgid "Parent Store Category"
2306
+ msgstr "Hoofd winkel categorie"
2307
 
2308
+ #: inc/class-post-types.php:112
2309
+ msgid "Parent Store Category:"
2310
+ msgstr "Hoofd winkel categorie:"
2311
 
2312
+ #: inc/class-post-types.php:113
2313
+ msgid "Edit Store Category"
2314
+ msgstr "Wijzig winkel categorie"
2315
 
2316
+ #: inc/class-post-types.php:114
2317
+ msgid "Update Store Category"
2318
+ msgstr "Winkel categorie bijwerken"
2319
 
2320
+ #: inc/class-post-types.php:115
2321
+ msgid "Add New Store Category"
2322
+ msgstr "Voeg winkel categorie toe"
2323
+
2324
+ #: inc/class-post-types.php:116
2325
+ msgid "New Store Category Name"
2326
+ msgstr "Naam winkel categorie"
2327
+
2328
+ #: inc/class-post-types.php:147
2329
+ msgid "Enter store title here"
2330
+ msgstr "Voer winkel naam in"
2331
+
2332
+ #: inc/class-post-types.php:165
2333
+ msgid "Zip"
2334
+ msgstr "Postcode"
2335
+
2336
+ #: inc/wpsl-functions.php:184
2337
+ msgid "Show the store list below the map"
2338
+ msgstr "Toon the locatie lijst onder de kaart"
2339
+
2340
+ #: inc/wpsl-functions.php:201
2341
+ msgid "Monday"
2342
+ msgstr "Maandag"
2343
+
2344
+ #: inc/wpsl-functions.php:202
2345
+ msgid "Tuesday"
2346
+ msgstr "Dinsdag"
2347
+
2348
+ #: inc/wpsl-functions.php:203
2349
+ msgid "Wednesday"
2350
+ msgstr "Woensdag"
2351
+
2352
+ #: inc/wpsl-functions.php:204
2353
+ msgid "Thursday"
2354
+ msgstr "Donderdag"
2355
+
2356
+ #: inc/wpsl-functions.php:205
2357
+ msgid "Friday"
2358
+ msgstr "Vrijdag"
2359
+
2360
+ #: inc/wpsl-functions.php:206
2361
+ msgid "Saturday"
2362
+ msgstr "Zaterdag"
2363
+
2364
+ #: inc/wpsl-functions.php:207
2365
+ msgid "Sunday"
2366
+ msgstr "Zondag"
2367
+
2368
+ #: inc/wpsl-functions.php:237
2369
  #, php-format
2370
+ msgid "Mon %sTue %sWed %sThu %sFri %sSat Closed %sSun Closed"
2371
+ msgstr "ma %sdi %swoe %sdo %svrij %szat gesloten %szo gesloten"
 
 
 
 
 
 
2372
 
2373
+ #: inc/wpsl-functions.php:253
2374
+ msgid "Satellite"
2375
+ msgstr "Satelliet"
2376
 
2377
+ #: inc/wpsl-functions.php:254
2378
+ msgid "Hybrid"
2379
+ msgstr "Hybrid"
2380
 
2381
+ #: inc/wpsl-functions.php:255
2382
+ msgid "Terrain"
2383
+ msgstr "Terrein"
2384
 
2385
+ #: inc/wpsl-functions.php:270
2386
+ msgid "(city) (state) (zip code)"
2387
+ msgstr "(stad) (provincie) (postcode)"
2388
 
2389
+ #: inc/wpsl-functions.php:271
2390
+ msgid "(city), (state) (zip code)"
2391
+ msgstr "(stad), (provincie), (postcode)"
2392
 
2393
+ #: inc/wpsl-functions.php:272
2394
+ msgid "(city) (zip code)"
2395
+ msgstr "(stad) (postcode)"
2396
 
2397
+ #: inc/wpsl-functions.php:273
2398
+ msgid "(city), (zip code)"
2399
+ msgstr "(stad), (postcode)"
2400
 
2401
+ #: inc/wpsl-functions.php:274
2402
+ msgid "(zip code) (city) (state)"
2403
+ msgstr "(postcode) (stad) (provincie)"
2404
 
2405
+ #: inc/wpsl-functions.php:275
2406
+ msgid "(zip code) (city)"
2407
+ msgstr "(postcode) (stad)"
2408
 
2409
+ #~ msgid "If a store url exists, make the store name clickable?"
2410
+ #~ msgstr "Als een winkel url bestaat, maak de winkel naam dan klikbaar?"
 
2411
 
2412
+ #~ msgid "Slug"
2413
+ #~ msgstr "Structuur"
 
2414
 
2415
+ #, fuzzy
2416
+ #~ msgid "Reset Map"
2417
+ #~ msgstr "Herstel"
2418
 
2419
+ #, fuzzy
2420
+ #~ msgid "Show My Location"
2421
+ #~ msgstr "Locatie"
2422
 
2423
+ #~ msgid "Select store search template"
2424
+ #~ msgstr "Selecteer template"
 
2425
 
2426
+ #~ msgid "Design"
2427
+ #~ msgstr "Ontwerp"
2428
+
2429
+ #~ msgid "Position of the map controls"
2430
+ #~ msgstr "Positie van de kaart bediening"
2431
+
2432
+ #~ msgid "API Settings"
2433
+ #~ msgstr "API Instellingen"
2434
+
2435
+ #~ msgid "Design Settings"
2436
+ #~ msgstr "Design instellingen"
2437
+
2438
+ #~ msgid "Update Settings"
2439
+ #~ msgstr "Instellingen bijwerken"
2440
+
2441
+ #~ msgid "Set Store Image"
2442
+ #~ msgstr "Plaats winkel afbeelding"
2443
+
2444
+ #~ msgid "Upload"
2445
+ #~ msgstr "Upload"
2446
+
2447
+ #~ msgid "to"
2448
+ #~ msgstr "tot"
2449
+
2450
+ #~ msgid "Road map"
2451
+ #~ msgstr "Wegenkaart"
2452
+
2453
+ #~ msgid "Add Period"
2454
+ #~ msgstr "Periode toevoegen"
2455
+
2456
+ #~ msgid "Manage Stores"
2457
+ #~ msgstr "Beheer Locaties"
2458
+
2459
+ #~ msgid "Add Store"
2460
+ #~ msgstr "Locatie Toevoegen"
2461
+
2462
+ #~ msgid "FAQ"
2463
+ #~ msgstr "FAQ"
2464
+
2465
+ #~ msgid "There was a problem updating the store details, please try again."
2466
+ #~ msgstr ""
2467
+ #~ "De locatie data kon niet worden gewijzigd, probeer het nog een keer."
2468
+
2469
+ #~ msgid "There was a problem saving the new store details, please try again."
2470
+ #~ msgstr ""
2471
+ #~ "De locatie data kon niet worden opgeslagen, probeer het nog een keer."
2472
+
2473
+ #~ msgid "Store succesfully added."
2474
+ #~ msgstr "Locatie succesvol toegevoegd."
2475
+
2476
+ #~ msgid "Current Stores"
2477
+ #~ msgstr "Huidige Locaties"
2478
+
2479
+ #~ msgid ""
2480
+ #~ "One of the label fields was left empty, the default value for that field "
2481
+ #~ "has been restored."
2482
+ #~ msgstr "Een van de label velden was leeg, de standaard waarde is hersteld."
2483
+
2484
+ #~ msgid "Dismiss"
2485
+ #~ msgstr "Sluiten"
2486
+
2487
+ #~ msgid "Active"
2488
+ #~ msgstr "Actief"
2489
+
2490
+ #~ msgid "Inactive"
2491
+ #~ msgstr "Niet actief"
2492
+
2493
+ #~ msgid "Edit"
2494
+ #~ msgstr "Bewerk"
2495
+
2496
+ #~ msgid "Delete"
2497
+ #~ msgstr "Verwijder"
2498
+
2499
+ #~ msgid "ID"
2500
+ #~ msgstr "ID"
2501
+
2502
+ #~ msgid "Thumbnail"
2503
+ #~ msgstr "Afbeelding"
2504
+
2505
+ #~ msgid "Name"
2506
+ #~ msgstr "Naam"
2507
+
2508
+ #~ msgid "Status"
2509
+ #~ msgstr "Status"
2510
+
2511
+ #~ msgid "Actions"
2512
+ #~ msgstr "Acties"
2513
+
2514
+ #~ msgid "Activate"
2515
+ #~ msgstr "Activeer"
2516
+
2517
+ #~ msgid "Deactivate"
2518
+ #~ msgstr "Deactiveer"
2519
+
2520
+ #~ msgid "deactivated"
2521
+ #~ msgstr "gedeactiveerd"
2522
+
2523
+ #~ msgid "deactivating"
2524
+ #~ msgstr "gedeactiveerd"
2525
+
2526
+ #~ msgid "activated"
2527
+ #~ msgstr "geactiveerd"
2528
+
2529
+ #~ msgid "activating"
2530
+ #~ msgstr "activeren"
2531
+
2532
+ #~ msgid "There was a problem %s the store(s), please try again."
2533
+ #~ msgstr ""
2534
+ #~ "Er is een probleem met het %s van de locatie(s), probeer het nog een keer."
2535
+
2536
+ #~ msgid "Store(s) successfully %s."
2537
+ #~ msgstr "Locatie(s) succesvol %s."
2538
+
2539
+ #~ msgid "There was a problem removing the store(s), please try again."
2540
+ #~ msgstr ""
2541
+ #~ "De locatie(s) konden niet worden verwijderd, probeer het nog een keer."
2542
+
2543
+ #~ msgid "Store(s) successfully removed."
2544
+ #~ msgstr "Locatie(s) succesvol verwijderd."
2545
+
2546
+ #~ msgid "Are you sure you want to delete this store?"
2547
+ #~ msgstr "Weet je zeker dat je deze locatie wilt verwijderen?"
2548
+
2549
+ #~ msgid "Cancel"
2550
+ #~ msgstr "Annuleer"
2551
+
2552
+ #~ msgid "Address:"
2553
+ #~ msgstr "Adres:"
2554
+
2555
+ #~ msgid "City:"
2556
+ #~ msgstr "Stad:"
2557
+
2558
+ #~ msgid "State / Province:"
2559
+ #~ msgstr "Provincie:"
2560
+
2561
+ #~ msgid "Extra details"
2562
+ #~ msgstr "Extra informatie"
2563
+
2564
+ #~ msgid "Phone:"
2565
+ #~ msgstr "Telefoon:"
2566
+
2567
+ #~ msgid "Fax:"
2568
+ #~ msgstr "Fax:"
2569
+
2570
+ #~ msgid "Description:"
2571
+ #~ msgstr "Omschrijving:"
2572
+
2573
+ #~ msgid "Thumbnail:"
2574
+ #~ msgstr "Afbeelding:"
2575
+
2576
+ #~ msgid "Change thumbnail"
2577
+ #~ msgstr "Wijzig afbeelding"
2578
+
2579
+ #~ msgid "Remove"
2580
+ #~ msgstr "Verwijder"
2581
+
2582
+ #~ msgid "Status:"
2583
+ #~ msgstr "Status:"
2584
+
2585
+ #~ msgid "active"
2586
+ #~ msgstr "actief"
2587
+
2588
+ #~ msgid "inactive"
2589
+ #~ msgstr "niet actief"
2590
+
2591
+ #~ msgid "How do I show the store locator on my page?"
2592
+ #~ msgstr "Hoe plaatst ik de store locator op een pagina?"
2593
+
2594
+ #~ msgid ""
2595
+ #~ "Add this shortcode <code>[wpsl]</code> to the page where you want to show "
2596
+ #~ "the store locator."
2597
+ #~ msgstr ""
2598
+ #~ "Voeg deze shortcode <code>[wpsl]</code> toe aan de pagina waar je de "
2599
+ #~ "store locator wil tonen."
2600
+
2601
+ #~ msgid ""
2602
+ #~ "The map doesn't display properly. It's either broken in half or doesn't "
2603
+ #~ "load at all."
2604
+ #~ msgstr ""
2605
+ #~ "De kaart is niet goed zichtbaar. Hij wordt niet geladen, of is maar voor "
2606
+ #~ "de helft zichtbaar."
2607
+
2608
+ #~ msgid ""
2609
+ #~ "Make sure you have defined a start point for the map under settings -> "
2610
+ #~ "map settings."
2611
+ #~ msgstr ""
2612
+ #~ "Zorg dat er een start locatie is opgegeven op de instellingen pagina -> "
2613
+ #~ "kaart instellingen."
2614
+
2615
+ #~ msgid ""
2616
+ #~ "I get an error saying the \"sensor\" parameter specified in the request "
2617
+ #~ "must be set to either \"true\" or \"false\"."
2618
+ #~ msgstr ""
2619
+ #~ "Ik krijg de volgende foutmelding, the \"sensor\" parameter specified in "
2620
+ #~ "the request must be set to either \"true\" or \"false\"."
2621
+
2622
+ #~ msgid ""
2623
+ #~ "Make sure you don't have any security plugins, or custom functions "
2624
+ #~ "running that strip away version numbers from file paths."
2625
+ #~ msgstr ""
2626
+ #~ "Zorg ervoor dat je geen beveiligings plugins, of custom functies hebt die "
2627
+ #~ "versie nummers van de bestands paden weghalen."
2628
+
2629
+ #~ msgid "The store locator doesn't load, it only shows the number 1?"
2630
+ #~ msgstr "De store locator laadt niet, het toont alleen een '1'?"
2631
+
2632
+ #~ msgid ""
2633
+ #~ "This is most likely caused by your theme using ajax navigation ( the "
2634
+ #~ "loading of content without reloading the page ), or a conflict with "
2635
+ #~ "another plugin. Try to disable the ajax navigation in the theme settings, "
2636
+ #~ "or deactivate the plugin that enables it to see if that solves the "
2637
+ #~ "problem."
2638
+ #~ msgstr ""
2639
+ #~ "Dit wordt waarschijnlijk veroorzaakt doordat je theme ajax navigatie "
2640
+ #~ "gebruikt ( het laden van nieuwe content zonder dat de pagina zelf opnieuw "
2641
+ #~ "geladen wordt ), of door een conflict met een andere plugin. Probeer de "
2642
+ #~ "ajax navigatie in je theme uit te zetten, of deactiveer de plugin die de "
2643
+ #~ "functionaliteit toevoegd om te kijken ofdat dat het probleem oplost."
2644
+
2645
+ #~ msgid ""
2646
+ #~ "If you don't use ajax navigation, but do see the number 1 it's probably a "
2647
+ #~ "conflict with another plugin. Try to disable the plugins one by one to "
2648
+ #~ "see if one of them is causing a conflict."
2649
+ #~ msgstr ""
2650
+ #~ "Als je geen ajax navigatie gebruikt, maar wel het getal '1' ziet dan is "
2651
+ #~ "het waarschijnlijk een conflict met een andere plugin. Probeer alle "
2652
+ #~ "plugins een voor een te deactiveren om te kijken welke plugin het "
2653
+ #~ "probleem veroorzaakt."
2654
+
2655
+ #~ msgid ""
2656
+ #~ "If you find a plugin or theme that causes a conflict, please report it on "
2657
+ #~ "the <a href=\"%s\">support page</a>."
2658
+ #~ msgstr ""
2659
+ #~ "Als je een plugin of theme tegenkomt dat een probleem veroorzaakt, meld "
2660
+ #~ "het dan op de <a href=\"%s\">support pagina</a>."
2661
+
2662
+ #~ msgid "Why does it show the location I searched for in the wrong country?"
2663
+ #~ msgstr "Waarom toont het de locatie waar ik op zocht in het verkeerde land?"
2664
+
2665
+ #~ msgid ""
2666
+ #~ "Some location names exist in more then one country, and Google will guess "
2667
+ #~ "which one you mean. This can be fixed by setting the correct \"Map Region"
2668
+ #~ "\" on the settings page -> \"API Settings\"."
2669
+ #~ msgstr ""
2670
+ #~ "Sommige locatie namen komen in meerdere landen voor, en daardoor kan het "
2671
+ #~ "gebeuren dat Google de locatie in het verkeerde land kiest. Dit kan "
2672
+ #~ "opgelost worden door de juiste \"Kaart regio\" in te stellen op de "
2673
+ #~ "instellingen pagina onder \"API Instellingen\"."
2674
+
2675
+ #~ msgid "Zoom level:"
2676
+ #~ msgstr "Zoom niveau:"
2677
+
2678
+ #~ msgid ""
2679
+ #~ "* This is the text that is placed before the search input and radius "
2680
+ #~ "dropdown"
2681
+ #~ msgstr ""
2682
+ #~ "* Dit is de tekst die voor het zoekveld en radius dropdown geplaatst "
2683
+ #~ "wordt."
2684
+
2685
+ #~ msgid "Default country that will be used on the \"Add Store\" page."
2686
+ #~ msgstr ""
2687
+ #~ "Het land dat standaard gebruikt wordt op de \"Locatie Toevoegen\" pagina."
2688
+
2689
+ #~ msgid "Search radius:"
2690
+ #~ msgstr "Zoek radius:"
2691
+
2692
+ #~ msgid "No results found:"
2693
+ #~ msgstr "Geen locaties gevonden:"
2694
+
2695
+ #~ msgid "Search:"
2696
+ #~ msgstr "Zoek:"
2697
+
2698
+ #~ msgid "Results:"
2699
+ #~ msgstr "Resultaten:"
2700
+
2701
+ #~ msgid "More info:"
2702
+ #~ msgstr "Meer info:"
2703
+
2704
+ #~ msgid "Hours:"
2705
+ #~ msgstr "Openingstijden:"
2706
+
2707
+ #~ msgid "Start location:"
2708
+ #~ msgstr "Start locatie:"
2709
+
2710
+ #~ msgid "Back:"
2711
+ #~ msgstr "Terug:"
2712
+
2713
+ #~ msgid "Reset:"
2714
+ #~ msgstr "Herstel:"
2715
+
2716
+ #~ msgid "Street view:"
2717
+ #~ msgstr "Street view:"
2718
+
2719
+ #~ msgid "Zoom here:"
2720
+ #~ msgstr "Zoom hier:"
languages/wpsl-pt_PT.mo ADDED
Binary file
languages/wpsl-pt_PT.po ADDED
@@ -0,0 +1,2412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Store Locator v2.0\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-09-01 13:49+0100\n"
6
+ "PO-Revision-Date: 2015-09-05 13:48-0000\n"
7
+ "Last-Translator: Rúben Martins <geral@rubenmartins.pt>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Generator: Poedit 1.6.4\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "X-Textdomain-Support: yes\n"
19
+ "Language: pt_PT\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ #: admin/class-admin.php:118
23
+ #, php-format
24
+ msgid ""
25
+ "Before adding the [wpsl] shortcode to a page, please don't forget to define "
26
+ "a %sstart point%s. %sDismiss%s"
27
+ msgstr ""
28
+ "Antes de adicionar o shortcode [WPSL] para uma página, por favor, não se "
29
+ "esqueça de definir %sum ponto de inicio%s. %sRemover%s"
30
+
31
+ #: admin/class-admin.php:120
32
+ #, php-format
33
+ msgid ""
34
+ "Before adding the [wpsl] shortcode to a page, please don't forget to define "
35
+ "a start point on the %ssettings%s page. %sDismiss%s"
36
+ msgstr ""
37
+ "Antes de adicionar o shortcode [WPSL] para uma página, por favor, não se "
38
+ "esqueça de definir um ponto de partida na página de %sdefinições%s. %sAnular"
39
+ "%s"
40
+
41
+ #: admin/class-admin.php:150 admin/templates/map-settings.php:4
42
+ msgid "Settings"
43
+ msgstr "Definições"
44
+
45
+ #: admin/class-admin.php:264
46
+ msgid "Cannot determine the address at this location."
47
+ msgstr "Não é possível determinar o endereço nesta localização."
48
+
49
+ #: admin/class-admin.php:265
50
+ msgid "Geocode was not successful for the following reason"
51
+ msgstr "Geocodificação não foi bem sucedida pelo seguinte motivo"
52
+
53
+ #: admin/class-admin.php:266 admin/upgrade.php:393
54
+ msgid "Security check failed, reload the page and try again."
55
+ msgstr ""
56
+ "Verificação de segurança falhou, recarregue a página e tente novamente."
57
+
58
+ #: admin/class-admin.php:267
59
+ msgid "Please fill in all the required store details."
60
+ msgstr "Por favor, preencha todos os detalhes necessários da loja."
61
+
62
+ #: admin/class-admin.php:268
63
+ msgid "The map preview requires all the location details."
64
+ msgstr "A pré-visualização de mapa exige todos os detalhes da localização."
65
+
66
+ #: admin/class-admin.php:269 admin/class-metaboxes.php:504
67
+ #: frontend/class-frontend.php:483
68
+ msgid "Closed"
69
+ msgstr "Fechado"
70
+
71
+ #: admin/class-admin.php:270
72
+ msgid "The code for the map style is invalid."
73
+ msgstr "O código para o estilo de mapa é inválido."
74
+
75
+ #: admin/class-admin.php:361
76
+ msgid "Welcome to WP Store Locator"
77
+ msgstr "Bem-vindo ao WP Store Locator"
78
+
79
+ #: admin/class-admin.php:362
80
+ msgid "Sign up for the latest plugin updates and announcements."
81
+ msgstr "Registe-se para as últimas atualizações de plugin e anúncios."
82
+
83
+ #: admin/class-admin.php:406
84
+ msgid "Documentation"
85
+ msgstr "Documentação"
86
+
87
+ #: admin/class-admin.php:409
88
+ msgid "General Settings"
89
+ msgstr "Definições Gerais"
90
+
91
+ #: admin/class-admin.php:429
92
+ #, php-format
93
+ msgid "If you like this plugin please leave us a %s5 star%s rating."
94
+ msgstr ""
95
+ "Se gosta deste plugin, por favor deixe-nos uma classificação de %s5 estrelas"
96
+ "%s."
97
+
98
+ #: admin/class-geocode.php:73
99
+ msgid ""
100
+ "The Google Geocoding API returned no results for the supplied address. "
101
+ "Please change the address and try again."
102
+ msgstr ""
103
+ "O Google Geocoding API nao retornou resultados para o endereço fornecido. "
104
+ "Por favor, altere o endereço e tente novamente."
105
+
106
+ #: admin/class-geocode.php:76
107
+ #, php-format
108
+ msgid ""
109
+ "You have reached the daily allowed geocoding limit, you can read more %shere"
110
+ "%s."
111
+ msgstr ""
112
+ "Você atingiu o limite diário de geocodificação permitido, você pode ler mais "
113
+ "%saqui%s."
114
+
115
+ #: admin/class-geocode.php:79 admin/class-geocode.php:105
116
+ msgid ""
117
+ "The Google Geocoding API failed to return valid data, please try again later."
118
+ msgstr ""
119
+ "O Google Geocoding API não conseguiu retornar dados válidos, por favor, "
120
+ "tente novamente mais tarde."
121
+
122
+ #: admin/class-metaboxes.php:33
123
+ msgid "Store Details"
124
+ msgstr "Detalhes da Loja"
125
+
126
+ #: admin/class-metaboxes.php:34
127
+ msgid "Store Map"
128
+ msgstr "Mapa da Loja"
129
+
130
+ #: admin/class-metaboxes.php:48
131
+ msgid "Location"
132
+ msgstr "Localização"
133
+
134
+ #: admin/class-metaboxes.php:50 inc/class-post-types.php:162
135
+ msgid "Address"
136
+ msgstr "Morada"
137
+
138
+ #: admin/class-metaboxes.php:54
139
+ msgid "Address 2"
140
+ msgstr "Morada 2"
141
+
142
+ #: admin/class-metaboxes.php:57 inc/class-post-types.php:163
143
+ msgid "City"
144
+ msgstr "Cidade"
145
+
146
+ #: admin/class-metaboxes.php:61 inc/class-post-types.php:164
147
+ msgid "State"
148
+ msgstr "Estado"
149
+
150
+ #: admin/class-metaboxes.php:64
151
+ msgid "Zip Code"
152
+ msgstr "Código Postal"
153
+
154
+ #: admin/class-metaboxes.php:67
155
+ msgid "Country"
156
+ msgstr "País"
157
+
158
+ #: admin/class-metaboxes.php:74
159
+ msgid "Latitude"
160
+ msgstr "Latitude"
161
+
162
+ #: admin/class-metaboxes.php:77
163
+ msgid "Longitude"
164
+ msgstr "Longitude"
165
+
166
+ #: admin/class-metaboxes.php:80 admin/class-metaboxes.php:129
167
+ #: admin/class-metaboxes.php:144
168
+ msgid "Opening Hours"
169
+ msgstr "Horas de Abertura"
170
+
171
+ #: admin/class-metaboxes.php:82 admin/templates/map-settings.php:419
172
+ #: admin/templates/map-settings.php:420 frontend/underscore-functions.php:133
173
+ #: inc/wpsl-functions.php:114
174
+ msgid "Hours"
175
+ msgstr "Horas"
176
+
177
+ #: admin/class-metaboxes.php:86
178
+ msgid "Additional Information"
179
+ msgstr "Informação Adicional"
180
+
181
+ #: admin/class-metaboxes.php:88
182
+ msgid "Tel"
183
+ msgstr "Tel"
184
+
185
+ #: admin/class-metaboxes.php:91 admin/templates/map-settings.php:407
186
+ #: admin/templates/map-settings.php:408 frontend/class-frontend.php:665
187
+ #: frontend/underscore-functions.php:32 frontend/underscore-functions.php:124
188
+ #: inc/wpsl-functions.php:111
189
+ msgid "Fax"
190
+ msgstr "Fax"
191
+
192
+ #: admin/class-metaboxes.php:94 admin/templates/map-settings.php:411
193
+ #: admin/templates/map-settings.php:412 admin/upgrade.php:210
194
+ #: frontend/class-frontend.php:669 frontend/underscore-functions.php:35
195
+ #: frontend/underscore-functions.php:127 inc/wpsl-functions.php:112
196
+ msgid "Email"
197
+ msgstr "E-mail"
198
+
199
+ #: admin/class-metaboxes.php:97 admin/templates/map-settings.php:415
200
+ #: admin/templates/map-settings.php:416 admin/upgrade.php:214
201
+ #: frontend/class-frontend.php:674 inc/wpsl-functions.php:113
202
+ msgid "Url"
203
+ msgstr "Url"
204
+
205
+ #: admin/class-metaboxes.php:426
206
+ msgid "Hour format"
207
+ msgstr "Formato de horas"
208
+
209
+ #: admin/class-metaboxes.php:433
210
+ msgid "Days"
211
+ msgstr "Dias"
212
+
213
+ #: admin/class-metaboxes.php:434
214
+ msgid "Opening Periods"
215
+ msgstr "Horário de Funcionamento"
216
+
217
+ #: admin/class-metaboxes.php:681
218
+ msgid "Failed to publish the store. Please fill in the required store details."
219
+ msgstr ""
220
+ "Falha ao publicar a loja. Por favor, preencha os detalhes necessários da "
221
+ "loja."
222
+
223
+ #: admin/class-metaboxes.php:816
224
+ msgid "Preview Location"
225
+ msgstr "Pré-visualizar localização"
226
+
227
+ #: admin/class-metaboxes.php:817
228
+ #, php-format
229
+ msgid ""
230
+ "The map preview is based on the provided address, city and country details. "
231
+ "%s It will ignore any custom latitude or longitude values."
232
+ msgstr ""
233
+ "A pré-visualização do mapa é baseado no endereço, cidade e país fornecidos. "
234
+ "%s Irá ignorar quaisquer valores de latitude ou longitude personalizados."
235
+
236
+ #: admin/class-metaboxes.php:818
237
+ msgid "You can drag the marker to adjust the exact location of the marker."
238
+ msgstr "Você pode arrastar o marcador para ajustar ao local exato do marcador."
239
+
240
+ #: admin/class-metaboxes.php:838 admin/class-metaboxes.php:841
241
+ msgid "Store updated."
242
+ msgstr "Loja atualizada."
243
+
244
+ #: admin/class-metaboxes.php:839
245
+ msgid "Custom field updated."
246
+ msgstr "Campo personalizado atualizado."
247
+
248
+ #: admin/class-metaboxes.php:840
249
+ msgid "Custom field deleted."
250
+ msgstr "Campo personalizado apagado."
251
+
252
+ #: admin/class-metaboxes.php:842
253
+ #, php-format
254
+ msgid "Store restored to revision from %s"
255
+ msgstr "Loja restaurada para revisão de% s"
256
+
257
+ #: admin/class-metaboxes.php:843
258
+ msgid "Store published."
259
+ msgstr "Loja publicada."
260
+
261
+ #: admin/class-metaboxes.php:844
262
+ msgid "Store saved."
263
+ msgstr "Loja Guardada."
264
+
265
+ #: admin/class-metaboxes.php:845
266
+ msgid "Store submitted."
267
+ msgstr "Loja submetida."
268
+
269
+ #: admin/class-metaboxes.php:847
270
+ #, php-format
271
+ msgid "Store scheduled for: <strong>%1$s</strong>."
272
+ msgstr "Loja agendada para: <strong>%1$s</strong>."
273
+
274
+ #: admin/class-metaboxes.php:848
275
+ msgid "M j, Y @ G:i"
276
+ msgstr "j M, Y @ G:i"
277
+
278
+ #: admin/class-metaboxes.php:850
279
+ msgid "Store draft updated."
280
+ msgstr "Rascunho de loja atualizado."
281
+
282
+ #: admin/class-metaboxes.php:856
283
+ msgid "View store"
284
+ msgstr "Ver loja"
285
+
286
+ #: admin/class-metaboxes.php:862
287
+ msgid "Preview store"
288
+ msgstr "Pré-visualizar loja"
289
+
290
+ #: admin/class-settings.php:38
291
+ msgid "WP Store Locator Transients Cleared"
292
+ msgstr "Cache temporário de WP Store Locator apagado"
293
+
294
+ #: admin/class-settings.php:370
295
+ msgid ""
296
+ "The max results field cannot be empty, the default value has been restored."
297
+ msgstr ""
298
+ "O campo de máximo resultados não pode estar vazio, o valor padrão foi "
299
+ "restaurado."
300
+
301
+ #: admin/class-settings.php:373
302
+ msgid ""
303
+ "The search radius field cannot be empty, the default value has been restored."
304
+ msgstr ""
305
+ "O campo de raio de pesquisa não pode estar vazio, o valor padrão foi "
306
+ "restaurado."
307
+
308
+ #: admin/class-settings.php:376
309
+ #, php-format
310
+ msgid ""
311
+ "Please provide the name of a city or country that can be used as a starting "
312
+ "point under \"Map Settings\". %s This will only be used if auto-locating the "
313
+ "user fails, or the option itself is disabled."
314
+ msgstr ""
315
+ "Por favor, forneça o nome de uma cidade ou país que pode ser usado como um "
316
+ "ponto de partida em \"Definições do mapa\". %s Isso só será usado se a auto-"
317
+ "localização do utilizador falhar, ou a própria opção estiver desativada."
318
+
319
+ #: admin/class-settings.php:397
320
+ msgid "Select your language"
321
+ msgstr "Selecione o seu idioma"
322
+
323
+ #: admin/class-settings.php:398
324
+ msgid "English"
325
+ msgstr "English"
326
+
327
+ #: admin/class-settings.php:399
328
+ msgid "Arabic"
329
+ msgstr "Arabic"
330
+
331
+ #: admin/class-settings.php:400
332
+ msgid "Basque"
333
+ msgstr "Basque"
334
+
335
+ #: admin/class-settings.php:401
336
+ msgid "Bulgarian"
337
+ msgstr "Bulgarian"
338
+
339
+ #: admin/class-settings.php:402
340
+ msgid "Bengali"
341
+ msgstr "Bengali"
342
+
343
+ #: admin/class-settings.php:403
344
+ msgid "Catalan"
345
+ msgstr "Catalan"
346
+
347
+ #: admin/class-settings.php:404
348
+ msgid "Czech"
349
+ msgstr "Czech"
350
+
351
+ #: admin/class-settings.php:405
352
+ msgid "Danish"
353
+ msgstr "Danish"
354
+
355
+ #: admin/class-settings.php:406
356
+ msgid "German"
357
+ msgstr "German"
358
+
359
+ #: admin/class-settings.php:407
360
+ msgid "Greek"
361
+ msgstr "Greek"
362
+
363
+ #: admin/class-settings.php:408
364
+ msgid "English (Australian)"
365
+ msgstr "English (Australian)"
366
+
367
+ #: admin/class-settings.php:409
368
+ msgid "English (Great Britain)"
369
+ msgstr "English (Great Britain)"
370
+
371
+ #: admin/class-settings.php:410
372
+ msgid "Spanish"
373
+ msgstr "Spanish"
374
+
375
+ #: admin/class-settings.php:411
376
+ msgid "Farsi"
377
+ msgstr "Farsi"
378
+
379
+ #: admin/class-settings.php:412
380
+ msgid "Finnish"
381
+ msgstr "Finnish"
382
+
383
+ #: admin/class-settings.php:413
384
+ msgid "Filipino"
385
+ msgstr "Filipino"
386
+
387
+ #: admin/class-settings.php:414
388
+ msgid "French"
389
+ msgstr "French"
390
+
391
+ #: admin/class-settings.php:415
392
+ msgid "Galician"
393
+ msgstr "Galician"
394
+
395
+ #: admin/class-settings.php:416
396
+ msgid "Gujarati"
397
+ msgstr "Gujarati"
398
+
399
+ #: admin/class-settings.php:417
400
+ msgid "Hindi"
401
+ msgstr "Hindi"
402
+
403
+ #: admin/class-settings.php:418
404
+ msgid "Croatian"
405
+ msgstr "Croatian"
406
+
407
+ #: admin/class-settings.php:419
408
+ msgid "Hungarian"
409
+ msgstr "Hungarian"
410
+
411
+ #: admin/class-settings.php:420
412
+ msgid "Indonesian"
413
+ msgstr "Indonesian"
414
+
415
+ #: admin/class-settings.php:421
416
+ msgid "Italian"
417
+ msgstr "Italian"
418
+
419
+ #: admin/class-settings.php:422
420
+ msgid "Hebrew"
421
+ msgstr "Hebrew"
422
+
423
+ #: admin/class-settings.php:423
424
+ msgid "Japanese"
425
+ msgstr "Japanese"
426
+
427
+ #: admin/class-settings.php:424
428
+ msgid "Kannada"
429
+ msgstr "Kannada"
430
+
431
+ #: admin/class-settings.php:425
432
+ msgid "Korean"
433
+ msgstr "Korean"
434
+
435
+ #: admin/class-settings.php:426
436
+ msgid "Lithuanian"
437
+ msgstr "Lithuanian"
438
+
439
+ #: admin/class-settings.php:427
440
+ msgid "Latvian"
441
+ msgstr "Latvian"
442
+
443
+ #: admin/class-settings.php:428
444
+ msgid "Malayalam"
445
+ msgstr "Malayalam"
446
+
447
+ #: admin/class-settings.php:429
448
+ msgid "Marathi"
449
+ msgstr "Marathi"
450
+
451
+ #: admin/class-settings.php:430
452
+ msgid "Dutch"
453
+ msgstr "Dutch"
454
+
455
+ #: admin/class-settings.php:431
456
+ msgid "Norwegian"
457
+ msgstr "Norwegian"
458
+
459
+ #: admin/class-settings.php:432
460
+ msgid "Norwegian Nynorsk"
461
+ msgstr "Norwegian Nynorsk"
462
+
463
+ #: admin/class-settings.php:433
464
+ msgid "Polish"
465
+ msgstr "Polish"
466
+
467
+ #: admin/class-settings.php:434
468
+ msgid "Portuguese"
469
+ msgstr "Portuguese"
470
+
471
+ #: admin/class-settings.php:435
472
+ msgid "Portuguese (Brazil)"
473
+ msgstr "Portuguese (Brazil)"
474
+
475
+ #: admin/class-settings.php:436
476
+ msgid "Portuguese (Portugal)"
477
+ msgstr "Portuguese (Portugal)"
478
+
479
+ #: admin/class-settings.php:437
480
+ msgid "Romanian"
481
+ msgstr "Romanian"
482
+
483
+ #: admin/class-settings.php:438
484
+ msgid "Russian"
485
+ msgstr "Russian"
486
+
487
+ #: admin/class-settings.php:439
488
+ msgid "Slovak"
489
+ msgstr "Slovak"
490
+
491
+ #: admin/class-settings.php:440
492
+ msgid "Slovenian"
493
+ msgstr "Slovenian"
494
+
495
+ #: admin/class-settings.php:441
496
+ msgid "Serbian"
497
+ msgstr "Serbian"
498
+
499
+ #: admin/class-settings.php:442
500
+ msgid "Swedish"
501
+ msgstr "Swedish"
502
+
503
+ #: admin/class-settings.php:443
504
+ msgid "Tagalog"
505
+ msgstr "Tagalog"
506
+
507
+ #: admin/class-settings.php:444
508
+ msgid "Tamil"
509
+ msgstr "Tamil"
510
+
511
+ #: admin/class-settings.php:445
512
+ msgid "Telugu"
513
+ msgstr "Telugu"
514
+
515
+ #: admin/class-settings.php:446
516
+ msgid "Thai"
517
+ msgstr "Thai"
518
+
519
+ #: admin/class-settings.php:447
520
+ msgid "Turkish"
521
+ msgstr "Turkish"
522
+
523
+ #: admin/class-settings.php:448
524
+ msgid "Ukrainian"
525
+ msgstr "Ukrainian"
526
+
527
+ #: admin/class-settings.php:449
528
+ msgid "Vietnamese"
529
+ msgstr "Vietnamese"
530
+
531
+ #: admin/class-settings.php:450
532
+ msgid "Chinese (Simplified)"
533
+ msgstr "Chinese (Simplified)"
534
+
535
+ #: admin/class-settings.php:451
536
+ msgid "Chinese (Traditional)"
537
+ msgstr "Chinese (Traditional)"
538
+
539
+ #: admin/class-settings.php:456
540
+ msgid "Select your region"
541
+ msgstr "Selecione a sua região"
542
+
543
+ #: admin/class-settings.php:457
544
+ msgid "Afghanistan"
545
+ msgstr "Afghanistan"
546
+
547
+ #: admin/class-settings.php:458
548
+ msgid "Albania"
549
+ msgstr "Albania"
550
+
551
+ #: admin/class-settings.php:459
552
+ msgid "Algeria"
553
+ msgstr "Algeria"
554
+
555
+ #: admin/class-settings.php:460
556
+ msgid "American Samoa"
557
+ msgstr "American Samoa"
558
+
559
+ #: admin/class-settings.php:461
560
+ msgid "Andorra"
561
+ msgstr "Andorra"
562
+
563
+ #: admin/class-settings.php:462
564
+ msgid "Anguilla"
565
+ msgstr "Anguilla"
566
+
567
+ #: admin/class-settings.php:463
568
+ msgid "Angola"
569
+ msgstr "Angola"
570
+
571
+ #: admin/class-settings.php:464
572
+ msgid "Antigua and Barbuda"
573
+ msgstr "Antigua and Barbuda"
574
+
575
+ #: admin/class-settings.php:465
576
+ msgid "Argentina"
577
+ msgstr "Argentina"
578
+
579
+ #: admin/class-settings.php:466
580
+ msgid "Armenia"
581
+ msgstr "Armenia"
582
+
583
+ #: admin/class-settings.php:467
584
+ msgid "Aruba"
585
+ msgstr "Aruba"
586
+
587
+ #: admin/class-settings.php:468
588
+ msgid "Australia"
589
+ msgstr "Australia"
590
+
591
+ #: admin/class-settings.php:469
592
+ msgid "Austria"
593
+ msgstr "Austria"
594
+
595
+ #: admin/class-settings.php:470
596
+ msgid "Azerbaijan"
597
+ msgstr "Azerbaijan"
598
+
599
+ #: admin/class-settings.php:471
600
+ msgid "Bahamas"
601
+ msgstr "Bahamas"
602
+
603
+ #: admin/class-settings.php:472
604
+ msgid "Bahrain"
605
+ msgstr "Bahrain"
606
+
607
+ #: admin/class-settings.php:473
608
+ msgid "Bangladesh"
609
+ msgstr "Bangladesh"
610
+
611
+ #: admin/class-settings.php:474
612
+ msgid "Barbados"
613
+ msgstr "Barbados"
614
+
615
+ #: admin/class-settings.php:475
616
+ msgid "Belarus"
617
+ msgstr "Belarus"
618
+
619
+ #: admin/class-settings.php:476
620
+ msgid "Belgium"
621
+ msgstr "Belgium"
622
+
623
+ #: admin/class-settings.php:477
624
+ msgid "Belize"
625
+ msgstr "Belize"
626
+
627
+ #: admin/class-settings.php:478
628
+ msgid "Benin"
629
+ msgstr "Benin"
630
+
631
+ #: admin/class-settings.php:479
632
+ msgid "Bermuda"
633
+ msgstr "Bermuda"
634
+
635
+ #: admin/class-settings.php:480
636
+ msgid "Bhutan"
637
+ msgstr "Bhutan"
638
+
639
+ #: admin/class-settings.php:481
640
+ msgid "Bolivia"
641
+ msgstr "Bolivia"
642
+
643
+ #: admin/class-settings.php:482
644
+ msgid "Bosnia and Herzegovina"
645
+ msgstr "Bosnia and Herzegovina"
646
+
647
+ #: admin/class-settings.php:483
648
+ msgid "Botswana"
649
+ msgstr "Botswana"
650
+
651
+ #: admin/class-settings.php:484
652
+ msgid "Brazil"
653
+ msgstr "Brazil"
654
+
655
+ #: admin/class-settings.php:485
656
+ msgid "British Indian Ocean Territory"
657
+ msgstr "British Indian Ocean Territory"
658
+
659
+ #: admin/class-settings.php:486
660
+ msgid "Brunei"
661
+ msgstr "Brunei"
662
+
663
+ #: admin/class-settings.php:487
664
+ msgid "Bulgaria"
665
+ msgstr "Bulgaria"
666
+
667
+ #: admin/class-settings.php:488
668
+ msgid "Burkina Faso"
669
+ msgstr "Burkina Faso"
670
+
671
+ #: admin/class-settings.php:489
672
+ msgid "Burundi"
673
+ msgstr "Burundi"
674
+
675
+ #: admin/class-settings.php:490
676
+ msgid "Cambodia"
677
+ msgstr "Cambodia"
678
+
679
+ #: admin/class-settings.php:491
680
+ msgid "Cameroon"
681
+ msgstr "Cameroon"
682
+
683
+ #: admin/class-settings.php:492
684
+ msgid "Canada"
685
+ msgstr "Canada"
686
+
687
+ #: admin/class-settings.php:493
688
+ msgid "Cape Verde"
689
+ msgstr "Cape Verde"
690
+
691
+ #: admin/class-settings.php:494
692
+ msgid "Cayman Islands"
693
+ msgstr "Cayman Islands"
694
+
695
+ #: admin/class-settings.php:495
696
+ msgid "Central African Republic"
697
+ msgstr "Central African Republic"
698
+
699
+ #: admin/class-settings.php:496
700
+ msgid "Chad"
701
+ msgstr "Chad"
702
+
703
+ #: admin/class-settings.php:497
704
+ msgid "Chile"
705
+ msgstr "Chile"
706
+
707
+ #: admin/class-settings.php:498
708
+ msgid "China"
709
+ msgstr "China"
710
+
711
+ #: admin/class-settings.php:499
712
+ msgid "Christmas Island"
713
+ msgstr "Christmas Island"
714
+
715
+ #: admin/class-settings.php:500
716
+ msgid "Cocos Islands"
717
+ msgstr "Cocos Islands"
718
+
719
+ #: admin/class-settings.php:501
720
+ msgid "Colombia"
721
+ msgstr "Colombia"
722
+
723
+ #: admin/class-settings.php:502
724
+ msgid "Comoros"
725
+ msgstr "Comoros"
726
+
727
+ #: admin/class-settings.php:503
728
+ msgid "Congo"
729
+ msgstr "Congo"
730
+
731
+ #: admin/class-settings.php:504
732
+ msgid "Costa Rica"
733
+ msgstr "Costa Rica"
734
+
735
+ #: admin/class-settings.php:505
736
+ msgid "Côte d'Ivoire"
737
+ msgstr "Côte d'Ivoire"
738
+
739
+ #: admin/class-settings.php:506
740
+ msgid "Croatia"
741
+ msgstr "Croatia"
742
+
743
+ #: admin/class-settings.php:507
744
+ msgid "Cuba"
745
+ msgstr "Cuba"
746
+
747
+ #: admin/class-settings.php:508
748
+ msgid "Czech Republic"
749
+ msgstr "Czech Republic"
750
+
751
+ #: admin/class-settings.php:509
752
+ msgid "Denmark"
753
+ msgstr "Denmark"
754
+
755
+ #: admin/class-settings.php:510
756
+ msgid "Djibouti"
757
+ msgstr "Djibouti"
758
+
759
+ #: admin/class-settings.php:511
760
+ msgid "Democratic Republic of the Congo"
761
+ msgstr "Democratic Republic of the Congo"
762
+
763
+ #: admin/class-settings.php:512
764
+ msgid "Dominica"
765
+ msgstr "Dominica"
766
+
767
+ #: admin/class-settings.php:513
768
+ msgid "Dominican Republic"
769
+ msgstr "Dominican Republic"
770
+
771
+ #: admin/class-settings.php:514
772
+ msgid "Ecuador"
773
+ msgstr "Ecuador"
774
+
775
+ #: admin/class-settings.php:515
776
+ msgid "Egypt"
777
+ msgstr "Egypt"
778
+
779
+ #: admin/class-settings.php:516
780
+ msgid "El Salvador"
781
+ msgstr "El Salvador"
782
+
783
+ #: admin/class-settings.php:517
784
+ msgid "Equatorial Guinea"
785
+ msgstr "Equatorial Guinea"
786
+
787
+ #: admin/class-settings.php:518
788
+ msgid "Eritrea"
789
+ msgstr "Eritrea"
790
+
791
+ #: admin/class-settings.php:519
792
+ msgid "Estonia"
793
+ msgstr "Estonia"
794
+
795
+ #: admin/class-settings.php:520
796
+ msgid "Ethiopia"
797
+ msgstr "Ethiopia"
798
+
799
+ #: admin/class-settings.php:521
800
+ msgid "Fiji"
801
+ msgstr "Fiji"
802
+
803
+ #: admin/class-settings.php:522
804
+ msgid "Finland"
805
+ msgstr "Finland"
806
+
807
+ #: admin/class-settings.php:523
808
+ msgid "France"
809
+ msgstr "France"
810
+
811
+ #: admin/class-settings.php:524
812
+ msgid "French Guiana"
813
+ msgstr "French Guiana"
814
+
815
+ #: admin/class-settings.php:525
816
+ msgid "Gabon"
817
+ msgstr "Gabon"
818
+
819
+ #: admin/class-settings.php:526
820
+ msgid "Gambia"
821
+ msgstr "Gambia"
822
+
823
+ #: admin/class-settings.php:527
824
+ msgid "Germany"
825
+ msgstr "Germany"
826
+
827
+ #: admin/class-settings.php:528
828
+ msgid "Ghana"
829
+ msgstr "Ghana"
830
+
831
+ #: admin/class-settings.php:529
832
+ msgid "Greenland"
833
+ msgstr "Greenland"
834
+
835
+ #: admin/class-settings.php:530
836
+ msgid "Greece"
837
+ msgstr "Greece"
838
+
839
+ #: admin/class-settings.php:531
840
+ msgid "Grenada"
841
+ msgstr "Grenada"
842
+
843
+ #: admin/class-settings.php:532
844
+ msgid "Guam"
845
+ msgstr "Guam"
846
+
847
+ #: admin/class-settings.php:533
848
+ msgid "Guadeloupe"
849
+ msgstr "Guadeloupe"
850
+
851
+ #: admin/class-settings.php:534
852
+ msgid "Guatemala"
853
+ msgstr "Guatemala"
854
+
855
+ #: admin/class-settings.php:535
856
+ msgid "Guinea"
857
+ msgstr "Guinea"
858
+
859
+ #: admin/class-settings.php:536
860
+ msgid "Guinea-Bissau"
861
+ msgstr "Guinea-Bissau"
862
+
863
+ #: admin/class-settings.php:537
864
+ msgid "Haiti"
865
+ msgstr "Haiti"
866
+
867
+ #: admin/class-settings.php:538
868
+ msgid "Honduras"
869
+ msgstr "Honduras"
870
+
871
+ #: admin/class-settings.php:539
872
+ msgid "Hong Kong"
873
+ msgstr "Hong Kong"
874
+
875
+ #: admin/class-settings.php:540
876
+ msgid "Hungary"
877
+ msgstr "Hungary"
878
+
879
+ #: admin/class-settings.php:541
880
+ msgid "Iceland"
881
+ msgstr "Iceland"
882
+
883
+ #: admin/class-settings.php:542
884
+ msgid "India"
885
+ msgstr "India"
886
+
887
+ #: admin/class-settings.php:543
888
+ msgid "Indonesia"
889
+ msgstr "Indonesia"
890
+
891
+ #: admin/class-settings.php:544
892
+ msgid "Iran"
893
+ msgstr "Iran"
894
+
895
+ #: admin/class-settings.php:545
896
+ msgid "Iraq"
897
+ msgstr "Iraq"
898
+
899
+ #: admin/class-settings.php:546
900
+ msgid "Ireland"
901
+ msgstr "Ireland"
902
+
903
+ #: admin/class-settings.php:547
904
+ msgid "Israel"
905
+ msgstr "Israel"
906
+
907
+ #: admin/class-settings.php:548
908
+ msgid "Italy"
909
+ msgstr "Italy"
910
+
911
+ #: admin/class-settings.php:549
912
+ msgid "Jamaica"
913
+ msgstr "Jamaica"
914
+
915
+ #: admin/class-settings.php:550
916
+ msgid "Japan"
917
+ msgstr "Japan"
918
+
919
+ #: admin/class-settings.php:551
920
+ msgid "Jordan"
921
+ msgstr "Jordan"
922
+
923
+ #: admin/class-settings.php:552
924
+ msgid "Kazakhstan"
925
+ msgstr "Kazakhstan"
926
+
927
+ #: admin/class-settings.php:553
928
+ msgid "Kenya"
929
+ msgstr "Kenya"
930
+
931
+ #: admin/class-settings.php:554
932
+ msgid "Kuwait"
933
+ msgstr "Kuwait"
934
+
935
+ #: admin/class-settings.php:555
936
+ msgid "Kyrgyzstan"
937
+ msgstr "Kyrgyzstan"
938
+
939
+ #: admin/class-settings.php:556
940
+ msgid "Laos"
941
+ msgstr "Laos"
942
+
943
+ #: admin/class-settings.php:557
944
+ msgid "Latvia"
945
+ msgstr "Latvia"
946
+
947
+ #: admin/class-settings.php:558
948
+ msgid "Lebanon"
949
+ msgstr "Lebanon"
950
+
951
+ #: admin/class-settings.php:559
952
+ msgid "Lesotho"
953
+ msgstr "Lesotho"
954
+
955
+ #: admin/class-settings.php:560
956
+ msgid "Liberia"
957
+ msgstr "Liberia"
958
+
959
+ #: admin/class-settings.php:561
960
+ msgid "Libya"
961
+ msgstr "Libya"
962
+
963
+ #: admin/class-settings.php:562
964
+ msgid "Liechtenstein"
965
+ msgstr "Liechtenstein"
966
+
967
+ #: admin/class-settings.php:563
968
+ msgid "Lithuania"
969
+ msgstr "Lithuania"
970
+
971
+ #: admin/class-settings.php:564
972
+ msgid "Luxembourg"
973
+ msgstr "Luxembourg"
974
+
975
+ #: admin/class-settings.php:565
976
+ msgid "Macau"
977
+ msgstr "Macau"
978
+
979
+ #: admin/class-settings.php:566
980
+ msgid "Macedonia"
981
+ msgstr "Macedonia"
982
+
983
+ #: admin/class-settings.php:567
984
+ msgid "Madagascar"
985
+ msgstr "Madagascar"
986
+
987
+ #: admin/class-settings.php:568
988
+ msgid "Malawi"
989
+ msgstr "Malawi"
990
+
991
+ #: admin/class-settings.php:569
992
+ msgid "Malaysia "
993
+ msgstr "Malaysia "
994
+
995
+ #: admin/class-settings.php:570
996
+ msgid "Mali"
997
+ msgstr "Mali"
998
+
999
+ #: admin/class-settings.php:571
1000
+ msgid "Marshall Islands"
1001
+ msgstr "Marshall Islands"
1002
+
1003
+ #: admin/class-settings.php:572
1004
+ msgid "Martinique"
1005
+ msgstr "Martinique"
1006
+
1007
+ #: admin/class-settings.php:573
1008
+ msgid "Mauritania"
1009
+ msgstr "Mauritania"
1010
+
1011
+ #: admin/class-settings.php:574
1012
+ msgid "Mauritius"
1013
+ msgstr "Mauritius"
1014
+
1015
+ #: admin/class-settings.php:575
1016
+ msgid "Mexico"
1017
+ msgstr "Mexico"
1018
+
1019
+ #: admin/class-settings.php:576
1020
+ msgid "Micronesia"
1021
+ msgstr "Micronesia"
1022
+
1023
+ #: admin/class-settings.php:577
1024
+ msgid "Moldova"
1025
+ msgstr "Moldova"
1026
+
1027
+ #: admin/class-settings.php:578
1028
+ msgid "Monaco"
1029
+ msgstr "Monaco"
1030
+
1031
+ #: admin/class-settings.php:579
1032
+ msgid "Mongolia"
1033
+ msgstr "Mongolia"
1034
+
1035
+ #: admin/class-settings.php:580
1036
+ msgid "Montenegro"
1037
+ msgstr "Montenegro"
1038
+
1039
+ #: admin/class-settings.php:581
1040
+ msgid "Montserrat"
1041
+ msgstr "Montserrat"
1042
+
1043
+ #: admin/class-settings.php:582
1044
+ msgid "Morocco"
1045
+ msgstr "Morocco"
1046
+
1047
+ #: admin/class-settings.php:583
1048
+ msgid "Mozambique"
1049
+ msgstr "Mozambique"
1050
+
1051
+ #: admin/class-settings.php:584
1052
+ msgid "Myanmar"
1053
+ msgstr "Myanmar"
1054
+
1055
+ #: admin/class-settings.php:585
1056
+ msgid "Namibia"
1057
+ msgstr "Namibia"
1058
+
1059
+ #: admin/class-settings.php:586
1060
+ msgid "Nauru"
1061
+ msgstr "Nauru"
1062
+
1063
+ #: admin/class-settings.php:587
1064
+ msgid "Nepal"
1065
+ msgstr "Nepal"
1066
+
1067
+ #: admin/class-settings.php:588
1068
+ msgid "Netherlands"
1069
+ msgstr "Netherlands"
1070
+
1071
+ #: admin/class-settings.php:589
1072
+ msgid "Netherlands Antilles"
1073
+ msgstr "Netherlands Antilles"
1074
+
1075
+ #: admin/class-settings.php:590
1076
+ msgid "New Zealand"
1077
+ msgstr "New Zealand"
1078
+
1079
+ #: admin/class-settings.php:591
1080
+ msgid "Nicaragua"
1081
+ msgstr "Nicaragua"
1082
+
1083
+ #: admin/class-settings.php:592
1084
+ msgid "Niger"
1085
+ msgstr "Niger"
1086
+
1087
+ #: admin/class-settings.php:593
1088
+ msgid "Nigeria"
1089
+ msgstr "Nigeria"
1090
+
1091
+ #: admin/class-settings.php:594
1092
+ msgid "Niue"
1093
+ msgstr "Niue"
1094
+
1095
+ #: admin/class-settings.php:595
1096
+ msgid "Northern Mariana Islands"
1097
+ msgstr "Northern Mariana Islands"
1098
+
1099
+ #: admin/class-settings.php:596
1100
+ msgid "Norway"
1101
+ msgstr "Norway"
1102
+
1103
+ #: admin/class-settings.php:597
1104
+ msgid "Oman"
1105
+ msgstr "Oman"
1106
+
1107
+ #: admin/class-settings.php:598
1108
+ msgid "Pakistan"
1109
+ msgstr "Pakistan"
1110
+
1111
+ #: admin/class-settings.php:599
1112
+ msgid "Panama"
1113
+ msgstr "Panama"
1114
+
1115
+ #: admin/class-settings.php:600
1116
+ msgid "Papua New Guinea"
1117
+ msgstr "Papua New Guinea"
1118
+
1119
+ #: admin/class-settings.php:601
1120
+ msgid "Paraguay"
1121
+ msgstr "Paraguay"
1122
+
1123
+ #: admin/class-settings.php:602
1124
+ msgid "Peru"
1125
+ msgstr "Peru"
1126
+
1127
+ #: admin/class-settings.php:603
1128
+ msgid "Philippines"
1129
+ msgstr "Philippines"
1130
+
1131
+ #: admin/class-settings.php:604
1132
+ msgid "Pitcairn Islands"
1133
+ msgstr "Pitcairn Islands"
1134
+
1135
+ #: admin/class-settings.php:605
1136
+ msgid "Poland"
1137
+ msgstr "Poland"
1138
+
1139
+ #: admin/class-settings.php:606
1140
+ msgid "Portugal"
1141
+ msgstr "Portugal"
1142
+
1143
+ #: admin/class-settings.php:607
1144
+ msgid "Qatar"
1145
+ msgstr "Qatar"
1146
+
1147
+ #: admin/class-settings.php:608
1148
+ msgid "Reunion"
1149
+ msgstr "Reunion"
1150
+
1151
+ #: admin/class-settings.php:609
1152
+ msgid "Romania"
1153
+ msgstr "Romania"
1154
+
1155
+ #: admin/class-settings.php:610
1156
+ msgid "Russia"
1157
+ msgstr "Russia"
1158
+
1159
+ #: admin/class-settings.php:611
1160
+ msgid "Rwanda"
1161
+ msgstr "Rwanda"
1162
+
1163
+ #: admin/class-settings.php:612
1164
+ msgid "Saint Helena"
1165
+ msgstr "Saint Helena"
1166
+
1167
+ #: admin/class-settings.php:613
1168
+ msgid "Saint Kitts and Nevis"
1169
+ msgstr "Saint Kitts and Nevis"
1170
+
1171
+ #: admin/class-settings.php:614
1172
+ msgid "Saint Vincent and the Grenadines"
1173
+ msgstr "Saint Vincent and the Grenadines"
1174
+
1175
+ #: admin/class-settings.php:615
1176
+ msgid "Saint Lucia"
1177
+ msgstr "Saint Lucia"
1178
+
1179
+ #: admin/class-settings.php:616
1180
+ msgid "Samoa"
1181
+ msgstr "Samoa"
1182
+
1183
+ #: admin/class-settings.php:617
1184
+ msgid "San Marino"
1185
+ msgstr "San Marino"
1186
+
1187
+ #: admin/class-settings.php:618
1188
+ msgid "São Tomé and Príncipe"
1189
+ msgstr "São Tomé and Príncipe"
1190
+
1191
+ #: admin/class-settings.php:619
1192
+ msgid "Saudi Arabia"
1193
+ msgstr "Saudi Arabia"
1194
+
1195
+ #: admin/class-settings.php:620
1196
+ msgid "Senegal"
1197
+ msgstr "Senegal"
1198
+
1199
+ #: admin/class-settings.php:621
1200
+ msgid "Serbia"
1201
+ msgstr "Serbia"
1202
+
1203
+ #: admin/class-settings.php:622
1204
+ msgid "Seychelles"
1205
+ msgstr "Seychelles"
1206
+
1207
+ #: admin/class-settings.php:623
1208
+ msgid "Sierra Leone"
1209
+ msgstr "Sierra Leone"
1210
+
1211
+ #: admin/class-settings.php:624
1212
+ msgid "Singapore"
1213
+ msgstr "Singapore"
1214
+
1215
+ #: admin/class-settings.php:625
1216
+ msgid "Slovakia"
1217
+ msgstr "Slovakia"
1218
+
1219
+ #: admin/class-settings.php:626
1220
+ msgid "Solomon Islands"
1221
+ msgstr "Solomon Islands"
1222
+
1223
+ #: admin/class-settings.php:627
1224
+ msgid "Somalia"
1225
+ msgstr "Somalia"
1226
+
1227
+ #: admin/class-settings.php:628
1228
+ msgid "South Africa"
1229
+ msgstr "South Africa"
1230
+
1231
+ #: admin/class-settings.php:629
1232
+ msgid "South Korea"
1233
+ msgstr "South Korea"
1234
+
1235
+ #: admin/class-settings.php:630
1236
+ msgid "Spain"
1237
+ msgstr "Spain"
1238
+
1239
+ #: admin/class-settings.php:631
1240
+ msgid "Sri Lanka"
1241
+ msgstr "Sri Lanka"
1242
+
1243
+ #: admin/class-settings.php:632
1244
+ msgid "Sudan"
1245
+ msgstr "Sudan"
1246
+
1247
+ #: admin/class-settings.php:633
1248
+ msgid "Swaziland"
1249
+ msgstr "Swaziland"
1250
+
1251
+ #: admin/class-settings.php:634
1252
+ msgid "Sweden"
1253
+ msgstr "Sweden"
1254
+
1255
+ #: admin/class-settings.php:635
1256
+ msgid "Switzerland"
1257
+ msgstr "Switzerland"
1258
+
1259
+ #: admin/class-settings.php:636
1260
+ msgid "Syria"
1261
+ msgstr "Syria"
1262
+
1263
+ #: admin/class-settings.php:637
1264
+ msgid "Taiwan"
1265
+ msgstr "Taiwan"
1266
+
1267
+ #: admin/class-settings.php:638
1268
+ msgid "Tajikistan"
1269
+ msgstr "Tajikistan"
1270
+
1271
+ #: admin/class-settings.php:639
1272
+ msgid "Tanzania"
1273
+ msgstr "Tanzania"
1274
+
1275
+ #: admin/class-settings.php:640
1276
+ msgid "Thailand"
1277
+ msgstr "Thailand"
1278
+
1279
+ #: admin/class-settings.php:641
1280
+ msgid "Timor-Leste"
1281
+ msgstr "Timor-Leste"
1282
+
1283
+ #: admin/class-settings.php:642
1284
+ msgid "Tokelau"
1285
+ msgstr "Tokelau"
1286
+
1287
+ #: admin/class-settings.php:643
1288
+ msgid "Togo"
1289
+ msgstr "Togo"
1290
+
1291
+ #: admin/class-settings.php:644
1292
+ msgid "Tonga"
1293
+ msgstr "Tonga"
1294
+
1295
+ #: admin/class-settings.php:645
1296
+ msgid "Trinidad and Tobago"
1297
+ msgstr "Trinidad and Tobago"
1298
+
1299
+ #: admin/class-settings.php:646
1300
+ msgid "Tunisia"
1301
+ msgstr "Tunisia"
1302
+
1303
+ #: admin/class-settings.php:647
1304
+ msgid "Turkey"
1305
+ msgstr "Turkey"
1306
+
1307
+ #: admin/class-settings.php:648
1308
+ msgid "Turkmenistan"
1309
+ msgstr "Turkmenistan"
1310
+
1311
+ #: admin/class-settings.php:649
1312
+ msgid "Tuvalu"
1313
+ msgstr "Tuvalu"
1314
+
1315
+ #: admin/class-settings.php:650
1316
+ msgid "Uganda"
1317
+ msgstr "Uganda"
1318
+
1319
+ #: admin/class-settings.php:651
1320
+ msgid "Ukraine"
1321
+ msgstr "Ukraine"
1322
+
1323
+ #: admin/class-settings.php:652
1324
+ msgid "United Arab Emirates"
1325
+ msgstr "United Arab Emirates"
1326
+
1327
+ #: admin/class-settings.php:653
1328
+ msgid "United Kingdom"
1329
+ msgstr "United Kingdom"
1330
+
1331
+ #: admin/class-settings.php:654
1332
+ msgid "United States"
1333
+ msgstr "United States"
1334
+
1335
+ #: admin/class-settings.php:655
1336
+ msgid "Uruguay"
1337
+ msgstr "Uruguay"
1338
+
1339
+ #: admin/class-settings.php:656
1340
+ msgid "Uzbekistan"
1341
+ msgstr "Uzbekistan"
1342
+
1343
+ #: admin/class-settings.php:657
1344
+ msgid "Wallis Futuna"
1345
+ msgstr "Wallis Futuna"
1346
+
1347
+ #: admin/class-settings.php:658
1348
+ msgid "Venezuela"
1349
+ msgstr "Venezuela"
1350
+
1351
+ #: admin/class-settings.php:659
1352
+ msgid "Vietnam"
1353
+ msgstr "Vietnam"
1354
+
1355
+ #: admin/class-settings.php:660
1356
+ msgid "Yemen"
1357
+ msgstr "Yemen"
1358
+
1359
+ #: admin/class-settings.php:661
1360
+ msgid "Zambia"
1361
+ msgstr "Zambia"
1362
+
1363
+ #: admin/class-settings.php:662
1364
+ msgid "Zimbabwe"
1365
+ msgstr "Zimbabwe"
1366
+
1367
+ #: admin/class-settings.php:705
1368
+ msgid "World view"
1369
+ msgstr "Visão de mundo"
1370
+
1371
+ #: admin/class-settings.php:708 admin/class-settings.php:821
1372
+ #: inc/wpsl-functions.php:179
1373
+ msgid "Default"
1374
+ msgstr "Padrão"
1375
+
1376
+ #: admin/class-settings.php:711 inc/wpsl-functions.php:252
1377
+ msgid "Roadmap"
1378
+ msgstr "Mapa das estradas"
1379
+
1380
+ #: admin/class-settings.php:851
1381
+ msgid "Start location marker"
1382
+ msgstr "Marcador de inicio de localização"
1383
+
1384
+ #: admin/class-settings.php:853
1385
+ msgid "Store location marker"
1386
+ msgstr "Marcador de localização da loja"
1387
+
1388
+ #: admin/class-settings.php:934
1389
+ msgid "Textarea"
1390
+ msgstr "Área de Texto"
1391
+
1392
+ #: admin/class-settings.php:935
1393
+ msgid "Dropdowns (recommended)"
1394
+ msgstr "Dropdowns (recomendado)"
1395
+
1396
+ #: admin/class-settings.php:943
1397
+ msgid "Bounces up and down"
1398
+ msgstr "Balança para cima e para baixo"
1399
+
1400
+ #: admin/class-settings.php:944
1401
+ msgid "Will open the info window"
1402
+ msgstr "Irá abrir a janela de informações"
1403
+
1404
+ #: admin/class-settings.php:945
1405
+ msgid "Does not respond"
1406
+ msgstr "Não responde"
1407
+
1408
+ #: admin/class-settings.php:953
1409
+ msgid "In the store listings"
1410
+ msgstr "Na listagem de lojas"
1411
+
1412
+ #: admin/class-settings.php:954
1413
+ msgid "In the info window on the map"
1414
+ msgstr "Na janela de informações do mapa"
1415
+
1416
+ #: admin/class-settings.php:1010
1417
+ msgid "12 Hours"
1418
+ msgstr "12 Horas"
1419
+
1420
+ #: admin/class-settings.php:1011
1421
+ msgid "24 Hours"
1422
+ msgstr "24 Horas"
1423
+
1424
+ #: admin/roles.php:20
1425
+ msgid "Store Locator Manager"
1426
+ msgstr "Gestor do Store Locator"
1427
+
1428
+ #: admin/templates/map-settings.php:12
1429
+ msgid "Google Maps API"
1430
+ msgstr "API dos Mapas do Google"
1431
+
1432
+ #: admin/templates/map-settings.php:15
1433
+ msgid "API key"
1434
+ msgstr "Chave de API"
1435
+
1436
+ #: admin/templates/map-settings.php:15
1437
+ #, php-format
1438
+ msgid ""
1439
+ "A valid %sAPI key%s allows you to monitor the API usage and is required if "
1440
+ "you need to purchase additional quota."
1441
+ msgstr ""
1442
+ "A %schave de API%s válida permite que você monitorize o uso da API e é "
1443
+ "necessário se você precisar de comprar quota adicional."
1444
+
1445
+ #: admin/templates/map-settings.php:16
1446
+ msgid "Optional"
1447
+ msgstr "Opcional"
1448
+
1449
+ #: admin/templates/map-settings.php:19
1450
+ msgid "Map language"
1451
+ msgstr "Linguagem de mapa"
1452
+
1453
+ #: admin/templates/map-settings.php:19
1454
+ msgid "If no map language is selected the browser's prefered language is used."
1455
+ msgstr ""
1456
+ "Se nenhum idioma de mapa é selecionado, o idioma preferido do navegador é "
1457
+ "usado."
1458
+
1459
+ #: admin/templates/map-settings.php:25
1460
+ msgid "Map region"
1461
+ msgstr "Região de mapa"
1462
+
1463
+ #: admin/templates/map-settings.php:25
1464
+ #, php-format
1465
+ msgid ""
1466
+ "This will bias the geocoding results towards the selected region. %s If no "
1467
+ "region is selected the bias is set to the United States."
1468
+ msgstr ""
1469
+ "Este será os resultados de geocodificação para a região selecionada. %s Se "
1470
+ "nenhuma região for selecionada, o padrão é definido para os Estados Unidos."
1471
+
1472
+ #: admin/templates/map-settings.php:31 admin/templates/map-settings.php:73
1473
+ #: admin/templates/map-settings.php:163 admin/templates/map-settings.php:256
1474
+ #: admin/templates/map-settings.php:282 admin/templates/map-settings.php:332
1475
+ #: admin/templates/map-settings.php:358 admin/templates/map-settings.php:455
1476
+ #: admin/templates/map-settings.php:476
1477
+ msgid "Save Changes"
1478
+ msgstr "Guardar alterações"
1479
+
1480
+ #: admin/templates/map-settings.php:41 admin/templates/map-settings.php:383
1481
+ #: admin/templates/map-settings.php:384 frontend/templates/default.php:43
1482
+ #: frontend/templates/store-listings-below.php:43 inc/wpsl-functions.php:97
1483
+ msgid "Search"
1484
+ msgstr "Pesquisar"
1485
+
1486
+ #: admin/templates/map-settings.php:44
1487
+ msgid "Show the max results dropdown?"
1488
+ msgstr "Mostrar os máximos resultados em dropdown?"
1489
+
1490
+ #: admin/templates/map-settings.php:48
1491
+ msgid "Show the search radius dropdown?"
1492
+ msgstr "Mostrar o raio de pesquisa em dropdown?"
1493
+
1494
+ #: admin/templates/map-settings.php:52
1495
+ msgid "Show the category dropdown?"
1496
+ msgstr "Mostrar a categoria em dropdown?"
1497
+
1498
+ #: admin/templates/map-settings.php:56
1499
+ msgid "Distance unit"
1500
+ msgstr "Unidade de distância"
1501
+
1502
+ #: admin/templates/map-settings.php:59
1503
+ msgid "km"
1504
+ msgstr "km"
1505
+
1506
+ #: admin/templates/map-settings.php:61
1507
+ msgid "mi"
1508
+ msgstr "mi"
1509
+
1510
+ #: admin/templates/map-settings.php:65
1511
+ msgid "Max search results"
1512
+ msgstr "Máximos resultados da pesquisa"
1513
+
1514
+ #: admin/templates/map-settings.php:65 admin/templates/map-settings.php:69
1515
+ msgid "The default value is set between the [ ]."
1516
+ msgstr "O valor padrão é definido entre [ ]."
1517
+
1518
+ #: admin/templates/map-settings.php:69
1519
+ msgid "Search radius options"
1520
+ msgstr "Opções de raio de pesquisa"
1521
+
1522
+ #: admin/templates/map-settings.php:83
1523
+ msgid "Map"
1524
+ msgstr "Mapa"
1525
+
1526
+ #: admin/templates/map-settings.php:86
1527
+ msgid "Attempt to auto-locate the user"
1528
+ msgstr "Tentativa de auto-localizar o utilizador"
1529
+
1530
+ #: admin/templates/map-settings.php:90
1531
+ msgid "Load locations on page load"
1532
+ msgstr "Carregar localizações no carregamento da página"
1533
+
1534
+ #: admin/templates/map-settings.php:94
1535
+ msgid "Number of locations to show"
1536
+ msgstr "Número de locais a mostrar"
1537
+
1538
+ #: admin/templates/map-settings.php:94
1539
+ #, php-format
1540
+ msgid ""
1541
+ "Although the location data is cached after the first load, a lower number "
1542
+ "will result in the map being more responsive. %s If this field is left empty "
1543
+ "or set to 0, then all locations are loaded."
1544
+ msgstr ""
1545
+ "Embora os dados de localização são colocadas em cache depois do primeiro "
1546
+ "carregamento, um número inferior irá resultar no mapa ser mais ajustável. %s "
1547
+ "Se este campo for deixado em branco ou definido como 0, em seguida, todos os "
1548
+ "locais serão carregados."
1549
+
1550
+ #: admin/templates/map-settings.php:98
1551
+ msgid "Start point"
1552
+ msgstr "Ponto de partida"
1553
+
1554
+ #: admin/templates/map-settings.php:98
1555
+ #, php-format
1556
+ msgid ""
1557
+ "%sRequired field.%s %s If auto-locating the user is disabled or fails, the "
1558
+ "center of the provided city or country will be used as the initial starting "
1559
+ "point for the user."
1560
+ msgstr ""
1561
+ "%sCampos obrigatórios.%s %s Se a auto-localização do utilizador estiver "
1562
+ "desativada ou falhar, o centro da cidade ou país fornecido será utilizado "
1563
+ "como ponto de partida inicial para o utilizador."
1564
+
1565
+ #: admin/templates/map-settings.php:103
1566
+ msgid "Initial zoom level"
1567
+ msgstr "Nível de zoom inicial"
1568
+
1569
+ #: admin/templates/map-settings.php:107
1570
+ msgid "Max auto zoom level"
1571
+ msgstr "Nível de zoom máximo automático"
1572
+
1573
+ #: admin/templates/map-settings.php:107
1574
+ #, php-format
1575
+ msgid ""
1576
+ "This value sets the zoom level for the \"Zoom here\" link in the info "
1577
+ "window. %s It is also used to limit the zooming when the viewport of the map "
1578
+ "is changed to make all the markers fit on the screen."
1579
+ msgstr ""
1580
+ "Esse valor define o nível de zoom para a ligação \"zoom aqui\" na janela de "
1581
+ "informações. %s Também é usado para limitar o zoom quando a janela de "
1582
+ "visualização do mapa é alterada para fazer todos os marcadores se ajustarem "
1583
+ "ao ecran."
1584
+
1585
+ #: admin/templates/map-settings.php:111
1586
+ msgid "Show the street view controls?"
1587
+ msgstr "Mostrar controlos de vista de rua?"
1588
+
1589
+ #: admin/templates/map-settings.php:115
1590
+ msgid "Show the pan controls?"
1591
+ msgstr "Mostrar os controlos de panorâmica?"
1592
+
1593
+ #: admin/templates/map-settings.php:119
1594
+ msgid "Show the map type control?"
1595
+ msgstr "Mostrar o controlador do tipo de mapa?"
1596
+
1597
+ #: admin/templates/map-settings.php:123
1598
+ msgid "Enable scroll wheel zooming?"
1599
+ msgstr "Activar roda de scroll do zoom?"
1600
+
1601
+ #: admin/templates/map-settings.php:127
1602
+ msgid "Zoom control position"
1603
+ msgstr "Posição do controlo de Zoom"
1604
+
1605
+ #: admin/templates/map-settings.php:130
1606
+ msgid "Left"
1607
+ msgstr "Esquerda"
1608
+
1609
+ #: admin/templates/map-settings.php:132
1610
+ msgid "Right"
1611
+ msgstr "Direita"
1612
+
1613
+ #: admin/templates/map-settings.php:136
1614
+ msgid "Zoom control style"
1615
+ msgstr "Estilo de controlo de Zoom"
1616
+
1617
+ #: admin/templates/map-settings.php:139
1618
+ msgid "Small"
1619
+ msgstr "Pequeno"
1620
+
1621
+ #: admin/templates/map-settings.php:141
1622
+ msgid "Large"
1623
+ msgstr "Grande"
1624
+
1625
+ #: admin/templates/map-settings.php:145
1626
+ msgid "Map type"
1627
+ msgstr "Tipo de mapa"
1628
+
1629
+ #: admin/templates/map-settings.php:149
1630
+ msgid "Map style"
1631
+ msgstr "Estilo do mapa"
1632
+
1633
+ #: admin/templates/map-settings.php:149
1634
+ msgid ""
1635
+ "Custom map styles only work if the map type is set to \"Roadmap\" or "
1636
+ "\"Terrain\"."
1637
+ msgstr ""
1638
+ "Estilos de mapa personalizados só funcionam se o tipo de mapa estiver "
1639
+ "definido para \"Mapa de Estrada\" ou \"Terreno\"."
1640
+
1641
+ #: admin/templates/map-settings.php:152
1642
+ #, php-format
1643
+ msgid ""
1644
+ "You can use existing map styles from %sSnazzy Maps%s or %sMap Stylr%s and "
1645
+ "paste it in the textarea below, or you can generate a custom map style "
1646
+ "through the %sMap Style Editor%s or %sStyled Maps Wizard%s."
1647
+ msgstr ""
1648
+ "Você pode usar estilos de mapa existente %sSnazzy Mapas%s ou%sMAP Stylr%s e "
1649
+ "cole-o na área de texto abaixo, ou você pode gerar um estilo de mapa "
1650
+ "personalizado através do %sMAP Editor de estilos%s ou %sAssistente de mapas"
1651
+ "% s."
1652
+
1653
+ #: admin/templates/map-settings.php:153
1654
+ #, php-format
1655
+ msgid ""
1656
+ "If you like to write the style code yourself, then you can find the "
1657
+ "documentation from Google %shere%s."
1658
+ msgstr ""
1659
+ "Se você gosta de escrever os código de estilo, então você pode encontrar a "
1660
+ "documentação do Google %saqui%s."
1661
+
1662
+ #: admin/templates/map-settings.php:155
1663
+ msgid "Preview Map Style"
1664
+ msgstr "Pré-visualizar estilo do mapa"
1665
+
1666
+ #: admin/templates/map-settings.php:159
1667
+ msgid "Show credits?"
1668
+ msgstr "Mostrar créditos?"
1669
+
1670
+ #: admin/templates/map-settings.php:159
1671
+ msgid ""
1672
+ "This will place a \"Search provided by WP Store Locator\" backlink below the "
1673
+ "map."
1674
+ msgstr ""
1675
+ "Isto irá colocar a \"Pesquisa fornecida pela WP Store Locator\" backlink "
1676
+ "abaixo do mapa."
1677
+
1678
+ #: admin/templates/map-settings.php:173
1679
+ msgid "User Experience"
1680
+ msgstr "Experiência de utilizador"
1681
+
1682
+ #: admin/templates/map-settings.php:176
1683
+ msgid "Store Locator height"
1684
+ msgstr "Altura do Store Locator"
1685
+
1686
+ #: admin/templates/map-settings.php:180
1687
+ msgid "Max width for the info window content"
1688
+ msgstr "Máxima largura para o conteúdo da janela de informações"
1689
+
1690
+ #: admin/templates/map-settings.php:184
1691
+ msgid "Search field width"
1692
+ msgstr "Largura do campo de pesquisa"
1693
+
1694
+ #: admin/templates/map-settings.php:188
1695
+ msgid "Search and radius label width"
1696
+ msgstr "Largura de marcador de pesquisa e raio"
1697
+
1698
+ #: admin/templates/map-settings.php:192
1699
+ msgid "Store Locator template"
1700
+ msgstr "Modelo de Store Locator"
1701
+
1702
+ #: admin/templates/map-settings.php:192
1703
+ #, php-format
1704
+ msgid ""
1705
+ "The selected template is used with the [wpsl] shortcode. %s You can add a "
1706
+ "custom template with the %swpsl_templates%s filter."
1707
+ msgstr ""
1708
+ "O modelo selecionado é utilizado com o [WPSL] shortcode. %s Você pode "
1709
+ "adicionar um modelo personalizado com o filtro %swpsl_templates%s."
1710
+
1711
+ #: admin/templates/map-settings.php:196
1712
+ msgid "Hide the scrollbar?"
1713
+ msgstr "Esconder a barra de scroll?"
1714
+
1715
+ #: admin/templates/map-settings.php:200
1716
+ msgid "Open links in a new window?"
1717
+ msgstr "Abrir links numa nova janela?"
1718
+
1719
+ #: admin/templates/map-settings.php:204
1720
+ msgid "Show a reset map button?"
1721
+ msgstr "Mostrar um botão de reposição de mapa?"
1722
+
1723
+ #: admin/templates/map-settings.php:208
1724
+ msgid ""
1725
+ "When a user clicks on \"Directions\", open a new window, and show the route "
1726
+ "on google.com/maps ?"
1727
+ msgstr ""
1728
+ "Quando um utilizador clica em \"Como chegar\", abrir uma nova janela, e "
1729
+ "mostrar a rota em google.com/maps?"
1730
+
1731
+ #: admin/templates/map-settings.php:212
1732
+ msgid "Show a \"More info\" link in the store listings?"
1733
+ msgstr "Mostrar o link \"Mais informação\" nas listas de lojas?"
1734
+
1735
+ #: admin/templates/map-settings.php:212
1736
+ #, php-format
1737
+ msgid ""
1738
+ "This places a \"More Info\" link below the address and will show the phone, "
1739
+ "fax, email, opening hours and description once the link is clicked. %s If "
1740
+ "you for example want the contact details to always be visible, then please "
1741
+ "follow the instructions on %sthis%s page."
1742
+ msgstr ""
1743
+ "Isto coloca um link de \"Mais Informação\" abaixo do endereço e vai mostrar "
1744
+ "o telefone, fax, e-mail, horário de funcionamento e descrição uma vez que o "
1745
+ "link seja clicado. %s Se você quiser, por exemplo, quiser que os dados de "
1746
+ "contacto estejam sempre visíveis, siga as instruções %snesta%s página."
1747
+
1748
+ #: admin/templates/map-settings.php:216
1749
+ msgid "Where do you want to show the \"More info\" details?"
1750
+ msgstr "Onde quer mostrar os detalhes de \"Mais informação\"?"
1751
+
1752
+ #: admin/templates/map-settings.php:220
1753
+ msgid "Make the store name clickable if a store URL exists?"
1754
+ msgstr "Permitir que o nome da loja seja clicável se um link da loja existir?"
1755
+
1756
+ #: admin/templates/map-settings.php:220
1757
+ #, php-format
1758
+ msgid ""
1759
+ "If %spermalinks%s are enabled, the store name will always link to the store "
1760
+ "page."
1761
+ msgstr ""
1762
+ "Se as %sligações permanentes% s estiverem activadas, o nome da loja será "
1763
+ "sempre uma ligação para as página da loja."
1764
+
1765
+ #: admin/templates/map-settings.php:224
1766
+ msgid "Make the phone number clickable on mobile devices?"
1767
+ msgstr "Fazer o número de telefone clicável em dispositivos móveis?"
1768
+
1769
+ #: admin/templates/map-settings.php:228
1770
+ msgid ""
1771
+ "If street view is available for the current location, then show a \"Street "
1772
+ "view\" link in the info window?"
1773
+ msgstr ""
1774
+ "Se a vista da rua estiver disponível para a localização atual, em seguida, "
1775
+ "mostrar um link \"Vista da Rua\" na janela de informação?"
1776
+
1777
+ #: admin/templates/map-settings.php:228
1778
+ #, php-format
1779
+ msgid ""
1780
+ "Enabling this option can sometimes result in a small delay in the opening of "
1781
+ "the info window. %s This happens because an API request is made to Google "
1782
+ "Maps to check if street view is available for the current location."
1783
+ msgstr ""
1784
+ "A ativação desta opção, por vezes, pode resultar em um pequeno atraso na "
1785
+ "abertura da janela de informações. %s Isso acontece porque uma solicitação "
1786
+ "de API é feita para o Google Maps para verificar se vista da rua está "
1787
+ "disponível para a localização atual."
1788
+
1789
+ #: admin/templates/map-settings.php:232
1790
+ msgid "Show a \"Zoom here\" link in the info window?"
1791
+ msgstr "Mostrar o link \"Zoom aqui\" na janela de informação?"
1792
+
1793
+ #: admin/templates/map-settings.php:232
1794
+ #, php-format
1795
+ msgid ""
1796
+ "Clicking this link will make the map zoom in to the %s max auto zoom level "
1797
+ "%s."
1798
+ msgstr ""
1799
+ "Ao clicar nessa ligação vai fazer o mapa ampliar ao%s nível máximo de zoom "
1800
+ "automático %s."
1801
+
1802
+ #: admin/templates/map-settings.php:236
1803
+ msgid "On page load move the mouse cursor to the search field?"
1804
+ msgstr ""
1805
+ "No carregamento da página mover o cursor do mouse para o campo de pesquisa?"
1806
+
1807
+ #: admin/templates/map-settings.php:236
1808
+ #, php-format
1809
+ msgid ""
1810
+ "If the store locator is not placed at the top of the page, enabling this "
1811
+ "feature can result in the page scrolling down. %s %sThis option is disabled "
1812
+ "on mobile devices.%s"
1813
+ msgstr ""
1814
+ "Se o localizador de lojas não é colocado na parte superior da página, "
1815
+ "activando esta funcionalidade pode resultar que a página desça. %s %sEsta "
1816
+ "opção é desativada em dispositivos móveis.%s"
1817
+
1818
+ #: admin/templates/map-settings.php:240
1819
+ msgid "Use the default style for the info window?"
1820
+ msgstr "Usar o estilo padrão para a janela de informações?"
1821
+
1822
+ #: admin/templates/map-settings.php:240
1823
+ #, php-format
1824
+ msgid ""
1825
+ "If the default style is disabled the %sInfoBox%s library will be used "
1826
+ "instead. %s This enables you to easily change the look and feel of the info "
1827
+ "window through the .wpsl-infobox css class."
1828
+ msgstr ""
1829
+ "Se o estilo padrão é desativado a livraria da %sCaixa de informação%s será "
1830
+ "usado em seu lugar. %s Isso permite que você facilmente mude a aparência da "
1831
+ "janela de informações através da classe css .wpsl-infobox."
1832
+
1833
+ #: admin/templates/map-settings.php:244
1834
+ msgid "Hide the distance in the search results?"
1835
+ msgstr "Esconder a distância nos resultados da pesquisa?"
1836
+
1837
+ #: admin/templates/map-settings.php:248
1838
+ msgid "If a user hovers over the search results the store marker"
1839
+ msgstr ""
1840
+ "Se um utilizador passar sobre os resultados da pesquisa os marcadores de loja"
1841
+
1842
+ #: admin/templates/map-settings.php:248
1843
+ #, php-format
1844
+ msgid ""
1845
+ "If marker clusters are enabled this option will not work as expected as long "
1846
+ "as the markers are clustered. %s The bouncing of the marker won't be visible "
1847
+ "at all unless a user zooms in far enough for the marker cluster to change "
1848
+ "back in to individual markers. %s The info window will open as expected, but "
1849
+ "it won't be clear to which marker it belongs to. "
1850
+ msgstr ""
1851
+ "Se o agrupamento de marcadores estiverem habilitados, esta opção não irá "
1852
+ "funcionar como esperado, enquanto os marcadores estão agrupados. %s O salto "
1853
+ "do marcador não será visível a todos, a menos que um utilizador se aproxime "
1854
+ "suficientemente longe para o agrupamento de marcadores mudar novamente para "
1855
+ "marcadores individuais. %s A janela de informações será apresentada como "
1856
+ "previsto, mas não vai ser claro sobre qual marcador pertence."
1857
+
1858
+ #: admin/templates/map-settings.php:252
1859
+ msgid "Address format"
1860
+ msgstr "Formato de morada"
1861
+
1862
+ #: admin/templates/map-settings.php:252
1863
+ #, php-format
1864
+ msgid ""
1865
+ "You can add custom address formats with the %swpsl_address_formats%s filter."
1866
+ msgstr ""
1867
+ "Você pode adicionar formatos personalizados de endereço com o filtro"
1868
+ "%swpsl_address_formats%s."
1869
+
1870
+ #: admin/templates/map-settings.php:266
1871
+ msgid "Markers"
1872
+ msgstr "Marcadores"
1873
+
1874
+ #: admin/templates/map-settings.php:270
1875
+ msgid "Enable marker clusters?"
1876
+ msgstr "Ativar agrupamento de marcadores?"
1877
+
1878
+ #: admin/templates/map-settings.php:270
1879
+ msgid "Recommended for maps with a large amount of markers."
1880
+ msgstr "Recomendado para mapas com uma grande quantidade de marcadores."
1881
+
1882
+ #: admin/templates/map-settings.php:274
1883
+ msgid "Max zoom level"
1884
+ msgstr "Nível de zoom máximo"
1885
+
1886
+ #: admin/templates/map-settings.php:274
1887
+ msgid ""
1888
+ "If this zoom level is reached or exceeded, then all markers are moved out of "
1889
+ "the marker cluster and shown as individual markers."
1890
+ msgstr ""
1891
+ "Se este nível de zoom for atingido ou ultrapassado, em seguida, todos os "
1892
+ "marcadores são movidos para fora do agrupamento de marcadores e mostrados "
1893
+ "como marcadores individuais."
1894
+
1895
+ #: admin/templates/map-settings.php:278
1896
+ msgid "Cluster size"
1897
+ msgstr "Tamanho de agrupamento"
1898
+
1899
+ #: admin/templates/map-settings.php:278
1900
+ #, php-format
1901
+ msgid ""
1902
+ "The grid size of a cluster in pixels. %s A larger number will result in a "
1903
+ "lower amount of clusters and also make the algorithm run faster."
1904
+ msgstr ""
1905
+ "O tamanho da grelha de um agrupamento em pixels. %s Um número maior "
1906
+ "resultará em uma menor quantidade de agrupamentos e também fazer o algoritmo "
1907
+ "funcionar mais rápido."
1908
+
1909
+ #: admin/templates/map-settings.php:292
1910
+ msgid "Store Editor"
1911
+ msgstr "Editor de Loja"
1912
+
1913
+ #: admin/templates/map-settings.php:295
1914
+ msgid "Default country"
1915
+ msgstr "País padrão"
1916
+
1917
+ #: admin/templates/map-settings.php:299
1918
+ msgid "Map type for the location preview"
1919
+ msgstr "Tipo de mapa para a visualização local"
1920
+
1921
+ #: admin/templates/map-settings.php:303
1922
+ msgid "Hide the opening hours?"
1923
+ msgstr "Esconder o horário de abertura?"
1924
+
1925
+ #: admin/templates/map-settings.php:309
1926
+ msgid "Opening hours input type"
1927
+ msgstr "Tipo de campo de horário de abertura"
1928
+
1929
+ #: admin/templates/map-settings.php:313
1930
+ #, php-format
1931
+ msgid ""
1932
+ "Opening hours created in version 1.x %sare not%s automatically converted to "
1933
+ "the new dropdown format."
1934
+ msgstr ""
1935
+ "Horário de abertura criado na versão 1.x %snão são%s automaticamente "
1936
+ "convertidos para o novo formato de dropdown."
1937
+
1938
+ #: admin/templates/map-settings.php:316 admin/templates/map-settings.php:325
1939
+ msgid "The default opening hours"
1940
+ msgstr "Horas de abertura padrão"
1941
+
1942
+ #: admin/templates/map-settings.php:322
1943
+ msgid "Opening hours format"
1944
+ msgstr "Formato de horas de abertura"
1945
+
1946
+ #: admin/templates/map-settings.php:329
1947
+ msgid ""
1948
+ "The default country and opening hours are only used when a new store is "
1949
+ "created. So changing the default values will have no effect on existing "
1950
+ "store locations."
1951
+ msgstr ""
1952
+ "O país padrão e as horas de abertura são somente aplicadas quando uma nova "
1953
+ "loja é criada. Por isso alterar os valores padrão não irá ter efeito nas "
1954
+ "localizações de lojas existentes."
1955
+
1956
+ #: admin/templates/map-settings.php:342
1957
+ msgid "Permalink"
1958
+ msgstr "Link permanente"
1959
+
1960
+ #: admin/templates/map-settings.php:345
1961
+ msgid "Enable permalink?"
1962
+ msgstr "Activar links permanentes?"
1963
+
1964
+ #: admin/templates/map-settings.php:349
1965
+ msgid "Store slug"
1966
+ msgstr "URL de loja"
1967
+
1968
+ #: admin/templates/map-settings.php:353
1969
+ msgid "Category slug"
1970
+ msgstr "URL de categoria"
1971
+
1972
+ #: admin/templates/map-settings.php:356
1973
+ #, php-format
1974
+ msgid "The permalink slugs %smust be unique%s on your site."
1975
+ msgstr "Os urls permanentes %sdevem ser unicos%s no seu site."
1976
+
1977
+ #: admin/templates/map-settings.php:368
1978
+ msgid "Labels"
1979
+ msgstr "Etiquetas"
1980
+
1981
+ #: admin/templates/map-settings.php:371 admin/templates/map-settings.php:372
1982
+ #: frontend/templates/default.php:11
1983
+ #: frontend/templates/store-listings-below.php:11 inc/wpsl-functions.php:96
1984
+ msgid "Your location"
1985
+ msgstr "Sua localização"
1986
+
1987
+ #: admin/templates/map-settings.php:375 admin/templates/map-settings.php:376
1988
+ #: frontend/templates/default.php:20
1989
+ #: frontend/templates/store-listings-below.php:20 inc/wpsl-functions.php:99
1990
+ msgid "Search radius"
1991
+ msgstr "Raio de pesquisa"
1992
+
1993
+ #: admin/templates/map-settings.php:379 admin/templates/map-settings.php:380
1994
+ #: frontend/class-frontend.php:1296 inc/wpsl-functions.php:100
1995
+ msgid "No results found"
1996
+ msgstr "Sem resultados encontrados"
1997
+
1998
+ #: admin/templates/map-settings.php:387
1999
+ msgid "Searching (preloader text)"
2000
+ msgstr "Pesquisando (texto pré-carregado)"
2001
+
2002
+ #: admin/templates/map-settings.php:388 frontend/class-frontend.php:1295
2003
+ #: inc/wpsl-functions.php:98
2004
+ msgid "Searching..."
2005
+ msgstr "Procurando"
2006
+
2007
+ #: admin/templates/map-settings.php:391 admin/templates/map-settings.php:392
2008
+ #: frontend/templates/default.php:29
2009
+ #: frontend/templates/store-listings-below.php:29 inc/wpsl-functions.php:101
2010
+ msgid "Results"
2011
+ msgstr "Resultados"
2012
+
2013
+ #: admin/templates/map-settings.php:395 admin/upgrade.php:218
2014
+ #: inc/wpsl-functions.php:115
2015
+ msgid "Category filter"
2016
+ msgstr "Filtro de categoria"
2017
+
2018
+ #: admin/templates/map-settings.php:396 frontend/class-frontend.php:1082
2019
+ msgid "Category"
2020
+ msgstr "Categoria"
2021
+
2022
+ #: admin/templates/map-settings.php:399 admin/templates/map-settings.php:400
2023
+ #: admin/upgrade.php:66 frontend/class-frontend.php:1297
2024
+ #: frontend/underscore-functions.php:114 frontend/underscore-functions.php:141
2025
+ #: inc/wpsl-functions.php:102
2026
+ msgid "More info"
2027
+ msgstr "Mais informação"
2028
+
2029
+ #: admin/templates/map-settings.php:403 admin/templates/map-settings.php:404
2030
+ #: frontend/class-frontend.php:661 frontend/underscore-functions.php:29
2031
+ #: frontend/underscore-functions.php:121 inc/wpsl-functions.php:110
2032
+ msgid "Phone"
2033
+ msgstr "Telefone"
2034
+
2035
+ #: admin/templates/map-settings.php:423 admin/templates/map-settings.php:424
2036
+ #: frontend/class-frontend.php:1302 inc/wpsl-functions.php:95
2037
+ msgid "Start location"
2038
+ msgstr "Localização inicial"
2039
+
2040
+ #: admin/templates/map-settings.php:427
2041
+ msgid "Get directions"
2042
+ msgstr "Obter direcções"
2043
+
2044
+ #: admin/templates/map-settings.php:428 frontend/class-frontend.php:1300
2045
+ #: inc/wpsl-functions.php:103
2046
+ msgid "Directions"
2047
+ msgstr "Direcções"
2048
+
2049
+ #: admin/templates/map-settings.php:431
2050
+ msgid "No directions found"
2051
+ msgstr "Sem direcções encontradas"
2052
+
2053
+ #: admin/templates/map-settings.php:432 admin/upgrade.php:163
2054
+ #: frontend/class-frontend.php:1301 inc/wpsl-functions.php:104
2055
+ msgid "No route could be found between the origin and destination"
2056
+ msgstr "Nenhuma rota foi encontrada entre a origem e destino"
2057
+
2058
+ #: admin/templates/map-settings.php:435 admin/templates/map-settings.php:436
2059
+ #: admin/upgrade.php:87 frontend/class-frontend.php:1303
2060
+ #: inc/wpsl-functions.php:105
2061
+ msgid "Back"
2062
+ msgstr "Voltar"
2063
+
2064
+ #: admin/templates/map-settings.php:439 admin/templates/map-settings.php:440
2065
+ #: admin/upgrade.php:155 frontend/class-frontend.php:1304
2066
+ #: inc/wpsl-functions.php:106
2067
+ msgid "Street view"
2068
+ msgstr "Vista da rua"
2069
+
2070
+ #: admin/templates/map-settings.php:443 admin/templates/map-settings.php:444
2071
+ #: admin/upgrade.php:159 frontend/class-frontend.php:1305
2072
+ #: inc/wpsl-functions.php:107
2073
+ msgid "Zoom here"
2074
+ msgstr "Ampliar aqui"
2075
+
2076
+ #: admin/templates/map-settings.php:447
2077
+ msgid "General error"
2078
+ msgstr "Erro geral"
2079
+
2080
+ #: admin/templates/map-settings.php:448 frontend/class-frontend.php:1298
2081
+ #: inc/wpsl-functions.php:108
2082
+ msgid "Something went wrong, please try again!"
2083
+ msgstr "Algo deu errado, por favor tente novamente!"
2084
+
2085
+ #: admin/templates/map-settings.php:451
2086
+ msgid "Query limit error"
2087
+ msgstr "Erro limite da consulta"
2088
+
2089
+ #: admin/templates/map-settings.php:451
2090
+ #, php-format
2091
+ msgid ""
2092
+ "You can raise the %susage limit%s by obtaining an API %skey%s, and fill in "
2093
+ "the \"API key\" field at the top of this page."
2094
+ msgstr ""
2095
+ "Você pode aumentar os limite de %sutilização% s através da obtenção de uma "
2096
+ "%schave%s API, e preencher o campo \"chave API \" na parte superior da "
2097
+ "página."
2098
+
2099
+ #: admin/templates/map-settings.php:452 frontend/class-frontend.php:1299
2100
+ #: inc/wpsl-functions.php:109
2101
+ msgid "API usage limit reached"
2102
+ msgstr "Limite de uso de API atingido"
2103
+
2104
+ #: admin/templates/map-settings.php:465
2105
+ msgid "Tools"
2106
+ msgstr "Ferramentas"
2107
+
2108
+ #: admin/templates/map-settings.php:468
2109
+ msgid "Enable store locator debug?"
2110
+ msgstr "Activar store locator debug?"
2111
+
2112
+ #: admin/templates/map-settings.php:468
2113
+ #, php-format
2114
+ msgid ""
2115
+ "This disables the WPSL transient cache. %sThe transient cache is only used "
2116
+ "if the %sLoad locations on page load%s option is enabled."
2117
+ msgstr ""
2118
+ "Isto desativa o cache temporário do WPSL. %sO de cache temporário só é usado "
2119
+ "se a opção %sCarregar localizações no carregamento da página%s estiver "
2120
+ "habilitado."
2121
+
2122
+ #: admin/templates/map-settings.php:472
2123
+ msgid "WPSL transients"
2124
+ msgstr "WPSL temporário"
2125
+
2126
+ #: admin/templates/map-settings.php:473
2127
+ msgid "Clear store locator transient cache"
2128
+ msgstr "Limpar localização de lojas de cache temporário"
2129
+
2130
+ #: admin/upgrade.php:82
2131
+ msgid "info window"
2132
+ msgstr "informação de janela"
2133
+
2134
+ #: admin/upgrade.php:92
2135
+ msgid "Reset"
2136
+ msgstr "Limpar"
2137
+
2138
+ #: admin/upgrade.php:186 inc/wpsl-functions.php:90
2139
+ msgid "stores"
2140
+ msgstr "lojas"
2141
+
2142
+ #: admin/upgrade.php:190 inc/wpsl-functions.php:91
2143
+ msgid "store-category"
2144
+ msgstr "store-category"
2145
+
2146
+ #: admin/upgrade.php:371
2147
+ #, php-format
2148
+ msgid ""
2149
+ "Because you updated WP Store Locator from version 1.x, the %s current store "
2150
+ "locations need to be %sconverted%s to custom post types."
2151
+ msgstr ""
2152
+ "Porque você atualizou o WP Store Locator da versão 1.x, %sa atual "
2153
+ "localização de loja precisa de ser %sconvertida%s para tipos de conteúdo "
2154
+ "personalizado."
2155
+
2156
+ #: admin/upgrade.php:392
2157
+ #, php-format
2158
+ msgid ""
2159
+ "The script converting the locations timed out. %s You can click the \"Start "
2160
+ "Converting\" button again to restart the script. %s If there are thousands "
2161
+ "of store locations left to convert and you keep seeing this message, then "
2162
+ "you can try to contact your host and ask if they can increase the maximum "
2163
+ "execution time. %s The plugin tried to disable the maximum execution time, "
2164
+ "but if you are reading this then that failed."
2165
+ msgstr ""
2166
+ "O script de conversão de locais expirou. %s Você pode clicar no botão "
2167
+ "\"Começar a converter\" novamente para reiniciar o script. %s Se existem "
2168
+ "milhares de localizações de lojas por converter e você continua vendo esta "
2169
+ "mensagem, então você pode tentar entrar em contato com seu alojamento e "
2170
+ "perguntar se eles podem aumentar o tempo máximo de execução. O plugin%s "
2171
+ "tentou desativar o tempo máximo de execução, mas se você está lendo isso, "
2172
+ "então é porque falhou."
2173
+
2174
+ #: admin/upgrade.php:413
2175
+ msgid "Store locations to convert:"
2176
+ msgstr "Localização de lojas para converter:"
2177
+
2178
+ #: admin/upgrade.php:415
2179
+ msgid "Start Converting"
2180
+ msgstr "Iniciar a Conversão"
2181
+
2182
+ #: admin/upgrade.php:537
2183
+ #, php-format
2184
+ msgid ""
2185
+ "All the store locations are now converted to custom post types. %s You can "
2186
+ "view them on the %sAll Stores%s page."
2187
+ msgstr ""
2188
+ "Todos as localizações de lojas agora são convertidos em tipos de conteúdos "
2189
+ "personalizados. %s Você pode vê-las na página %sTodas as Lojas%s."
2190
+
2191
+ #: frontend/class-frontend.php:599
2192
+ msgid ""
2193
+ "If you use the [wpsl_address] shortcode outside a store page you need to set "
2194
+ "the ID attribute."
2195
+ msgstr ""
2196
+ "Se utilizar o shortcode [wpsl_address] fora de uma página de loja você "
2197
+ "necessita de definir o atributo ID."
2198
+
2199
+ #: frontend/class-frontend.php:710
2200
+ msgid ""
2201
+ "If you use the [wpsl_hours] shortcode outside a store page you need to set "
2202
+ "the ID attribute."
2203
+ msgstr ""
2204
+ "Se utilizar o shortcode [wpsl_hours] fora de uma página de loja você "
2205
+ "necessita de definir o atributo ID."
2206
+
2207
+ #: frontend/class-frontend.php:759
2208
+ msgid ""
2209
+ "If you use the [wpsl_map] shortcode outside a store page you need to set the "
2210
+ "ID attribute."
2211
+ msgstr ""
2212
+ "Se utilizar o shortcode [wpsl_map] fora de uma página de loja você necessita "
2213
+ "de definir o atributo ID."
2214
+
2215
+ #: frontend/class-frontend.php:1084
2216
+ msgid "Any"
2217
+ msgstr "Algum"
2218
+
2219
+ #: frontend/class-frontend.php:1197
2220
+ msgid "The application does not have permission to use the Geolocation API."
2221
+ msgstr "O aplicativo não tem permissão para usar a API de Geolocalização."
2222
+
2223
+ #: frontend/class-frontend.php:1198
2224
+ msgid "Location information is unavailable."
2225
+ msgstr "As informações de localização não estão disponíveis."
2226
+
2227
+ #: frontend/class-frontend.php:1199
2228
+ msgid "The geolocation request timed out."
2229
+ msgstr "O pedido de geolocalização expirou."
2230
+
2231
+ #: frontend/class-frontend.php:1200
2232
+ msgid "An unknown error occurred."
2233
+ msgstr "Ocorreu um erro desconhecido."
2234
+
2235
+ #: frontend/templates/default.php:60
2236
+ #: frontend/templates/store-listings-below.php:66
2237
+ #, php-format
2238
+ msgid "Search provided by %sWP Store Locator%s"
2239
+ msgstr "Pesquisa fornecido pelo %sWP Store Locator%s"
2240
+
2241
+ #: inc/class-post-types.php:50
2242
+ msgid "Store"
2243
+ msgstr "Loja"
2244
+
2245
+ #: inc/class-post-types.php:51
2246
+ msgid "Stores"
2247
+ msgstr "Lojas"
2248
+
2249
+ #: inc/class-post-types.php:55
2250
+ msgid "Store Locator"
2251
+ msgstr "Localizador de lojas"
2252
+
2253
+ #: inc/class-post-types.php:56
2254
+ #, php-format
2255
+ msgid "All %s"
2256
+ msgstr "Todos %s"
2257
+
2258
+ #: inc/class-post-types.php:58 inc/class-post-types.php:61
2259
+ #, php-format
2260
+ msgid "New %s"
2261
+ msgstr "Nova %s"
2262
+
2263
+ #: inc/class-post-types.php:59
2264
+ #, php-format
2265
+ msgid "Add New %s"
2266
+ msgstr "Adicionar Nova %s"
2267
+
2268
+ #: inc/class-post-types.php:60
2269
+ #, php-format
2270
+ msgid "Edit %s"
2271
+ msgstr "Editar %s"
2272
+
2273
+ #: inc/class-post-types.php:62
2274
+ #, php-format
2275
+ msgid "View %s"
2276
+ msgstr "Ver %s"
2277
+
2278
+ #: inc/class-post-types.php:63
2279
+ #, php-format
2280
+ msgid "Search %s"
2281
+ msgstr "Procurar %s"
2282
+
2283
+ #: inc/class-post-types.php:64
2284
+ #, php-format
2285
+ msgid "No %s found"
2286
+ msgstr "Sem %s encontrada"
2287
+
2288
+ #: inc/class-post-types.php:65
2289
+ #, php-format
2290
+ msgid "No %s found in trash"
2291
+ msgstr "Sem %s encontrada no lixo"
2292
+
2293
+ #: inc/class-post-types.php:107 inc/class-post-types.php:117
2294
+ msgid "Store Categories"
2295
+ msgstr "Categorias de Lojas"
2296
+
2297
+ #: inc/class-post-types.php:108
2298
+ msgid "Store Category"
2299
+ msgstr "Categoria de Loja"
2300
+
2301
+ #: inc/class-post-types.php:109
2302
+ msgid "Search Store Categories"
2303
+ msgstr "Pesquisar Categorias de Lojas"
2304
+
2305
+ #: inc/class-post-types.php:110
2306
+ msgid "All Store Categories"
2307
+ msgstr "Todas as Categorias de Lojas"
2308
+
2309
+ #: inc/class-post-types.php:111
2310
+ msgid "Parent Store Category"
2311
+ msgstr "Pai da Categoria de Loja"
2312
+
2313
+ #: inc/class-post-types.php:112
2314
+ msgid "Parent Store Category:"
2315
+ msgstr "Pai da Categoria de Loja:"
2316
+
2317
+ #: inc/class-post-types.php:113
2318
+ msgid "Edit Store Category"
2319
+ msgstr "Editar Categoria de Loja"
2320
+
2321
+ #: inc/class-post-types.php:114
2322
+ msgid "Update Store Category"
2323
+ msgstr "Actualizar Categoria de Loja"
2324
+
2325
+ #: inc/class-post-types.php:115
2326
+ msgid "Add New Store Category"
2327
+ msgstr "Adicionar Nova Categoria de Loja"
2328
+
2329
+ #: inc/class-post-types.php:116
2330
+ msgid "New Store Category Name"
2331
+ msgstr "Novo Nome de Categoria de Loja"
2332
+
2333
+ #: inc/class-post-types.php:147
2334
+ msgid "Enter store title here"
2335
+ msgstr "Insira o título da loja aqui"
2336
+
2337
+ #: inc/class-post-types.php:165
2338
+ msgid "Zip"
2339
+ msgstr "Código postal"
2340
+
2341
+ #: inc/wpsl-functions.php:184
2342
+ msgid "Show the store list below the map"
2343
+ msgstr "Mostrar a lista de lojas abaixo do mapa"
2344
+
2345
+ #: inc/wpsl-functions.php:201
2346
+ msgid "Monday"
2347
+ msgstr "Segunda-Feira"
2348
+
2349
+ #: inc/wpsl-functions.php:202
2350
+ msgid "Tuesday"
2351
+ msgstr "Terça-Feira"
2352
+
2353
+ #: inc/wpsl-functions.php:203
2354
+ msgid "Wednesday"
2355
+ msgstr "Quarta-Feira"
2356
+
2357
+ #: inc/wpsl-functions.php:204
2358
+ msgid "Thursday"
2359
+ msgstr "Quinta-Feira"
2360
+
2361
+ #: inc/wpsl-functions.php:205
2362
+ msgid "Friday"
2363
+ msgstr "Sexta-Feira"
2364
+
2365
+ #: inc/wpsl-functions.php:206
2366
+ msgid "Saturday"
2367
+ msgstr "Sábado"
2368
+
2369
+ #: inc/wpsl-functions.php:207
2370
+ msgid "Sunday"
2371
+ msgstr "Domingo"
2372
+
2373
+ #: inc/wpsl-functions.php:237
2374
+ #, php-format
2375
+ msgid "Mon %sTue %sWed %sThu %sFri %sSat Closed %sSun Closed"
2376
+ msgstr "Seg %sTer %sQua %sQui %sSex %sSáb Fechado %sDom Fechado"
2377
+
2378
+ #: inc/wpsl-functions.php:253
2379
+ msgid "Satellite"
2380
+ msgstr "Satélite"
2381
+
2382
+ #: inc/wpsl-functions.php:254
2383
+ msgid "Hybrid"
2384
+ msgstr "Hibrido"
2385
+
2386
+ #: inc/wpsl-functions.php:255
2387
+ msgid "Terrain"
2388
+ msgstr "Terreno"
2389
+
2390
+ #: inc/wpsl-functions.php:270
2391
+ msgid "(city) (state) (zip code)"
2392
+ msgstr "(cidade) (estado) (código postal)"
2393
+
2394
+ #: inc/wpsl-functions.php:271
2395
+ msgid "(city), (state) (zip code)"
2396
+ msgstr "(cidade), (estado) (código postal)"
2397
+
2398
+ #: inc/wpsl-functions.php:272
2399
+ msgid "(city) (zip code)"
2400
+ msgstr "(cidade) (código postal)"
2401
+
2402
+ #: inc/wpsl-functions.php:273
2403
+ msgid "(city), (zip code)"
2404
+ msgstr "(cidade), (código postal)"
2405
+
2406
+ #: inc/wpsl-functions.php:274
2407
+ msgid "(zip code) (city) (state)"
2408
+ msgstr "(código postal) (cidade) (estado)"
2409
+
2410
+ #: inc/wpsl-functions.php:275
2411
+ msgid "(zip code) (city)"
2412
+ msgstr "(código postal) (cidade)"
languages/wpsl.mo ADDED
Binary file
languages/wpsl.pot CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WP Store Locator v1.2.20\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-05-08 16:51+0100\n"
6
- "PO-Revision-Date: 2014-05-08 17:17+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "Language: en_US\n"
@@ -11,1788 +11,2285 @@ msgstr ""
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
- "X-Generator: Poedit 1.6.5\n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
18
  "X-Poedit-Basepath: ../\n"
19
  "X-Textdomain-Support: yes\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
 
22
- #: admin/class-admin.php:235
23
- msgid "Store Locator"
 
 
 
24
  msgstr ""
25
 
26
- #: admin/class-admin.php:236
27
- msgid "Manage Stores"
 
 
 
28
  msgstr ""
29
 
30
- #: admin/class-admin.php:237 admin/class-admin.php:559
31
- #: admin/templates/add-store.php:107
32
- msgid "Add Store"
 
 
 
 
33
  msgstr ""
34
 
35
- #: admin/class-admin.php:238 admin/class-admin.php:560
36
- #: admin/templates/map-settings.php:2
37
- msgid "Settings"
 
 
 
38
  msgstr ""
39
 
40
- #: admin/class-admin.php:239 admin/templates/faq.php:2
41
- msgid "FAQ"
42
  msgstr ""
43
 
44
- #: admin/class-admin.php:255 admin/class-store-overview.php:31
45
- msgid "Stores"
46
  msgstr ""
47
 
48
- #: admin/class-admin.php:424
49
- msgid "There was a problem updating the store details, please try again."
 
50
  msgstr ""
51
 
52
- #: admin/class-admin.php:428
53
- msgid "Store details updated."
54
  msgstr ""
55
 
56
- #: admin/class-admin.php:474
57
- msgid "There was a problem saving the new store details, please try again."
58
  msgstr ""
59
 
60
- #: admin/class-admin.php:478
61
- msgid "Store succesfully added."
62
  msgstr ""
63
 
64
- #: admin/class-admin.php:506
65
- msgid "Please fill in all the required fields."
66
  msgstr ""
67
 
68
- #: admin/class-admin.php:558
69
- msgid "Current Stores"
70
  msgstr ""
71
 
72
- #: admin/class-admin.php:595
73
- msgid ""
74
- "The max results field cannot be empty, the default value has been restored."
75
  msgstr ""
76
 
77
- #: admin/class-admin.php:598
78
  msgid ""
79
- "The search radius field cannot be empty, the default value has been restored."
 
80
  msgstr ""
81
 
82
- #: admin/class-admin.php:601
 
83
  msgid ""
84
- "One of the label fields was left empty, the default value for that field has "
85
- "been restored."
86
  msgstr ""
87
 
88
- #: admin/class-admin.php:604
89
  msgid ""
90
- "Please provide the name of a city or country that can be used as a starting "
91
- "point under \"Map Settings\". This will only be used if auto-locating the "
92
- "user fails, or the option itself is disabled."
93
  msgstr ""
94
 
95
- #: admin/class-admin.php:619
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  #, php-format
97
  msgid ""
98
- "Before adding the [wpsl] shortcode to a page, please don't forget to define "
99
- "a start point on the %ssettings%s page."
100
  msgstr ""
101
 
102
- #: admin/class-admin.php:619
103
- msgid "Dismiss"
104
  msgstr ""
105
 
106
- #: admin/class-admin.php:870
107
- msgid ""
108
- "The Google Geocoding API returned no results for the store location. Please "
109
- "change the location and try again."
 
 
 
 
 
 
110
  msgstr ""
111
 
112
- #: admin/class-admin.php:873
113
  #, php-format
114
- msgid ""
115
- "You have reached the daily allowed geocoding limit, you can read more <a "
116
- "href=\"%s\">here</a>."
117
  msgstr ""
118
 
119
- #: admin/class-admin.php:876
120
- msgid ""
121
- "The Google Geocoding API failed to return valid data, please try again later."
122
  msgstr ""
123
 
124
- #: admin/class-admin.php:956
125
- msgid "Start location marker:"
126
  msgstr ""
127
 
128
- #: admin/class-admin.php:958
129
- msgid "Store location marker:"
130
  msgstr ""
131
 
132
- #: admin/class-admin.php:1118 wp-store-locator.php:294
133
- msgid "Default"
 
134
  msgstr ""
135
 
136
- #: admin/class-admin.php:1226
137
- msgid "In the store listings"
138
  msgstr ""
139
 
140
- #: admin/class-admin.php:1227
141
- msgid "In the info window on the map"
142
  msgstr ""
143
 
144
- #: admin/class-admin.php:1253
145
- msgid "Select your language"
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  msgstr ""
147
 
148
- #: admin/class-admin.php:1254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  msgid "English"
150
  msgstr ""
151
 
152
- #: admin/class-admin.php:1255
153
  msgid "Arabic"
154
  msgstr ""
155
 
156
- #: admin/class-admin.php:1256
157
  msgid "Basque"
158
  msgstr ""
159
 
160
- #: admin/class-admin.php:1257
161
  msgid "Bulgarian"
162
  msgstr ""
163
 
164
- #: admin/class-admin.php:1258
165
  msgid "Bengali"
166
  msgstr ""
167
 
168
- #: admin/class-admin.php:1259
169
  msgid "Catalan"
170
  msgstr ""
171
 
172
- #: admin/class-admin.php:1260
173
  msgid "Czech"
174
  msgstr ""
175
 
176
- #: admin/class-admin.php:1261
177
  msgid "Danish"
178
  msgstr ""
179
 
180
- #: admin/class-admin.php:1262
181
  msgid "German"
182
  msgstr ""
183
 
184
- #: admin/class-admin.php:1263
185
  msgid "Greek"
186
  msgstr ""
187
 
188
- #: admin/class-admin.php:1264
189
  msgid "English (Australian)"
190
  msgstr ""
191
 
192
- #: admin/class-admin.php:1265
193
  msgid "English (Great Britain)"
194
  msgstr ""
195
 
196
- #: admin/class-admin.php:1266
197
  msgid "Spanish"
198
  msgstr ""
199
 
200
- #: admin/class-admin.php:1267
201
  msgid "Farsi"
202
  msgstr ""
203
 
204
- #: admin/class-admin.php:1268
205
  msgid "Finnish"
206
  msgstr ""
207
 
208
- #: admin/class-admin.php:1269
209
  msgid "Filipino"
210
  msgstr ""
211
 
212
- #: admin/class-admin.php:1270
213
  msgid "French"
214
  msgstr ""
215
 
216
- #: admin/class-admin.php:1271
217
  msgid "Galician"
218
  msgstr ""
219
 
220
- #: admin/class-admin.php:1272
221
  msgid "Gujarati"
222
  msgstr ""
223
 
224
- #: admin/class-admin.php:1273
225
  msgid "Hindi"
226
  msgstr ""
227
 
228
- #: admin/class-admin.php:1274
229
  msgid "Croatian"
230
  msgstr ""
231
 
232
- #: admin/class-admin.php:1275
233
  msgid "Hungarian"
234
  msgstr ""
235
 
236
- #: admin/class-admin.php:1276
237
  msgid "Indonesian"
238
  msgstr ""
239
 
240
- #: admin/class-admin.php:1277
241
  msgid "Italian"
242
  msgstr ""
243
 
244
- #: admin/class-admin.php:1278
245
  msgid "Hebrew"
246
  msgstr ""
247
 
248
- #: admin/class-admin.php:1279
249
  msgid "Japanese"
250
  msgstr ""
251
 
252
- #: admin/class-admin.php:1280
253
  msgid "Kannada"
254
  msgstr ""
255
 
256
- #: admin/class-admin.php:1281
257
  msgid "Korean"
258
  msgstr ""
259
 
260
- #: admin/class-admin.php:1282
261
  msgid "Lithuanian"
262
  msgstr ""
263
 
264
- #: admin/class-admin.php:1283
265
  msgid "Latvian"
266
  msgstr ""
267
 
268
- #: admin/class-admin.php:1284
269
  msgid "Malayalam"
270
  msgstr ""
271
 
272
- #: admin/class-admin.php:1285
273
  msgid "Marathi"
274
  msgstr ""
275
 
276
- #: admin/class-admin.php:1286
277
  msgid "Dutch"
278
  msgstr ""
279
 
280
- #: admin/class-admin.php:1287
281
  msgid "Norwegian"
282
  msgstr ""
283
 
284
- #: admin/class-admin.php:1288
285
  msgid "Norwegian Nynorsk"
286
  msgstr ""
287
 
288
- #: admin/class-admin.php:1289
289
  msgid "Polish"
290
  msgstr ""
291
 
292
- #: admin/class-admin.php:1290
293
  msgid "Portuguese"
294
  msgstr ""
295
 
296
- #: admin/class-admin.php:1291
297
  msgid "Portuguese (Brazil)"
298
  msgstr ""
299
 
300
- #: admin/class-admin.php:1292
301
  msgid "Portuguese (Portugal)"
302
  msgstr ""
303
 
304
- #: admin/class-admin.php:1293
305
  msgid "Romanian"
306
  msgstr ""
307
 
308
- #: admin/class-admin.php:1294
309
  msgid "Russian"
310
  msgstr ""
311
 
312
- #: admin/class-admin.php:1295
313
  msgid "Slovak"
314
  msgstr ""
315
 
316
- #: admin/class-admin.php:1296
317
  msgid "Slovenian"
318
  msgstr ""
319
 
320
- #: admin/class-admin.php:1297
321
  msgid "Serbian"
322
  msgstr ""
323
 
324
- #: admin/class-admin.php:1298
325
  msgid "Swedish"
326
  msgstr ""
327
 
328
- #: admin/class-admin.php:1299
329
  msgid "Tagalog"
330
  msgstr ""
331
 
332
- #: admin/class-admin.php:1300
333
  msgid "Tamil"
334
  msgstr ""
335
 
336
- #: admin/class-admin.php:1301
337
  msgid "Telugu"
338
  msgstr ""
339
 
340
- #: admin/class-admin.php:1302
341
  msgid "Thai"
342
  msgstr ""
343
 
344
- #: admin/class-admin.php:1303
345
  msgid "Turkish"
346
  msgstr ""
347
 
348
- #: admin/class-admin.php:1304
349
  msgid "Ukrainian"
350
  msgstr ""
351
 
352
- #: admin/class-admin.php:1305
353
  msgid "Vietnamese"
354
  msgstr ""
355
 
356
- #: admin/class-admin.php:1306
357
  msgid "Chinese (Simplified)"
358
  msgstr ""
359
 
360
- #: admin/class-admin.php:1307
361
  msgid "Chinese (Traditional)"
362
  msgstr ""
363
 
364
- #: admin/class-admin.php:1312
 
365
  msgid "Select your region"
366
- msgstr ""
367
 
368
- #: admin/class-admin.php:1313
369
  msgid "Afghanistan"
370
  msgstr ""
371
 
372
- #: admin/class-admin.php:1314
373
  msgid "Albania"
374
  msgstr ""
375
 
376
- #: admin/class-admin.php:1315
377
  msgid "Algeria"
378
  msgstr ""
379
 
380
- #: admin/class-admin.php:1316
381
  msgid "American Samoa"
382
  msgstr ""
383
 
384
- #: admin/class-admin.php:1317
385
  msgid "Andorra"
386
  msgstr ""
387
 
388
- #: admin/class-admin.php:1318
389
  msgid "Anguilla"
390
  msgstr ""
391
 
392
- #: admin/class-admin.php:1319
393
  msgid "Angola"
394
  msgstr ""
395
 
396
- #: admin/class-admin.php:1320
397
  msgid "Antigua and Barbuda"
398
  msgstr ""
399
 
400
- #: admin/class-admin.php:1321
401
  msgid "Argentina"
402
  msgstr ""
403
 
404
- #: admin/class-admin.php:1322
405
  msgid "Armenia"
406
  msgstr ""
407
 
408
- #: admin/class-admin.php:1323
409
  msgid "Aruba"
410
  msgstr ""
411
 
412
- #: admin/class-admin.php:1324
413
  msgid "Australia"
414
  msgstr ""
415
 
416
- #: admin/class-admin.php:1325
417
  msgid "Austria"
418
  msgstr ""
419
 
420
- #: admin/class-admin.php:1326
421
  msgid "Azerbaijan"
422
  msgstr ""
423
 
424
- #: admin/class-admin.php:1327
425
  msgid "Bahamas"
426
  msgstr ""
427
 
428
- #: admin/class-admin.php:1328
429
  msgid "Bahrain"
430
  msgstr ""
431
 
432
- #: admin/class-admin.php:1329
433
  msgid "Bangladesh"
434
  msgstr ""
435
 
436
- #: admin/class-admin.php:1330
437
  msgid "Barbados"
438
  msgstr ""
439
 
440
- #: admin/class-admin.php:1331
441
  msgid "Belarus"
442
  msgstr ""
443
 
444
- #: admin/class-admin.php:1332
445
  msgid "Belgium"
446
  msgstr ""
447
 
448
- #: admin/class-admin.php:1333
449
  msgid "Belize"
450
  msgstr ""
451
 
452
- #: admin/class-admin.php:1334
453
  msgid "Benin"
454
  msgstr ""
455
 
456
- #: admin/class-admin.php:1335
457
  msgid "Bermuda"
458
  msgstr ""
459
 
460
- #: admin/class-admin.php:1336
461
  msgid "Bhutan"
462
  msgstr ""
463
 
464
- #: admin/class-admin.php:1337
465
  msgid "Bolivia"
466
  msgstr ""
467
 
468
- #: admin/class-admin.php:1338
469
  msgid "Bosnia and Herzegovina"
470
  msgstr ""
471
 
472
- #: admin/class-admin.php:1339
473
  msgid "Botswana"
474
  msgstr ""
475
 
476
- #: admin/class-admin.php:1340
477
  msgid "Brazil"
478
  msgstr ""
479
 
480
- #: admin/class-admin.php:1341
481
  msgid "British Indian Ocean Territory"
482
  msgstr ""
483
 
484
- #: admin/class-admin.php:1342
485
  msgid "Brunei"
486
  msgstr ""
487
 
488
- #: admin/class-admin.php:1343
489
  msgid "Bulgaria"
490
  msgstr ""
491
 
492
- #: admin/class-admin.php:1344
493
  msgid "Burkina Faso"
494
  msgstr ""
495
 
496
- #: admin/class-admin.php:1345
497
  msgid "Burundi"
498
  msgstr ""
499
 
500
- #: admin/class-admin.php:1346
501
  msgid "Cambodia"
502
  msgstr ""
503
 
504
- #: admin/class-admin.php:1347
505
  msgid "Cameroon"
506
  msgstr ""
507
 
508
- #: admin/class-admin.php:1348
509
  msgid "Canada"
510
  msgstr ""
511
 
512
- #: admin/class-admin.php:1349
513
  msgid "Cape Verde"
514
  msgstr ""
515
 
516
- #: admin/class-admin.php:1350
517
  msgid "Cayman Islands"
518
  msgstr ""
519
 
520
- #: admin/class-admin.php:1351
521
  msgid "Central African Republic"
522
  msgstr ""
523
 
524
- #: admin/class-admin.php:1352
525
  msgid "Chad"
526
  msgstr ""
527
 
528
- #: admin/class-admin.php:1353
529
  msgid "Chile"
530
  msgstr ""
531
 
532
- #: admin/class-admin.php:1354
533
  msgid "China"
534
  msgstr ""
535
 
536
- #: admin/class-admin.php:1355
537
  msgid "Christmas Island"
538
  msgstr ""
539
 
540
- #: admin/class-admin.php:1356
541
  msgid "Cocos Islands"
542
  msgstr ""
543
 
544
- #: admin/class-admin.php:1357
545
  msgid "Colombia"
546
  msgstr ""
547
 
548
- #: admin/class-admin.php:1358
549
  msgid "Comoros"
550
  msgstr ""
551
 
552
- #: admin/class-admin.php:1359
553
  msgid "Congo"
554
  msgstr ""
555
 
556
- #: admin/class-admin.php:1360
557
  msgid "Costa Rica"
558
  msgstr ""
559
 
560
- #: admin/class-admin.php:1361
561
  msgid "Côte d'Ivoire"
562
  msgstr ""
563
 
564
- #: admin/class-admin.php:1362
565
  msgid "Croatia"
566
  msgstr ""
567
 
568
- #: admin/class-admin.php:1363
569
  msgid "Cuba"
570
  msgstr ""
571
 
572
- #: admin/class-admin.php:1364
573
  msgid "Czech Republic"
574
  msgstr ""
575
 
576
- #: admin/class-admin.php:1365
577
  msgid "Denmark"
578
  msgstr ""
579
 
580
- #: admin/class-admin.php:1366
581
  msgid "Djibouti"
582
  msgstr ""
583
 
584
- #: admin/class-admin.php:1367
585
  msgid "Democratic Republic of the Congo"
586
  msgstr ""
587
 
588
- #: admin/class-admin.php:1368
589
  msgid "Dominica"
590
  msgstr ""
591
 
592
- #: admin/class-admin.php:1369
593
  msgid "Dominican Republic"
594
  msgstr ""
595
 
596
- #: admin/class-admin.php:1370
597
  msgid "Ecuador"
598
  msgstr ""
599
 
600
- #: admin/class-admin.php:1371
601
  msgid "Egypt"
602
  msgstr ""
603
 
604
- #: admin/class-admin.php:1372
605
  msgid "El Salvador"
606
  msgstr ""
607
 
608
- #: admin/class-admin.php:1373
609
  msgid "Equatorial Guinea"
610
  msgstr ""
611
 
612
- #: admin/class-admin.php:1374
613
  msgid "Eritrea"
614
  msgstr ""
615
 
616
- #: admin/class-admin.php:1375
617
  msgid "Estonia"
618
  msgstr ""
619
 
620
- #: admin/class-admin.php:1376
621
  msgid "Ethiopia"
622
  msgstr ""
623
 
624
- #: admin/class-admin.php:1377
625
  msgid "Fiji"
626
  msgstr ""
627
 
628
- #: admin/class-admin.php:1378
629
  msgid "Finland"
630
  msgstr ""
631
 
632
- #: admin/class-admin.php:1379
633
  msgid "France"
634
  msgstr ""
635
 
636
- #: admin/class-admin.php:1380
637
  msgid "French Guiana"
638
  msgstr ""
639
 
640
- #: admin/class-admin.php:1381
641
  msgid "Gabon"
642
  msgstr ""
643
 
644
- #: admin/class-admin.php:1382
645
  msgid "Gambia"
646
  msgstr ""
647
 
648
- #: admin/class-admin.php:1383
649
  msgid "Germany"
650
  msgstr ""
651
 
652
- #: admin/class-admin.php:1384
653
  msgid "Ghana"
654
  msgstr ""
655
 
656
- #: admin/class-admin.php:1385
657
  msgid "Greenland"
658
  msgstr ""
659
 
660
- #: admin/class-admin.php:1386
661
  msgid "Greece"
662
  msgstr ""
663
 
664
- #: admin/class-admin.php:1387
665
  msgid "Grenada"
666
  msgstr ""
667
 
668
- #: admin/class-admin.php:1388
669
  msgid "Guam"
670
  msgstr ""
671
 
672
- #: admin/class-admin.php:1389
673
  msgid "Guadeloupe"
674
  msgstr ""
675
 
676
- #: admin/class-admin.php:1390
677
  msgid "Guatemala"
678
  msgstr ""
679
 
680
- #: admin/class-admin.php:1391
681
  msgid "Guinea"
682
  msgstr ""
683
 
684
- #: admin/class-admin.php:1392
685
  msgid "Guinea-Bissau"
686
  msgstr ""
687
 
688
- #: admin/class-admin.php:1393
689
  msgid "Haiti"
690
  msgstr ""
691
 
692
- #: admin/class-admin.php:1394
693
  msgid "Honduras"
694
  msgstr ""
695
 
696
- #: admin/class-admin.php:1395
697
  msgid "Hong Kong"
698
  msgstr ""
699
 
700
- #: admin/class-admin.php:1396
701
  msgid "Hungary"
702
  msgstr ""
703
 
704
- #: admin/class-admin.php:1397
705
  msgid "Iceland"
706
  msgstr ""
707
 
708
- #: admin/class-admin.php:1398
709
  msgid "India"
710
  msgstr ""
711
 
712
- #: admin/class-admin.php:1399
713
  msgid "Indonesia"
714
  msgstr ""
715
 
716
- #: admin/class-admin.php:1400
717
  msgid "Iran"
718
  msgstr ""
719
 
720
- #: admin/class-admin.php:1401
721
  msgid "Iraq"
722
  msgstr ""
723
 
724
- #: admin/class-admin.php:1402
725
  msgid "Ireland"
726
  msgstr ""
727
 
728
- #: admin/class-admin.php:1403
729
  msgid "Israel"
730
  msgstr ""
731
 
732
- #: admin/class-admin.php:1404
733
  msgid "Italy"
734
  msgstr ""
735
 
736
- #: admin/class-admin.php:1405
737
  msgid "Jamaica"
738
  msgstr ""
739
 
740
- #: admin/class-admin.php:1406
741
  msgid "Japan"
742
  msgstr ""
743
 
744
- #: admin/class-admin.php:1407
745
  msgid "Jordan"
746
  msgstr ""
747
 
748
- #: admin/class-admin.php:1408
749
  msgid "Kazakhstan"
750
  msgstr ""
751
 
752
- #: admin/class-admin.php:1409
753
  msgid "Kenya"
754
  msgstr ""
755
 
756
- #: admin/class-admin.php:1410
757
  msgid "Kuwait"
758
  msgstr ""
759
 
760
- #: admin/class-admin.php:1411
761
  msgid "Kyrgyzstan"
762
  msgstr ""
763
 
764
- #: admin/class-admin.php:1412
765
  msgid "Laos"
766
  msgstr ""
767
 
768
- #: admin/class-admin.php:1413
769
  msgid "Latvia"
770
  msgstr ""
771
 
772
- #: admin/class-admin.php:1414
773
  msgid "Lebanon"
774
  msgstr ""
775
 
776
- #: admin/class-admin.php:1415
777
  msgid "Lesotho"
778
  msgstr ""
779
 
780
- #: admin/class-admin.php:1416
781
  msgid "Liberia"
782
  msgstr ""
783
 
784
- #: admin/class-admin.php:1417
785
  msgid "Libya"
786
  msgstr ""
787
 
788
- #: admin/class-admin.php:1418
789
  msgid "Liechtenstein"
790
  msgstr ""
791
 
792
- #: admin/class-admin.php:1419
793
  msgid "Lithuania"
794
  msgstr ""
795
 
796
- #: admin/class-admin.php:1420
797
  msgid "Luxembourg"
798
  msgstr ""
799
 
800
- #: admin/class-admin.php:1421
801
  msgid "Macau"
802
  msgstr ""
803
 
804
- #: admin/class-admin.php:1422
805
  msgid "Macedonia"
806
  msgstr ""
807
 
808
- #: admin/class-admin.php:1423
809
  msgid "Madagascar"
810
  msgstr ""
811
 
812
- #: admin/class-admin.php:1424
813
  msgid "Malawi"
814
  msgstr ""
815
 
816
- #: admin/class-admin.php:1425
817
  msgid "Malaysia "
818
  msgstr ""
819
 
820
- #: admin/class-admin.php:1426
821
  msgid "Mali"
822
  msgstr ""
823
 
824
- #: admin/class-admin.php:1427
825
  msgid "Marshall Islands"
826
  msgstr ""
827
 
828
- #: admin/class-admin.php:1428
829
  msgid "Martinique"
830
  msgstr ""
831
 
832
- #: admin/class-admin.php:1429
833
  msgid "Mauritania"
834
  msgstr ""
835
 
836
- #: admin/class-admin.php:1430
837
  msgid "Mauritius"
838
  msgstr ""
839
 
840
- #: admin/class-admin.php:1431
841
  msgid "Mexico"
842
  msgstr ""
843
 
844
- #: admin/class-admin.php:1432
845
  msgid "Micronesia"
846
  msgstr ""
847
 
848
- #: admin/class-admin.php:1433
849
  msgid "Moldova"
850
  msgstr ""
851
 
852
- #: admin/class-admin.php:1434
853
  msgid "Monaco"
854
  msgstr ""
855
 
856
- #: admin/class-admin.php:1435
857
  msgid "Mongolia"
858
  msgstr ""
859
 
860
- #: admin/class-admin.php:1436
861
  msgid "Montenegro"
862
  msgstr ""
863
 
864
- #: admin/class-admin.php:1437
865
  msgid "Montserrat"
866
  msgstr ""
867
 
868
- #: admin/class-admin.php:1438
869
  msgid "Morocco"
870
  msgstr ""
871
 
872
- #: admin/class-admin.php:1439
873
  msgid "Mozambique"
874
  msgstr ""
875
 
876
- #: admin/class-admin.php:1440
877
  msgid "Myanmar"
878
  msgstr ""
879
 
880
- #: admin/class-admin.php:1441
881
  msgid "Namibia"
882
  msgstr ""
883
 
884
- #: admin/class-admin.php:1442
885
  msgid "Nauru"
886
  msgstr ""
887
 
888
- #: admin/class-admin.php:1443
889
  msgid "Nepal"
890
  msgstr ""
891
 
892
- #: admin/class-admin.php:1444
893
  msgid "Netherlands"
894
  msgstr ""
895
 
896
- #: admin/class-admin.php:1445
897
  msgid "Netherlands Antilles"
898
  msgstr ""
899
 
900
- #: admin/class-admin.php:1446
901
  msgid "New Zealand"
902
  msgstr ""
903
 
904
- #: admin/class-admin.php:1447
905
  msgid "Nicaragua"
906
  msgstr ""
907
 
908
- #: admin/class-admin.php:1448
909
  msgid "Niger"
910
  msgstr ""
911
 
912
- #: admin/class-admin.php:1449
913
  msgid "Nigeria"
914
  msgstr ""
915
 
916
- #: admin/class-admin.php:1450
917
  msgid "Niue"
918
  msgstr ""
919
 
920
- #: admin/class-admin.php:1451
921
  msgid "Northern Mariana Islands"
922
  msgstr ""
923
 
924
- #: admin/class-admin.php:1452
925
  msgid "Norway"
926
  msgstr ""
927
 
928
- #: admin/class-admin.php:1453
929
  msgid "Oman"
930
  msgstr ""
931
 
932
- #: admin/class-admin.php:1454
933
  msgid "Pakistan"
934
  msgstr ""
935
 
936
- #: admin/class-admin.php:1455
937
  msgid "Panama"
938
  msgstr ""
939
 
940
- #: admin/class-admin.php:1456
941
  msgid "Papua New Guinea"
942
  msgstr ""
943
 
944
- #: admin/class-admin.php:1457
945
  msgid "Paraguay"
946
  msgstr ""
947
 
948
- #: admin/class-admin.php:1458
949
  msgid "Peru"
950
  msgstr ""
951
 
952
- #: admin/class-admin.php:1459
953
  msgid "Philippines"
954
  msgstr ""
955
 
956
- #: admin/class-admin.php:1460
957
  msgid "Pitcairn Islands"
958
  msgstr ""
959
 
960
- #: admin/class-admin.php:1461
961
  msgid "Poland"
962
  msgstr ""
963
 
964
- #: admin/class-admin.php:1462
965
  msgid "Portugal"
966
  msgstr ""
967
 
968
- #: admin/class-admin.php:1463
969
  msgid "Qatar"
970
  msgstr ""
971
 
972
- #: admin/class-admin.php:1464
973
  msgid "Reunion"
974
  msgstr ""
975
 
976
- #: admin/class-admin.php:1465
977
  msgid "Romania"
978
  msgstr ""
979
 
980
- #: admin/class-admin.php:1466
981
  msgid "Russia"
982
  msgstr ""
983
 
984
- #: admin/class-admin.php:1467
985
  msgid "Rwanda"
986
  msgstr ""
987
 
988
- #: admin/class-admin.php:1468
989
  msgid "Saint Helena"
990
  msgstr ""
991
 
992
- #: admin/class-admin.php:1469
993
  msgid "Saint Kitts and Nevis"
994
  msgstr ""
995
 
996
- #: admin/class-admin.php:1470
997
  msgid "Saint Vincent and the Grenadines"
998
  msgstr ""
999
 
1000
- #: admin/class-admin.php:1471
1001
  msgid "Saint Lucia"
1002
  msgstr ""
1003
 
1004
- #: admin/class-admin.php:1472
1005
  msgid "Samoa"
1006
  msgstr ""
1007
 
1008
- #: admin/class-admin.php:1473
1009
  msgid "San Marino"
1010
  msgstr ""
1011
 
1012
- #: admin/class-admin.php:1474
1013
  msgid "São Tomé and Príncipe"
1014
  msgstr ""
1015
 
1016
- #: admin/class-admin.php:1475
1017
  msgid "Saudi Arabia"
1018
  msgstr ""
1019
 
1020
- #: admin/class-admin.php:1476
1021
  msgid "Senegal"
1022
  msgstr ""
1023
 
1024
- #: admin/class-admin.php:1477
1025
  msgid "Serbia"
1026
  msgstr ""
1027
 
1028
- #: admin/class-admin.php:1478
1029
  msgid "Seychelles"
1030
  msgstr ""
1031
 
1032
- #: admin/class-admin.php:1479
1033
  msgid "Sierra Leone"
1034
  msgstr ""
1035
 
1036
- #: admin/class-admin.php:1480
1037
  msgid "Singapore"
1038
  msgstr ""
1039
 
1040
- #: admin/class-admin.php:1481
1041
  msgid "Slovakia"
1042
  msgstr ""
1043
 
1044
- #: admin/class-admin.php:1482
1045
  msgid "Solomon Islands"
1046
  msgstr ""
1047
 
1048
- #: admin/class-admin.php:1483
1049
  msgid "Somalia"
1050
  msgstr ""
1051
 
1052
- #: admin/class-admin.php:1484
1053
  msgid "South Africa"
1054
  msgstr ""
1055
 
1056
- #: admin/class-admin.php:1485
1057
  msgid "South Korea"
1058
  msgstr ""
1059
 
1060
- #: admin/class-admin.php:1486
1061
  msgid "Spain"
1062
  msgstr ""
1063
 
1064
- #: admin/class-admin.php:1487
1065
  msgid "Sri Lanka"
1066
  msgstr ""
1067
 
1068
- #: admin/class-admin.php:1488
1069
  msgid "Sudan"
1070
  msgstr ""
1071
 
1072
- #: admin/class-admin.php:1489
1073
  msgid "Swaziland"
1074
  msgstr ""
1075
 
1076
- #: admin/class-admin.php:1490
1077
  msgid "Sweden"
1078
  msgstr ""
1079
 
1080
- #: admin/class-admin.php:1491
1081
  msgid "Switzerland"
1082
  msgstr ""
1083
 
1084
- #: admin/class-admin.php:1492
1085
  msgid "Syria"
1086
  msgstr ""
1087
 
1088
- #: admin/class-admin.php:1493
1089
  msgid "Taiwan"
1090
  msgstr ""
1091
 
1092
- #: admin/class-admin.php:1494
1093
  msgid "Tajikistan"
1094
  msgstr ""
1095
 
1096
- #: admin/class-admin.php:1495
1097
  msgid "Tanzania"
1098
  msgstr ""
1099
 
1100
- #: admin/class-admin.php:1496
1101
  msgid "Thailand"
1102
  msgstr ""
1103
 
1104
- #: admin/class-admin.php:1497
1105
  msgid "Timor-Leste"
1106
  msgstr ""
1107
 
1108
- #: admin/class-admin.php:1498
1109
  msgid "Tokelau"
1110
  msgstr ""
1111
 
1112
- #: admin/class-admin.php:1499
1113
  msgid "Togo"
1114
  msgstr ""
1115
 
1116
- #: admin/class-admin.php:1500
1117
  msgid "Tonga"
1118
  msgstr ""
1119
 
1120
- #: admin/class-admin.php:1501
1121
  msgid "Trinidad and Tobago"
1122
  msgstr ""
1123
 
1124
- #: admin/class-admin.php:1502
1125
  msgid "Tunisia"
1126
  msgstr ""
1127
 
1128
- #: admin/class-admin.php:1503
1129
  msgid "Turkey"
1130
  msgstr ""
1131
 
1132
- #: admin/class-admin.php:1504
1133
  msgid "Turkmenistan"
1134
  msgstr ""
1135
 
1136
- #: admin/class-admin.php:1505
1137
  msgid "Tuvalu"
1138
  msgstr ""
1139
 
1140
- #: admin/class-admin.php:1506
1141
  msgid "Uganda"
1142
  msgstr ""
1143
 
1144
- #: admin/class-admin.php:1507
1145
  msgid "Ukraine"
1146
  msgstr ""
1147
 
1148
- #: admin/class-admin.php:1508
1149
  msgid "United Arab Emirates"
1150
  msgstr ""
1151
 
1152
- #: admin/class-admin.php:1509
1153
  msgid "United Kingdom"
1154
  msgstr ""
1155
 
1156
- #: admin/class-admin.php:1510
1157
  msgid "United States"
1158
  msgstr ""
1159
 
1160
- #: admin/class-admin.php:1511
1161
  msgid "Uruguay"
1162
  msgstr ""
1163
 
1164
- #: admin/class-admin.php:1512
1165
  msgid "Uzbekistan"
1166
  msgstr ""
1167
 
1168
- #: admin/class-admin.php:1513
1169
  msgid "Wallis Futuna"
1170
  msgstr ""
1171
 
1172
- #: admin/class-admin.php:1514
1173
  msgid "Venezuela"
1174
  msgstr ""
1175
 
1176
- #: admin/class-admin.php:1515
1177
  msgid "Vietnam"
1178
  msgstr ""
1179
 
1180
- #: admin/class-admin.php:1516
1181
  msgid "Yemen"
1182
  msgstr ""
1183
 
1184
- #: admin/class-admin.php:1517
1185
  msgid "Zambia"
1186
  msgstr ""
1187
 
1188
- #: admin/class-admin.php:1518
1189
  msgid "Zimbabwe"
1190
  msgstr ""
1191
 
1192
- #: admin/class-admin.php:1591
1193
- msgid "Cannot determine the address at this location."
1194
  msgstr ""
1195
 
1196
- #: admin/class-admin.php:1592
1197
- msgid "Geocode was not successful for the following reason: "
 
1198
  msgstr ""
1199
 
1200
- #: admin/class-admin.php:1593
1201
- msgid "Security check failed, reload the page and try again."
1202
  msgstr ""
1203
 
1204
- #: admin/class-store-overview.php:30
1205
- msgid "Store"
1206
  msgstr ""
1207
 
1208
- #: admin/class-store-overview.php:65
1209
- msgid "No stores found"
1210
  msgstr ""
1211
 
1212
- #: admin/class-store-overview.php:95
1213
- msgid "Active"
1214
  msgstr ""
1215
 
1216
- #: admin/class-store-overview.php:95
1217
- msgid "Inactive"
1218
  msgstr ""
1219
 
1220
- #: admin/class-store-overview.php:97
1221
- msgid "Edit"
1222
  msgstr ""
1223
 
1224
- #: admin/class-store-overview.php:135
1225
- msgid "ID"
1226
  msgstr ""
1227
 
1228
- #: admin/class-store-overview.php:136
1229
- msgid "Thumbnail"
1230
  msgstr ""
1231
 
1232
- #: admin/class-store-overview.php:137
1233
- msgid "Name"
1234
  msgstr ""
1235
 
1236
- #: admin/class-store-overview.php:138
1237
- msgid "Address"
1238
  msgstr ""
1239
 
1240
- #: admin/class-store-overview.php:139
1241
- msgid "City"
1242
  msgstr ""
1243
 
1244
- #: admin/class-store-overview.php:140
1245
- msgid "State"
1246
  msgstr ""
1247
 
1248
- #: admin/class-store-overview.php:141
1249
- msgid "Zip"
1250
  msgstr ""
1251
 
1252
- #: admin/class-store-overview.php:142
1253
- msgid "Status"
1254
  msgstr ""
1255
 
1256
- #: admin/class-store-overview.php:143
1257
- msgid "Actions"
1258
  msgstr ""
1259
 
1260
- #: admin/class-store-overview.php:193
1261
- msgid "deactivated"
 
 
 
1262
  msgstr ""
1263
 
1264
- #: admin/class-store-overview.php:194
1265
- msgid "deactivating"
1266
  msgstr ""
1267
 
1268
- #: admin/class-store-overview.php:197
1269
- msgid "activated"
1270
  msgstr ""
1271
 
1272
- #: admin/class-store-overview.php:198
1273
- msgid "activating"
1274
  msgstr ""
1275
 
1276
- #: admin/class-store-overview.php:205
1277
- msgid "There was a problem "
1278
  msgstr ""
1279
 
1280
- #: admin/class-store-overview.php:208
1281
- msgid "Store(s) successfully "
 
 
 
1282
  msgstr ""
1283
 
1284
- #: admin/class-store-overview.php:229
1285
- msgid "There was a problem removing the store(s), please try again."
 
 
 
 
1286
  msgstr ""
1287
 
1288
- #: admin/class-store-overview.php:232
1289
- msgid "Store(s) successfully removed."
 
 
1290
  msgstr ""
1291
 
1292
- #: admin/class-store-overview.php:417
1293
- msgid "Are you sure you want to delete this store?"
1294
  msgstr ""
1295
 
1296
- #: admin/class-store-overview.php:419
1297
- msgid "Delete"
1298
  msgstr ""
1299
 
1300
- #: admin/class-store-overview.php:420
1301
- msgid "Cancel"
1302
  msgstr ""
1303
 
1304
- #: admin/templates/add-store.php:13 admin/templates/edit-store.php:23
1305
- msgid "Store details"
1306
  msgstr ""
1307
 
1308
- #: admin/templates/add-store.php:16 admin/templates/edit-store.php:35
1309
- msgid "Store Name:"
1310
  msgstr ""
1311
 
1312
- #: admin/templates/add-store.php:20 admin/templates/edit-store.php:39
1313
- msgid "Address:"
1314
  msgstr ""
1315
 
1316
- #: admin/templates/add-store.php:24 admin/templates/edit-store.php:43
1317
- msgid "Address 2:"
1318
  msgstr ""
1319
 
1320
- #: admin/templates/add-store.php:28 admin/templates/edit-store.php:47
1321
- msgid "City:"
1322
  msgstr ""
1323
 
1324
- #: admin/templates/add-store.php:32 admin/templates/edit-store.php:51
1325
- msgid "State / Province:"
1326
  msgstr ""
1327
 
1328
- #: admin/templates/add-store.php:36 admin/templates/edit-store.php:55
1329
- msgid "Zip Code:"
1330
  msgstr ""
1331
 
1332
- #: admin/templates/add-store.php:40 admin/templates/edit-store.php:59
1333
- msgid "Country:"
1334
  msgstr ""
1335
 
1336
- #: admin/templates/add-store.php:45 admin/templates/edit-store.php:64
1337
- msgid "Latitude:"
1338
  msgstr ""
1339
 
1340
- #: admin/templates/add-store.php:49 admin/templates/edit-store.php:68
1341
- msgid "Longitude:"
1342
  msgstr ""
1343
 
1344
- #: admin/templates/add-store.php:53 admin/templates/edit-store.php:72
1345
- msgid "Preview location on the map"
 
 
 
 
1346
  msgstr ""
1347
 
1348
- #: admin/templates/add-store.php:54 admin/templates/edit-store.php:73
1349
- msgid "You can adjust the location by dragging the marker around"
1350
  msgstr ""
1351
 
1352
- #: admin/templates/add-store.php:65 admin/templates/edit-store.php:84
1353
- msgid "Extra details"
 
 
 
 
1354
  msgstr ""
1355
 
1356
- #: admin/templates/add-store.php:68 admin/templates/edit-store.php:87
1357
- #: admin/templates/map-settings.php:277
1358
- msgid "Phone:"
1359
  msgstr ""
1360
 
1361
- #: admin/templates/add-store.php:72 admin/templates/edit-store.php:91
1362
- #: admin/templates/map-settings.php:281
1363
- msgid "Fax:"
1364
  msgstr ""
1365
 
1366
- #: admin/templates/add-store.php:76 admin/templates/edit-store.php:95
1367
- msgid "Email:"
 
 
 
 
1368
  msgstr ""
1369
 
1370
- #: admin/templates/add-store.php:80 admin/templates/edit-store.php:99
1371
- msgid "Url:"
1372
  msgstr ""
1373
 
1374
- #: admin/templates/add-store.php:84 admin/templates/edit-store.php:103
1375
- msgid "Description:"
1376
  msgstr ""
1377
 
1378
- #: admin/templates/add-store.php:88 admin/templates/edit-store.php:107
1379
- msgid "Operation Hours:"
1380
  msgstr ""
1381
 
1382
- #: admin/templates/add-store.php:94 admin/templates/edit-store.php:113
1383
- msgid "Thumbnail:"
1384
  msgstr ""
1385
 
1386
- #: admin/templates/add-store.php:98 admin/templates/edit-store.php:125
1387
- msgid "Change thumbnail"
1388
  msgstr ""
1389
 
1390
- #: admin/templates/add-store.php:99 admin/templates/edit-store.php:126
1391
- msgid "Remove"
1392
  msgstr ""
1393
 
1394
- #: admin/templates/edit-store.php:14
1395
- msgid "Edit "
1396
  msgstr ""
1397
 
1398
- #: admin/templates/edit-store.php:26
1399
- msgid "Status:"
1400
  msgstr ""
1401
 
1402
- #: admin/templates/edit-store.php:29
1403
- msgid "active"
1404
  msgstr ""
1405
 
1406
- #: admin/templates/edit-store.php:31
1407
- msgid "inactive"
1408
  msgstr ""
1409
 
1410
- #: admin/templates/edit-store.php:135
1411
- msgid "Update Store"
1412
  msgstr ""
1413
 
1414
- #: admin/templates/faq.php:6
1415
- msgid "How do I show the store locator on my page?"
1416
  msgstr ""
1417
 
1418
- #: admin/templates/faq.php:8
1419
  msgid ""
1420
- "Add this shortcode <code>[wpsl]</code> to the page where you want to show "
1421
- "the store locator."
1422
  msgstr ""
1423
 
1424
- #: admin/templates/faq.php:12
 
1425
  msgid ""
1426
- "The map doesn't display properly. It's either broken in half or doesn't load "
1427
- "at all."
 
1428
  msgstr ""
1429
 
1430
- #: admin/templates/faq.php:14
 
1431
  msgid ""
1432
- "Make sure you have defined a start point for the map under settings -> map "
1433
- "settings."
1434
  msgstr ""
1435
 
1436
- #: admin/templates/faq.php:18
 
 
 
 
 
 
 
 
1437
  msgid ""
1438
- "I get an error saying the \"sensor\" parameter specified in the request must "
1439
- "be set to either \"true\" or \"false\"."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1440
  msgstr ""
1441
 
1442
- #: admin/templates/faq.php:20
 
 
 
 
 
1443
  msgid ""
1444
- "Make sure you don't have any security plugins, or custom functions running "
1445
- "that strip away version numbers from file paths."
1446
  msgstr ""
1447
 
1448
- #: admin/templates/faq.php:24
1449
- msgid "The store locator doesn't load, it only shows the number 1?"
1450
  msgstr ""
1451
 
1452
- #: admin/templates/faq.php:26
 
 
 
 
 
 
 
 
1453
  msgid ""
1454
- "This is most likely caused by your theme using ajax navigation ( the loading "
1455
- "of content without reloading the page ), or a conflict with another plugin. "
1456
- "Try to disable the ajax navigation in the theme settings, or deactivate the "
1457
- "plugin that enables it to see if that solves the problem."
1458
  msgstr ""
1459
 
1460
- #: admin/templates/faq.php:27
 
 
 
 
 
1461
  msgid ""
1462
- "If you don't use ajax navigation, but do see the number 1 it's probably a "
1463
- "conflict with another plugin. Try to disable the plugins one by one to see "
1464
- "if one of them is causing a conflict."
 
1465
  msgstr ""
1466
 
1467
- #: admin/templates/faq.php:28
 
 
 
 
 
 
 
 
1468
  #, php-format
1469
  msgid ""
1470
- "If you find a plugin or theme that causes a conflict, please report it on "
1471
- "the <a href=\"%s\">support page</a>."
1472
  msgstr ""
1473
 
1474
- #: admin/templates/faq.php:32
1475
- msgid "Why does it show the location I searched for in the wrong country?"
1476
  msgstr ""
1477
 
1478
- #: admin/templates/faq.php:34
1479
  msgid ""
1480
- "Some location names exist in more then one country, and Google will guess "
1481
- "which one you mean. This can be fixed by setting the correct \"Map Region\" "
1482
- "on the settings page -> \"API Settings\"."
1483
  msgstr ""
1484
 
1485
- #: admin/templates/map-settings.php:16
1486
- msgid "API Settings"
 
 
 
 
1487
  msgstr ""
1488
 
1489
- #: admin/templates/map-settings.php:19
1490
- msgid "API key:"
1491
  msgstr ""
1492
 
1493
- #: admin/templates/map-settings.php:20
1494
- msgid "Optional"
 
 
 
1495
  msgstr ""
1496
 
1497
- #: admin/templates/map-settings.php:23
1498
- msgid "Map language:"
1499
  msgstr ""
1500
 
1501
- #: admin/templates/map-settings.php:29
1502
- msgid "Map region:"
 
 
 
 
 
 
 
 
1503
  msgstr ""
1504
 
1505
- #: admin/templates/map-settings.php:34
1506
  #, php-format
1507
  msgid ""
1508
- "* A valid <a href=\"%s\">API key</a> allows you to monitor the API usage "
1509
- "<br> and is required if you need to purchase additional quota."
 
1510
  msgstr ""
1511
 
1512
- #: admin/templates/map-settings.php:43
1513
- msgid "Search Settings"
1514
  msgstr ""
1515
 
1516
- #: admin/templates/map-settings.php:46
1517
- msgid "Distance unit:"
1518
  msgstr ""
1519
 
1520
- #: admin/templates/map-settings.php:50
1521
- msgid "Max search results:"
 
 
 
 
 
 
1522
  msgstr ""
1523
 
1524
- #: admin/templates/map-settings.php:54
1525
- msgid "Search radius options:"
1526
  msgstr ""
1527
 
1528
- #: admin/templates/map-settings.php:58
 
1529
  msgid ""
1530
- "If a user hovers over the search results, the corresponding marker will "
1531
- "bounce?"
1532
  msgstr ""
1533
 
1534
- #: admin/templates/map-settings.php:61
1535
- msgid "* The default value is set between the ( )"
1536
  msgstr ""
1537
 
1538
- #: admin/templates/map-settings.php:70
1539
- msgid "Map Settings"
1540
  msgstr ""
1541
 
1542
- #: admin/templates/map-settings.php:73
1543
- msgid "Attempt to auto-locate the user:"
1544
  msgstr ""
1545
 
1546
- #: admin/templates/map-settings.php:77
1547
- msgid "Load all stores on page load:"
1548
  msgstr ""
1549
 
1550
- #: admin/templates/map-settings.php:81
1551
- msgid "Start point: *"
 
 
1552
  msgstr ""
1553
 
1554
- #: admin/templates/map-settings.php:86
1555
- msgid "Zoom level:"
1556
  msgstr ""
1557
 
1558
- #: admin/templates/map-settings.php:90
1559
- msgid "Map type:"
 
 
 
1560
  msgstr ""
1561
 
1562
- #: admin/templates/map-settings.php:94
1563
- msgid "Show the street view controls?"
1564
  msgstr ""
1565
 
1566
- #: admin/templates/map-settings.php:98
1567
- msgid "Show the pan controls?"
1568
  msgstr ""
1569
 
1570
- #: admin/templates/map-settings.php:102
1571
- msgid "Position of the map controls:"
1572
  msgstr ""
1573
 
1574
- #: admin/templates/map-settings.php:105
1575
- msgid "Left"
1576
  msgstr ""
1577
 
1578
- #: admin/templates/map-settings.php:107
1579
- msgid "Right"
1580
  msgstr ""
1581
 
1582
- #: admin/templates/map-settings.php:111
1583
- msgid "Zoom control style:"
 
 
 
1584
  msgstr ""
1585
 
1586
- #: admin/templates/map-settings.php:114
1587
- msgid "Small"
1588
  msgstr ""
1589
 
1590
- #: admin/templates/map-settings.php:116
1591
- msgid "Large"
1592
  msgstr ""
1593
 
1594
- #: admin/templates/map-settings.php:119
1595
  msgid ""
1596
- "* Required field. If auto-locating the user is disabled or fails, the center "
1597
- "of the provided city or country will be used as the initial starting point "
1598
- "for the user."
1599
  msgstr ""
1600
 
1601
- #: admin/templates/map-settings.php:128
1602
- msgid "Design Settings"
1603
  msgstr ""
1604
 
1605
- #: admin/templates/map-settings.php:131
1606
- msgid "Store Locator height"
1607
  msgstr ""
1608
 
1609
- #: admin/templates/map-settings.php:135
1610
- msgid "Max width for the infowindow"
1611
  msgstr ""
1612
 
1613
- #: admin/templates/map-settings.php:139
1614
- msgid "Search field width"
1615
  msgstr ""
1616
 
1617
- #: admin/templates/map-settings.php:143
1618
- msgid "Search and radius label width *"
 
1619
  msgstr ""
1620
 
1621
- #: admin/templates/map-settings.php:147
1622
- msgid "Select template"
1623
  msgstr ""
1624
 
1625
- #: admin/templates/map-settings.php:151
1626
- msgid "Hide the scrollbar?"
 
 
1627
  msgstr ""
1628
 
1629
- #: admin/templates/map-settings.php:155
1630
- msgid "Show the limit results dropdown?"
 
 
1631
  msgstr ""
1632
 
1633
- #: admin/templates/map-settings.php:159
1634
- msgid "Open links in a new window?"
 
1635
  msgstr ""
1636
 
1637
- #: admin/templates/map-settings.php:163
1638
- msgid "Show a reset map button?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1639
  msgstr ""
1640
 
1641
- #: admin/templates/map-settings.php:167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1642
  msgid ""
1643
- "When a user clicks on \"Directions\", open a new window and show the route "
1644
- "on maps.google.com"
1645
  msgstr ""
1646
 
1647
- #: admin/templates/map-settings.php:171
1648
- msgid "Show a \"More info\" link in the store listings?"
 
1649
  msgstr ""
1650
 
1651
- #: admin/templates/map-settings.php:175
1652
- msgid "Where do you want to show the \"More info\" details?"
1653
  msgstr ""
1654
 
1655
- #: admin/templates/map-settings.php:179
1656
- msgid "If a store url exists, make the store name clickable?"
1657
  msgstr ""
1658
 
1659
- #: admin/templates/map-settings.php:183
1660
- msgid "Make the phone number clickable on mobile devices?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1661
  msgstr ""
1662
 
1663
- #: admin/templates/map-settings.php:187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1664
  msgid ""
1665
- "If available for the current location, show a link to enable street view "
1666
- "from the infowindow?"
 
 
 
 
1667
  msgstr ""
1668
 
1669
- #: admin/templates/map-settings.php:191
1670
- msgid "Show a \"zoom to\" link in the infowindow?"
1671
  msgstr ""
1672
 
1673
- #: admin/templates/map-settings.php:195
1674
- msgid "On pageload move the mousecursor to the input field. **"
1675
  msgstr ""
1676
 
1677
- #: admin/templates/map-settings.php:198
 
1678
  msgid ""
1679
- "* This is the text that is placed before the search input and radius dropdown"
 
1680
  msgstr ""
1681
 
1682
- #: admin/templates/map-settings.php:199
1683
  msgid ""
1684
- "** If the store locator is not placed at the top of the page, enabling this "
1685
- "feature can result in the page sliding down."
1686
  msgstr ""
1687
 
1688
- #: admin/templates/map-settings.php:208
1689
- msgid "Markers"
 
 
1690
  msgstr ""
1691
 
1692
- #: admin/templates/map-settings.php:212
1693
- msgid "Enable marker clusters? *"
 
 
1694
  msgstr ""
1695
 
1696
- #: admin/templates/map-settings.php:216
1697
- msgid "Max zoom level:"
1698
  msgstr ""
1699
 
1700
- #: admin/templates/map-settings.php:220
1701
- msgid "Cluster size:"
1702
  msgstr ""
1703
 
1704
- #: admin/templates/map-settings.php:223
1705
- msgid "* Recommended for maps with a large amounts of markers."
1706
  msgstr ""
1707
 
1708
- #: admin/templates/map-settings.php:232
1709
- msgid "Store Editor Settings"
1710
  msgstr ""
1711
 
1712
- #: admin/templates/map-settings.php:235
1713
- msgid "Default country that will be used on the \"Add Store\" page."
1714
  msgstr ""
1715
 
1716
- #: admin/templates/map-settings.php:246
1717
- msgid "Labels"
 
 
1718
  msgstr ""
1719
 
1720
- #: admin/templates/map-settings.php:249
1721
- msgid "Your location:"
1722
  msgstr ""
1723
 
1724
- #: admin/templates/map-settings.php:253
1725
- msgid "Search radius:"
1726
  msgstr ""
1727
 
1728
- #: admin/templates/map-settings.php:257
1729
- msgid "No results found:"
1730
  msgstr ""
1731
 
1732
- #: admin/templates/map-settings.php:261
1733
- msgid "Search:"
 
1734
  msgstr ""
1735
 
1736
- #: admin/templates/map-settings.php:265
1737
- msgid "Searching (preloader text):"
 
1738
  msgstr ""
1739
 
1740
- #: admin/templates/map-settings.php:269
1741
- msgid "Results:"
 
1742
  msgstr ""
1743
 
1744
- #: admin/templates/map-settings.php:273
1745
- msgid "More info:"
 
1746
  msgstr ""
1747
 
1748
- #: admin/templates/map-settings.php:285
1749
- msgid "Hours:"
 
1750
  msgstr ""
1751
 
1752
- #: admin/templates/map-settings.php:289
1753
- msgid "Start location:"
 
1754
  msgstr ""
1755
 
1756
- #: admin/templates/map-settings.php:293
1757
- msgid "Get directions:"
 
1758
  msgstr ""
1759
 
1760
- #: admin/templates/map-settings.php:297
1761
- msgid "Back:"
 
1762
  msgstr ""
1763
 
1764
- #: admin/templates/map-settings.php:301
1765
- msgid "Reset:"
1766
  msgstr ""
1767
 
1768
- #: admin/templates/map-settings.php:305
1769
- msgid "Street view:"
1770
  msgstr ""
1771
 
1772
- #: admin/templates/map-settings.php:309
1773
- msgid "Zoom here:"
1774
  msgstr ""
1775
 
1776
- #: admin/templates/map-settings.php:313
1777
- msgid "General error:"
1778
  msgstr ""
1779
 
1780
- #: admin/templates/map-settings.php:317
1781
- msgid "Query limit error:"
1782
  msgstr ""
1783
 
1784
- #: admin/templates/map-settings.php:320
1785
- #, php-format
1786
- msgid ""
1787
- "* You can raise the <a href=\"%s\">usage limit</a> by obtaining an API <a "
1788
- "href=\"%s\">key</a>, <br> and fill in the \"API key\" field at the top of "
1789
- "this page."
1790
  msgstr ""
1791
 
1792
- #: admin/templates/map-settings.php:326
1793
- msgid "Update Settings"
1794
  msgstr ""
1795
 
1796
- #: wp-store-locator.php:298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1797
  msgid "Show the store list below the map"
1798
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WP Store Locator v2.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-09-01 13:49+0100\n"
6
+ "PO-Revision-Date: 2015-09-01 13:49+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "Language: en_US\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Generator: Poedit 1.7.4\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
18
  "X-Poedit-Basepath: ../\n"
19
  "X-Textdomain-Support: yes\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
 
22
+ #: admin/class-admin.php:118
23
+ #, php-format
24
+ msgid ""
25
+ "Before adding the [wpsl] shortcode to a page, please don't forget to define "
26
+ "a %sstart point%s. %sDismiss%s"
27
  msgstr ""
28
 
29
+ #: admin/class-admin.php:120
30
+ #, php-format
31
+ msgid ""
32
+ "Before adding the [wpsl] shortcode to a page, please don't forget to define "
33
+ "a start point on the %ssettings%s page. %sDismiss%s"
34
  msgstr ""
35
 
36
+ #: admin/class-admin.php:150 admin/templates/map-settings.php:4
37
+ #, fuzzy
38
+ msgid "Settings"
39
+ msgstr "Instellingen"
40
+
41
+ #: admin/class-admin.php:264
42
+ msgid "Cannot determine the address at this location."
43
  msgstr ""
44
 
45
+ #: admin/class-admin.php:265
46
+ msgid "Geocode was not successful for the following reason"
47
+ msgstr ""
48
+
49
+ #: admin/class-admin.php:266 admin/upgrade.php:393
50
+ msgid "Security check failed, reload the page and try again."
51
  msgstr ""
52
 
53
+ #: admin/class-admin.php:267
54
+ msgid "Please fill in all the required store details."
55
  msgstr ""
56
 
57
+ #: admin/class-admin.php:268
58
+ msgid "The map preview requires all the location details."
59
  msgstr ""
60
 
61
+ #: admin/class-admin.php:269 admin/class-metaboxes.php:504
62
+ #: frontend/class-frontend.php:483
63
+ msgid "Closed"
64
  msgstr ""
65
 
66
+ #: admin/class-admin.php:270
67
+ msgid "The code for the map style is invalid."
68
  msgstr ""
69
 
70
+ #: admin/class-admin.php:361
71
+ msgid "Welcome to WP Store Locator"
72
  msgstr ""
73
 
74
+ #: admin/class-admin.php:362
75
+ msgid "Sign up for the latest plugin updates and announcements."
76
  msgstr ""
77
 
78
+ #: admin/class-admin.php:406
79
+ msgid "Documentation"
80
  msgstr ""
81
 
82
+ #: admin/class-admin.php:409
83
+ msgid "General Settings"
84
  msgstr ""
85
 
86
+ #: admin/class-admin.php:429
87
+ #, php-format
88
+ msgid "If you like this plugin please leave us a %s5 star%s rating."
89
  msgstr ""
90
 
91
+ #: admin/class-geocode.php:73
92
  msgid ""
93
+ "The Google Geocoding API returned no results for the supplied address. "
94
+ "Please change the address and try again."
95
  msgstr ""
96
 
97
+ #: admin/class-geocode.php:76
98
+ #, php-format
99
  msgid ""
100
+ "You have reached the daily allowed geocoding limit, you can read more %shere"
101
+ "%s."
102
  msgstr ""
103
 
104
+ #: admin/class-geocode.php:79 admin/class-geocode.php:105
105
  msgid ""
106
+ "The Google Geocoding API failed to return valid data, please try again later."
 
 
107
  msgstr ""
108
 
109
+ #: admin/class-metaboxes.php:33
110
+ msgid "Store Details"
111
+ msgstr ""
112
+
113
+ #: admin/class-metaboxes.php:34
114
+ msgid "Store Map"
115
+ msgstr ""
116
+
117
+ #: admin/class-metaboxes.php:48
118
+ msgid "Location"
119
+ msgstr ""
120
+
121
+ #: admin/class-metaboxes.php:50 inc/class-post-types.php:162
122
+ msgid "Address"
123
+ msgstr ""
124
+
125
+ #: admin/class-metaboxes.php:54
126
+ msgid "Address 2"
127
+ msgstr ""
128
+
129
+ #: admin/class-metaboxes.php:57 inc/class-post-types.php:163
130
+ msgid "City"
131
+ msgstr ""
132
+
133
+ #: admin/class-metaboxes.php:61 inc/class-post-types.php:164
134
+ msgid "State"
135
+ msgstr ""
136
+
137
+ #: admin/class-metaboxes.php:64
138
+ msgid "Zip Code"
139
+ msgstr ""
140
+
141
+ #: admin/class-metaboxes.php:67
142
+ msgid "Country"
143
+ msgstr ""
144
+
145
+ #: admin/class-metaboxes.php:74
146
+ msgid "Latitude"
147
+ msgstr ""
148
+
149
+ #: admin/class-metaboxes.php:77
150
+ msgid "Longitude"
151
+ msgstr ""
152
+
153
+ #: admin/class-metaboxes.php:80 admin/class-metaboxes.php:129
154
+ #: admin/class-metaboxes.php:144
155
+ msgid "Opening Hours"
156
+ msgstr ""
157
+
158
+ #: admin/class-metaboxes.php:82 admin/templates/map-settings.php:419
159
+ #: admin/templates/map-settings.php:420 frontend/underscore-functions.php:133
160
+ #: inc/wpsl-functions.php:114
161
+ msgid "Hours"
162
+ msgstr ""
163
+
164
+ #: admin/class-metaboxes.php:86
165
+ msgid "Additional Information"
166
+ msgstr ""
167
+
168
+ #: admin/class-metaboxes.php:88
169
+ msgid "Tel"
170
+ msgstr ""
171
+
172
+ #: admin/class-metaboxes.php:91 admin/templates/map-settings.php:407
173
+ #: admin/templates/map-settings.php:408 frontend/class-frontend.php:665
174
+ #: frontend/underscore-functions.php:32 frontend/underscore-functions.php:124
175
+ #: inc/wpsl-functions.php:111
176
+ msgid "Fax"
177
+ msgstr ""
178
+
179
+ #: admin/class-metaboxes.php:94 admin/templates/map-settings.php:411
180
+ #: admin/templates/map-settings.php:412 admin/upgrade.php:210
181
+ #: frontend/class-frontend.php:669 frontend/underscore-functions.php:35
182
+ #: frontend/underscore-functions.php:127 inc/wpsl-functions.php:112
183
+ #, fuzzy
184
+ msgid "Email"
185
+ msgstr "Dit e-mailadres staat al ingeschreven!"
186
+
187
+ #: admin/class-metaboxes.php:97 admin/templates/map-settings.php:415
188
+ #: admin/templates/map-settings.php:416 admin/upgrade.php:214
189
+ #: frontend/class-frontend.php:674 inc/wpsl-functions.php:113
190
+ msgid "Url"
191
+ msgstr ""
192
+
193
+ #: admin/class-metaboxes.php:426
194
+ msgid "Hour format"
195
+ msgstr ""
196
+
197
+ #: admin/class-metaboxes.php:433
198
+ msgid "Days"
199
+ msgstr ""
200
+
201
+ #: admin/class-metaboxes.php:434
202
+ msgid "Opening Periods"
203
+ msgstr ""
204
+
205
+ #: admin/class-metaboxes.php:681
206
+ msgid "Failed to publish the store. Please fill in the required store details."
207
+ msgstr ""
208
+
209
+ #: admin/class-metaboxes.php:816
210
+ msgid "Preview Location"
211
+ msgstr ""
212
+
213
+ #: admin/class-metaboxes.php:817
214
  #, php-format
215
  msgid ""
216
+ "The map preview is based on the provided address, city and country details. "
217
+ "%s It will ignore any custom latitude or longitude values."
218
  msgstr ""
219
 
220
+ #: admin/class-metaboxes.php:818
221
+ msgid "You can drag the marker to adjust the exact location of the marker."
222
  msgstr ""
223
 
224
+ #: admin/class-metaboxes.php:838 admin/class-metaboxes.php:841
225
+ msgid "Store updated."
226
+ msgstr ""
227
+
228
+ #: admin/class-metaboxes.php:839
229
+ msgid "Custom field updated."
230
+ msgstr ""
231
+
232
+ #: admin/class-metaboxes.php:840
233
+ msgid "Custom field deleted."
234
  msgstr ""
235
 
236
+ #: admin/class-metaboxes.php:842
237
  #, php-format
238
+ msgid "Store restored to revision from %s"
 
 
239
  msgstr ""
240
 
241
+ #: admin/class-metaboxes.php:843
242
+ msgid "Store published."
 
243
  msgstr ""
244
 
245
+ #: admin/class-metaboxes.php:844
246
+ msgid "Store saved."
247
  msgstr ""
248
 
249
+ #: admin/class-metaboxes.php:845
250
+ msgid "Store submitted."
251
  msgstr ""
252
 
253
+ #: admin/class-metaboxes.php:847
254
+ #, php-format
255
+ msgid "Store scheduled for: <strong>%1$s</strong>."
256
  msgstr ""
257
 
258
+ #: admin/class-metaboxes.php:848
259
+ msgid "M j, Y @ G:i"
260
  msgstr ""
261
 
262
+ #: admin/class-metaboxes.php:850
263
+ msgid "Store draft updated."
264
  msgstr ""
265
 
266
+ #: admin/class-metaboxes.php:856
267
+ msgid "View store"
268
+ msgstr ""
269
+
270
+ #: admin/class-metaboxes.php:862
271
+ msgid "Preview store"
272
+ msgstr ""
273
+
274
+ #: admin/class-settings.php:38
275
+ msgid "WP Store Locator Transients Cleared"
276
+ msgstr ""
277
+
278
+ #: admin/class-settings.php:370
279
+ msgid ""
280
+ "The max results field cannot be empty, the default value has been restored."
281
  msgstr ""
282
 
283
+ #: admin/class-settings.php:373
284
+ msgid ""
285
+ "The search radius field cannot be empty, the default value has been restored."
286
+ msgstr ""
287
+
288
+ #: admin/class-settings.php:376
289
+ #, php-format
290
+ msgid ""
291
+ "Please provide the name of a city or country that can be used as a starting "
292
+ "point under \"Map Settings\". %s This will only be used if auto-locating the "
293
+ "user fails, or the option itself is disabled."
294
+ msgstr ""
295
+
296
+ #: admin/class-settings.php:397
297
+ #, fuzzy
298
+ msgid "Select your language"
299
+ msgstr "Geef een geldig e-mailadres op!"
300
+
301
+ #: admin/class-settings.php:398
302
  msgid "English"
303
  msgstr ""
304
 
305
+ #: admin/class-settings.php:399
306
  msgid "Arabic"
307
  msgstr ""
308
 
309
+ #: admin/class-settings.php:400
310
  msgid "Basque"
311
  msgstr ""
312
 
313
+ #: admin/class-settings.php:401
314
  msgid "Bulgarian"
315
  msgstr ""
316
 
317
+ #: admin/class-settings.php:402
318
  msgid "Bengali"
319
  msgstr ""
320
 
321
+ #: admin/class-settings.php:403
322
  msgid "Catalan"
323
  msgstr ""
324
 
325
+ #: admin/class-settings.php:404
326
  msgid "Czech"
327
  msgstr ""
328
 
329
+ #: admin/class-settings.php:405
330
  msgid "Danish"
331
  msgstr ""
332
 
333
+ #: admin/class-settings.php:406
334
  msgid "German"
335
  msgstr ""
336
 
337
+ #: admin/class-settings.php:407
338
  msgid "Greek"
339
  msgstr ""
340
 
341
+ #: admin/class-settings.php:408
342
  msgid "English (Australian)"
343
  msgstr ""
344
 
345
+ #: admin/class-settings.php:409
346
  msgid "English (Great Britain)"
347
  msgstr ""
348
 
349
+ #: admin/class-settings.php:410
350
  msgid "Spanish"
351
  msgstr ""
352
 
353
+ #: admin/class-settings.php:411
354
  msgid "Farsi"
355
  msgstr ""
356
 
357
+ #: admin/class-settings.php:412
358
  msgid "Finnish"
359
  msgstr ""
360
 
361
+ #: admin/class-settings.php:413
362
  msgid "Filipino"
363
  msgstr ""
364
 
365
+ #: admin/class-settings.php:414
366
  msgid "French"
367
  msgstr ""
368
 
369
+ #: admin/class-settings.php:415
370
  msgid "Galician"
371
  msgstr ""
372
 
373
+ #: admin/class-settings.php:416
374
  msgid "Gujarati"
375
  msgstr ""
376
 
377
+ #: admin/class-settings.php:417
378
  msgid "Hindi"
379
  msgstr ""
380
 
381
+ #: admin/class-settings.php:418
382
  msgid "Croatian"
383
  msgstr ""
384
 
385
+ #: admin/class-settings.php:419
386
  msgid "Hungarian"
387
  msgstr ""
388
 
389
+ #: admin/class-settings.php:420
390
  msgid "Indonesian"
391
  msgstr ""
392
 
393
+ #: admin/class-settings.php:421
394
  msgid "Italian"
395
  msgstr ""
396
 
397
+ #: admin/class-settings.php:422
398
  msgid "Hebrew"
399
  msgstr ""
400
 
401
+ #: admin/class-settings.php:423
402
  msgid "Japanese"
403
  msgstr ""
404
 
405
+ #: admin/class-settings.php:424
406
  msgid "Kannada"
407
  msgstr ""
408
 
409
+ #: admin/class-settings.php:425
410
  msgid "Korean"
411
  msgstr ""
412
 
413
+ #: admin/class-settings.php:426
414
  msgid "Lithuanian"
415
  msgstr ""
416
 
417
+ #: admin/class-settings.php:427
418
  msgid "Latvian"
419
  msgstr ""
420
 
421
+ #: admin/class-settings.php:428
422
  msgid "Malayalam"
423
  msgstr ""
424
 
425
+ #: admin/class-settings.php:429
426
  msgid "Marathi"
427
  msgstr ""
428
 
429
+ #: admin/class-settings.php:430
430
  msgid "Dutch"
431
  msgstr ""
432
 
433
+ #: admin/class-settings.php:431
434
  msgid "Norwegian"
435
  msgstr ""
436
 
437
+ #: admin/class-settings.php:432
438
  msgid "Norwegian Nynorsk"
439
  msgstr ""
440
 
441
+ #: admin/class-settings.php:433
442
  msgid "Polish"
443
  msgstr ""
444
 
445
+ #: admin/class-settings.php:434
446
  msgid "Portuguese"
447
  msgstr ""
448
 
449
+ #: admin/class-settings.php:435
450
  msgid "Portuguese (Brazil)"
451
  msgstr ""
452
 
453
+ #: admin/class-settings.php:436
454
  msgid "Portuguese (Portugal)"
455
  msgstr ""
456
 
457
+ #: admin/class-settings.php:437
458
  msgid "Romanian"
459
  msgstr ""
460
 
461
+ #: admin/class-settings.php:438
462
  msgid "Russian"
463
  msgstr ""
464
 
465
+ #: admin/class-settings.php:439
466
  msgid "Slovak"
467
  msgstr ""
468
 
469
+ #: admin/class-settings.php:440
470
  msgid "Slovenian"
471
  msgstr ""
472
 
473
+ #: admin/class-settings.php:441
474
  msgid "Serbian"
475
  msgstr ""
476
 
477
+ #: admin/class-settings.php:442
478
  msgid "Swedish"
479
  msgstr ""
480
 
481
+ #: admin/class-settings.php:443
482
  msgid "Tagalog"
483
  msgstr ""
484
 
485
+ #: admin/class-settings.php:444
486
  msgid "Tamil"
487
  msgstr ""
488
 
489
+ #: admin/class-settings.php:445
490
  msgid "Telugu"
491
  msgstr ""
492
 
493
+ #: admin/class-settings.php:446
494
  msgid "Thai"
495
  msgstr ""
496
 
497
+ #: admin/class-settings.php:447
498
  msgid "Turkish"
499
  msgstr ""
500
 
501
+ #: admin/class-settings.php:448
502
  msgid "Ukrainian"
503
  msgstr ""
504
 
505
+ #: admin/class-settings.php:449
506
  msgid "Vietnamese"
507
  msgstr ""
508
 
509
+ #: admin/class-settings.php:450
510
  msgid "Chinese (Simplified)"
511
  msgstr ""
512
 
513
+ #: admin/class-settings.php:451
514
  msgid "Chinese (Traditional)"
515
  msgstr ""
516
 
517
+ #: admin/class-settings.php:456
518
+ #, fuzzy
519
  msgid "Select your region"
520
+ msgstr "Geef een geldig e-mailadres op!"
521
 
522
+ #: admin/class-settings.php:457
523
  msgid "Afghanistan"
524
  msgstr ""
525
 
526
+ #: admin/class-settings.php:458
527
  msgid "Albania"
528
  msgstr ""
529
 
530
+ #: admin/class-settings.php:459
531
  msgid "Algeria"
532
  msgstr ""
533
 
534
+ #: admin/class-settings.php:460
535
  msgid "American Samoa"
536
  msgstr ""
537
 
538
+ #: admin/class-settings.php:461
539
  msgid "Andorra"
540
  msgstr ""
541
 
542
+ #: admin/class-settings.php:462
543
  msgid "Anguilla"
544
  msgstr ""
545
 
546
+ #: admin/class-settings.php:463
547
  msgid "Angola"
548
  msgstr ""
549
 
550
+ #: admin/class-settings.php:464
551
  msgid "Antigua and Barbuda"
552
  msgstr ""
553
 
554
+ #: admin/class-settings.php:465
555
  msgid "Argentina"
556
  msgstr ""
557
 
558
+ #: admin/class-settings.php:466
559
  msgid "Armenia"
560
  msgstr ""
561
 
562
+ #: admin/class-settings.php:467
563
  msgid "Aruba"
564
  msgstr ""
565
 
566
+ #: admin/class-settings.php:468
567
  msgid "Australia"
568
  msgstr ""
569
 
570
+ #: admin/class-settings.php:469
571
  msgid "Austria"
572
  msgstr ""
573
 
574
+ #: admin/class-settings.php:470
575
  msgid "Azerbaijan"
576
  msgstr ""
577
 
578
+ #: admin/class-settings.php:471
579
  msgid "Bahamas"
580
  msgstr ""
581
 
582
+ #: admin/class-settings.php:472
583
  msgid "Bahrain"
584
  msgstr ""
585
 
586
+ #: admin/class-settings.php:473
587
  msgid "Bangladesh"
588
  msgstr ""
589
 
590
+ #: admin/class-settings.php:474
591
  msgid "Barbados"
592
  msgstr ""
593
 
594
+ #: admin/class-settings.php:475
595
  msgid "Belarus"
596
  msgstr ""
597
 
598
+ #: admin/class-settings.php:476
599
  msgid "Belgium"
600
  msgstr ""
601
 
602
+ #: admin/class-settings.php:477
603
  msgid "Belize"
604
  msgstr ""
605
 
606
+ #: admin/class-settings.php:478
607
  msgid "Benin"
608
  msgstr ""
609
 
610
+ #: admin/class-settings.php:479
611
  msgid "Bermuda"
612
  msgstr ""
613
 
614
+ #: admin/class-settings.php:480
615
  msgid "Bhutan"
616
  msgstr ""
617
 
618
+ #: admin/class-settings.php:481
619
  msgid "Bolivia"
620
  msgstr ""
621
 
622
+ #: admin/class-settings.php:482
623
  msgid "Bosnia and Herzegovina"
624
  msgstr ""
625
 
626
+ #: admin/class-settings.php:483
627
  msgid "Botswana"
628
  msgstr ""
629
 
630
+ #: admin/class-settings.php:484
631
  msgid "Brazil"
632
  msgstr ""
633
 
634
+ #: admin/class-settings.php:485
635
  msgid "British Indian Ocean Territory"
636
  msgstr ""
637
 
638
+ #: admin/class-settings.php:486
639
  msgid "Brunei"
640
  msgstr ""
641
 
642
+ #: admin/class-settings.php:487
643
  msgid "Bulgaria"
644
  msgstr ""
645
 
646
+ #: admin/class-settings.php:488
647
  msgid "Burkina Faso"
648
  msgstr ""
649
 
650
+ #: admin/class-settings.php:489
651
  msgid "Burundi"
652
  msgstr ""
653
 
654
+ #: admin/class-settings.php:490
655
  msgid "Cambodia"
656
  msgstr ""
657
 
658
+ #: admin/class-settings.php:491
659
  msgid "Cameroon"
660
  msgstr ""
661
 
662
+ #: admin/class-settings.php:492
663
  msgid "Canada"
664
  msgstr ""
665
 
666
+ #: admin/class-settings.php:493
667
  msgid "Cape Verde"
668
  msgstr ""
669
 
670
+ #: admin/class-settings.php:494
671
  msgid "Cayman Islands"
672
  msgstr ""
673
 
674
+ #: admin/class-settings.php:495
675
  msgid "Central African Republic"
676
  msgstr ""
677
 
678
+ #: admin/class-settings.php:496
679
  msgid "Chad"
680
  msgstr ""
681
 
682
+ #: admin/class-settings.php:497
683
  msgid "Chile"
684
  msgstr ""
685
 
686
+ #: admin/class-settings.php:498
687
  msgid "China"
688
  msgstr ""
689
 
690
+ #: admin/class-settings.php:499
691
  msgid "Christmas Island"
692
  msgstr ""
693
 
694
+ #: admin/class-settings.php:500
695
  msgid "Cocos Islands"
696
  msgstr ""
697
 
698
+ #: admin/class-settings.php:501
699
  msgid "Colombia"
700
  msgstr ""
701
 
702
+ #: admin/class-settings.php:502
703
  msgid "Comoros"
704
  msgstr ""
705
 
706
+ #: admin/class-settings.php:503
707
  msgid "Congo"
708
  msgstr ""
709
 
710
+ #: admin/class-settings.php:504
711
  msgid "Costa Rica"
712
  msgstr ""
713
 
714
+ #: admin/class-settings.php:505
715
  msgid "Côte d'Ivoire"
716
  msgstr ""
717
 
718
+ #: admin/class-settings.php:506
719
  msgid "Croatia"
720
  msgstr ""
721
 
722
+ #: admin/class-settings.php:507
723
  msgid "Cuba"
724
  msgstr ""
725
 
726
+ #: admin/class-settings.php:508
727
  msgid "Czech Republic"
728
  msgstr ""
729
 
730
+ #: admin/class-settings.php:509
731
  msgid "Denmark"
732
  msgstr ""
733
 
734
+ #: admin/class-settings.php:510
735
  msgid "Djibouti"
736
  msgstr ""
737
 
738
+ #: admin/class-settings.php:511
739
  msgid "Democratic Republic of the Congo"
740
  msgstr ""
741
 
742
+ #: admin/class-settings.php:512
743
  msgid "Dominica"
744
  msgstr ""
745
 
746
+ #: admin/class-settings.php:513
747
  msgid "Dominican Republic"
748
  msgstr ""
749
 
750
+ #: admin/class-settings.php:514
751
  msgid "Ecuador"
752
  msgstr ""
753
 
754
+ #: admin/class-settings.php:515
755
  msgid "Egypt"
756
  msgstr ""
757
 
758
+ #: admin/class-settings.php:516
759
  msgid "El Salvador"
760
  msgstr ""
761
 
762
+ #: admin/class-settings.php:517
763
  msgid "Equatorial Guinea"
764
  msgstr ""
765
 
766
+ #: admin/class-settings.php:518
767
  msgid "Eritrea"
768
  msgstr ""
769
 
770
+ #: admin/class-settings.php:519
771
  msgid "Estonia"
772
  msgstr ""
773
 
774
+ #: admin/class-settings.php:520
775
  msgid "Ethiopia"
776
  msgstr ""
777
 
778
+ #: admin/class-settings.php:521
779
  msgid "Fiji"
780
  msgstr ""
781
 
782
+ #: admin/class-settings.php:522
783
  msgid "Finland"
784
  msgstr ""
785
 
786
+ #: admin/class-settings.php:523
787
  msgid "France"
788
  msgstr ""
789
 
790
+ #: admin/class-settings.php:524
791
  msgid "French Guiana"
792
  msgstr ""
793
 
794
+ #: admin/class-settings.php:525
795
  msgid "Gabon"
796
  msgstr ""
797
 
798
+ #: admin/class-settings.php:526
799
  msgid "Gambia"
800
  msgstr ""
801
 
802
+ #: admin/class-settings.php:527
803
  msgid "Germany"
804
  msgstr ""
805
 
806
+ #: admin/class-settings.php:528
807
  msgid "Ghana"
808
  msgstr ""
809
 
810
+ #: admin/class-settings.php:529
811
  msgid "Greenland"
812
  msgstr ""
813
 
814
+ #: admin/class-settings.php:530
815
  msgid "Greece"
816
  msgstr ""
817
 
818
+ #: admin/class-settings.php:531
819
  msgid "Grenada"
820
  msgstr ""
821
 
822
+ #: admin/class-settings.php:532
823
  msgid "Guam"
824
  msgstr ""
825
 
826
+ #: admin/class-settings.php:533
827
  msgid "Guadeloupe"
828
  msgstr ""
829
 
830
+ #: admin/class-settings.php:534
831
  msgid "Guatemala"
832
  msgstr ""
833
 
834
+ #: admin/class-settings.php:535
835
  msgid "Guinea"
836
  msgstr ""
837
 
838
+ #: admin/class-settings.php:536
839
  msgid "Guinea-Bissau"
840
  msgstr ""
841
 
842
+ #: admin/class-settings.php:537
843
  msgid "Haiti"
844
  msgstr ""
845
 
846
+ #: admin/class-settings.php:538
847
  msgid "Honduras"
848
  msgstr ""
849
 
850
+ #: admin/class-settings.php:539
851
  msgid "Hong Kong"
852
  msgstr ""
853
 
854
+ #: admin/class-settings.php:540
855
  msgid "Hungary"
856
  msgstr ""
857
 
858
+ #: admin/class-settings.php:541
859
  msgid "Iceland"
860
  msgstr ""
861
 
862
+ #: admin/class-settings.php:542
863
  msgid "India"
864
  msgstr ""
865
 
866
+ #: admin/class-settings.php:543
867
  msgid "Indonesia"
868
  msgstr ""
869
 
870
+ #: admin/class-settings.php:544
871
  msgid "Iran"
872
  msgstr ""
873
 
874
+ #: admin/class-settings.php:545
875
  msgid "Iraq"
876
  msgstr ""
877
 
878
+ #: admin/class-settings.php:546
879
  msgid "Ireland"
880
  msgstr ""
881
 
882
+ #: admin/class-settings.php:547
883
  msgid "Israel"
884
  msgstr ""
885
 
886
+ #: admin/class-settings.php:548
887
  msgid "Italy"
888
  msgstr ""
889
 
890
+ #: admin/class-settings.php:549
891
  msgid "Jamaica"
892
  msgstr ""
893
 
894
+ #: admin/class-settings.php:550
895
  msgid "Japan"
896
  msgstr ""
897
 
898
+ #: admin/class-settings.php:551
899
  msgid "Jordan"
900
  msgstr ""
901
 
902
+ #: admin/class-settings.php:552
903
  msgid "Kazakhstan"
904
  msgstr ""
905
 
906
+ #: admin/class-settings.php:553
907
  msgid "Kenya"
908
  msgstr ""
909
 
910
+ #: admin/class-settings.php:554
911
  msgid "Kuwait"
912
  msgstr ""
913
 
914
+ #: admin/class-settings.php:555
915
  msgid "Kyrgyzstan"
916
  msgstr ""
917
 
918
+ #: admin/class-settings.php:556
919
  msgid "Laos"
920
  msgstr ""
921
 
922
+ #: admin/class-settings.php:557
923
  msgid "Latvia"
924
  msgstr ""
925
 
926
+ #: admin/class-settings.php:558
927
  msgid "Lebanon"
928
  msgstr ""
929
 
930
+ #: admin/class-settings.php:559
931
  msgid "Lesotho"
932
  msgstr ""
933
 
934
+ #: admin/class-settings.php:560
935
  msgid "Liberia"
936
  msgstr ""
937
 
938
+ #: admin/class-settings.php:561
939
  msgid "Libya"
940
  msgstr ""
941
 
942
+ #: admin/class-settings.php:562
943
  msgid "Liechtenstein"
944
  msgstr ""
945
 
946
+ #: admin/class-settings.php:563
947
  msgid "Lithuania"
948
  msgstr ""
949
 
950
+ #: admin/class-settings.php:564
951
  msgid "Luxembourg"
952
  msgstr ""
953
 
954
+ #: admin/class-settings.php:565
955
  msgid "Macau"
956
  msgstr ""
957
 
958
+ #: admin/class-settings.php:566
959
  msgid "Macedonia"
960
  msgstr ""
961
 
962
+ #: admin/class-settings.php:567
963
  msgid "Madagascar"
964
  msgstr ""
965
 
966
+ #: admin/class-settings.php:568
967
  msgid "Malawi"
968
  msgstr ""
969
 
970
+ #: admin/class-settings.php:569
971
  msgid "Malaysia "
972
  msgstr ""
973
 
974
+ #: admin/class-settings.php:570
975
  msgid "Mali"
976
  msgstr ""
977
 
978
+ #: admin/class-settings.php:571
979
  msgid "Marshall Islands"
980
  msgstr ""
981
 
982
+ #: admin/class-settings.php:572
983
  msgid "Martinique"
984
  msgstr ""
985
 
986
+ #: admin/class-settings.php:573
987
  msgid "Mauritania"
988
  msgstr ""
989
 
990
+ #: admin/class-settings.php:574
991
  msgid "Mauritius"
992
  msgstr ""
993
 
994
+ #: admin/class-settings.php:575
995
  msgid "Mexico"
996
  msgstr ""
997
 
998
+ #: admin/class-settings.php:576
999
  msgid "Micronesia"
1000
  msgstr ""
1001
 
1002
+ #: admin/class-settings.php:577
1003
  msgid "Moldova"
1004
  msgstr ""
1005
 
1006
+ #: admin/class-settings.php:578
1007
  msgid "Monaco"
1008
  msgstr ""
1009
 
1010
+ #: admin/class-settings.php:579
1011
  msgid "Mongolia"
1012
  msgstr ""
1013
 
1014
+ #: admin/class-settings.php:580
1015
  msgid "Montenegro"
1016
  msgstr ""
1017
 
1018
+ #: admin/class-settings.php:581
1019
  msgid "Montserrat"
1020
  msgstr ""
1021
 
1022
+ #: admin/class-settings.php:582
1023
  msgid "Morocco"
1024
  msgstr ""
1025
 
1026
+ #: admin/class-settings.php:583
1027
  msgid "Mozambique"
1028
  msgstr ""
1029
 
1030
+ #: admin/class-settings.php:584
1031
  msgid "Myanmar"
1032
  msgstr ""
1033
 
1034
+ #: admin/class-settings.php:585
1035
  msgid "Namibia"
1036
  msgstr ""
1037
 
1038
+ #: admin/class-settings.php:586
1039
  msgid "Nauru"
1040
  msgstr ""
1041
 
1042
+ #: admin/class-settings.php:587
1043
  msgid "Nepal"
1044
  msgstr ""
1045
 
1046
+ #: admin/class-settings.php:588
1047
  msgid "Netherlands"
1048
  msgstr ""
1049
 
1050
+ #: admin/class-settings.php:589
1051
  msgid "Netherlands Antilles"
1052
  msgstr ""
1053
 
1054
+ #: admin/class-settings.php:590
1055
  msgid "New Zealand"
1056
  msgstr ""
1057
 
1058
+ #: admin/class-settings.php:591
1059
  msgid "Nicaragua"
1060
  msgstr ""
1061
 
1062
+ #: admin/class-settings.php:592
1063
  msgid "Niger"
1064
  msgstr ""
1065
 
1066
+ #: admin/class-settings.php:593
1067
  msgid "Nigeria"
1068
  msgstr ""
1069
 
1070
+ #: admin/class-settings.php:594
1071
  msgid "Niue"
1072
  msgstr ""
1073
 
1074
+ #: admin/class-settings.php:595
1075
  msgid "Northern Mariana Islands"
1076
  msgstr ""
1077
 
1078
+ #: admin/class-settings.php:596
1079
  msgid "Norway"
1080
  msgstr ""
1081
 
1082
+ #: admin/class-settings.php:597
1083
  msgid "Oman"
1084
  msgstr ""
1085
 
1086
+ #: admin/class-settings.php:598
1087
  msgid "Pakistan"
1088
  msgstr ""
1089
 
1090
+ #: admin/class-settings.php:599
1091
  msgid "Panama"
1092
  msgstr ""
1093
 
1094
+ #: admin/class-settings.php:600
1095
  msgid "Papua New Guinea"
1096
  msgstr ""
1097
 
1098
+ #: admin/class-settings.php:601
1099
  msgid "Paraguay"
1100
  msgstr ""
1101
 
1102
+ #: admin/class-settings.php:602
1103
  msgid "Peru"
1104
  msgstr ""
1105
 
1106
+ #: admin/class-settings.php:603
1107
  msgid "Philippines"
1108
  msgstr ""
1109
 
1110
+ #: admin/class-settings.php:604
1111
  msgid "Pitcairn Islands"
1112
  msgstr ""
1113
 
1114
+ #: admin/class-settings.php:605
1115
  msgid "Poland"
1116
  msgstr ""
1117
 
1118
+ #: admin/class-settings.php:606
1119
  msgid "Portugal"
1120
  msgstr ""
1121
 
1122
+ #: admin/class-settings.php:607
1123
  msgid "Qatar"
1124
  msgstr ""
1125
 
1126
+ #: admin/class-settings.php:608
1127
  msgid "Reunion"
1128
  msgstr ""
1129
 
1130
+ #: admin/class-settings.php:609
1131
  msgid "Romania"
1132
  msgstr ""
1133
 
1134
+ #: admin/class-settings.php:610
1135
  msgid "Russia"
1136
  msgstr ""
1137
 
1138
+ #: admin/class-settings.php:611
1139
  msgid "Rwanda"
1140
  msgstr ""
1141
 
1142
+ #: admin/class-settings.php:612
1143
  msgid "Saint Helena"
1144
  msgstr ""
1145
 
1146
+ #: admin/class-settings.php:613
1147
  msgid "Saint Kitts and Nevis"
1148
  msgstr ""
1149
 
1150
+ #: admin/class-settings.php:614
1151
  msgid "Saint Vincent and the Grenadines"
1152
  msgstr ""
1153
 
1154
+ #: admin/class-settings.php:615
1155
  msgid "Saint Lucia"
1156
  msgstr ""
1157
 
1158
+ #: admin/class-settings.php:616
1159
  msgid "Samoa"
1160
  msgstr ""
1161
 
1162
+ #: admin/class-settings.php:617
1163
  msgid "San Marino"
1164
  msgstr ""
1165
 
1166
+ #: admin/class-settings.php:618
1167
  msgid "São Tomé and Príncipe"
1168
  msgstr ""
1169
 
1170
+ #: admin/class-settings.php:619
1171
  msgid "Saudi Arabia"
1172
  msgstr ""
1173
 
1174
+ #: admin/class-settings.php:620
1175
  msgid "Senegal"
1176
  msgstr ""
1177
 
1178
+ #: admin/class-settings.php:621
1179
  msgid "Serbia"
1180
  msgstr ""
1181
 
1182
+ #: admin/class-settings.php:622
1183
  msgid "Seychelles"
1184
  msgstr ""
1185
 
1186
+ #: admin/class-settings.php:623
1187
  msgid "Sierra Leone"
1188
  msgstr ""
1189
 
1190
+ #: admin/class-settings.php:624
1191
  msgid "Singapore"
1192
  msgstr ""
1193
 
1194
+ #: admin/class-settings.php:625
1195
  msgid "Slovakia"
1196
  msgstr ""
1197
 
1198
+ #: admin/class-settings.php:626
1199
  msgid "Solomon Islands"
1200
  msgstr ""
1201
 
1202
+ #: admin/class-settings.php:627
1203
  msgid "Somalia"
1204
  msgstr ""
1205
 
1206
+ #: admin/class-settings.php:628
1207
  msgid "South Africa"
1208
  msgstr ""
1209
 
1210
+ #: admin/class-settings.php:629
1211
  msgid "South Korea"
1212
  msgstr ""
1213
 
1214
+ #: admin/class-settings.php:630
1215
  msgid "Spain"
1216
  msgstr ""
1217
 
1218
+ #: admin/class-settings.php:631
1219
  msgid "Sri Lanka"
1220
  msgstr ""
1221
 
1222
+ #: admin/class-settings.php:632
1223
  msgid "Sudan"
1224
  msgstr ""
1225
 
1226
+ #: admin/class-settings.php:633
1227
  msgid "Swaziland"
1228
  msgstr ""
1229
 
1230
+ #: admin/class-settings.php:634
1231
  msgid "Sweden"
1232
  msgstr ""
1233
 
1234
+ #: admin/class-settings.php:635
1235
  msgid "Switzerland"
1236
  msgstr ""
1237
 
1238
+ #: admin/class-settings.php:636
1239
  msgid "Syria"
1240
  msgstr ""
1241
 
1242
+ #: admin/class-settings.php:637
1243
  msgid "Taiwan"
1244
  msgstr ""
1245
 
1246
+ #: admin/class-settings.php:638
1247
  msgid "Tajikistan"
1248
  msgstr ""
1249
 
1250
+ #: admin/class-settings.php:639
1251
  msgid "Tanzania"
1252
  msgstr ""
1253
 
1254
+ #: admin/class-settings.php:640
1255
  msgid "Thailand"
1256
  msgstr ""
1257
 
1258
+ #: admin/class-settings.php:641
1259
  msgid "Timor-Leste"
1260
  msgstr ""
1261
 
1262
+ #: admin/class-settings.php:642
1263
  msgid "Tokelau"
1264
  msgstr ""
1265
 
1266
+ #: admin/class-settings.php:643
1267
  msgid "Togo"
1268
  msgstr ""
1269
 
1270
+ #: admin/class-settings.php:644
1271
  msgid "Tonga"
1272
  msgstr ""
1273
 
1274
+ #: admin/class-settings.php:645
1275
  msgid "Trinidad and Tobago"
1276
  msgstr ""
1277
 
1278
+ #: admin/class-settings.php:646
1279
  msgid "Tunisia"
1280
  msgstr ""
1281
 
1282
+ #: admin/class-settings.php:647
1283
  msgid "Turkey"
1284
  msgstr ""
1285
 
1286
+ #: admin/class-settings.php:648
1287
  msgid "Turkmenistan"
1288
  msgstr ""
1289
 
1290
+ #: admin/class-settings.php:649
1291
  msgid "Tuvalu"
1292
  msgstr ""
1293
 
1294
+ #: admin/class-settings.php:650
1295
  msgid "Uganda"
1296
  msgstr ""
1297
 
1298
+ #: admin/class-settings.php:651
1299
  msgid "Ukraine"
1300
  msgstr ""
1301
 
1302
+ #: admin/class-settings.php:652
1303
  msgid "United Arab Emirates"
1304
  msgstr ""
1305
 
1306
+ #: admin/class-settings.php:653
1307
  msgid "United Kingdom"
1308
  msgstr ""
1309
 
1310
+ #: admin/class-settings.php:654
1311
  msgid "United States"
1312
  msgstr ""
1313
 
1314
+ #: admin/class-settings.php:655
1315
  msgid "Uruguay"
1316
  msgstr ""
1317
 
1318
+ #: admin/class-settings.php:656
1319
  msgid "Uzbekistan"
1320
  msgstr ""
1321
 
1322
+ #: admin/class-settings.php:657
1323
  msgid "Wallis Futuna"
1324
  msgstr ""
1325
 
1326
+ #: admin/class-settings.php:658
1327
  msgid "Venezuela"
1328
  msgstr ""
1329
 
1330
+ #: admin/class-settings.php:659
1331
  msgid "Vietnam"
1332
  msgstr ""
1333
 
1334
+ #: admin/class-settings.php:660
1335
  msgid "Yemen"
1336
  msgstr ""
1337
 
1338
+ #: admin/class-settings.php:661
1339
  msgid "Zambia"
1340
  msgstr ""
1341
 
1342
+ #: admin/class-settings.php:662
1343
  msgid "Zimbabwe"
1344
  msgstr ""
1345
 
1346
+ #: admin/class-settings.php:705
1347
+ msgid "World view"
1348
  msgstr ""
1349
 
1350
+ #: admin/class-settings.php:708 admin/class-settings.php:821
1351
+ #: inc/wpsl-functions.php:179
1352
+ msgid "Default"
1353
  msgstr ""
1354
 
1355
+ #: admin/class-settings.php:711 inc/wpsl-functions.php:252
1356
+ msgid "Roadmap"
1357
  msgstr ""
1358
 
1359
+ #: admin/class-settings.php:851
1360
+ msgid "Start location marker"
1361
  msgstr ""
1362
 
1363
+ #: admin/class-settings.php:853
1364
+ msgid "Store location marker"
1365
  msgstr ""
1366
 
1367
+ #: admin/class-settings.php:934
1368
+ msgid "Textarea"
1369
  msgstr ""
1370
 
1371
+ #: admin/class-settings.php:935
1372
+ msgid "Dropdowns (recommended)"
1373
  msgstr ""
1374
 
1375
+ #: admin/class-settings.php:943
1376
+ msgid "Bounces up and down"
1377
  msgstr ""
1378
 
1379
+ #: admin/class-settings.php:944
1380
+ msgid "Will open the info window"
1381
  msgstr ""
1382
 
1383
+ #: admin/class-settings.php:945
1384
+ msgid "Does not respond"
1385
  msgstr ""
1386
 
1387
+ #: admin/class-settings.php:953
1388
+ msgid "In the store listings"
1389
  msgstr ""
1390
 
1391
+ #: admin/class-settings.php:954
1392
+ msgid "In the info window on the map"
1393
  msgstr ""
1394
 
1395
+ #: admin/class-settings.php:1010
1396
+ msgid "12 Hours"
1397
  msgstr ""
1398
 
1399
+ #: admin/class-settings.php:1011
1400
+ msgid "24 Hours"
1401
  msgstr ""
1402
 
1403
+ #: admin/roles.php:20
1404
+ msgid "Store Locator Manager"
1405
  msgstr ""
1406
 
1407
+ #: admin/templates/map-settings.php:12
1408
+ msgid "Google Maps API"
1409
  msgstr ""
1410
 
1411
+ #: admin/templates/map-settings.php:15
1412
+ msgid "API key"
1413
  msgstr ""
1414
 
1415
+ #: admin/templates/map-settings.php:15
1416
+ #, php-format
1417
+ msgid ""
1418
+ "A valid %sAPI key%s allows you to monitor the API usage and is required if "
1419
+ "you need to purchase additional quota."
1420
  msgstr ""
1421
 
1422
+ #: admin/templates/map-settings.php:16
1423
+ msgid "Optional"
1424
  msgstr ""
1425
 
1426
+ #: admin/templates/map-settings.php:19
1427
+ msgid "Map language"
1428
  msgstr ""
1429
 
1430
+ #: admin/templates/map-settings.php:19
1431
+ msgid "If no map language is selected the browser's prefered language is used."
1432
  msgstr ""
1433
 
1434
+ #: admin/templates/map-settings.php:25
1435
+ msgid "Map region"
1436
  msgstr ""
1437
 
1438
+ #: admin/templates/map-settings.php:25
1439
+ #, php-format
1440
+ msgid ""
1441
+ "This will bias the geocoding results towards the selected region. %s If no "
1442
+ "region is selected the bias is set to the United States."
1443
  msgstr ""
1444
 
1445
+ #: admin/templates/map-settings.php:31 admin/templates/map-settings.php:73
1446
+ #: admin/templates/map-settings.php:163 admin/templates/map-settings.php:256
1447
+ #: admin/templates/map-settings.php:282 admin/templates/map-settings.php:332
1448
+ #: admin/templates/map-settings.php:358 admin/templates/map-settings.php:455
1449
+ #: admin/templates/map-settings.php:476
1450
+ msgid "Save Changes"
1451
  msgstr ""
1452
 
1453
+ #: admin/templates/map-settings.php:41 admin/templates/map-settings.php:383
1454
+ #: admin/templates/map-settings.php:384 frontend/templates/default.php:43
1455
+ #: frontend/templates/store-listings-below.php:43 inc/wpsl-functions.php:97
1456
+ msgid "Search"
1457
  msgstr ""
1458
 
1459
+ #: admin/templates/map-settings.php:44
1460
+ msgid "Show the max results dropdown?"
1461
  msgstr ""
1462
 
1463
+ #: admin/templates/map-settings.php:48
1464
+ msgid "Show the search radius dropdown?"
1465
  msgstr ""
1466
 
1467
+ #: admin/templates/map-settings.php:52
1468
+ msgid "Show the category dropdown?"
1469
  msgstr ""
1470
 
1471
+ #: admin/templates/map-settings.php:56
1472
+ msgid "Distance unit"
1473
  msgstr ""
1474
 
1475
+ #: admin/templates/map-settings.php:59
1476
+ msgid "km"
1477
  msgstr ""
1478
 
1479
+ #: admin/templates/map-settings.php:61
1480
+ msgid "mi"
1481
  msgstr ""
1482
 
1483
+ #: admin/templates/map-settings.php:65
1484
+ msgid "Max search results"
1485
  msgstr ""
1486
 
1487
+ #: admin/templates/map-settings.php:65 admin/templates/map-settings.php:69
1488
+ msgid "The default value is set between the [ ]."
1489
  msgstr ""
1490
 
1491
+ #: admin/templates/map-settings.php:69
1492
+ msgid "Search radius options"
1493
  msgstr ""
1494
 
1495
+ #: admin/templates/map-settings.php:83
1496
+ msgid "Map"
1497
  msgstr ""
1498
 
1499
+ #: admin/templates/map-settings.php:86
1500
+ msgid "Attempt to auto-locate the user"
1501
  msgstr ""
1502
 
1503
+ #: admin/templates/map-settings.php:90
1504
+ msgid "Load locations on page load"
1505
  msgstr ""
1506
 
1507
+ #: admin/templates/map-settings.php:94
1508
+ msgid "Number of locations to show"
1509
  msgstr ""
1510
 
1511
+ #: admin/templates/map-settings.php:94
1512
+ #, php-format
1513
+ msgid ""
1514
+ "Although the location data is cached after the first load, a lower number "
1515
+ "will result in the map being more responsive. %s If this field is left empty "
1516
+ "or set to 0, then all locations are loaded."
1517
  msgstr ""
1518
 
1519
+ #: admin/templates/map-settings.php:98
1520
+ msgid "Start point"
1521
  msgstr ""
1522
 
1523
+ #: admin/templates/map-settings.php:98
1524
+ #, php-format
1525
+ msgid ""
1526
+ "%sRequired field.%s %s If auto-locating the user is disabled or fails, the "
1527
+ "center of the provided city or country will be used as the initial starting "
1528
+ "point for the user."
1529
  msgstr ""
1530
 
1531
+ #: admin/templates/map-settings.php:103
1532
+ msgid "Initial zoom level"
 
1533
  msgstr ""
1534
 
1535
+ #: admin/templates/map-settings.php:107
1536
+ msgid "Max auto zoom level"
 
1537
  msgstr ""
1538
 
1539
+ #: admin/templates/map-settings.php:107
1540
+ #, php-format
1541
+ msgid ""
1542
+ "This value sets the zoom level for the \"Zoom here\" link in the info "
1543
+ "window. %s It is also used to limit the zooming when the viewport of the map "
1544
+ "is changed to make all the markers fit on the screen."
1545
  msgstr ""
1546
 
1547
+ #: admin/templates/map-settings.php:111
1548
+ msgid "Show the street view controls?"
1549
  msgstr ""
1550
 
1551
+ #: admin/templates/map-settings.php:115
1552
+ msgid "Show the pan controls?"
1553
  msgstr ""
1554
 
1555
+ #: admin/templates/map-settings.php:119
1556
+ msgid "Show the map type control?"
1557
  msgstr ""
1558
 
1559
+ #: admin/templates/map-settings.php:123
1560
+ msgid "Enable scroll wheel zooming?"
1561
  msgstr ""
1562
 
1563
+ #: admin/templates/map-settings.php:127
1564
+ msgid "Zoom control position"
1565
  msgstr ""
1566
 
1567
+ #: admin/templates/map-settings.php:130
1568
+ msgid "Left"
1569
  msgstr ""
1570
 
1571
+ #: admin/templates/map-settings.php:132
1572
+ msgid "Right"
1573
  msgstr ""
1574
 
1575
+ #: admin/templates/map-settings.php:136
1576
+ msgid "Zoom control style"
1577
  msgstr ""
1578
 
1579
+ #: admin/templates/map-settings.php:139
1580
+ msgid "Small"
1581
  msgstr ""
1582
 
1583
+ #: admin/templates/map-settings.php:141
1584
+ msgid "Large"
1585
  msgstr ""
1586
 
1587
+ #: admin/templates/map-settings.php:145
1588
+ msgid "Map type"
1589
  msgstr ""
1590
 
1591
+ #: admin/templates/map-settings.php:149
1592
+ msgid "Map style"
1593
  msgstr ""
1594
 
1595
+ #: admin/templates/map-settings.php:149
1596
  msgid ""
1597
+ "Custom map styles only work if the map type is set to \"Roadmap\" or "
1598
+ "\"Terrain\"."
1599
  msgstr ""
1600
 
1601
+ #: admin/templates/map-settings.php:152
1602
+ #, php-format
1603
  msgid ""
1604
+ "You can use existing map styles from %sSnazzy Maps%s or %sMap Stylr%s and "
1605
+ "paste it in the textarea below, or you can generate a custom map style "
1606
+ "through the %sMap Style Editor%s or %sStyled Maps Wizard%s."
1607
  msgstr ""
1608
 
1609
+ #: admin/templates/map-settings.php:153
1610
+ #, php-format
1611
  msgid ""
1612
+ "If you like to write the style code yourself, then you can find the "
1613
+ "documentation from Google %shere%s."
1614
  msgstr ""
1615
 
1616
+ #: admin/templates/map-settings.php:155
1617
+ msgid "Preview Map Style"
1618
+ msgstr ""
1619
+
1620
+ #: admin/templates/map-settings.php:159
1621
+ msgid "Show credits?"
1622
+ msgstr ""
1623
+
1624
+ #: admin/templates/map-settings.php:159
1625
  msgid ""
1626
+ "This will place a \"Search provided by WP Store Locator\" backlink below the "
1627
+ "map."
1628
+ msgstr ""
1629
+
1630
+ #: admin/templates/map-settings.php:173
1631
+ msgid "User Experience"
1632
+ msgstr ""
1633
+
1634
+ #: admin/templates/map-settings.php:176
1635
+ msgid "Store Locator height"
1636
+ msgstr ""
1637
+
1638
+ #: admin/templates/map-settings.php:180
1639
+ msgid "Max width for the info window content"
1640
+ msgstr ""
1641
+
1642
+ #: admin/templates/map-settings.php:184
1643
+ msgid "Search field width"
1644
+ msgstr ""
1645
+
1646
+ #: admin/templates/map-settings.php:188
1647
+ msgid "Search and radius label width"
1648
  msgstr ""
1649
 
1650
+ #: admin/templates/map-settings.php:192
1651
+ msgid "Store Locator template"
1652
+ msgstr ""
1653
+
1654
+ #: admin/templates/map-settings.php:192
1655
+ #, php-format
1656
  msgid ""
1657
+ "The selected template is used with the [wpsl] shortcode. %s You can add a "
1658
+ "custom template with the %swpsl_templates%s filter."
1659
  msgstr ""
1660
 
1661
+ #: admin/templates/map-settings.php:196
1662
+ msgid "Hide the scrollbar?"
1663
  msgstr ""
1664
 
1665
+ #: admin/templates/map-settings.php:200
1666
+ msgid "Open links in a new window?"
1667
+ msgstr ""
1668
+
1669
+ #: admin/templates/map-settings.php:204
1670
+ msgid "Show a reset map button?"
1671
+ msgstr ""
1672
+
1673
+ #: admin/templates/map-settings.php:208
1674
  msgid ""
1675
+ "When a user clicks on \"Directions\", open a new window, and show the route "
1676
+ "on google.com/maps ?"
 
 
1677
  msgstr ""
1678
 
1679
+ #: admin/templates/map-settings.php:212
1680
+ msgid "Show a \"More info\" link in the store listings?"
1681
+ msgstr ""
1682
+
1683
+ #: admin/templates/map-settings.php:212
1684
+ #, php-format
1685
  msgid ""
1686
+ "This places a \"More Info\" link below the address and will show the phone, "
1687
+ "fax, email, opening hours and description once the link is clicked. %s If "
1688
+ "you for example want the contact details to always be visible, then please "
1689
+ "follow the instructions on %sthis%s page."
1690
  msgstr ""
1691
 
1692
+ #: admin/templates/map-settings.php:216
1693
+ msgid "Where do you want to show the \"More info\" details?"
1694
+ msgstr ""
1695
+
1696
+ #: admin/templates/map-settings.php:220
1697
+ msgid "Make the store name clickable if a store URL exists?"
1698
+ msgstr ""
1699
+
1700
+ #: admin/templates/map-settings.php:220
1701
  #, php-format
1702
  msgid ""
1703
+ "If %spermalinks%s are enabled, the store name will always link to the store "
1704
+ "page."
1705
  msgstr ""
1706
 
1707
+ #: admin/templates/map-settings.php:224
1708
+ msgid "Make the phone number clickable on mobile devices?"
1709
  msgstr ""
1710
 
1711
+ #: admin/templates/map-settings.php:228
1712
  msgid ""
1713
+ "If street view is available for the current location, then show a \"Street "
1714
+ "view\" link in the info window?"
 
1715
  msgstr ""
1716
 
1717
+ #: admin/templates/map-settings.php:228
1718
+ #, php-format
1719
+ msgid ""
1720
+ "Enabling this option can sometimes result in a small delay in the opening of "
1721
+ "the info window. %s This happens because an API request is made to Google "
1722
+ "Maps to check if street view is available for the current location."
1723
  msgstr ""
1724
 
1725
+ #: admin/templates/map-settings.php:232
1726
+ msgid "Show a \"Zoom here\" link in the info window?"
1727
  msgstr ""
1728
 
1729
+ #: admin/templates/map-settings.php:232
1730
+ #, php-format
1731
+ msgid ""
1732
+ "Clicking this link will make the map zoom in to the %s max auto zoom level "
1733
+ "%s."
1734
  msgstr ""
1735
 
1736
+ #: admin/templates/map-settings.php:236
1737
+ msgid "On page load move the mouse cursor to the search field?"
1738
  msgstr ""
1739
 
1740
+ #: admin/templates/map-settings.php:236
1741
+ #, php-format
1742
+ msgid ""
1743
+ "If the store locator is not placed at the top of the page, enabling this "
1744
+ "feature can result in the page scrolling down. %s %sThis option is disabled "
1745
+ "on mobile devices.%s"
1746
+ msgstr ""
1747
+
1748
+ #: admin/templates/map-settings.php:240
1749
+ msgid "Use the default style for the info window?"
1750
  msgstr ""
1751
 
1752
+ #: admin/templates/map-settings.php:240
1753
  #, php-format
1754
  msgid ""
1755
+ "If the default style is disabled the %sInfoBox%s library will be used "
1756
+ "instead. %s This enables you to easily change the look and feel of the info "
1757
+ "window through the .wpsl-infobox css class."
1758
  msgstr ""
1759
 
1760
+ #: admin/templates/map-settings.php:244
1761
+ msgid "Hide the distance in the search results?"
1762
  msgstr ""
1763
 
1764
+ #: admin/templates/map-settings.php:248
1765
+ msgid "If a user hovers over the search results the store marker"
1766
  msgstr ""
1767
 
1768
+ #: admin/templates/map-settings.php:248
1769
+ #, php-format
1770
+ msgid ""
1771
+ "If marker clusters are enabled this option will not work as expected as long "
1772
+ "as the markers are clustered. %s The bouncing of the marker won't be visible "
1773
+ "at all unless a user zooms in far enough for the marker cluster to change "
1774
+ "back in to individual markers. %s The info window will open as expected, but "
1775
+ "it won't be clear to which marker it belongs to. "
1776
  msgstr ""
1777
 
1778
+ #: admin/templates/map-settings.php:252
1779
+ msgid "Address format"
1780
  msgstr ""
1781
 
1782
+ #: admin/templates/map-settings.php:252
1783
+ #, php-format
1784
  msgid ""
1785
+ "You can add custom address formats with the %swpsl_address_formats%s filter."
 
1786
  msgstr ""
1787
 
1788
+ #: admin/templates/map-settings.php:266
1789
+ msgid "Markers"
1790
  msgstr ""
1791
 
1792
+ #: admin/templates/map-settings.php:270
1793
+ msgid "Enable marker clusters?"
1794
  msgstr ""
1795
 
1796
+ #: admin/templates/map-settings.php:270
1797
+ msgid "Recommended for maps with a large amount of markers."
1798
  msgstr ""
1799
 
1800
+ #: admin/templates/map-settings.php:274
1801
+ msgid "Max zoom level"
1802
  msgstr ""
1803
 
1804
+ #: admin/templates/map-settings.php:274
1805
+ msgid ""
1806
+ "If this zoom level is reached or exceeded, then all markers are moved out of "
1807
+ "the marker cluster and shown as individual markers."
1808
  msgstr ""
1809
 
1810
+ #: admin/templates/map-settings.php:278
1811
+ msgid "Cluster size"
1812
  msgstr ""
1813
 
1814
+ #: admin/templates/map-settings.php:278
1815
+ #, php-format
1816
+ msgid ""
1817
+ "The grid size of a cluster in pixels. %s A larger number will result in a "
1818
+ "lower amount of clusters and also make the algorithm run faster."
1819
  msgstr ""
1820
 
1821
+ #: admin/templates/map-settings.php:292
1822
+ msgid "Store Editor"
1823
  msgstr ""
1824
 
1825
+ #: admin/templates/map-settings.php:295
1826
+ msgid "Default country"
1827
  msgstr ""
1828
 
1829
+ #: admin/templates/map-settings.php:299
1830
+ msgid "Map type for the location preview"
1831
  msgstr ""
1832
 
1833
+ #: admin/templates/map-settings.php:303
1834
+ msgid "Hide the opening hours?"
1835
  msgstr ""
1836
 
1837
+ #: admin/templates/map-settings.php:309
1838
+ msgid "Opening hours input type"
1839
  msgstr ""
1840
 
1841
+ #: admin/templates/map-settings.php:313
1842
+ #, php-format
1843
+ msgid ""
1844
+ "Opening hours created in version 1.x %sare not%s automatically converted to "
1845
+ "the new dropdown format."
1846
  msgstr ""
1847
 
1848
+ #: admin/templates/map-settings.php:316 admin/templates/map-settings.php:325
1849
+ msgid "The default opening hours"
1850
  msgstr ""
1851
 
1852
+ #: admin/templates/map-settings.php:322
1853
+ msgid "Opening hours format"
1854
  msgstr ""
1855
 
1856
+ #: admin/templates/map-settings.php:329
1857
  msgid ""
1858
+ "The default country and opening hours are only used when a new store is "
1859
+ "created. So changing the default values will have no effect on existing "
1860
+ "store locations."
1861
  msgstr ""
1862
 
1863
+ #: admin/templates/map-settings.php:342
1864
+ msgid "Permalink"
1865
  msgstr ""
1866
 
1867
+ #: admin/templates/map-settings.php:345
1868
+ msgid "Enable permalink?"
1869
  msgstr ""
1870
 
1871
+ #: admin/templates/map-settings.php:349
1872
+ msgid "Store slug"
1873
  msgstr ""
1874
 
1875
+ #: admin/templates/map-settings.php:353
1876
+ msgid "Category slug"
1877
  msgstr ""
1878
 
1879
+ #: admin/templates/map-settings.php:356
1880
+ #, php-format
1881
+ msgid "The permalink slugs %smust be unique%s on your site."
1882
  msgstr ""
1883
 
1884
+ #: admin/templates/map-settings.php:368
1885
+ msgid "Labels"
1886
  msgstr ""
1887
 
1888
+ #: admin/templates/map-settings.php:371 admin/templates/map-settings.php:372
1889
+ #: frontend/templates/default.php:11
1890
+ #: frontend/templates/store-listings-below.php:11 inc/wpsl-functions.php:96
1891
+ msgid "Your location"
1892
  msgstr ""
1893
 
1894
+ #: admin/templates/map-settings.php:375 admin/templates/map-settings.php:376
1895
+ #: frontend/templates/default.php:20
1896
+ #: frontend/templates/store-listings-below.php:20 inc/wpsl-functions.php:99
1897
+ msgid "Search radius"
1898
  msgstr ""
1899
 
1900
+ #: admin/templates/map-settings.php:379 admin/templates/map-settings.php:380
1901
+ #: frontend/class-frontend.php:1296 inc/wpsl-functions.php:100
1902
+ msgid "No results found"
1903
  msgstr ""
1904
 
1905
+ #: admin/templates/map-settings.php:387
1906
+ msgid "Searching (preloader text)"
1907
+ msgstr ""
1908
+
1909
+ #: admin/templates/map-settings.php:388 frontend/class-frontend.php:1295
1910
+ #: inc/wpsl-functions.php:98
1911
+ msgid "Searching..."
1912
+ msgstr ""
1913
+
1914
+ #: admin/templates/map-settings.php:391 admin/templates/map-settings.php:392
1915
+ #: frontend/templates/default.php:29
1916
+ #: frontend/templates/store-listings-below.php:29 inc/wpsl-functions.php:101
1917
+ msgid "Results"
1918
+ msgstr ""
1919
+
1920
+ #: admin/templates/map-settings.php:395 admin/upgrade.php:218
1921
+ #: inc/wpsl-functions.php:115
1922
+ msgid "Category filter"
1923
+ msgstr ""
1924
+
1925
+ #: admin/templates/map-settings.php:396 frontend/class-frontend.php:1082
1926
+ msgid "Category"
1927
+ msgstr ""
1928
+
1929
+ #: admin/templates/map-settings.php:399 admin/templates/map-settings.php:400
1930
+ #: admin/upgrade.php:66 frontend/class-frontend.php:1297
1931
+ #: frontend/underscore-functions.php:114 frontend/underscore-functions.php:141
1932
+ #: inc/wpsl-functions.php:102
1933
+ msgid "More info"
1934
+ msgstr ""
1935
+
1936
+ #: admin/templates/map-settings.php:403 admin/templates/map-settings.php:404
1937
+ #: frontend/class-frontend.php:661 frontend/underscore-functions.php:29
1938
+ #: frontend/underscore-functions.php:121 inc/wpsl-functions.php:110
1939
+ msgid "Phone"
1940
+ msgstr ""
1941
+
1942
+ #: admin/templates/map-settings.php:423 admin/templates/map-settings.php:424
1943
+ #: frontend/class-frontend.php:1302 inc/wpsl-functions.php:95
1944
+ msgid "Start location"
1945
+ msgstr ""
1946
+
1947
+ #: admin/templates/map-settings.php:427
1948
+ msgid "Get directions"
1949
+ msgstr ""
1950
+
1951
+ #: admin/templates/map-settings.php:428 frontend/class-frontend.php:1300
1952
+ #: inc/wpsl-functions.php:103
1953
+ msgid "Directions"
1954
+ msgstr ""
1955
+
1956
+ #: admin/templates/map-settings.php:431
1957
+ msgid "No directions found"
1958
+ msgstr ""
1959
+
1960
+ #: admin/templates/map-settings.php:432 admin/upgrade.php:163
1961
+ #: frontend/class-frontend.php:1301 inc/wpsl-functions.php:104
1962
+ msgid "No route could be found between the origin and destination"
1963
  msgstr ""
1964
 
1965
+ #: admin/templates/map-settings.php:435 admin/templates/map-settings.php:436
1966
+ #: admin/upgrade.php:87 frontend/class-frontend.php:1303
1967
+ #: inc/wpsl-functions.php:105
1968
+ msgid "Back"
1969
+ msgstr ""
1970
+
1971
+ #: admin/templates/map-settings.php:439 admin/templates/map-settings.php:440
1972
+ #: admin/upgrade.php:155 frontend/class-frontend.php:1304
1973
+ #: inc/wpsl-functions.php:106
1974
+ msgid "Street view"
1975
+ msgstr ""
1976
+
1977
+ #: admin/templates/map-settings.php:443 admin/templates/map-settings.php:444
1978
+ #: admin/upgrade.php:159 frontend/class-frontend.php:1305
1979
+ #: inc/wpsl-functions.php:107
1980
+ msgid "Zoom here"
1981
+ msgstr ""
1982
+
1983
+ #: admin/templates/map-settings.php:447
1984
+ msgid "General error"
1985
+ msgstr ""
1986
+
1987
+ #: admin/templates/map-settings.php:448 frontend/class-frontend.php:1298
1988
+ #: inc/wpsl-functions.php:108
1989
+ msgid "Something went wrong, please try again!"
1990
+ msgstr ""
1991
+
1992
+ #: admin/templates/map-settings.php:451
1993
+ msgid "Query limit error"
1994
+ msgstr ""
1995
+
1996
+ #: admin/templates/map-settings.php:451
1997
+ #, php-format
1998
  msgid ""
1999
+ "You can raise the %susage limit%s by obtaining an API %skey%s, and fill in "
2000
+ "the \"API key\" field at the top of this page."
2001
  msgstr ""
2002
 
2003
+ #: admin/templates/map-settings.php:452 frontend/class-frontend.php:1299
2004
+ #: inc/wpsl-functions.php:109
2005
+ msgid "API usage limit reached"
2006
  msgstr ""
2007
 
2008
+ #: admin/templates/map-settings.php:465
2009
+ msgid "Tools"
2010
  msgstr ""
2011
 
2012
+ #: admin/templates/map-settings.php:468
2013
+ msgid "Enable store locator debug?"
2014
  msgstr ""
2015
 
2016
+ #: admin/templates/map-settings.php:468
2017
+ #, php-format
2018
+ msgid ""
2019
+ "This disables the WPSL transient cache. %sThe transient cache is only used "
2020
+ "if the %sLoad locations on page load%s option is enabled."
2021
+ msgstr ""
2022
+
2023
+ #: admin/templates/map-settings.php:472
2024
+ msgid "WPSL transients"
2025
+ msgstr ""
2026
+
2027
+ #: admin/templates/map-settings.php:473
2028
+ msgid "Clear store locator transient cache"
2029
+ msgstr ""
2030
+
2031
+ #: admin/upgrade.php:82
2032
+ msgid "info window"
2033
+ msgstr ""
2034
+
2035
+ #: admin/upgrade.php:92
2036
+ msgid "Reset"
2037
  msgstr ""
2038
 
2039
+ #: admin/upgrade.php:186 inc/wpsl-functions.php:90
2040
+ msgid "stores"
2041
+ msgstr ""
2042
+
2043
+ #: admin/upgrade.php:190 inc/wpsl-functions.php:91
2044
+ msgid "store-category"
2045
+ msgstr ""
2046
+
2047
+ #: admin/upgrade.php:371
2048
+ #, php-format
2049
+ msgid ""
2050
+ "Because you updated WP Store Locator from version 1.x, the %s current store "
2051
+ "locations need to be %sconverted%s to custom post types."
2052
+ msgstr ""
2053
+
2054
+ #: admin/upgrade.php:392
2055
+ #, php-format
2056
  msgid ""
2057
+ "The script converting the locations timed out. %s You can click the \"Start "
2058
+ "Converting\" button again to restart the script. %s If there are thousands "
2059
+ "of store locations left to convert and you keep seeing this message, then "
2060
+ "you can try to contact your host and ask if they can increase the maximum "
2061
+ "execution time. %s The plugin tried to disable the maximum execution time, "
2062
+ "but if you are reading this then that failed."
2063
  msgstr ""
2064
 
2065
+ #: admin/upgrade.php:413
2066
+ msgid "Store locations to convert:"
2067
  msgstr ""
2068
 
2069
+ #: admin/upgrade.php:415
2070
+ msgid "Start Converting"
2071
  msgstr ""
2072
 
2073
+ #: admin/upgrade.php:537
2074
+ #, php-format
2075
  msgid ""
2076
+ "All the store locations are now converted to custom post types. %s You can "
2077
+ "view them on the %sAll Stores%s page."
2078
  msgstr ""
2079
 
2080
+ #: frontend/class-frontend.php:599
2081
  msgid ""
2082
+ "If you use the [wpsl_address] shortcode outside a store page you need to set "
2083
+ "the ID attribute."
2084
  msgstr ""
2085
 
2086
+ #: frontend/class-frontend.php:710
2087
+ msgid ""
2088
+ "If you use the [wpsl_hours] shortcode outside a store page you need to set "
2089
+ "the ID attribute."
2090
  msgstr ""
2091
 
2092
+ #: frontend/class-frontend.php:759
2093
+ msgid ""
2094
+ "If you use the [wpsl_map] shortcode outside a store page you need to set the "
2095
+ "ID attribute."
2096
  msgstr ""
2097
 
2098
+ #: frontend/class-frontend.php:1084
2099
+ msgid "Any"
2100
  msgstr ""
2101
 
2102
+ #: frontend/class-frontend.php:1197
2103
+ msgid "The application does not have permission to use the Geolocation API."
2104
  msgstr ""
2105
 
2106
+ #: frontend/class-frontend.php:1198
2107
+ msgid "Location information is unavailable."
2108
  msgstr ""
2109
 
2110
+ #: frontend/class-frontend.php:1199
2111
+ msgid "The geolocation request timed out."
2112
  msgstr ""
2113
 
2114
+ #: frontend/class-frontend.php:1200
2115
+ msgid "An unknown error occurred."
2116
  msgstr ""
2117
 
2118
+ #: frontend/templates/default.php:60
2119
+ #: frontend/templates/store-listings-below.php:66
2120
+ #, php-format
2121
+ msgid "Search provided by %sWP Store Locator%s"
2122
  msgstr ""
2123
 
2124
+ #: inc/class-post-types.php:50
2125
+ msgid "Store"
2126
  msgstr ""
2127
 
2128
+ #: inc/class-post-types.php:51
2129
+ msgid "Stores"
2130
  msgstr ""
2131
 
2132
+ #: inc/class-post-types.php:55
2133
+ msgid "Store Locator"
2134
  msgstr ""
2135
 
2136
+ #: inc/class-post-types.php:56
2137
+ #, php-format
2138
+ msgid "All %s"
2139
  msgstr ""
2140
 
2141
+ #: inc/class-post-types.php:58 inc/class-post-types.php:61
2142
+ #, php-format
2143
+ msgid "New %s"
2144
  msgstr ""
2145
 
2146
+ #: inc/class-post-types.php:59
2147
+ #, php-format
2148
+ msgid "Add New %s"
2149
  msgstr ""
2150
 
2151
+ #: inc/class-post-types.php:60
2152
+ #, php-format
2153
+ msgid "Edit %s"
2154
  msgstr ""
2155
 
2156
+ #: inc/class-post-types.php:62
2157
+ #, php-format
2158
+ msgid "View %s"
2159
  msgstr ""
2160
 
2161
+ #: inc/class-post-types.php:63
2162
+ #, php-format
2163
+ msgid "Search %s"
2164
  msgstr ""
2165
 
2166
+ #: inc/class-post-types.php:64
2167
+ #, php-format
2168
+ msgid "No %s found"
2169
  msgstr ""
2170
 
2171
+ #: inc/class-post-types.php:65
2172
+ #, php-format
2173
+ msgid "No %s found in trash"
2174
  msgstr ""
2175
 
2176
+ #: inc/class-post-types.php:107 inc/class-post-types.php:117
2177
+ msgid "Store Categories"
2178
  msgstr ""
2179
 
2180
+ #: inc/class-post-types.php:108
2181
+ msgid "Store Category"
2182
  msgstr ""
2183
 
2184
+ #: inc/class-post-types.php:109
2185
+ msgid "Search Store Categories"
2186
  msgstr ""
2187
 
2188
+ #: inc/class-post-types.php:110
2189
+ msgid "All Store Categories"
2190
  msgstr ""
2191
 
2192
+ #: inc/class-post-types.php:111
2193
+ msgid "Parent Store Category"
2194
  msgstr ""
2195
 
2196
+ #: inc/class-post-types.php:112
2197
+ msgid "Parent Store Category:"
 
 
 
 
2198
  msgstr ""
2199
 
2200
+ #: inc/class-post-types.php:113
2201
+ msgid "Edit Store Category"
2202
  msgstr ""
2203
 
2204
+ #: inc/class-post-types.php:114
2205
+ msgid "Update Store Category"
2206
+ msgstr ""
2207
+
2208
+ #: inc/class-post-types.php:115
2209
+ msgid "Add New Store Category"
2210
+ msgstr ""
2211
+
2212
+ #: inc/class-post-types.php:116
2213
+ msgid "New Store Category Name"
2214
+ msgstr ""
2215
+
2216
+ #: inc/class-post-types.php:147
2217
+ msgid "Enter store title here"
2218
+ msgstr ""
2219
+
2220
+ #: inc/class-post-types.php:165
2221
+ msgid "Zip"
2222
+ msgstr ""
2223
+
2224
+ #: inc/wpsl-functions.php:184
2225
  msgid "Show the store list below the map"
2226
  msgstr ""
2227
+
2228
+ #: inc/wpsl-functions.php:201
2229
+ msgid "Monday"
2230
+ msgstr ""
2231
+
2232
+ #: inc/wpsl-functions.php:202
2233
+ msgid "Tuesday"
2234
+ msgstr ""
2235
+
2236
+ #: inc/wpsl-functions.php:203
2237
+ msgid "Wednesday"
2238
+ msgstr ""
2239
+
2240
+ #: inc/wpsl-functions.php:204
2241
+ msgid "Thursday"
2242
+ msgstr ""
2243
+
2244
+ #: inc/wpsl-functions.php:205
2245
+ msgid "Friday"
2246
+ msgstr ""
2247
+
2248
+ #: inc/wpsl-functions.php:206
2249
+ msgid "Saturday"
2250
+ msgstr ""
2251
+
2252
+ #: inc/wpsl-functions.php:207
2253
+ msgid "Sunday"
2254
+ msgstr ""
2255
+
2256
+ #: inc/wpsl-functions.php:237
2257
+ #, php-format
2258
+ msgid "Mon %sTue %sWed %sThu %sFri %sSat Closed %sSun Closed"
2259
+ msgstr ""
2260
+
2261
+ #: inc/wpsl-functions.php:253
2262
+ msgid "Satellite"
2263
+ msgstr ""
2264
+
2265
+ #: inc/wpsl-functions.php:254
2266
+ msgid "Hybrid"
2267
+ msgstr ""
2268
+
2269
+ #: inc/wpsl-functions.php:255
2270
+ msgid "Terrain"
2271
+ msgstr ""
2272
+
2273
+ #: inc/wpsl-functions.php:270
2274
+ msgid "(city) (state) (zip code)"
2275
+ msgstr ""
2276
+
2277
+ #: inc/wpsl-functions.php:271
2278
+ msgid "(city), (state) (zip code)"
2279
+ msgstr ""
2280
+
2281
+ #: inc/wpsl-functions.php:272
2282
+ msgid "(city) (zip code)"
2283
+ msgstr ""
2284
+
2285
+ #: inc/wpsl-functions.php:273
2286
+ msgid "(city), (zip code)"
2287
+ msgstr ""
2288
+
2289
+ #: inc/wpsl-functions.php:274
2290
+ msgid "(zip code) (city) (state)"
2291
+ msgstr ""
2292
+
2293
+ #: inc/wpsl-functions.php:275
2294
+ msgid "(zip code) (city)"
2295
+ msgstr ""
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
- === WP Store Locator ===
 
2
  Contributors: tijmensmit
3
- Tags: google maps, store locator, business locations, geocoding, stores, geo
4
- Requires at least: 3.5
5
- Tested up to: 4.2
6
- Stable tag: 1.2.25
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -12,27 +13,54 @@ An easy to use location management system that enables users to search for nearb
12
  == Description ==
13
 
14
  WP Store Locator is a powerful and easy to use location management system.
15
- You can customize the appearance of the map and provide custom labels for entry fields.
16
- Users can filter the results by radius and see driving directions to the nearby stores in
17
  the language that is set in the admin panel.
18
 
19
  = Features include: =
20
 
21
- * Manage an unlimited numbers of stores
22
- * Set an unique thumbnail for each store
23
- * Provide extra details for stores like the phone, fax, email, url, description and opening hours
24
- * You can drag the marker to the exact spot on the 'Add Store' page
25
- * Show the driving distances in either km or miles
26
- * Choose from nine retina ready marker icons
27
- * Show the store listings either underneath the map, or next to it
28
- * Show Google Maps in different languages, this also influences the language for the driving directions
29
- * Show the driving directions to the stores
30
- * Users can filter the returned results by radius or max results
31
- * Supports the clustering of markers
32
- * Customize the max results and search radius values that users can select
33
- * Customize map settings like the terrain type, location of the map controls and the default zoom level
34
- * Auto-locate the location of the user and show nearby stores
35
- * Labels can be translated in any language through the settings panel
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  == Installation ==
38
 
@@ -67,17 +95,65 @@ If you don't use ajax navigation, but do see the number 1 it's probably a confli
67
 
68
  If you find a plugin or theme that causes a conflict, please report it on the [support page](http://wordpress.org/support/plugin/wp-store-locator).
69
 
 
70
 
71
  == Screenshots ==
72
 
73
  1. Front-end of the plugin
74
  2. The driving directions from the user location to the selected store
75
- 3. The 'Add Store' screen
76
  4. The plugin settings
77
- 5. Overview from the current stores
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  = 1.2.25 =
82
  * Fixed: The store search breaking after the reset button was clicked, via [Drew75](https://wordpress.org/support/profile/drew75)
83
  * Fixed: Two PHP notices.
1
+ === WP Store Locator ===
2
+ Plugin URI: http://wpstorelocator.co
3
  Contributors: tijmensmit
4
+ Tags: google maps, store locator, business locations, geocoding, stores, geo, zipcode locator, dealer locater, geocode, gmaps, google map, google map plugin, location finder, map tools, shop locator, wp google map
5
+ Requires at least: 3.7
6
+ Tested up to: 4.3
7
+ Stable tag: 2.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
13
  == Description ==
14
 
15
  WP Store Locator is a powerful and easy to use location management system.
16
+ You can customize the appearance of the map, and provide custom labels for entry fields.
17
+ Users can filter the results by radius, and see driving directions to the nearby stores in
18
  the language that is set in the admin panel.
19
 
20
  = Features include: =
21
 
22
+ * Manage an unlimited numbers of stores.
23
+ * Provide extra details for stores like the phone, fax, email, url, description and opening hours. There are filters available that allow you add [custom](http://wpstorelocator.co/document/add-custom-meta-data-to-store-locations/) meta data.
24
+ * Support for custom [map styles](http://www.mapstylr.com/).
25
+ * Choose from nine retina ready marker icons.
26
+ * Show the driving distances in either km or miles.
27
+ * Shortcodes that enable you to add individual opening hours, addresses or just a map with a single marker to any page.
28
+ * Compatible with multilingual plugins like WPML and qTranslate X.
29
+ * You can drag the marker in the editor to the exact location on the map.
30
+ * Show the search results either underneath the map, or next to it.
31
+ * Show Google Maps in different languages, this also influences the language for the driving directions.
32
+ * Show the driving directions to the stores.
33
+ * Customize the max results and search radius values that users can select.
34
+ * Users can filter the returned results by radius, max results or category.
35
+ * Supports [marker clusters](https://developers.google.com/maps/articles/toomanymarkers?hl=en#markerclusterer).
36
+ * Customize map settings like the terrain type, location of the map controls and the default zoom level.
37
+ * Use the Geolocation API to find the current location of the user and show nearby stores.
38
+ * Developer friendly code. It uses custom post types and includes almost 30 different [filters](http://wpstorelocator.co/documentation/filters/) that help you change the look and feel of the store locator.
39
+
40
+ = Documentation =
41
+
42
+ Please take a look at the store locator [documentation](http://wpstorelocator.co/documentation/) before making a support request.
43
+
44
+ * [Getting Started](http://wpstorelocator.co/documentation/getting-started/)
45
+ * [Troubleshooting](http://wpstorelocator.co/documentation/troubleshooting/)
46
+ * [Customisations](http://wpstorelocator.co/documentation/customisations/)
47
+ * [Filters](http://wpstorelocator.co/documentation/filters/)
48
+
49
+ = Premium Add-ons =
50
+
51
+ The following store locator add-ons will be available soon.
52
+
53
+ = CSV Import / Export =
54
+ * Bulk import locations by importing a .CSV file.
55
+
56
+ = Statistics =
57
+ * Keep track where users are searching, and see where there is demand for a possible store.
58
+
59
+ = Search Widget =
60
+ * Enable users to search from a sidebar widget for nearby store locations.
61
+
62
+ = Store Directory =
63
+ * Generate a directory based on the store locations.
64
 
65
  == Installation ==
66
 
95
 
96
  If you find a plugin or theme that causes a conflict, please report it on the [support page](http://wordpress.org/support/plugin/wp-store-locator).
97
 
98
+ > You can find the full documentation [here](http://wpstorelocator.co/documentation/)
99
 
100
  == Screenshots ==
101
 
102
  1. Front-end of the plugin
103
  2. The driving directions from the user location to the selected store
104
+ 3. The 'Store Details' section
105
  4. The plugin settings
 
106
 
107
  == Changelog ==
108
 
109
+ = 2.0 =
110
+ * New: Moved away from a custom db table, the store locations are now registered as custom post types.
111
+ * Note: The upgrade procedure will ask you to convert the current store locations to custom post types. This takes around 1 minute for every 1000 store locations.
112
+ * New: The option to enable/disable permalinks for the stores, and set a custom slug from the settings page.
113
+ * New: Three new [shortcodes](http://wpstorelocator.co/document/shortcodes/): [wpsl_map], [wpsl_hours] and [wpsl_address].
114
+ * New: A template attribute for the [wpsl](http://wpstorelocator.co/document/shortcodes/#store-locator) shortcode, via [Damien Carbery](http://www.damiencarbery.com).
115
+ * New: Supports [WPML](https://wpml.org/) and [qTranslate X](https://wordpress.org/plugins/qtranslate-x/).
116
+ * New: A textarea on the settings page where you can paste JSON code to create a [custom map style](https://developers.google.com/maps/documentation/javascript/styling).
117
+ * New: The option to hide the search radius dropdown on the frontend.
118
+ * New: A [wpsl_geolocation_timeout](http://wpstorelocator.co/document/wpsl_geolocation_timeout/) filter.
119
+ * New: The option to choose between different address formats, and a [filter](http://wpstorelocator.co/document/wpsl_address_formats/) to add custom ones.
120
+ * New: The option to use the [InfoBox](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html) library to style the info window.
121
+ * New: The option to choose between two different effects when a user hovers over the result list.
122
+ * New: Set the opening hours through dropdowns instead of a textarea.
123
+ * New: Filters that make it possible to add custom store data, and change the HTML structure of the info window and store listing template.
124
+ * New: The option to define a max location load if the auto loading of locations is enabled.
125
+ * New: The option to enable/disable scroll wheel zooming and the map type control on the map.
126
+ * New: Added 'Email' and 'Url' to the labels on the settings page.
127
+ * New: Added a general settings and documentation link to the plugin action links.
128
+ * New: The option to set a max auto zoom level to prevent the auto zoom from zooming to far.
129
+ * New: The option to set a different map type for the location preview.
130
+ * New: A check to see if the [SCRIPT_DEBUG](https://codex.wordpress.org/Debugging_in_WordPress#SCRIPT_DEBUG) constant is set, if this is the case the full scripts are loaded, otherwise the minified scripts are used.
131
+ * New: A [wpsl_thumb_size](http://wpstorelocator.co/document/wpsl_thumb_size/) filter that enables you to set the thumb size on the frontend without editing CSS files.
132
+ * New: The option to hide the distance in the store listing.
133
+ * New: Added JS code that prevents a grey map when the store locator is placed in a tab. This does require the use of a #wpsl-map-tab anchor.
134
+ * New: Portuguese translation via [Rúben Martins](http://www.rubenmartins.pt/).
135
+ * Changed: Better error handling for the Geolocation API.
136
+ * Changed: Regardless of the selected template, the store map is always placed before the store list on smaller screens.
137
+ * Changed: The wp-content/languages folder is checked for translations before using the translations in the plugin folder.
138
+ * Changed: The 'reset map' button now uses an icon font, and is placed in right bottom corner together with a new 'current location' icon.
139
+ * Changed: The cluster marker image will use HTTPS when available.
140
+ * Changed: Increased the default Geolocation timeout from 3000 to 5000 ms.
141
+ * Changed: The geocode requests to the Google Maps API will always use HTTPS.
142
+ * Changed: Instead of curl or file_get_contents the Google Maps API request will now use [wp_remote_get](https://codex.wordpress.org/Function_Reference/wp_remote_get).
143
+ * Changed: Replaced the 'wpsl_capability' filter with a 'Store Locator Manager' [role](http://wpstorelocator.co/document/roles/).
144
+ * Changed: Added an extra check in JS to prevent the search radius or max results value being set to NaN.
145
+ * Changed: The [wpsl_templates](http://wpstorelocator.co/document/wpsl_templates/) filter now expects an id field to be present in the array.
146
+ * Changed: Renamed the 'wpsl_gmap_api_attributes' filter to [wpsl_gmap_api_params](http://wpstorelocator.co/document/wpsl_gmap_api_params/).
147
+ * Changed: Added the 'enableHighAccuracy' parameter to the Geolocation request to make it more accurate on mobile devices.
148
+ * Fixed: An issue that prevented the settings page from saving the changes on servers that used the mod_security module.
149
+ * Fixed: The pan control option not working on the frontend if it was enabled on the settings page.
150
+ * Fixed: Prevented an empty comma from appearing in the direction URL if the zip code didn't exist.
151
+ * Fixed: Modified the CSS to prevent themes hiding the map images.
152
+ * Fixed: Dragging the store location marker in the store editor would sometimes return the incorrect coordinates.
153
+ * Fixed: The 'Back' button appeared multiple times after the user clicked on the 'Directions' link from different info windows.
154
+ * Fixed: The dropdown fields not being restored to the default values after the 'reset map' button was clicked.
155
+ * Note: Requires at least WP 3.7 instead of WP 3.5.
156
+
157
  = 1.2.25 =
158
  * Fixed: The store search breaking after the reset button was clicked, via [Drew75](https://wordpress.org/support/profile/drew75)
159
  * Fixed: Two PHP notices.
uninstall.php CHANGED
@@ -21,16 +21,62 @@ if ( !is_multisite() ) {
21
  switch_to_blog( $original_blog_id );
22
  }
23
 
24
- /* Delete the tables and options from the db */
 
 
 
 
 
25
  function wpsl_uninstall() {
26
 
27
  global $wpdb, $current_user;
28
 
 
29
  $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'wpsl_stores' );
 
 
 
30
 
31
- delete_option( 'wpsl_version' );
32
- delete_option( 'wpsl_settings' );
 
33
 
 
 
 
 
 
 
 
 
 
 
 
34
  delete_user_meta( $current_user->ID, 'wpsl_disable_location_warning' );
35
  delete_user_meta( $current_user->ID, 'wpsl_stores_per_page' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
21
  switch_to_blog( $original_blog_id );
22
  }
23
 
24
+ /**
25
+ * Delete the table ( users who upgraded from 1.x only ), options, store locations and taxonomies from the db.
26
+ *
27
+ * @todo Make the removal of db data optional through a checkbox on the settings page.
28
+ *
29
+ */
30
  function wpsl_uninstall() {
31
 
32
  global $wpdb, $current_user;
33
 
34
+ /* If the 1.x table still exists we remove it */
35
  $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'wpsl_stores' );
36
+
37
+ /* Check if we need to delete the autoload transients */
38
+ $option_names = $wpdb->get_results( "SELECT option_name AS transient_name FROM " . $wpdb->options . " WHERE option_name LIKE ('\_transient\_wpsl\_autoload\_%')" );
39
 
40
+ if ( $option_names ) {
41
+ foreach ( $option_names as $option_name ) {
42
+ $transient_name = str_replace( "_transient_", "", $option_name->transient_name );
43
 
44
+ delete_transient( $transient_name );
45
+ }
46
+ }
47
+
48
+ /* Delete the options used by the plugin */
49
+ $options = array( 'wpsl_version', 'wpsl_settings', 'wpsl_notices', 'wpsl_legacy_support', 'wpsl_flush_rewrite', 'wpsl_delete_transient', 'wpsl_convert_cpt' );
50
+
51
+ foreach ( $options as $option ) {
52
+ delete_option( $option );
53
+ }
54
+
55
  delete_user_meta( $current_user->ID, 'wpsl_disable_location_warning' );
56
  delete_user_meta( $current_user->ID, 'wpsl_stores_per_page' );
57
+
58
+ /* Disable the time limit before we start removing all the store location posts */
59
+ @set_time_limit( 0 );
60
+
61
+ /* 'any' ignores trashed or auto-draft store location posts, so we make sure they are removed as well */
62
+ $post_statuses = array( 'any', 'trash', 'auto-draft' );
63
+
64
+ /* Delete the 'wpsl_stores' custom post types */
65
+ foreach ( $post_statuses as $post_status ) {
66
+ $posts = get_posts( array( 'post_type' => 'wpsl_stores', 'post_status' => $post_status, 'posts_per_page' => -1, 'fields' => 'ids' ) );
67
+
68
+ if ( $posts ) {
69
+ foreach ( $posts as $post ) {
70
+ wp_delete_post( $post, true );
71
+ }
72
+ }
73
+ }
74
+
75
+ /* Delete the terms, taxonomy and term relationships for the wpsl_store_category */
76
+ $sql = "DELETE t,tt,tr FROM $wpdb->terms AS t
77
+ LEFT JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id
78
+ LEFT JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
79
+ WHERE tt.taxonomy = 'wpsl_store_category'";
80
+
81
+ $wpdb->query( $sql );
82
  }
wp-store-locator.php CHANGED
@@ -1,17 +1,16 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Store Locator
4
- Plugin URI:
5
  Description: An easy to use location management system that enables users to search for nearby physical stores
6
  Author: Tijmen Smit
7
- Author URI: http://tijmensmit.com/
8
- Version: 1.2.25
9
  Text Domain: wpsl
10
  Domain Path: /languages/
11
- License: GPLv3
12
 
13
  WP Store Locator
14
- Copyright (C)2013, Tijmen Smit - info@tijmensmit.com
15
 
16
  This program is free software: you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
@@ -29,49 +28,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29
  @package WP_Store_locator
30
  @category Core
31
  @author Tijmen Smit
32
- @version 1.0
33
  */
34
 
35
  if ( !class_exists( 'WP_Store_locator' ) ) {
36
 
37
  class WP_Store_locator {
38
 
39
- /**
40
- * Stores the current plugin settings
41
- * @since 1.0
42
- * @var array
43
- */
44
- public $settings = array();
45
-
46
- /**
47
- * Stores the default plugin settings
48
- * @since 1.0
49
- * @var array
50
- */
51
- public $default_settings = array();
52
-
53
  /**
54
  * Class constructor
55
  */
56
  function __construct() {
57
-
58
  $this->define_constants();
59
- $this->define_tables();
60
-
61
- if ( is_admin() ) {
62
- require_once( WPSL_PLUGIN_DIR . 'admin/class-admin.php' );
63
- require_once( WPSL_PLUGIN_DIR . 'admin/misc-functions.php' );
64
-
65
- load_plugin_textdomain( 'wpsl', false, basename( dirname( __FILE__ ) ) . '/languages' );
66
-
67
- register_activation_hook( __FILE__, array( $this, 'run_install' ) );
68
-
69
- $this->default_settings = $this->get_default_settings();
70
- } else {
71
- require_once( WPSL_PLUGIN_DIR . 'frontend/class-frontend.php' );
72
- }
73
 
74
- require_once( WPSL_PLUGIN_DIR . 'frontend/wpsl-ajax-functions.php' );
 
 
 
75
  }
76
 
77
  /**
@@ -81,9 +57,9 @@ if ( !class_exists( 'WP_Store_locator' ) ) {
81
  * @return void
82
  */
83
  public function define_constants() {
84
-
85
  if ( !defined( 'WPSL_VERSION_NUM' ) )
86
- define( 'WPSL_VERSION_NUM', '1.2.25' );
87
 
88
  if ( !defined( 'WPSL_URL' ) )
89
  define( 'WPSL_URL', plugin_dir_url( __FILE__ ) );
@@ -91,235 +67,54 @@ if ( !class_exists( 'WP_Store_locator' ) ) {
91
  if ( !defined( 'WPSL_BASENAME' ) )
92
  define( 'WPSL_BASENAME', plugin_basename( __FILE__ ) );
93
 
94
- if ( ! defined( 'WPSL_PLUGIN_DIR' ) )
95
  define( 'WPSL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
96
  }
97
-
98
- private function define_tables() {
99
-
100
- global $wpdb;
101
-
102
- $wpdb->wpsl_stores = $wpdb->prefix . 'wpsl_stores';
103
- }
104
 
105
  /**
106
- * Run the install functions
107
  *
108
- * @since 1.2.20
109
  * @return void
110
  */
111
- public function run_install( $network_wide ) {
112
 
113
- global $wpdb;
 
 
 
114
 
115
- if ( function_exists( 'is_multisite' ) && is_multisite() ) {
116
-
117
- if ( $network_wide ) {
118
- $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
119
-
120
- foreach ( $blog_ids as $blog_id ) {
121
- switch_to_blog( $blog_id );
122
- $this->define_tables();
123
- $this->install_data();
124
- }
125
-
126
- restore_current_blog();
127
- } else {
128
- $this->install_data();
129
- }
130
- } else {
131
- $this->install_data();
132
  }
133
  }
134
 
135
  /**
136
- * Create the required db and install the default settings and options values
137
  *
138
- * @since 1.2.20
139
  * @return void
140
  */
141
- public function install_data() {
142
-
143
- $this->create_tables();
144
- $this->set_default_settings();
145
 
146
- update_option( 'wpsl_version', WPSL_VERSION_NUM );
147
- }
148
-
149
- /**
150
- * Create the required tables
151
- *
152
- * @since 1.0
153
- * @return void
154
- */
155
- public function create_tables() {
156
 
157
- global $wpdb;
158
-
159
- $charset_collate = '';
160
-
161
- if ( !empty( $wpdb->charset ) )
162
- $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
163
- if ( !empty( $wpdb->collate ) )
164
- $charset_collate .= " COLLATE $wpdb->collate";
165
-
166
- if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->wpsl_stores'" ) != $wpdb->wpsl_stores ) {
167
- $sql = "CREATE TABLE " . $wpdb->wpsl_stores . " (
168
- wpsl_id int(10) unsigned NOT NULL auto_increment,
169
- store varchar(255) NULL,
170
- address varchar(255) NULL,
171
- address2 varchar(255) NULL,
172
- city varchar(255) NULL,
173
- state varchar(255) NULL,
174
- zip varchar(100) NULL,
175
- country varchar(255) NULL,
176
- country_iso tinytext NOT NULL,
177
- lat float(10,6) NOT NULL,
178
- lng float(10,6) NOT NULL,
179
- description text NULL,
180
- phone varchar(100) NULL,
181
- fax varchar(100) NULL,
182
- url varchar(255) NULL,
183
- email varchar(255) NULL,
184
- hours varchar(255) NULL,
185
- thumb_id bigint(20) unsigned NOT NULL,
186
- active tinyint(1) NULL default 1,
187
- PRIMARY KEY (wpsl_id)
188
- ) $charset_collate;";
189
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
190
- dbDelta( $sql );
191
- }
192
- }
193
-
194
- /**
195
- * Set the default pluging settings
196
- *
197
- * @since 1.0
198
- * @return void
199
- */
200
- public function set_default_settings() {
201
-
202
- $settings = get_option( 'wpsl_settings' );
203
-
204
- if ( !$settings ) {
205
- update_option( 'wpsl_settings', $this->default_settings );
206
- }
207
- }
208
 
209
  /**
210
- * Get the default plugin settings
211
  *
212
- * @since 1.0
213
  * @return void
214
  */
215
- public function get_default_settings() {
216
-
217
- $default_settings = array (
218
- 'api_key' => '',
219
- 'api_language' => 'en',
220
- 'api_region' => '',
221
- 'distance_unit' => 'km',
222
- 'max_results' => '(25),50,75,100',
223
- 'search_radius' => '10,25,(50),100,200,500',
224
- 'marker_bounce' => '1',
225
- 'auto_locate' => '1',
226
- 'auto_load' => '1',
227
- 'zoom_level' => '3',
228
- 'zoom_name' => '',
229
- 'zoom_latlng' => '',
230
- 'height' => '350',
231
- 'map_type' => 'roadmap',
232
- 'pan_controls' => '0',
233
- 'streetview' => '0',
234
- 'results_dropdown' => '1',
235
- 'infowindow_width' => '225',
236
- 'search_width' => '179',
237
- 'label_width' => '95',
238
- 'control_position' => 'left',
239
- 'control_style' => 'small',
240
- 'marker_clusters' => '0',
241
- 'cluster_zoom' => '0',
242
- 'cluster_size' => '0',
243
- 'new_window' => '0',
244
- 'reset_map' => '0',
245
- 'template_id' => '0',
246
- 'store_below_scroll' => '0',
247
- 'direction_redirect' => '0',
248
- 'more_info' => '0',
249
- 'store_url' => '0',
250
- 'phone_url' => '0',
251
- 'marker_streetview' => '0',
252
- 'marker_zoom_to' => '0',
253
- 'more_info_location' => 'info window',
254
- 'mouse_focus' => '1',
255
- 'start_marker' => 'red.png',
256
- 'store_marker' => 'blue.png',
257
- 'editor_country' => '',
258
- 'start_label' => __( 'Start location', 'wpsl' ),
259
- 'search_label' => __( 'Your location', 'wpsl' ),
260
- 'search_btn_label' => __( 'Search', 'wpsl' ),
261
- 'preloader_label' => __( 'Searching...', 'wpsl' ),
262
- 'radius_label' => __( 'Search radius', 'wpsl' ),
263
- 'no_results_label' => __( 'No results found', 'wpsl' ),
264
- 'results_label' => __( 'Results', 'wpsl' ),
265
- 'more_label' => __( 'More info', 'wpsl' ),
266
- 'directions_label' => __( 'Directions', 'wpsl' ),
267
- 'no_directions_label' => __( 'No route could be found between the origin and destination', 'wpsl' ),
268
- 'back_label' => __( 'Back', 'wpsl' ),
269
- 'reset_label' => __( 'Reset', 'wpsl' ),
270
- 'street_view_label' => __( 'Street view', 'wpsl' ),
271
- 'zoom_here_label' => __( 'Zoom here', 'wpsl' ),
272
- 'error_label' => __( 'Something went wrong, please try again!', 'wpsl' ),
273
- 'limit_label' => __( 'API usage limit reached', 'wpsl' ),
274
- 'phone_label' => __( 'Phone', 'wpsl' ),
275
- 'fax_label' => __( 'Fax', 'wpsl' ),
276
- 'hours_label' => __( 'Hours', 'wpsl' )
277
- );
278
-
279
- return $default_settings;
280
- }
281
-
282
- /**
283
- * Get the current plugin settings
284
- *
285
- * @since 1.0
286
- * @return array $setting The current plugin settings
287
- */
288
- public function get_settings() {
289
-
290
- $settings = get_option( 'wpsl_settings' );
291
-
292
- if ( !$settings ) {
293
- update_option( 'wpsl_settings', $this->default_settings );
294
- $settings = $this->default_settings;
295
- }
296
-
297
- return $settings;
298
- }
299
-
300
- /**
301
- * Return a list of the default store templates
302
- *
303
- * @since 1.2.20
304
- * @return array $templates The list of default store templates
305
- */
306
- public function get_templates() {
307
-
308
- $templates = array (
309
- array (
310
- 'name' => __( 'Default', 'wpsl' ),
311
- 'path' => WPSL_PLUGIN_DIR . 'frontend/templates/default.php'
312
- ),
313
- array (
314
- 'name' => __( 'Show the store list below the map', 'wpsl' ),
315
- 'path' => WPSL_PLUGIN_DIR . 'frontend/templates/store-listings-below.php'
316
- )
317
- );
318
-
319
- return apply_filters( 'wpsl_templates', $templates );
320
  }
321
-
322
  }
323
 
324
- $wpsl = new WP_Store_locator();
325
  }
1
  <?php
2
  /*
3
  Plugin Name: WP Store Locator
 
4
  Description: An easy to use location management system that enables users to search for nearby physical stores
5
  Author: Tijmen Smit
6
+ Author URI: http://wpstorelocator.co/
7
+ Version: 2.0
8
  Text Domain: wpsl
9
  Domain Path: /languages/
10
+ License: GPL v3
11
 
12
  WP Store Locator
13
+ Copyright (C) 2013 Tijmen Smit - tijmen@wpstorelocator.co
14
 
15
  This program is free software: you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License as published by
28
  @package WP_Store_locator
29
  @category Core
30
  @author Tijmen Smit
31
+ @version 2.0
32
  */
33
 
34
  if ( !class_exists( 'WP_Store_locator' ) ) {
35
 
36
  class WP_Store_locator {
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /**
39
  * Class constructor
40
  */
41
  function __construct() {
42
+
43
  $this->define_constants();
44
+ $this->includes();
45
+ $this->plugin_settings();
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
+ $this->post_types = new WPSL_Post_Types();
48
+ $this->i18n = new WPSL_i18n();
49
+
50
+ register_activation_hook( __FILE__, array( $this, 'install' ) );
51
  }
52
 
53
  /**
57
  * @return void
58
  */
59
  public function define_constants() {
60
+
61
  if ( !defined( 'WPSL_VERSION_NUM' ) )
62
+ define( 'WPSL_VERSION_NUM', '2.0' );
63
 
64
  if ( !defined( 'WPSL_URL' ) )
65
  define( 'WPSL_URL', plugin_dir_url( __FILE__ ) );
67
  if ( !defined( 'WPSL_BASENAME' ) )
68
  define( 'WPSL_BASENAME', plugin_basename( __FILE__ ) );
69
 
70
+ if ( !defined( 'WPSL_PLUGIN_DIR' ) )
71
  define( 'WPSL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
72
  }
 
 
 
 
 
 
 
73
 
74
  /**
75
+ * Include the required files
76
  *
77
+ * @since 2.0
78
  * @return void
79
  */
80
+ public function includes() {
81
 
82
+ require_once( WPSL_PLUGIN_DIR . 'inc/wpsl-functions.php' );
83
+ require_once( WPSL_PLUGIN_DIR . 'inc/class-post-types.php' );
84
+ require_once( WPSL_PLUGIN_DIR . 'inc/class-i18n.php' );
85
+ require_once( WPSL_PLUGIN_DIR . 'frontend/class-frontend.php' );
86
 
87
+ if ( is_admin() ) {
88
+ require_once( WPSL_PLUGIN_DIR . 'admin/roles.php' );
89
+ require_once( WPSL_PLUGIN_DIR . 'admin/class-admin.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
  }
92
 
93
  /**
94
+ * Setup the plugin settings
95
  *
96
+ * @since 2.0
97
  * @return void
98
  */
99
+ public function plugin_settings() {
 
 
 
100
 
101
+ global $wpsl_settings, $wpsl_default_settings;
 
 
 
 
 
 
 
 
 
102
 
103
+ $wpsl_settings = wpsl_get_settings();
104
+ $wpsl_default_settings = wpsl_get_default_settings();
105
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
  /**
108
+ * Install the plugin data
109
  *
110
+ * @since 2.0
111
  * @return void
112
  */
113
+ public function install( $network_wide ) {
114
+ require_once( WPSL_PLUGIN_DIR . 'inc/install.php' );
115
+ wpsl_install( $network_wide );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
 
117
  }
118
 
119
+ $GLOBALS['wpsl'] = new WP_Store_locator();
120
  }
wpml-config.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <wpml-config>
2
+ <admin-texts>
3
+ <key name="wpsl_settings">
4
+ <key name="editor_country"/>
5
+ <key name="start_label"/>
6
+ <key name="search_label"/>
7
+ <key name="search_btn_label"/>
8
+ <key name="preloader_label"/>
9
+ <key name="radius_label"/>
10
+ <key name="no_results_label"/>
11
+ <key name="results_label"/>
12
+ <key name="category_label"/>
13
+ <key name="more_label"/>
14
+ <key name="directions_label"/>
15
+ <key name="no_directions_label"/>
16
+ <key name="back_label"/>
17
+ <key name="street_view_label"/>
18
+ <key name="zoom_here_label"/>
19
+ <key name="error_label"/>
20
+ <key name="limit_label"/>
21
+ <key name="phone_label"/>
22
+ <key name="fax_label"/>
23
+ <key name="email_label"/>
24
+ <key name="url_label"/>
25
+ <key name="hours_label"/>
26
+ </key>
27
+ </admin-texts>
28
+ </wpml-config>