| @@ -167,9 +167,9 @@ | ||
| 167 | 167 | $this->data['is_edit_mode']= false; |
| 168 | 168 | if(Plugin::$instance->editor->is_edit_mode()) |
| 169 | 169 | $this->data['is_edit_mode']= true; |
| 170 | 170 | |
| 171 | - echo $this->view('wdk-map', $this->data); | |
| 171 | + $this->view('wdk-map', $this->data, true); | |
| 172 | 172 | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | private function generate_controls_conf() { |
| @@ -180,8 +180,47 @@ | ||
| 180 | 180 | 'tab' => '1', |
| 181 | 181 | ] |
| 182 | 182 | ); |
| 183 | 183 | |
| 184 | + if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout')){ | |
| 185 | + $this->add_control( | |
| 186 | + 'is_custom_layout_enable', | |
| 187 | + [ | |
| 188 | + 'label' => __( 'Enable Custom Layout', 'wpdirectorykit' ), | |
| 189 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 190 | + 'label_on' => __( 'True', 'wpdirectorykit' ), | |
| 191 | + 'label_off' => __( 'False', 'wpdirectorykit' ), | |
| 192 | + 'return_value' => 'yes', | |
| 193 | + 'default' => '', | |
| 194 | + | |
| 195 | + ] | |
| 196 | + ); | |
| 197 | + $this->add_control( | |
| 198 | + 'custom_layout_id', | |
| 199 | + [ | |
| 200 | + 'label' => __( 'Layout Template id', 'wpdirectorykit' ), | |
| 201 | + 'type' => \Elementor\Controls_Manager::TEXT, | |
| 202 | + 'default' => '', | |
| 203 | + 'placeholder' => __( 'put your template id', 'wpdirectorykit' ), | |
| 204 | + 'description' => __( 'Create layout here', 'wpdirectorykit' ) . ' ' . wdk_sprintf( | |
| 205 | + /* translators: 1: Tag with link open, 2: close link tag. */ | |
| 206 | + __('%1$s here %2$s', 'wpdirectorykit'), | |
| 207 | + '<a target="_blank" href="' . esc_urL(admin_url('edit.php?post_type=elementor_library#add_new')) . '">', | |
| 208 | + '</a>' | |
| 209 | + ), | |
| 210 | + 'conditions' => [ | |
| 211 | + 'terms' => [ | |
| 212 | + [ | |
| 213 | + 'name' => 'is_custom_layout_enable', | |
| 214 | + 'operator' => '==', | |
| 215 | + 'value' => 'yes', | |
| 216 | + ] | |
| 217 | + ], | |
| 218 | + ], | |
| 219 | + ] | |
| 220 | + ); | |
| 221 | + } | |
| 222 | + | |
| 184 | 223 | if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')){ |
| 185 | 224 | $this->add_control( |
| 186 | 225 | 'is_ajax_enable', |
| 187 | 226 | [ |
| @@ -216,13 +255,52 @@ | ||
| 216 | 255 | 'block' => esc_html__( 'False', 'wpdirectorykit' ), |
| 217 | 256 | 'render_type' => 'template', |
| 218 | 257 | 'return_value' => 'yes', |
| 219 | 258 | 'default' => '', |
| 220 | - 'separator' => 'after', | |
| 221 | 259 | ] |
| 222 | 260 | ); |
| 223 | 261 | |
| 224 | 262 | $this->add_control( |
| 263 | + 'enable_rectangle_auto_search', | |
| 264 | + [ | |
| 265 | + 'label' => esc_html__( 'Recangle auto search', 'wpdirectorykit' ), | |
| 266 | + 'type' => Controls_Manager::SWITCHER, | |
| 267 | + 'none' => esc_html__( 'True', 'wpdirectorykit' ), | |
| 268 | + 'block' => esc_html__( 'False', 'wpdirectorykit' ), | |
| 269 | + 'render_type' => 'template', | |
| 270 | + 'return_value' => 'yes', | |
| 271 | + 'default' => 'yes', | |
| 272 | + ] | |
| 273 | + ); | |
| 274 | + | |
| 275 | + $this->add_control( | |
| 276 | + 'disable_rectangle', | |
| 277 | + [ | |
| 278 | + 'label' => esc_html__( 'Disable Rectangle Search', 'wpdirectorykit' ), | |
| 279 | + 'type' => Controls_Manager::SWITCHER, | |
| 280 | + 'none' => esc_html__( 'True', 'wpdirectorykit' ), | |
| 281 | + 'block' => esc_html__( 'False', 'wpdirectorykit' ), | |
| 282 | + 'render_type' => 'template', | |
| 283 | + 'return_value' => 'yes', | |
| 284 | + 'default' => '', | |
| 285 | + ] | |
| 286 | + ); | |
| 287 | + | |
| 288 | + $this->add_control( | |
| 289 | + 'enable_scrollWheelZoom', | |
| 290 | + [ | |
| 291 | + 'label' => esc_html__( 'Enable scrollWheelZoom', 'wpdirectorykit' ), | |
| 292 | + 'type' => Controls_Manager::SWITCHER, | |
| 293 | + 'none' => esc_html__( 'True', 'wpdirectorykit' ), | |
| 294 | + 'block' => esc_html__( 'False', 'wpdirectorykit' ), | |
| 295 | + 'render_type' => 'template', | |
| 296 | + 'return_value' => 'yes', | |
| 297 | + 'default' => '', | |
| 298 | + 'separator' => 'after', | |
| 299 | + ] | |
| 300 | + ); | |
| 301 | + | |
| 302 | + $this->add_control( | |
| 225 | 303 | 'conf_limit', |
| 226 | 304 | [ |
| 227 | 305 | 'label' => __( 'Limit Results', 'wpdirectorykit' ), |
| 228 | 306 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| @@ -292,44 +370,8 @@ | ||
| 292 | 370 | 'default' => 'desc', |
| 293 | 371 | ] |
| 294 | 372 | ); |
| 295 | 373 | |
| 296 | - | |
| 297 | - $fields_data = wdk_cached_field_get(); | |
| 298 | - $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); | |
| 299 | - $order_i = 0; | |
| 300 | - | |
| 301 | - $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit'); | |
| 302 | - $fields_list [(++$order_i).'__first_image'] = esc_html__('First Image', 'wpdirectorykit'); | |
| 303 | - $fields_list [(++$order_i).'__counter_views'] = esc_html__('Views counter', 'wpdirectorykit'); | |
| 304 | - $fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit'); | |
| 305 | - | |
| 306 | - $fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit'); | |
| 307 | - $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit'); | |
| 308 | - $fields_list [(++$order_i).'__category_title'] = esc_html__('Category', 'wpdirectorykit'); | |
| 309 | - $fields_list [(++$order_i).'__location_title'] = esc_html__('Location', 'wpdirectorykit'); | |
| 310 | - | |
| 311 | - foreach($fields_data as $field) | |
| 312 | - { | |
| 313 | - if(wmvc_show_data('field_type', $field) == 'SECTION') { | |
| 314 | - $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --'; | |
| 315 | - } else { | |
| 316 | - $fields_list[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']'; | |
| 317 | - } | |
| 318 | - } | |
| 319 | - | |
| 320 | - $this->add_control( | |
| 321 | - 'custom_marker_fields', | |
| 322 | - [ | |
| 323 | - 'label' => __('Show field value instead of marker on map', 'wpdirectorykit'), | |
| 324 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 325 | - 'default' => '', | |
| 326 | - 'label_block' => true, | |
| 327 | - 'options' => $fields_list, | |
| 328 | - 'separator' => 'after', | |
| 329 | - ] | |
| 330 | - ); | |
| 331 | - | |
| 332 | 374 | } |
| 333 | 375 | |
| 334 | 376 | $this->end_controls_section(); |
| 335 | 377 | |
| @@ -460,9 +502,11 @@ | ||
| 460 | 502 | $this->add_control( |
| 461 | 503 | 'jawg_map_key', |
| 462 | 504 | [ |
| 463 | 505 | 'label' => __( 'Jawg Map API Key', 'wpdirectorykit' ), |
| 506 | + /* translators: 1: URL. */ | |
| 464 | 507 | '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') |
| 508 | + /* translators: 1: URL. */ | |
| 465 | 509 | .' '.wdk_sprintf(__( 'or check demo maps <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.jawg.io/en/maps'), |
| 466 | 510 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 467 | 511 | 'default' => '', |
| 468 | 512 | 'condition' => [ |
| @@ -476,11 +520,31 @@ | ||
| 476 | 520 | ] |
| 477 | 521 | ); |
| 478 | 522 | |
| 479 | 523 | $this->add_control( |
| 524 | + 'carto_map_key', | |
| 525 | + [ | |
| 526 | + 'label' => __( 'Carto Map API Key', 'wpdirectorykit' ), | |
| 527 | + /* translators: 1: URL. */ | |
| 528 | + 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://carto.com/basemaps/apikey/'), | |
| 529 | + 'type' => \Elementor\Controls_Manager::TEXT, | |
| 530 | + 'default' => '', | |
| 531 | + 'condition' => [ | |
| 532 | + 'conf_custom_map_style' => [ | |
| 533 | + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png', | |
| 534 | + 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', | |
| 535 | + 'https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png', | |
| 536 | + 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}{r}.png', | |
| 537 | + ], | |
| 538 | + ], | |
| 539 | + ] | |
| 540 | + ); | |
| 541 | + | |
| 542 | + $this->add_control( | |
| 480 | 543 | 'thunderforest_map_key', |
| 481 | 544 | [ |
| 482 | 545 | 'label' => __( 'Thunderforest Map API Key', 'wpdirectorykit' ), |
| 546 | + /* translators: 1: URL. */ | |
| 483 | 547 | 'description' => wdk_sprintf(__( 'Please follow link and get API key <a href="%1$s" target="_blank"> here </a>', 'wpdirectorykit' ), 'https://www.thunderforest.com/pricing/'), |
| 484 | 548 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 485 | 549 | 'default' => '', |
| 486 | 550 | 'condition' => [ |
| @@ -500,8 +564,9 @@ | ||
| 500 | 564 | $this->add_control( |
| 501 | 565 | 'google_map_key', |
| 502 | 566 | [ |
| 503 | 567 | 'label' => __( 'Google Map API Key', 'wpdirectorykit' ), |
| 568 | + /* translators: 1: URL. */ | |
| 504 | 569 | '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'), |
| 505 | 570 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 506 | 571 | 'default' => '', |
| 507 | 572 | 'condition' => [ |
| @@ -688,8 +753,43 @@ | ||
| 688 | 753 | 'label' => esc_html__('Marker', 'wpdirectorykit'), |
| 689 | 754 | 'type' => Controls_Manager::HEADING, |
| 690 | 755 | 'separator' => 'before', |
| 691 | 756 | ] |
| 757 | + ); | |
| 758 | + | |
| 759 | + $fields_data = wdk_cached_field_get(); | |
| 760 | + $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); | |
| 761 | + $order_i = 0; | |
| 762 | + | |
| 763 | + $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit'); | |
| 764 | + $fields_list [(++$order_i).'__first_image'] = esc_html__('First Image', 'wpdirectorykit'); | |
| 765 | + $fields_list [(++$order_i).'__counter_views'] = esc_html__('Views counter', 'wpdirectorykit'); | |
| 766 | + $fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit'); | |
| 767 | + | |
| 768 | + $fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit'); | |
| 769 | + $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit'); | |
| 770 | + $fields_list [(++$order_i).'__category_title'] = esc_html__('Category', 'wpdirectorykit'); | |
| 771 | + $fields_list [(++$order_i).'__location_title'] = esc_html__('Location', 'wpdirectorykit'); | |
| 772 | + | |
| 773 | + foreach($fields_data as $field) | |
| 774 | + { | |
| 775 | + if(wmvc_show_data('field_type', $field) == 'SECTION') { | |
| 776 | + $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --'; | |
| 777 | + } else { | |
| 778 | + $fields_list[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']'; | |
| 779 | + } | |
| 780 | + } | |
| 781 | + | |
| 782 | + $this->add_control( | |
| 783 | + 'custom_marker_fields', | |
| 784 | + [ | |
| 785 | + 'label' => __('Show field value instead of marker on map', 'wpdirectorykit'), | |
| 786 | + 'type' => \Elementor\Controls_Manager::SELECT2, | |
| 787 | + 'default' => '', | |
| 788 | + 'label_block' => true, | |
| 789 | + 'options' => $fields_list, | |
| 790 | + 'separator' => 'after', | |
| 791 | + ] | |
| 692 | 792 | ); |
| 693 | 793 | |
| 694 | 794 | $this->start_controls_tabs('marker_button_style'); |
| 695 | 795 | |