| @@ -110,8 +110,11 @@ | ||
| 110 | 110 | wp_register_style( 'wdk-locations-list', WPDIRECTORYKIT_URL. 'elementor-elements/assets/css/widgets/wdk-locations-list.css', array(), $this->version, 'all' ); |
| 111 | 111 | wp_register_style( 'wdk-listings-map', WPDIRECTORYKIT_URL. 'elementor-elements/assets/css/widgets/wdk-map.css', array(), $this->version, 'all' ); |
| 112 | 112 | wp_register_style( 'wdk-listings-carousel', WPDIRECTORYKIT_URL. 'elementor-elements/assets/css/widgets/wdk-listings-carousel.css', array(), $this->version, 'all' ); |
| 113 | 113 | wp_register_style( 'wdk-listing-related-listings-table', WPDIRECTORYKIT_URL. 'elementor-elements/assets/css/widgets/wdk-listing-related-listings-table.css', array(), $this->version, 'all' ); |
| 114 | + wp_register_style( 'wdk-search-popup', WPDIRECTORYKIT_URL. 'elementor-elements/assets/css/widgets/wdk-search-popup.css', array(), $this->version, 'all' ); | |
| 115 | + wp_register_style( 'wdk-tabs', WPDIRECTORYKIT_URL. 'elementor-elements/assets/css/widgets/wdk-tabs.css', array(), $this->version, 'all' ); | |
| 116 | + wp_register_style( 'wdk-language-switcher', WPDIRECTORYKIT_URL. 'elementor-elements/assets/css/widgets/wdk-language-switcher.css', array(), $this->version, 'all' ); | |
| 114 | 117 | wp_register_style( 'wdk-notify', plugin_dir_url( __FILE__ ) . 'css/wdk-notify.css', array(), $this->version, 'all' ); |
| 115 | 118 | wp_register_style( 'wdk-modal', plugin_dir_url( __FILE__ ) . 'css/wdk-modal.css', array(), $this->version, 'all' ); |
| 116 | 119 | wp_register_style( 'wdk-hover', plugin_dir_url( __FILE__ ) . 'css/wdk-hover.css', array(), $this->version, 'all' ); |
| 117 | 120 | wp_register_style( 'leaflet', plugin_dir_url( __FILE__ ) . 'js/openstreetmap/leaflet.css', array(), '1.7.1', 'all' ); |
| @@ -119,10 +122,11 @@ | ||
| 119 | 122 | wp_register_style( 'leaflet-cluster', plugin_dir_url( __FILE__ ) . 'js/openstreetmap/MarkerCluster.css', array(), '1.7.1', 'all' ); |
| 120 | 123 | wp_register_style( 'leaflet-fullscreen', plugin_dir_url( __FILE__ ) . 'js/openstreetmap/leaflet.fullscreen.css', array(), '1.7.1', 'all' ); |
| 121 | 124 | wp_register_style( 'ion.range-slider', plugin_dir_url( __FILE__ ) . 'js/ion.range-slider/css/ion.range-slider.min.css', array(), '2.3.1', 'all' ); |
| 122 | 125 | wp_register_style( 'wdk-slider-range', plugin_dir_url( __FILE__ ) . 'css/wdk-slider-range.css', array(), '1.0', 'all' ); |
| 123 | - wp_register_style( 'select2', plugin_dir_url( __FILE__ ) . 'js/select2/css/select2.min.css', array(), '4.0.13', 'all' ); | |
| 126 | + wp_register_style( 'select2-select2', plugin_dir_url( __FILE__ ) . 'js/select2/css/select2.min.css', array(), '4.0.13', 'all' ); | |
| 124 | 127 | wp_register_style( 'wdk-treefield-dropdown', plugin_dir_url( __FILE__ ) . 'js/wdk_treefield_dropdown/wdk_treefield_dropdown.css', array(), '1.0', 'all' ); |
| 128 | + wp_register_style( 'leaflet-draw', plugin_dir_url( __FILE__ ) . 'js/leaflet-draw/leaflet.draw.css', array(), '1.0', 'all' ); | |
| 125 | 129 | |
| 126 | 130 | wp_register_style('blueimp-gallery', plugin_dir_url( __FILE__ ).'js/blueimp-gallery/css/blueimp-gallery.min.css', array(), '1.8', 'all'); |
| 127 | 131 | |
| 128 | 132 | wp_register_style('slick', plugin_dir_url( __FILE__ ).'js/slick/slick.css', array(), '1.8', 'all'); |
| @@ -150,8 +154,11 @@ | ||
| 150 | 154 | $custom_css .= " |
| 151 | 155 | .wdk-element .wdk-map .wdk_marker-container.category_id_".esc_attr(wmvc_show_data('idcategory', $category),'',TRUE, TRUE)." .wdk_face.front i { |
| 152 | 156 | color: ".esc_attr(wmvc_show_data('category_color', $category),'',TRUE, TRUE)."; |
| 153 | 157 | } |
| 158 | + .wdk-element .wdk-map .wdk_marker-container.category_id_".esc_attr(wmvc_show_data('idcategory', $category),'',TRUE, TRUE).":hover .wdk_face.front i { | |
| 159 | + color:#fff; | |
| 160 | + } | |
| 154 | 161 | .wdk-element .wdk-map .wdk_marker-container.category_id_".esc_attr(wmvc_show_data('idcategory', $category),'',TRUE, TRUE)." .wdk_marker-container:hover .wdk_marker-card::after, |
| 155 | 162 | .wdk-element .wdk-map .wdk_marker-container.category_id_".esc_attr(wmvc_show_data('idcategory', $category),'',TRUE, TRUE)." .wdk_marker-card::before { |
| 156 | 163 | background: ".esc_attr(wmvc_show_data('category_color', $category),'',TRUE, TRUE)."; |
| 157 | 164 | } |
| @@ -205,17 +212,24 @@ | ||
| 205 | 212 | wp_register_script('wdk-blueimp-slider', plugin_dir_url( __FILE__ ).'js/wdk-blueimp-slider.js', array( 'jquery' ), '1.0', false ); |
| 206 | 213 | wp_register_script('slick', plugin_dir_url( __FILE__ ).'js/slick/slick.min.js', array( 'jquery' ), '1.8', false ); |
| 207 | 214 | wp_register_script('ion.range-slider', plugin_dir_url( __FILE__ ).'js/ion.range-slider/js/ion.range-slider.min.js', array( 'jquery' ), '2.3.1', false ); |
| 208 | 215 | wp_register_script('wdk-slider-range', plugin_dir_url( __FILE__ ).'js/wdk-slider-range.js', array( 'jquery' ), '1.0', false ); |
| 209 | - wp_register_script('select2', plugin_dir_url( __FILE__ ).'js/select2/js/select2.min.js', array( 'jquery' ), '4.0.13', false ); | |
| 216 | + wp_register_script('select2-select2', plugin_dir_url( __FILE__ ).'js/select2/js/select2.min.js', array( 'jquery' ), '4.0.13', false ); | |
| 210 | 217 | wp_register_script('wdk-select2', plugin_dir_url( __FILE__ ).'js/wdk-select2.js', array( 'jquery' ), '4.0.13', false ); |
| 218 | + wp_register_script('leaflet-googlemutant', plugin_dir_url( __FILE__ ).'js/leaflet-gridlayer-googlemutant/leaflet-googlemutant.js', array( 'jquery' ), '4.0.13', false ); | |
| 219 | + wp_register_script('wdk-ajax-loading-listings', plugin_dir_url( __FILE__ ).'js/wdk-ajax-loading-listings.js', array( 'jquery' ), '1.0', false ); | |
| 220 | + wp_register_script('leaflet-draw', plugin_dir_url( __FILE__ ).'js/leaflet-draw/leaflet.draw.js', array( 'jquery' ), '1.0', false ); | |
| 221 | + wp_register_script('wdk-map-rectangle', plugin_dir_url( __FILE__ ).'js/wdk-map-rectangle.js', array( 'jquery', 'leaflet-draw', 'wp-i18n' ), '1.0', false ); | |
| 222 | + wp_register_script('wdk-tabs', WPDIRECTORYKIT_URL. 'elementor-elements/assets/js/wdk-tabs.js', array( 'jquery', 'leaflet-draw' ), '1.0', false ); | |
| 223 | + | |
| 211 | 224 | |
| 212 | - | |
| 213 | - $params = array( | |
| 214 | - 'ajax_url' => admin_url( 'admin-ajax.php' ) | |
| 215 | - ); | |
| 225 | + if( wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_popup')) { | |
| 226 | + wp_register_script('wdk-popup-listings', plugin_dir_url( __FILE__ ).'js/wdk-popup-listings.js', array( 'jquery', 'jquery-confirm' ), '1.6', false ); | |
| 227 | + wp_enqueue_script('wdk-popup-listings'); | |
| 228 | + wp_enqueue_style('jquery-confirm'); | |
| 229 | + } | |
| 230 | + | |
| 216 | 231 | wp_register_script('wdk-treefield-dropdown', plugin_dir_url( __FILE__ ).'js/wdk_treefield_dropdown/wdk_treefield_dropdown.js', array( 'jquery' ), '1.0', false ); |
| 217 | - wp_localize_script( 'wdk-treefield-dropdown', 'script_parameters', $params); | |
| 218 | 232 | |
| 219 | 233 | wp_register_script('jquery-confirm', plugin_dir_url( __FILE__ ).'js/jquery-confirm/js/jquery-confirm.js', array( 'jquery' ), '3.3.4', false ); |
| 220 | 234 | |
| 221 | 235 | $params = array( |
| @@ -238,16 +252,41 @@ | ||
| 238 | 252 | 'format_date' => wdk_convert_date_format_js(get_option('date_format')), |
| 239 | 253 | 'format_datetime' => wdk_convert_date_format_js(get_option('date_format').' '.get_option('time_format')), |
| 240 | 254 | 'format_date_js' => wdk_convert_date_format_jquery(get_option('date_format')), |
| 241 | 255 | 'format_datetime_js' => wdk_convert_date_format_jquery(get_option('date_format').' '.get_option('time_format')), |
| 256 | + 'settings_wdk_field_search_suggestion_disable' => (wdk_get_option('wdk_field_search_suggestion_disable')) ? 1 : 0, | |
| 257 | + 'text' => array( | |
| 258 | + "read_more"=> esc_html__("Read More", 'wpdirectorykit'), | |
| 259 | + "read_less"=> esc_html__("Read Less", 'wpdirectorykit'), | |
| 260 | + ), | |
| 261 | + 'wpApiSettings' => [ | |
| 262 | + 'root'=> esc_url_raw(rest_url()), | |
| 263 | + 'nonce'=> wp_create_nonce('wp_rest'), | |
| 264 | + 'wdk_secure_nonce'=> wp_create_nonce('wdk_secure_ajax'), | |
| 265 | + ], | |
| 266 | + 'fields_data' => wdk_cached_field_get(), | |
| 267 | + 'wdk_ai_search_fields' => get_option( 'wdk_ai_search_fields', []), | |
| 242 | 268 | ); |
| 243 | - | |
| 244 | - wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpdirectorykit-public.js', array( 'jquery' ), $this->version, false ); | |
| 269 | + wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wpdirectorykit-public.js', array( 'jquery' ,'wp-i18n'), $this->version, false ); | |
| 245 | 270 | wp_localize_script( $this->plugin_name, 'script_parameters', $params); |
| 271 | + wp_localize_script( $this->plugin_name, 'wdk_script_parameters', $params); | |
| 246 | 272 | |
| 247 | 273 | wp_register_style('jquery-ui', WPDIRECTORYKIT_URL. 'public/css/jquery-ui.css', array(), '1.12.1' ); |
| 248 | 274 | |
| 249 | 275 | $custom_css = '.wdk-image:not(.media):not(.jsplaceholder){background-image: url('.esc_url(wdk_placeholder_image_src()).');background-size: cover;background-position: center; }'; |
| 276 | + | |
| 277 | + $params = array( | |
| 278 | + 'ajax_url' => admin_url( 'admin-ajax.php' ), | |
| 279 | + 'text' =>array( | |
| 280 | + 'errorLoading' => esc_html__('The results could not be loaded.', 'wpdirectorykit'), | |
| 281 | + 'loadingMore' => esc_html__('Loading more results…', 'wpdirectorykit'), | |
| 282 | + 'noResults' => esc_html__('No results found', 'wpdirectorykit'), | |
| 283 | + 'searching' => esc_html__('Searching…', 'wpdirectorykit'), | |
| 284 | + 'removeAllItems' => esc_html__('Remove all items', 'wpdirectorykit'), | |
| 285 | + ), | |
| 286 | + ); | |
| 287 | + wp_localize_script('wdk-select2', 'wdk_select2_script_parameters', $params); | |
| 288 | + | |
| 250 | 289 | wp_add_inline_style( $this->plugin_name, $custom_css); |
| 251 | 290 | } |
| 252 | 291 | |
| 253 | 292 | |
| @@ -259,10 +298,10 @@ | ||
| 259 | 298 | if(isset($_POST['page']))$page = sanitize_text_field($_POST['page']); |
| 260 | 299 | if(isset($_POST['function']))$function = sanitize_text_field($_POST['function']); |
| 261 | 300 | |
| 262 | 301 | /* protect access only to ajax controller */ |
| 263 | - if($page != 'wdk_frontendajax') { | |
| 264 | - exit(esc_html__('Access denied','wdk-bookings')); | |
| 302 | + if($page != 'wdk_frontendajax' && $page != 'wdk_backendajax') { | |
| 303 | + exit(esc_html__('Access denied','wpdirectorykit')); | |
| 265 | 304 | } |
| 266 | 305 | |
| 267 | 306 | $WMVC = &wdk_get_instance(); |
| 268 | 307 | $WMVC->load_controller($page, $function, array()); |