@@ -39,21 +39,21 @@ discard block |
||
| 39 | 39 | $is_detail_page = false; |
| 40 | 40 | $geodir_map_name = geodir_map_name(); |
| 41 | 41 | |
| 42 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 42 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
|
|
| 43 | 43 | $is_detail_page = true; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | wp_enqueue_script('jquery');
|
| 47 | 47 | |
| 48 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 48 | + wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 49 | 49 | wp_enqueue_script('geodirectory-script');
|
| 50 | 50 | |
| 51 | 51 | $geodir_vars_data = array( |
| 52 | 52 | 'siteurl' => get_option('siteurl'),
|
| 53 | 53 | 'geodir_plugin_url' => geodir_plugin_url(), |
| 54 | - 'geodir_lazy_load' => get_option('geodir_lazy_load',1),
|
|
| 54 | + 'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
|
|
| 55 | 55 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
| 56 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 56 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
|
|
| 57 | 57 | 'is_rtl' => is_rtl() ? 1 : 0, // fix rtl issue |
| 58 | 58 | 'lightBox_txtImage' => addslashes(__('Image', 'geodirectory')),
|
| 59 | 59 | 'lightBox_txtOf' => addslashes(__('of', 'geodirectory')),
|
@@ -76,24 +76,24 @@ discard block |
||
| 76 | 76 | * |
| 77 | 77 | * } |
| 78 | 78 | */ |
| 79 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 79 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
|
|
| 80 | 80 | |
| 81 | 81 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
| 82 | 82 | |
| 83 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 84 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
|
|
| 83 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 84 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
|
|
| 85 | 85 | |
| 86 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 86 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 87 | 87 | wp_enqueue_script('geodirectory-lightbox-jquery');
|
| 88 | 88 | |
| 89 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 89 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 90 | 90 | if ($is_detail_page) {
|
| 91 | 91 | wp_enqueue_script('geodirectory-jquery-simplemodal');
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | if (in_array($geodir_map_name, array('auto', 'google'))) {
|
| 95 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 96 | - $map_key = "&key=" . geodir_get_map_api_key(); |
|
| 95 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
| 96 | + $map_key = "&key=".geodir_get_map_api_key(); |
|
| 97 | 97 | /** |
| 98 | 98 | * Filter the variables that are added to the end of the google maps script call. |
| 99 | 99 | * |
@@ -103,55 +103,55 @@ discard block |
||
| 103 | 103 | * @param string $var The string to filter, default is empty string. |
| 104 | 104 | */ |
| 105 | 105 | $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
| 106 | - wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
|
|
| 106 | + wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
|
|
| 107 | 107 | |
| 108 | 108 | // Overlapping Marker Spiderfier |
| 109 | - wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 109 | + wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url().'/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 110 | 110 | wp_enqueue_script('geodirectory-g-overlappingmarker-script');
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | if ($geodir_map_name == 'osm') {
|
| 114 | 114 | // Leaflet OpenStreetMap |
| 115 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 115 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 116 | 116 | wp_enqueue_style('geodirectory-leaflet-style');
|
| 117 | 117 | |
| 118 | - wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 118 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 119 | 119 | wp_enqueue_script('geodirectory-leaflet-script');
|
| 120 | 120 | |
| 121 | - wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 121 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 122 | 122 | wp_enqueue_script('geodirectory-leaflet-geo-script');
|
| 123 | 123 | |
| 124 | 124 | if ($is_detail_page) {
|
| 125 | - wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
| 125 | + wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
| 126 | 126 | wp_enqueue_style('geodirectory-leaflet-routing-style');
|
| 127 | 127 | |
| 128 | - wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 128 | + wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 129 | 129 | wp_enqueue_script('geodirectory-leaflet-routing-script');
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // Overlapping Marker Spiderfier Leaflet |
| 133 | - wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 133 | + wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url().'/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 134 | 134 | wp_enqueue_script('geodirectory-o-overlappingmarker-script');
|
| 135 | 135 | } |
| 136 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 136 | + wp_enqueue_script('jquery-ui-autocomplete');
|
|
| 137 | 137 | |
| 138 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 138 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 139 | 139 | wp_enqueue_script('geodirectory-goMap-script');
|
| 140 | 140 | |
| 141 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 141 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 142 | 142 | wp_enqueue_script('chosen');
|
| 143 | 143 | |
| 144 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 144 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 145 | 145 | wp_enqueue_script('geodirectory-choose-ajax');
|
| 146 | 146 | |
| 147 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 147 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 148 | 148 | |
| 149 | 149 | if (is_page() && geodir_is_page('add-listing')) {
|
| 150 | 150 | // SCRIPT FOR UPLOAD |
| 151 | 151 | wp_enqueue_script('plupload-all');
|
| 152 | 152 | wp_enqueue_script('jquery-ui-sortable');
|
| 153 | 153 | |
| 154 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 154 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 155 | 155 | wp_enqueue_script('geodirectory-plupload-script');
|
| 156 | 156 | // SCRIPT FOR UPLOAD END |
| 157 | 157 | |
@@ -198,27 +198,27 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
| 200 | 200 | |
| 201 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 201 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 202 | 202 | } // End if for add place page |
| 203 | 203 | |
| 204 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 204 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 205 | 205 | if ($is_detail_page) {
|
| 206 | 206 | wp_enqueue_script('geodirectory-post-custom-js');
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | // font awesome rating script |
| 210 | 210 | if (get_option('geodir_reviewrating_enable_font_awesome')) {
|
| 211 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 211 | + wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 212 | 212 | wp_enqueue_script('geodir-barrating-js');
|
| 213 | 213 | } else { // default rating script
|
| 214 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 214 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 215 | 215 | wp_enqueue_script('geodir-jRating-js');
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 218 | + wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 219 | 219 | wp_enqueue_script('geodir-on-document-load');
|
| 220 | 220 | |
| 221 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 221 | + wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 222 | 222 | wp_enqueue_script('google-geometa');
|
| 223 | 223 | } |
| 224 | 224 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | */ |
| 234 | 234 | function geodir_header_scripts() |
| 235 | 235 | {
|
| 236 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
| 236 | + echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
|
|
| 237 | 237 | echo stripslashes(get_option('geodir_header_scripts'));
|
| 238 | 238 | } |
| 239 | 239 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | function geodir_google_analytics_tracking_code() |
| 249 | 249 | {
|
| 250 | - if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
|
|
| 250 | + if (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')) {?>
|
|
| 251 | 251 | |
| 252 | 252 | <script> |
| 253 | 253 | (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
@@ -255,14 +255,14 @@ discard block |
||
| 255 | 255 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 256 | 256 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| 257 | 257 | |
| 258 | - ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto');
|
|
| 259 | - <?php if(get_option('geodir_ga_anonymize_ip')){echo "ga('set', 'anonymizeIP', true);";}?>
|
|
| 258 | + ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto');
|
|
| 259 | + <?php if (get_option('geodir_ga_anonymize_ip')) {echo "ga('set', 'anonymizeIP', true);"; }?>
|
|
| 260 | 260 | ga('send', 'pageview');
|
| 261 | 261 | |
| 262 | 262 | </script> |
| 263 | 263 | |
| 264 | 264 | <?php |
| 265 | - }elseif( get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
|
|
| 265 | + }elseif (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) {
|
|
| 266 | 266 | echo stripslashes(get_option('geodir_ga_tracking_code'));
|
| 267 | 267 | } |
| 268 | 268 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * |
| 286 | 286 | * Flexbox wont wrap on ios for search form items |
| 287 | 287 | */ |
| 288 | - if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
|
|
| 288 | + if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
|
|
| 289 | 289 | echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
|
| 290 | 290 | } |
| 291 | 291 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | function geodir_add_async_forscript($url) |
| 303 | 303 | {
|
| 304 | - if (strpos($url, '#asyncload')===false) |
|
| 304 | + if (strpos($url, '#asyncload') === false) |
|
| 305 | 305 | return $url; |
| 306 | 306 | else if (is_admin()) |
| 307 | 307 | return str_replace('#asyncload', '', $url);
|
@@ -319,18 +319,18 @@ discard block |
||
| 319 | 319 | function geodir_templates_styles() |
| 320 | 320 | {
|
| 321 | 321 | |
| 322 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 322 | + wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 323 | 323 | wp_enqueue_style('geodir-core-scss');
|
| 324 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 324 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 325 | 325 | |
| 326 | - if(is_rtl()){
|
|
| 327 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 326 | + if (is_rtl()) {
|
|
| 327 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 328 | 328 | wp_enqueue_style('geodirectory-frontend-rtl-style');
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | wp_register_script('font-awesome', 'https://use.fontawesome.com/releases/v5.5.0/js/all.js#faload', array('font-awesome-shim'), GEODIRECTORY_VERSION);
|
| 332 | 332 | wp_register_script('font-awesome-shim', 'https://use.fontawesome.com/releases/v5.5.0/js/v4-shims.js', array(), GEODIRECTORY_VERSION);
|
| 333 | - wp_enqueue_script( 'font-awesome' ); |
|
| 333 | + wp_enqueue_script('font-awesome');
|
|
| 334 | 334 | |
| 335 | 335 | |
| 336 | 336 | } |
@@ -399,18 +399,18 @@ discard block |
||
| 399 | 399 | $term_id = get_queried_object_id(); |
| 400 | 400 | $taxonomy = get_query_var('taxonomy');
|
| 401 | 401 | |
| 402 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
|
|
| 403 | - $term = get_term($term_id, $post_type . 'category'); |
|
| 402 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
|
|
| 403 | + $term = get_term($term_id, $post_type.'category'); |
|
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | - if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
|
|
| 408 | - $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
| 407 | + if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
|
|
| 408 | + $taxonomy_search = $_REQUEST['s'.$post_type.'category']; |
|
| 409 | 409 | |
| 410 | 410 | if (!is_array($taxonomy_search)) {
|
| 411 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
| 412 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 413 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
| 411 | + $term = get_term((int) $taxonomy_search, $post_type.'category'); |
|
| 412 | + } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 413 | + $term = get_term((int) $taxonomy_search[0], $post_type.'category'); |
|
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if ($max_page > 1 || $always_show) {
|
| 423 | 423 | // Extra pagination info |
| 424 | 424 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
| 425 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 425 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
| 426 | 426 | $end_no = min($paged * $posts_per_page, $numposts); |
| 427 | 427 | |
| 428 | 428 | if ($geodir_pagination_more_info != '') {
|
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } else {
|
| 433 | 433 | $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
| 434 | 434 | } |
| 435 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
| 435 | + $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>'; |
|
| 436 | 436 | /** |
| 437 | 437 | * Adds an extra pagination info above/under pagination. |
| 438 | 438 | * |
@@ -448,15 +448,15 @@ discard block |
||
| 448 | 448 | $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
| 449 | 449 | |
| 450 | 450 | if ($geodir_pagination_more_info == 'before') {
|
| 451 | - $before = $before . $pagination_info; |
|
| 451 | + $before = $before.$pagination_info; |
|
| 452 | 452 | } else if ($geodir_pagination_more_info == 'after') {
|
| 453 | - $after = $pagination_info . $after; |
|
| 453 | + $after = $pagination_info.$after; |
|
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | echo "$before <div class='Navi gd-navi'>"; |
| 458 | 458 | if ($paged >= ($pages_to_show - 1)) {
|
| 459 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
| 459 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link()).'">«</a>';
|
|
| 460 | 460 | } |
| 461 | 461 | previous_posts_link($prelabel); |
| 462 | 462 | for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
@@ -464,13 +464,13 @@ discard block |
||
| 464 | 464 | if ($i == $paged) {
|
| 465 | 465 | echo "<strong class='on'>$i</strong>"; |
| 466 | 466 | } else {
|
| 467 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
| 467 | + echo ' <a href="'.str_replace('&paged', '&paged', get_pagenum_link($i)).'">'.$i.'</a> ';
|
|
| 468 | 468 | } |
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | next_posts_link($nxtlabel, $max_page); |
| 472 | 472 | if (($paged + $half_pages_to_show) < ($max_page)) {
|
| 473 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
| 473 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link($max_page)).'">»</a>';
|
|
| 474 | 474 | } |
| 475 | 475 | echo "</div> $after"; |
| 476 | 476 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | jQuery(function ($) {
|
| 509 | 509 | $("#distance_slider").slider({
|
| 510 | 510 | range: true, |
| 511 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
| 511 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
| 512 | 512 | min: 0, |
| 513 | 513 | max: <?php echo $dist; ?>, |
| 514 | 514 | step: <?php echo $dist_dif; ?>, |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : ''; |
| 576 | 576 | ?> |
| 577 | 577 | <script type="text/javascript"> |
| 578 | - var default_location = '<?php echo $city ;?>'; |
|
| 578 | + var default_location = '<?php echo $city; ?>'; |
|
| 579 | 579 | var latlng; |
| 580 | 580 | var address; |
| 581 | 581 | var dist = 0; |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | var $form = jQuery(this).closest('form');
|
| 592 | 592 | |
| 593 | 593 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
|
| 594 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
|
|
| 594 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
|
|
| 595 | 595 | |
| 596 | 596 | // Disable location based search for disabled location post type. |
| 597 | 597 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
|
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | |
| 608 | - if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
|
|
| 608 | + if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
|
|
| 609 | 609 | |
| 610 | 610 | // OSM can't handel post code with no space so we test for it and add one if needed |
| 611 | 611 | if(window.gdMaps === 'osm'){
|
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | }); |
| 635 | 635 | |
| 636 | 636 | function geodir_setsearch($form) {
|
| 637 | - if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
|
|
| 637 | + if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
|
|
| 638 | 638 | geocodeAddress($form); |
| 639 | 639 | } |
| 640 | 640 | |
@@ -653,15 +653,15 @@ discard block |
||
| 653 | 653 | // Call the geocode function |
| 654 | 654 | Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null; |
| 655 | 655 | |
| 656 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 657 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 656 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 657 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 658 | 658 | jQuery(".snear", $form).val('');
|
| 659 | 659 | } |
| 660 | 660 | jQuery($form).submit(); |
| 661 | 661 | } else {
|
| 662 | 662 | var address = jQuery(".snear", $form).val();
|
| 663 | 663 | |
| 664 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
|
|
| 664 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
|
|
| 665 | 665 | initialise2(); |
| 666 | 666 | } else {
|
| 667 | 667 | <?php |
@@ -674,21 +674,21 @@ discard block |
||
| 674 | 674 | $near_add2 = apply_filters('geodir_search_near_addition', '');
|
| 675 | 675 | ?> |
| 676 | 676 | if (window.gdMaps === 'google') {
|
| 677 | - Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
|
|
| 677 | + Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
|
|
| 678 | 678 | function (results, status) {
|
| 679 | 679 | if (status == google.maps.GeocoderStatus.OK) {
|
| 680 | 680 | updateSearchPosition(results[0].geometry.location, $form); |
| 681 | 681 | } else {
|
| 682 | - alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
|
|
| 682 | + alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
|
|
| 683 | 683 | } |
| 684 | 684 | }); |
| 685 | 685 | } else if (window.gdMaps === 'osm') {
|
| 686 | - geocodePositionOSM(false, address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>, false, false, |
|
| 686 | + geocodePositionOSM(false, address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>, false, false, |
|
| 687 | 687 | function(geo) {
|
| 688 | 688 | if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
|
| 689 | 689 | updateSearchPosition(geo, $form); |
| 690 | 690 | } else {
|
| 691 | - alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
|
|
| 691 | + alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
|
|
| 692 | 692 | } |
| 693 | 693 | }); |
| 694 | 694 | } else {
|
@@ -734,19 +734,19 @@ discard block |
||
| 734 | 734 | var msg; |
| 735 | 735 | switch (err.code) {
|
| 736 | 736 | case err.UNKNOWN_ERROR: |
| 737 | - msg = "<?php _e('Unable to find your location','geodirectory');?>";
|
|
| 737 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
|
|
| 738 | 738 | break; |
| 739 | 739 | case err.PERMISSION_DENINED: |
| 740 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
|
|
| 740 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
|
|
| 741 | 741 | break; |
| 742 | 742 | case err.POSITION_UNAVAILABLE: |
| 743 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
|
|
| 743 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
|
|
| 744 | 744 | break; |
| 745 | 745 | case err.BREAK: |
| 746 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
|
|
| 746 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
|
|
| 747 | 747 | break; |
| 748 | 748 | default: |
| 749 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
|
|
| 749 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
|
|
| 750 | 750 | } |
| 751 | 751 | jQuery('#info').html(msg);
|
| 752 | 752 | } |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | * @param object $post The post object. |
| 797 | 797 | * @param string $link The link to the post. |
| 798 | 798 | */ |
| 799 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 799 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img"> </span></a>', $post, $link);
|
|
| 800 | 800 | break; |
| 801 | 801 | case 'new' : |
| 802 | 802 | /** |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | * @param object $post The post object. |
| 807 | 807 | * @param string $link The link to the post. |
| 808 | 808 | */ |
| 809 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 809 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing"> </span></a>', $post, $link);
|
|
| 810 | 810 | break; |
| 811 | 811 | |
| 812 | 812 | } |
@@ -820,11 +820,11 @@ discard block |
||
| 820 | 820 | * @since 1.6.22 |
| 821 | 821 | */ |
| 822 | 822 | function geodir_fix_script_conflict() {
|
| 823 | - if ( wp_script_is( 'flexslider', 'enqueued' ) && wp_script_is( 'geodirectory-jquery-flexslider-js', 'enqueued' ) ) {
|
|
| 824 | - wp_dequeue_script( 'flexslider' ); |
|
| 823 | + if (wp_script_is('flexslider', 'enqueued') && wp_script_is('geodirectory-jquery-flexslider-js', 'enqueued')) {
|
|
| 824 | + wp_dequeue_script('flexslider');
|
|
| 825 | 825 | } |
| 826 | 826 | } |
| 827 | -add_action( 'wp_enqueue_scripts', 'geodir_fix_script_conflict', 100 ); |
|
| 827 | +add_action('wp_enqueue_scripts', 'geodir_fix_script_conflict', 100);
|
|
| 828 | 828 | |
| 829 | 829 | /** |
| 830 | 830 | * make fontawesome search for inline before and after icons |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | */ |
| 836 | 836 | function geodir_fontawesome_defer($url) |
| 837 | 837 | {
|
| 838 | - if (strpos($url, 'use.fontawesome.com/releases/')===false) |
|
| 838 | + if (strpos($url, 'use.fontawesome.com/releases/') === false) |
|
| 839 | 839 | return $url; |
| 840 | 840 | else if (is_admin()) |
| 841 | 841 | return str_replace('#faload', '', $url);
|
@@ -847,9 +847,9 @@ discard block |
||
| 847 | 847 | /** |
| 848 | 848 | * Dequeue our fontawesome if using BB page. |
| 849 | 849 | */ |
| 850 | -function geodir_fix_beaver_builder(){
|
|
| 851 | - if(isset($_REQUEST['fl_builder'])){
|
|
| 852 | - wp_dequeue_script( 'font-awesome' ); |
|
| 850 | +function geodir_fix_beaver_builder() {
|
|
| 851 | + if (isset($_REQUEST['fl_builder'])) {
|
|
| 852 | + wp_dequeue_script('font-awesome');
|
|
| 853 | 853 | } |
| 854 | 854 | } |
| 855 | -add_filter('wp_print_scripts','geodir_fix_beaver_builder',100);
|
|
| 855 | +add_filter('wp_print_scripts', 'geodir_fix_beaver_builder', 100);
|
|
@@ -132,12 +132,12 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
|
| 134 | 134 | } else {
|
| 135 | - $geodir_map_options['height'] = $geodir_map_options['height'] . 'px'; |
|
| 135 | + $geodir_map_options['height'] = $geodir_map_options['height'].'px'; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
|
| 139 | 139 | } else {
|
| 140 | - $geodir_map_options['width'] = $geodir_map_options['width'] . 'px'; |
|
| 140 | + $geodir_map_options['width'] = $geodir_map_options['width'].'px'; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -169,10 +169,10 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | $exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
|
| 171 | 171 | |
| 172 | - if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)): |
|
| 172 | + if (count((array) $post_types) != count($exclude_post_types) || ($enable_jason_on_load)): |
|
| 173 | 173 | // Set default map options |
| 174 | 174 | |
| 175 | - wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
|
|
| 175 | + wp_enqueue_script('geodir-map-widget', geodir_plugin_url().'/geodirectory-functions/map-functions/js/map.min.js', array(), false, true);
|
|
| 176 | 176 | |
| 177 | 177 | wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
|
| 178 | 178 | |
@@ -191,41 +191,41 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | $map_width = apply_filters('geodir_change_map_width', $map_width);
|
| 193 | 193 | ?> |
| 194 | - <div id="catcher_<?php echo $map_canvas_name;?>"></div> |
|
| 194 | + <div id="catcher_<?php echo $map_canvas_name; ?>"></div> |
|
| 195 | 195 | <div class="stick_trigger_container"> |
| 196 | 196 | <div class="trigger_sticky triggeroff_sticky"></div> |
| 197 | - <div class="top_banner_section geodir_map_container <?php echo $map_class_name;?>" |
|
| 198 | - id="sticky_map_<?php echo $map_canvas_name;?>" |
|
| 199 | - style="min-height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"> |
|
| 197 | + <div class="top_banner_section geodir_map_container <?php echo $map_class_name; ?>" |
|
| 198 | + id="sticky_map_<?php echo $map_canvas_name; ?>" |
|
| 199 | + style="min-height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"> |
|
| 200 | 200 | |
| 201 | 201 | <div class="map_background"> |
| 202 | 202 | <div class="top_banner_section_in clearfix"> |
| 203 | - <div class="<?php echo $map_canvas_name;?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name;?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fas fa-expand-arrows-alt"></i></span></div>
|
|
| 204 | - <div class="<?php echo $map_canvas_name;?>_TopRight TopRight"></div> |
|
| 205 | - <div id="<?php echo $map_canvas_name;?>_wrapper" class="main_map_wrapper" |
|
| 206 | - style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"> |
|
| 203 | + <div class="<?php echo $map_canvas_name; ?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name; ?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fas fa-expand-arrows-alt"></i></span></div>
|
|
| 204 | + <div class="<?php echo $map_canvas_name; ?>_TopRight TopRight"></div> |
|
| 205 | + <div id="<?php echo $map_canvas_name; ?>_wrapper" class="main_map_wrapper" |
|
| 206 | + style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"> |
|
| 207 | 207 | <!-- new map start --> |
| 208 | 208 | <div class="iprelative"> |
| 209 | - <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name;?>" |
|
| 210 | - style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div> |
|
| 211 | - <div id="<?php echo $map_canvas_name;?>_loading_div" class="loading_div" |
|
| 212 | - style=" height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div> |
|
| 209 | + <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name; ?>" |
|
| 210 | + style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div> |
|
| 211 | + <div id="<?php echo $map_canvas_name; ?>_loading_div" class="loading_div" |
|
| 212 | + style=" height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div> |
|
| 213 | 213 | <!--<div id="home_map_counter"></div> --> |
| 214 | - <div id="<?php echo $map_canvas_name;?>_map_nofound" |
|
| 214 | + <div id="<?php echo $map_canvas_name; ?>_map_nofound" |
|
| 215 | 215 | class="advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div> |
| 216 | - <div id="<?php echo $map_canvas_name;?>_map_notloaded" |
|
| 216 | + <div id="<?php echo $map_canvas_name; ?>_map_notloaded" |
|
| 217 | 217 | class="advmap_notloaded"><?php _e('<h3>Google Map Not Loaded</h3><p>Sorry, unable to load Google Maps API.', 'geodirectory'); ?></div>
|
| 218 | 218 | </div> |
| 219 | 219 | <!-- new map end --> |
| 220 | 220 | </div> |
| 221 | - <div class="<?php echo $map_canvas_name;?>_BottomLeft BottomLeft"></div> |
|
| 221 | + <div class="<?php echo $map_canvas_name; ?>_BottomLeft BottomLeft"></div> |
|
| 222 | 222 | </div> |
| 223 | 223 | </div> |
| 224 | 224 | <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
|
| 225 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/> |
|
| 225 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="1"/> |
|
| 226 | 226 | <?php } else {
|
| 227 | 227 | ?> |
| 228 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/> |
|
| 228 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="0"/> |
|
| 229 | 229 | <?php } |
| 230 | 230 | |
| 231 | 231 | if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters']) |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | <div class="gd-input-group-addon gd-directions-right gd-mylocation-go"><input type="button" value="<?php _e('Get Directions', 'geodirectory'); ?>" class="<?php echo $map_canvas_name; ?>_getdirection" id="directions" onclick="calcRoute('<?php echo $map_canvas_name; ?>')" /></div>
|
| 246 | 246 | </div> |
| 247 | 247 | <script> |
| 248 | - <?php if(geodir_is_page('detail')){?>
|
|
| 248 | + <?php if (geodir_is_page('detail')) {?>
|
|
| 249 | 249 | jQuery(function () {
|
| 250 | 250 | gd_initialize_ac(); |
| 251 | 251 | }); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | // Create the autocomplete object, restricting the search |
| 257 | 257 | // to geographical location types. |
| 258 | 258 | autocomplete = new google.maps.places.Autocomplete( |
| 259 | - /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name;?>_fromAddress')),
|
|
| 259 | + /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name; ?>_fromAddress')),
|
|
| 260 | 260 | {types: ['geocode']});
|
| 261 | 261 | // When the user selects an address from the dropdown, |
| 262 | 262 | // populate the address fields in the form. |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | |
| 271 | 271 | if (window.gdMaps == 'osm') {
|
| 272 | 272 | window.setTimeout(function() {
|
| 273 | - calcRoute('<?php echo $map_canvas_name;?>');
|
|
| 273 | + calcRoute('<?php echo $map_canvas_name; ?>');
|
|
| 274 | 274 | }, 1000); |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | $map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
|
| 326 | 326 | ?> |
| 327 | - <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>"> |
|
| 327 | + <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel; ?>"> |
|
| 328 | 328 | <?php |
| 329 | 329 | $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
|
| 330 | 330 | $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
|
@@ -334,12 +334,12 @@ discard block |
||
| 334 | 334 | } |
| 335 | 335 | ?> |
| 336 | 336 | <div |
| 337 | - class="map-category-listing<?php echo $map_cat_class;?>"> |
|
| 337 | + class="map-category-listing<?php echo $map_cat_class; ?>"> |
|
| 338 | 338 | <div class="gd-trigger gd-triggeroff"><i class="fas fa-compress"></i><i class="fas fa-expand"></i></div> |
| 339 | - <div id="<?php echo $map_canvas_name;?>_cat" |
|
| 340 | - class="<?php echo $map_canvas_name;?>_map_category map_category" |
|
| 341 | - <?php if ($child_collapse){ ?>checked="checked" <?php }?>
|
|
| 342 | - style="max-height:<?php echo $geodir_map_options['height'];?>;"> |
|
| 339 | + <div id="<?php echo $map_canvas_name; ?>_cat" |
|
| 340 | + class="<?php echo $map_canvas_name; ?>_map_category map_category" |
|
| 341 | + <?php if ($child_collapse) { ?>checked="checked" <?php }?>
|
|
| 342 | + style="max-height:<?php echo $geodir_map_options['height']; ?>;"> |
|
| 343 | 343 | <input |
| 344 | 344 | onkeydown="if(event.keyCode == 13){build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false)}"
|
| 345 | 345 | type="text" |
@@ -351,11 +351,11 @@ discard block |
||
| 351 | 351 | <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/> |
| 352 | 352 | <?php } else {$child_collapse = "0";
|
| 353 | 353 | ?> |
| 354 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/> |
|
| 354 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="0"/> |
|
| 355 | 355 | <?php } ?> |
| 356 | 356 | <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/> |
| 357 | 357 | <div class="geodir_toggle"> |
| 358 | - <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'),0,true,0,$map_canvas_name,$child_collapse,true); ?> |
|
| 358 | + <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'), 0, true, 0, $map_canvas_name, $child_collapse, true); ?> |
|
| 359 | 359 | <script> |
| 360 | 360 | jQuery(window).load(function() {
|
| 361 | 361 | geodir_show_sub_cat_collapse_button(); |
@@ -385,21 +385,21 @@ discard block |
||
| 385 | 385 | $city = $country != 'me' ? $city : ''; |
| 386 | 386 | $gd_neighbourhood = $country != 'me' ? $gd_neighbourhood : ''; |
| 387 | 387 | ?> |
| 388 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/> |
|
| 389 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country" |
|
| 390 | - value="<?php echo $country;?>"/> |
|
| 391 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_region" name="gd_region" |
|
| 392 | - value="<?php echo $region;?>"/> |
|
| 393 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_city" name="gd_city" |
|
| 394 | - value="<?php echo $city;?>"/> |
|
| 395 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood" |
|
| 396 | - value="<?php echo $gd_neighbourhood;?>"/> |
|
| 388 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="1"/> |
|
| 389 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_country" name="gd_country" |
|
| 390 | + value="<?php echo $country; ?>"/> |
|
| 391 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_region" name="gd_region" |
|
| 392 | + value="<?php echo $region; ?>"/> |
|
| 393 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_city" name="gd_city" |
|
| 394 | + value="<?php echo $city; ?>"/> |
|
| 395 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_neighbourhood" name="gd_neighbourhood" |
|
| 396 | + value="<?php echo $gd_neighbourhood; ?>"/> |
|
| 397 | 397 | <?php } else { //end of location filter
|
| 398 | 398 | ?> |
| 399 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/> |
|
| 399 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="0"/> |
|
| 400 | 400 | <?php }?> |
| 401 | 401 | |
| 402 | - <input type="hidden" id="<?php echo $map_canvas_name;?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt;?>"/> |
|
| 402 | + <input type="hidden" id="<?php echo $map_canvas_name; ?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt; ?>"/> |
|
| 403 | 403 | |
| 404 | 404 | <input type="hidden" name="limitstart" value=""/> |
| 405 | 405 | |
@@ -416,8 +416,8 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | if (count($map_post_types) > 1) {
|
| 418 | 418 | ?> |
| 419 | - <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu" |
|
| 420 | - style="max-width:<?php echo $map_width;?>!important;"> |
|
| 419 | + <div class="map-places-listing" id="<?php echo $map_canvas_name; ?>_posttype_menu" |
|
| 420 | + style="max-width:<?php echo $map_width; ?>!important;"> |
|
| 421 | 421 | |
| 422 | 422 | <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
|
| 423 | 423 | <div class="geodir-map-posttype-list"><?php } ?> |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | foreach ($post_types as $post_type => $args) {
|
| 429 | 429 | if (!in_array($post_type, $exclude_post_types)) {
|
| 430 | 430 | $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : ''; |
| 431 | - echo '<li id="' . $post_type . '" ' . $class . '><a href="javascript:void(0);" onclick="jQuery(\'#' . $map_canvas_name . '_posttype\').val(\'' . $post_type . '\');build_map_ajax_search_param(\'' . $map_canvas_name . '\', true)">' . __($args->labels->name, 'geodirectory') . '</a></li>'; |
|
| 431 | + echo '<li id="'.$post_type.'" '.$class.'><a href="javascript:void(0);" onclick="jQuery(\'#'.$map_canvas_name.'_posttype\').val(\''.$post_type.'\');build_map_ajax_search_param(\''.$map_canvas_name.'\', true)">'.__($args->labels->name, 'geodirectory').'</a></li>'; |
|
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | 434 | ?> |
@@ -453,8 +453,8 @@ discard block |
||
| 453 | 453 | <script type="text/javascript"> |
| 454 | 454 | |
| 455 | 455 | jQuery(document).ready(function () {
|
| 456 | - build_map_ajax_search_param('<?php echo $map_canvas_name;?>', false);
|
|
| 457 | - map_sticky('<?php echo $map_canvas_name;?>');
|
|
| 456 | + build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false);
|
|
| 457 | + map_sticky('<?php echo $map_canvas_name; ?>');
|
|
| 458 | 458 | }); |
| 459 | 459 | |
| 460 | 460 | </script> |
@@ -465,18 +465,18 @@ discard block |
||
| 465 | 465 | <script> |
| 466 | 466 | (function () {
|
| 467 | 467 | var screenH = jQuery(window).height(); |
| 468 | - var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']);?>";
|
|
| 468 | + var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']); ?>";
|
|
| 469 | 469 | |
| 470 | 470 | var ptypeH = ''; |
| 471 | - if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
|
|
| 472 | - ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
|
|
| 471 | + if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
|
|
| 472 | + ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
|
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | - jQuery("#sticky_map_<?php echo $map_canvas_name;?>").css("min-height", screenH * (heightVH / 100) + 'px');
|
|
| 476 | - jQuery("#<?php echo $map_canvas_name;?>_wrapper").height(screenH * (heightVH / 100) + 'px');
|
|
| 477 | - jQuery("#<?php echo $map_canvas_name;?>").height(screenH * (heightVH / 100) + 'px');
|
|
| 478 | - jQuery("#<?php echo $map_canvas_name;?>_loading_div").height(screenH * (heightVH / 100) + 'px');
|
|
| 479 | - jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
|
|
| 475 | + jQuery("#sticky_map_<?php echo $map_canvas_name; ?>").css("min-height", screenH * (heightVH / 100) + 'px');
|
|
| 476 | + jQuery("#<?php echo $map_canvas_name; ?>_wrapper").height(screenH * (heightVH / 100) + 'px');
|
|
| 477 | + jQuery("#<?php echo $map_canvas_name; ?>").height(screenH * (heightVH / 100) + 'px');
|
|
| 478 | + jQuery("#<?php echo $map_canvas_name; ?>_loading_div").height(screenH * (heightVH / 100) + 'px');
|
|
| 479 | + jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
|
|
| 480 | 480 | |
| 481 | 481 | }()); |
| 482 | 482 | </script> |
@@ -488,13 +488,13 @@ discard block |
||
| 488 | 488 | <script> |
| 489 | 489 | (function () {
|
| 490 | 490 | var screenH = jQuery(window).height(); |
| 491 | - var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']);?>";
|
|
| 491 | + var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']); ?>";
|
|
| 492 | 492 | var ptypeH = ''; |
| 493 | - if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
|
|
| 494 | - ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
|
|
| 493 | + if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
|
|
| 494 | + ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
|
|
| 495 | 495 | } |
| 496 | 496 | |
| 497 | - jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", heightVH - ptypeH + 'px');
|
|
| 497 | + jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", heightVH - ptypeH + 'px');
|
|
| 498 | 498 | |
| 499 | 499 | }()); |
| 500 | 500 | </script> |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | * @param array $geodir_map_options Array of map settings. |
| 510 | 510 | * @param string $map_canvas_name The canvas name and ID for the map. |
| 511 | 511 | */ |
| 512 | - do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
|
|
| 512 | + do_action('geodir_map_after_render', $geodir_map_options, $map_canvas_name);
|
|
| 513 | 513 | |
| 514 | 514 | |
| 515 | 515 | endif; // Exclude posttypes if end |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array)) {
|
| 56 | 56 | |
| 57 | - if(isset($map_jason[$post->ID])){return null;}
|
|
| 57 | + if (isset($map_jason[$post->ID])) {return null; }
|
|
| 58 | 58 | |
| 59 | 59 | $srcharr = array("'", "/", "-", '"', '\\');
|
| 60 | 60 | $replarr = array("′", "⁄", "–", "“", '');
|
| 61 | 61 | |
| 62 | - $default_category = isset($post->default_category) ? $post->default_category : geodir_get_post_meta($post->ID,'default_category'); |
|
| 62 | + $default_category = isset($post->default_category) ? $post->default_category : geodir_get_post_meta($post->ID, 'default_category'); |
|
| 63 | 63 | |
| 64 | 64 | $geodir_cat_icons = geodir_get_term_icon(); |
| 65 | 65 | $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$default_category]) ? $geodir_cat_icons[$default_category] : ''; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $title = str_replace($srcharr, $replarr, $post_title); |
| 69 | 69 | |
| 70 | 70 | if (is_ssl()) {
|
| 71 | - $icon = str_replace("http:","https:",$icon );
|
|
| 71 | + $icon = str_replace("http:", "https:", $icon);
|
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | if ($icon != '') {
|
@@ -84,18 +84,18 @@ discard block |
||
| 84 | 84 | $icon_size = array('w' => 36, 'h' => 45);
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $post_latitude = isset($post->post_latitude) ? $post->post_latitude : geodir_get_post_meta($post->ID,'post_latitude'); |
|
| 88 | - $post_longitude = isset($post->post_longitude) ? $post->post_longitude : geodir_get_post_meta($post->ID,'post_longitude'); |
|
| 87 | + $post_latitude = isset($post->post_latitude) ? $post->post_latitude : geodir_get_post_meta($post->ID, 'post_latitude'); |
|
| 88 | + $post_longitude = isset($post->post_longitude) ? $post->post_longitude : geodir_get_post_meta($post->ID, 'post_longitude'); |
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | - $post_json = '{"id":"' . $post->ID
|
|
| 92 | - . '","t": "' . $title |
|
| 93 | - . '","lt": "' . $post_latitude |
|
| 94 | - . '","ln": "' . $post_longitude |
|
| 95 | - . '","mk_id":"' . $post->ID . '_' . $default_category |
|
| 96 | - . '","i":"' . $icon |
|
| 97 | - . '","w":"' . $icon_size['w'] |
|
| 98 | - . '","h":"' . $icon_size['h'] . '"}'; |
|
| 91 | + $post_json = '{"id":"'.$post->ID
|
|
| 92 | + . '","t": "'.$title |
|
| 93 | + . '","lt": "'.$post_latitude |
|
| 94 | + . '","ln": "'.$post_longitude |
|
| 95 | + . '","mk_id":"'.$post->ID.'_'.$default_category |
|
| 96 | + . '","i":"'.$icon |
|
| 97 | + . '","w":"'.$icon_size['w'] |
|
| 98 | + . '","h":"'.$icon_size['h'].'"}'; |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * Filter the json data when creating output for post json marker.. |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | * @param string $post_json JSON representation of the post marker info. |
| 105 | 105 | * @param object $post The post object. |
| 106 | 106 | */ |
| 107 | - $post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
|
|
| 107 | + $post_map_json = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post);
|
|
| 108 | 108 | |
| 109 | 109 | // only assign it if it has a value |
| 110 | - if($post_map_json){
|
|
| 110 | + if ($post_map_json) {
|
|
| 111 | 111 | $map_jason[$post->ID] = $post_map_json; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -131,13 +131,13 @@ discard block |
||
| 131 | 131 | if (is_array($map_jason) && !empty($map_jason)) {
|
| 132 | 132 | |
| 133 | 133 | // on details page only show the main marker on the map |
| 134 | - if(geodir_is_page('detail')){
|
|
| 134 | + if (geodir_is_page('detail')) {
|
|
| 135 | 135 | global $post; |
| 136 | - if(isset($map_jason[$post->ID])){
|
|
| 136 | + if (isset($map_jason[$post->ID])) {
|
|
| 137 | 137 | $map_jason = array($map_jason[$post->ID]); |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | - $canvas_jason = $canvas . "_jason"; |
|
| 140 | + $canvas_jason = $canvas."_jason"; |
|
| 141 | 141 | $map_canvas_arr[$canvas] = array_unique($map_jason); |
| 142 | 142 | unset($cat_content_info); |
| 143 | 143 | $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
|
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | $json_content = substr(implode(',', $cat_content_info), 1);
|
| 147 | 147 | $json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
|
| 148 | 148 | $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08 |
| 149 | - $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
|
|
| 149 | + $canvas_jason = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
|
|
| 150 | 150 | } else {
|
| 151 | 151 | $canvas_jason = '[{"totalcount":"0"}]';
|
| 152 | 152 | } |
| 153 | - $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason); |
|
| 153 | + $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason); |
|
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | 156 | * Filter the send_marker_jason_to_js() function map canvas json args. |
@@ -162,12 +162,12 @@ discard block |
||
| 162 | 162 | * @param string $canvas Map canvas array key. |
| 163 | 163 | * @param array $map_canvas_jason_args Map canvas args. |
| 164 | 164 | */ |
| 165 | - $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
|
|
| 165 | + $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
|
|
| 166 | 166 | |
| 167 | - wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
|
|
| 167 | + wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
|
|
| 168 | 168 | } else {
|
| 169 | 169 | $canvas_jason = '[{"totalcount":"0"}]';
|
| 170 | - $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason); |
|
| 170 | + $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason); |
|
| 171 | 171 | |
| 172 | 172 | /** |
| 173 | 173 | * Filter the send_marker_jason_to_js() function map canvas json args. |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | * @param string $canvas Map canvas array key. |
| 180 | 180 | * @param array $map_canvas_jason_args Map canvas args. |
| 181 | 181 | */ |
| 182 | - $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
|
|
| 183 | - wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
|
|
| 182 | + $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
|
|
| 183 | + wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
|
|
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
@@ -245,11 +245,11 @@ discard block |
||
| 245 | 245 | $display = !$child_collapse ? '' : 'display:none'; |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
| 248 | + $out = '<ul class="treeview '.$list_class.'" style="margin-left:'.$p.'px;'.$display.';">'; |
|
| 249 | 249 | |
| 250 | 250 | $geodir_cat_icons = geodir_get_term_icon(); |
| 251 | 251 | |
| 252 | - $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place';
|
|
| 252 | + $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place';
|
|
| 253 | 253 | if ($is_home_map && $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype')) {
|
| 254 | 254 | $geodir_default_map_search_pt = $homemap_catlist_ptype; |
| 255 | 255 | } |
@@ -264,23 +264,23 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | // Untick the category by default on home map |
| 266 | 266 | if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
|
| 267 | - if (geodir_wpml_is_taxonomy_translated($post_type . 'category')) { // if WPML
|
|
| 267 | + if (geodir_wpml_is_taxonomy_translated($post_type.'category')) { // if WPML
|
|
| 268 | 268 | global $sitepress; |
| 269 | 269 | $default_lang = $sitepress->get_default_language(); |
| 270 | 270 | $term_id = geodir_wpml_object_id($cat_term->term_id, $post_type.'category', true, $default_lang); |
| 271 | - }else{
|
|
| 271 | + } else {
|
|
| 272 | 272 | $term_id = $cat_term->term_id; |
| 273 | 273 | } |
| 274 | - if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) {
|
|
| 274 | + if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$term_id, $geodir_home_map_untick)) {
|
|
| 275 | 275 | $checked = ''; |
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"'; |
|
| 280 | - $term_check .= ' name="' . $map_canvas_name . '_cat[]" '; |
|
| 281 | - $term_check .= ' title="' . esc_attr(geodir_utf8_ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">'; |
|
| 282 | - $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '"/>'; |
|
| 283 | - $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . geodir_utf8_ucfirst($cat_term->name) . '</label><span class="gd-map-cat-toggle"><i class="fas fa-long-arrow-alt-down" style="display:none"></span></i>'; |
|
| 279 | + $term_check = '<input type="checkbox" '.$checked.' id="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'" class="group_selector '.$main_list_class.'"'; |
|
| 280 | + $term_check .= ' name="'.$map_canvas_name.'_cat[]" '; |
|
| 281 | + $term_check .= ' title="'.esc_attr(geodir_utf8_ucfirst($cat_term->name)).'" value="'.$cat_term->term_id.'" onclick="javascript:build_map_ajax_search_param(\''.$map_canvas_name.'\',false, this)">'; |
|
| 282 | + $term_img = '<img height="15" width="15" alt="'.$cat_term->taxonomy.'" src="'.$icon.'" title="'.geodir_utf8_ucfirst($cat_term->name).'"/>'; |
|
| 283 | + $out .= '<li>'.$term_check.'<label for="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'">'.$term_img.geodir_utf8_ucfirst($cat_term->name).'</label><span class="gd-map-cat-toggle"><i class="fas fa-long-arrow-alt-down" style="display:none"></span></i>'; |
|
| 284 | 284 | |
| 285 | 285 | endif; |
| 286 | 286 | |
@@ -392,19 +392,19 @@ discard block |
||
| 392 | 392 | * @package GeoDirectory |
| 393 | 393 | */ |
| 394 | 394 | function geodir_map_load_script() {
|
| 395 | - if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'google-maps-api', 'done')) {
|
|
| 395 | + if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('google-maps-api', 'done')) {
|
|
| 396 | 396 | $plugin_url = geodir_plugin_url(); |
| 397 | 397 | ?> |
| 398 | 398 | <script type="text/javascript"> |
| 399 | 399 | if (!(window.google && typeof google.maps !== 'undefined')) {
|
| 400 | - var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION;?>");
|
|
| 400 | + var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION; ?>");
|
|
| 401 | 401 | document.getElementsByTagName("head")[0].appendChild(css);
|
| 402 | - var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION;?>");
|
|
| 402 | + var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION; ?>");
|
|
| 403 | 403 | document.getElementsByTagName("head")[0].appendChild(css);
|
| 404 | - document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
|
|
| 405 | - document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/osm.geocode.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
|
|
| 406 | - document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
|
|
| 407 | - document.write('<' + 'script id="geodirectory-o-overlappingmarker-script" src="<?php echo $plugin_url;?>/geodirectory-assets/jawj/oms-leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
|
|
| 404 | + document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
|
|
| 405 | + document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/osm.geocode.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
|
|
| 406 | + document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
|
|
| 407 | + document.write('<' + 'script id="geodirectory-o-overlappingmarker-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/jawj/oms-leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
|
|
| 408 | 408 | } |
| 409 | 409 | </script> |
| 410 | 410 | <?php |