PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
← All changes | elementor-elements/classes/wdk-listing-map.php +355 -12 1.2.7 → 1.5.9 View file →
@@ -170,9 +170,9 @@
170 170 if(Plugin::$instance->editor->is_edit_mode() || empty($wdk_listing_id)) {
171 171 $this->data['is_edit_mode']= true;
172 172 }
173 173
174 - echo $this->view('wdk-listing-map', $this->data);
174 + $this->view('wdk-listing-map', $this->data, true);
175 175 }
176 176
177 177 private function generate_controls_conf() {
178 178 if(true){
@@ -184,11 +184,61 @@
184 184 'tab' => '1',
185 185 ]
186 186 );
187 187
188 - $WMVC = &wdk_get_instance();
189 - $WMVC->model('field_m');
190 - $fields_data = $WMVC->field_m->get();
188 +
189 + $this->add_control(
190 + 'enable_router_suggest',
191 + [
192 + 'label' => esc_html__( 'Enable Router Suggestion', 'wpdirectorykit' ),
193 + 'type' => Controls_Manager::SWITCHER,
194 + 'none' => esc_html__( 'True', 'wpdirectorykit' ),
195 + 'block' => esc_html__( 'False', 'wpdirectorykit' ),
196 + 'render_type' => 'template',
197 + 'return_value' => 'yes',
198 + 'default' => '',
199 + ]
200 + );
201 +
202 + $this->add_control(
203 + 'text_suggestion_route_placeholder',
204 + [
205 + 'label' => __( 'Suggestion route placeholder', 'wpdirectorykit' ),
206 + 'type' => \Elementor\Controls_Manager::TEXT,
207 + 'rows' => 5,
208 + 'default' => __( 'Type your address', 'wpdirectorykit' ),
209 + 'conditions' => [
210 + 'terms' => [
211 + [
212 + 'name' => 'enable_router_suggest',
213 + 'operator' => '==',
214 + 'value' => 'yes',
215 + ]
216 + ],
217 + ],
218 + ]
219 + );
220 +
221 + $this->add_control(
222 + 'text_suggestion_route',
223 + [
224 + 'label' => __( 'Suggestion route button', 'wpdirectorykit' ),
225 + 'type' => \Elementor\Controls_Manager::TEXT,
226 + 'rows' => 5,
227 + 'default' => __( 'Suggest Route', 'wpdirectorykit' ),
228 + 'conditions' => [
229 + 'terms' => [
230 + [
231 + 'name' => 'enable_router_suggest',
232 + 'operator' => '==',
233 + 'value' => 'yes',
234 + ]
235 + ],
236 + ],
237 + ]
238 + );
239 +
240 + $fields_data = wdk_cached_field_get();
191 241 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
192 242 $order_i = 0;
193 243
194 244 $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
@@ -216,9 +266,9 @@
216 266 $this->add_control(
217 267 'field_id',
218 268 [
219 269 'label' => __( 'Marker position based on field with address (Detected gps by api)', 'wpdirectorykit' ),
220 - 'type' => \Elementor\Controls_Manager::SELECT,
270 + 'type' => \Elementor\Controls_Manager::SELECT2,
221 271 'default' => '',
222 272 'options' => $fields_list,
223 273 'separator' => 'after',
224 274 ]
@@ -315,9 +365,8 @@
315 365 ]
316 366 ]
317 367 );
318 368
319 -
320 369 $this->add_control(
321 370 'conf_custom_map_styles_h',
322 371 [
323 372 'label' => __( 'Map Styles', 'wpdirectorykit' ),
@@ -335,20 +384,133 @@
335 384 '' => esc_html__('Default', 'wpdirectorykit'),
336 385 'custom' => esc_html__('Custom', 'wpdirectorykit'),
337 386 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Light', 'wpdirectorykit'),
338 387 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png' => esc_html__('Osmde', 'wpdirectorykit'),
388 + 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png' => esc_html__('Osmde Fr', 'wpdirectorykit'),
389 + 'https://tile.openstreetmap.de/{z}/{x}/{y}.png' => esc_html__('Osmde De', 'wpdirectorykit'),
390 + 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' => esc_html__('Mapnik', 'wpdirectorykit'),
339 391 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png' => esc_html__('OpenTopoMap', 'wpdirectorykit'),
340 - 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' => esc_html__('OpenCycleMap', 'wpdirectorykit'),
341 392 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' => esc_html__('WorldImagery', 'wpdirectorykit'),
342 393 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png' => esc_html__('Carto DarkMatter', 'wpdirectorykit'),
343 394 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png' => esc_html__('Carto Voyager', 'wpdirectorykit'),
344 395 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png' => esc_html__('Maptiler dark (demo)', 'wpdirectorykit'),
396 + 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png' => esc_html__('Thunderforest MobileAtlas', 'wpdirectorykit'),
397 + 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' => esc_html__('Thunderforest OpenCycleMap', 'wpdirectorykit'),
398 + 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png' => esc_html__('Thunderforest TransportDark', 'wpdirectorykit'),
399 + 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png' => esc_html__('Thunderforest Landscape', 'wpdirectorykit'),
400 + 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png' => esc_html__('Thunderforest Outdoors', 'wpdirectorykit'),
401 + 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png' => esc_html__('Thunderforest Pioneer', 'wpdirectorykit'),
402 + 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png' => esc_html__('Thunderforest Neighbourhood', 'wpdirectorykit'),
403 + 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png' => esc_html__('CyclOSM', 'wpdirectorykit'),
404 + 'https://{s}.tile.jawg.io/jawg-terrain/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Streets', 'wpdirectorykit'),
405 + 'https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Sunny', 'wpdirectorykit'),
406 + 'https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Dark', 'wpdirectorykit'),
407 + 'https://{s}.tile.jawg.io/jawg-light/{z}/{x}/{y}{r}.png' => esc_html__('Jawg Light', 'wpdirectorykit'),
408 + 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}' => esc_html__('World Top oMap', 'wpdirectorykit'),
409 + 'google_map' => esc_html__('Google Map Layout', 'wpdirectorykit'),
345 410 ],
346 411 'default' => '',
347 412 ]
348 413 );
414 +
415 + $this->add_control(
416 + 'jawg_map_key',
417 + [
418 + 'label' => __( 'Jawg Map API Key', 'wpdirectorykit' ),
419 + /* translators: 1: URL. */
420 + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.jawg.io/en/pricing')
421 + /* translators: 1: URL. */
422 + .' '.wdk_sprintf(__( 'or check demo maps <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.jawg.io/en/maps'),
423 + 'type' => \Elementor\Controls_Manager::TEXT,
424 + 'default' => '',
425 + 'condition' => [
426 + 'conf_custom_map_style' => [
427 + 'https://{s}.tile.jawg.io/jawg-terrain/{z}/{x}/{y}{r}.png',
428 + 'https://{s}.tile.jawg.io/jawg-streets/{z}/{x}/{y}{r}.png',
429 + 'https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png',
430 + 'https://{s}.tile.jawg.io/jawg-light/{z}/{x}/{y}{r}.png',
431 + ],
432 + ],
433 + ]
434 + );
435 +
436 + $this->add_control(
437 + 'carto_map_key',
438 + [
439 + 'label' => __( 'Carto Map API Key', 'wpdirectorykit' ),
440 + /* translators: 1: URL. */
441 + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://carto.com/basemaps/apikey/'),
442 + 'type' => \Elementor\Controls_Manager::TEXT,
443 + 'default' => '',
444 + 'condition' => [
445 + 'conf_custom_map_style' => [
446 + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png',
447 + 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png',
448 + 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png',
449 + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png',
450 + ],
451 + ],
452 + ]
453 + );
454 +
455 + $this->add_control(
456 + 'thunderforest_map_key',
457 + [
458 + 'label' => __( 'Thunderforest Map API Key', 'wpdirectorykit' ),
459 + /* translators: 1: URL. */
460 + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.thunderforest.com/pricing/'),
461 + 'type' => \Elementor\Controls_Manager::TEXT,
462 + 'default' => '',
463 + 'condition' => [
464 + 'conf_custom_map_style' => [
465 + 'https://{s}.tile.thunderforest.com/mobile-atlas/{z}/{x}/{y}.png',
466 + 'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png',
467 + 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png',
468 + 'https://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png',
469 + 'https://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png',
470 + 'https://{s}.tile.thunderforest.com/pioneer/{z}/{x}/{y}.png',
471 + 'https://{s}.tile.thunderforest.com/neighbourhood/{z}/{x}/{y}.png',
472 + ],
473 + ],
474 + ]
475 + );
349 476
350 477 $this->add_control(
478 + 'google_map_key',
479 + [
480 + 'label' => __( 'Google Map API Key', 'wpdirectorykit' ),
481 + /* translators: 1: URL. */
482 + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://developers.google.com/maps/documentation/javascript/get-api-key'),
483 + 'type' => \Elementor\Controls_Manager::TEXT,
484 + 'default' => '',
485 + 'condition' => [
486 + 'conf_custom_map_style' => ['google_map'],
487 + ],
488 + ]
489 + );
490 +
491 + $this->add_control(
492 + 'google_map_default_type',
493 + [
494 + 'label' => __( 'Default Type', 'wpdirectorykit' ),
495 + 'type' => \Elementor\Controls_Manager::SELECT,
496 + 'default' => 'roadmap',
497 + 'options' => array(
498 + 'roadmap' => __( 'Roadmap', 'wpdirectorykit' ),
499 + 'aerial' => __( 'Aerial', 'wpdirectorykit' ),
500 + 'terrain' => __( 'Terrain', 'wpdirectorykit' ),
501 + 'hybrid' => __( 'Hybrid', 'wpdirectorykit' ),
502 + 'satellite' => __( 'Satellite', 'wpdirectorykit' ),
503 + 'traffic' => __( 'Traffic', 'wpdirectorykit' ),
504 + 'transit' => __( 'Transit', 'wpdirectorykit' ),
505 + ),
506 + 'condition' => [
507 + 'conf_custom_map_style' => ['google_map'],
508 + ],
509 + ]
510 + );
511 +
512 + $this->add_control(
351 513 'conf_custom_map_style_self',
352 514 [
353 515 'label' => esc_html__('Link to custom Map Style', 'wpdirectorykit'),
354 516 'description' => esc_html__( 'You can add some custom map by link example https://leaflet-extras.github.io/leaflet-providers/preview/ or create your custom style and put link for example on maps.cloudmade.com/editor', 'wpdirectorykit' ),
@@ -388,11 +550,9 @@
388 550 ]
389 551 ]
390 552 );
391 553
392 - $WMVC = &wdk_get_instance();
393 - $WMVC->model('field_m');
394 - $fields_data = $WMVC->field_m->get();
554 + $fields_data = wdk_cached_field_get();
395 555 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
396 556 $order_i = 0;
397 557
398 558 $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
@@ -420,9 +580,9 @@
420 580 $this->add_control(
421 581 'title_field_id',
422 582 [
423 583 'label' => __( 'Title Field', 'wpdirectorykit' ),
424 - 'type' => \Elementor\Controls_Manager::SELECT,
584 + 'type' => \Elementor\Controls_Manager::SELECT2,
425 585 'default' => '',
426 586 'options' => $fields_list,
427 587 ]
428 588 );
@@ -430,9 +590,9 @@
430 590 $this->add_control(
431 591 'content_field_id',
432 592 [
433 593 'label' => __( 'Content Field', 'wpdirectorykit' ),
434 - 'type' => \Elementor\Controls_Manager::SELECT,
594 + 'type' => \Elementor\Controls_Manager::SELECT2,
435 595 'default' => '',
436 596 'options' => $fields_list,
437 597 ]
438 598 );
@@ -593,8 +753,190 @@
593 753 $this->end_controls_tab();
594 754
595 755 $this->end_controls_tabs();
596 756 $this->end_controls_section();
757 +
758 + $this->start_controls_section(
759 + 'section_form_suggestion',
760 + [
761 + 'label' => __( 'Form Suggestion Route', 'wpdirectorykit' ),
762 + 'tab' => Controls_Manager::TAB_STYLE,
763 + 'conditions' => [
764 + 'terms' => [
765 + [
766 + 'name' => 'enable_router_suggest',
767 + 'operator' => '==',
768 + 'value' => 'yes',
769 + ]
770 + ],
771 + ],
772 + ]
773 + );
774 +
775 +
776 + $this->add_responsive_control (
777 + 'form_suggestion_style_align',
778 + [
779 + 'label' => __( 'Position', 'wpdirectorykit' ),
780 + 'type' => Controls_Manager::CHOOSE,
781 + 'options' => [
782 + 'left' => [
783 + 'title' => esc_html__( 'Left', 'wpdirectorykit' ),
784 + 'icon' => 'eicon-text-align-left',
785 + ],
786 + 'center' => [
787 + 'title' => esc_html__( 'Center', 'wpdirectorykit' ),
788 + 'icon' => 'eicon-text-align-center',
789 + ],
790 + 'right' => [
791 + 'title' => esc_html__( 'Right', 'wpdirectorykit' ),
792 + 'icon' => 'eicon-text-align-right',
793 + ],
794 + 'justify' => [
795 + 'title' => esc_html__( 'Default', 'wpdirectorykit' ),
796 + 'icon' => 'eicon-text-align-justify',
797 + ] ,
798 + ],
799 + 'render_type' => 'ui',
800 + 'selectors_dictionary' => [
801 + 'left' => 'flex-start',
802 + 'center' => 'center',
803 + 'right' => 'flex-end',
804 + 'justify' => 'space-between',
805 + ],
806 + 'selectors' => [
807 + '{{WRAPPER}} .route_suggestion' => 'justify-content:{{VALUE}};',
808 + ],
809 + ]
810 + );
811 +
812 + $this->add_responsive_control(
813 + 'form_suggestion_column_direct',
814 + [
815 + 'label' => __( 'Direction', 'wpdirectorykit' ),
816 + 'type' => Controls_Manager::SELECT,
817 + 'options' => [
818 + '' => esc_html__('Default', 'wpdirectorykit'),
819 + 'row' => esc_html__('Row', 'wpdirectorykit'),
820 + 'row-reverse' => esc_html__('Row reverse', 'wpdirectorykit'),
821 + 'column' => esc_html__('Column', 'wpdirectorykit'),
822 + 'column-reverse' => esc_html__('Column reverse', 'wpdirectorykit'),
823 + ],
824 + 'selectors' => [
825 + '{{WRAPPER}} .route_suggestion' => 'flex-direction: {{UNIT}}',
826 + ],
827 + 'separator' => 'before',
828 + ]
829 + );
830 +
831 + $this->add_responsive_control(
832 + 'form_suggestion_column_gap',
833 + [
834 + 'label' => esc_html__('Columns Gap', 'wpdirectorykit'),
835 + 'type' => Controls_Manager::SLIDER,
836 + 'default' => [
837 + 'size' => 10,
838 + ],
839 + 'range' => [
840 + 'px' => [
841 + 'min' => 0,
842 + 'max' => 60,
843 + ],
844 + ],
845 + 'selectors' => [
846 + '{{WRAPPER}} .route_suggestion > *' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;',
847 + '{{WRAPPER}} .route_suggestion' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};',
848 + ],
849 + ]
850 + );
851 +
852 + $this->add_responsive_control(
853 + 'form_suggestion_row_gap',
854 + [
855 + 'label' => esc_html__('Rows Gap', 'wpdirectorykit'),
856 + 'type' => Controls_Manager::SLIDER,
857 + 'default' => [
858 + 'size' => 10,
859 + ],
860 + 'range' => [
861 + 'px' => [
862 + 'min' => 0,
863 + 'max' => 60,
864 + ],
865 + ],
866 + 'selectors' => [
867 + '{{WRAPPER}} .route_suggestion > *' => 'margin-bottom: {{SIZE}}{{UNIT}};',
868 + '{{WRAPPER}} .route_suggestion ' => 'margin-bottom: -{{SIZE}}{{UNIT}};',
869 + ],
870 + ]
871 + );
872 +
873 +
874 + $this->add_responsive_control(
875 + 'form_suggestion_space_top',
876 + [
877 + 'label' => esc_html__('Space Top', 'wpdirectorykit'),
878 + 'type' => Controls_Manager::SLIDER,
879 + 'default' => [
880 + 'size' => 25,
881 + ],
882 + 'range' => [
883 + 'px' => [
884 + 'min' => 0,
885 + 'max' => 500,
886 + ],
887 + ],
888 + 'selectors' => [
889 + '{{WRAPPER}} .route_suggestion' => 'margin-top: {{SIZE}}{{UNIT}};',
890 + ],
891 + ]
892 + );
893 +
894 + $this->add_control(
895 + 'form_suggestion_header_1',
896 + [
897 + 'label' => __( 'Input', 'wpdirectorykit' ),
898 + 'type' => Controls_Manager::HEADING,
899 + ]
900 + );
901 +
902 + $selectors = array(
903 + 'normal' => '{{WRAPPER}} .route_suggestion .input_text',
904 + );
905 +
906 + $this->generate_renders_tabs($selectors, 'form_suggestion_input_dynamic', ['typo','color','background','border','border_radius','padding','shadow','transition', 'height', 'width']);
907 +
908 +
909 + $this->add_control(
910 + 'form_suggestion_header_2',
911 + [
912 + 'label' => __( 'Placeholder', 'wpdirectorykit' ),
913 + 'type' => Controls_Manager::HEADING,
914 + ]
915 + );
916 +
917 + $selectors = array(
918 + 'normal' => '{{WRAPPER}} .route_suggestion .input_text::placeholder',
919 + );
920 +
921 + $this->generate_renders_tabs($selectors, 'form_suggestion_input_pl_dynamic', ['align','typo','color']);
922 +
923 + $this->add_control(
924 + 'form_suggestion_header_3',
925 + [
926 + 'label' => __( 'Submit Button', 'wpdirectorykit' ),
927 + 'type' => Controls_Manager::HEADING,
928 + ]
929 + );
930 +
931 + $selectors = array(
932 + 'normal' => '{{WRAPPER}} .route_suggestion .wdk-btn',
933 + 'hover' => '{{WRAPPER}} .route_suggestion .wdk-btn%1$s',
934 + );
935 +
936 + $this->generate_renders_tabs($selectors, 'form_suggestion_btn_dynamic', ['typo', 'color', 'border', 'border_radius', 'shadow', 'transition', 'background_group','padding']);
937 +
938 + $this->end_controls_section();
597 939 }
598 940
599 941 private function generate_controls_content() {
600 942 }
@@ -623,6 +965,7 @@
623 965 wp_enqueue_style('slick');
624 966 wp_enqueue_style('slick-theme');
625 967 wp_enqueue_style('wdk-hover');
626 968 wp_enqueue_script('slick');
969 + wp_enqueue_script('leaflet-googlemutant');
627 970 }
628 971 }