| @@ -29,8 +29,9 @@ | ||
| 29 | 29 | \Elementor\Controls_Manager::add_tab( |
| 30 | 30 | 'tab_conf', |
| 31 | 31 | esc_html__('Settings', 'wpdirectorykit') |
| 32 | 32 | ); |
| 33 | + | |
| 33 | 34 | |
| 34 | 35 | \Elementor\Controls_Manager::add_tab( |
| 35 | 36 | 'tab_layout', |
| 36 | 37 | esc_html__('Layout', 'wpdirectorykit') |
| @@ -120,11 +121,11 @@ | ||
| 120 | 121 | $this->data['id_element'] = $this->get_id(); |
| 121 | 122 | $this->data['settings'] = $this->get_settings(); |
| 122 | 123 | $this->data['counts'] = array(); |
| 123 | 124 | |
| 124 | - wp_enqueue_script('select2'); | |
| 125 | + wp_enqueue_script('select2-select2'); | |
| 125 | 126 | wp_enqueue_script('wdk-select2'); |
| 126 | - wp_enqueue_style('select2'); | |
| 127 | + wp_enqueue_style('select2-select2'); | |
| 127 | 128 | global $wdk_visible_filters_limit; |
| 128 | 129 | global $wdk_enable_search_fields_toggle; |
| 129 | 130 | |
| 130 | 131 | global $wdk_search_fields_toggle_reset; |
| @@ -129,10 +130,12 @@ | ||
| 129 | 130 | |
| 130 | 131 | global $wdk_search_fields_toggle_reset; |
| 131 | 132 | $wdk_search_fields_toggle_reset = true; |
| 132 | 133 | |
| 133 | - if($this->data['settings']['section_config_more']) | |
| 134 | - $wdk_enable_search_fields_toggle = true; | |
| 134 | + if(isset($this->data['settings']['section_config_more'])){ | |
| 135 | + if($this->data['settings']['section_config_more']) | |
| 136 | + $wdk_enable_search_fields_toggle = true; | |
| 137 | + } | |
| 135 | 138 | |
| 136 | 139 | if(!empty($this->data['settings']['section_config_more_limit'])) { |
| 137 | 140 | $wdk_visible_filters_limit = $this->data['settings']['section_config_more_limit'] + 1; |
| 138 | 141 | } else { |
| @@ -137,8 +140,9 @@ | ||
| 137 | 140 | $wdk_visible_filters_limit = $this->data['settings']['section_config_more_limit'] + 1; |
| 138 | 141 | } else { |
| 139 | 142 | $wdk_visible_filters_limit = 0; |
| 140 | 143 | } |
| 144 | + | |
| 141 | 145 | $this->data['tab_field'] = NULL; |
| 142 | 146 | |
| 143 | 147 | if(!empty($this->data['settings']['tab_field'])) { |
| 144 | 148 | $this->data['tab_field'] = substr($this->data['settings']['tab_field'], strpos($this->data['settings']['tab_field'],'__')+2); |
| @@ -149,15 +153,25 @@ | ||
| 149 | 153 | parse_str($qr_string, $string_par); |
| 150 | 154 | $this->data['predefields_query'] = array_map('trim', $string_par); |
| 151 | 155 | |
| 152 | 156 | if(!empty($this->data['settings']['custom_category_root'])) { |
| 153 | - $this->data['predefields_query']['custom_category_root'] = | |
| 154 | - substr($this->data['settings']['custom_category_root'], strpos($this->data['settings']['custom_category_root'],'__')+2); | |
| 157 | + | |
| 158 | + if(!empty($this->data['settings']['field_id']) && strpos($this->data['settings']['field_id'],'__') !== FALSE){ | |
| 159 | + $this->data['settings']['custom_category_root'] = substr($this->data['settings']['custom_category_root'], strpos($this->data['settings']['custom_category_root'],'__')+2); | |
| 160 | + } | |
| 161 | + if(is_intval($this->data['settings']['custom_category_root'])) { | |
| 162 | + $this->data['predefields_query']['custom_category_root'] = $this->data['settings']['custom_category_root']; | |
| 163 | + } | |
| 155 | 164 | } |
| 156 | 165 | |
| 157 | 166 | if(!empty($this->data['settings']['custom_location_root'])) { |
| 158 | - $this->data['predefields_query']['custom_location_root'] = | |
| 159 | - substr($this->data['settings']['custom_location_root'], strpos($this->data['settings']['custom_location_root'],'__')+2); | |
| 167 | + if(strpos($this->data['settings']['field_id'],'__') !== FALSE){ | |
| 168 | + $this->data['settings']['custom_location_root'] = substr($this->data['settings']['custom_location_root'], strpos($this->data['settings']['custom_location_root'],'__')+2); | |
| 169 | + } | |
| 170 | + | |
| 171 | + if(is_intval($this->data['settings']['custom_location_root'])) { | |
| 172 | + $this->data['predefields_query']['custom_location_root'] = $this->data['settings']['custom_location_root']; | |
| 173 | + } | |
| 160 | 174 | } |
| 161 | 175 | |
| 162 | 176 | $this->data['is_edit_mode'] = false; |
| 163 | 177 | if(Plugin::$instance->editor->is_edit_mode()) { |
| @@ -182,9 +196,9 @@ | ||
| 182 | 196 | } |
| 183 | 197 | } |
| 184 | 198 | |
| 185 | 199 | |
| 186 | - echo $this->view('wdk-search', $this->data); | |
| 200 | + $this->view('wdk-search', $this->data, true); | |
| 187 | 201 | } |
| 188 | 202 | |
| 189 | 203 | |
| 190 | 204 | private function generate_controls_conf() { |
| @@ -193,8 +207,23 @@ | ||
| 193 | 207 | [ |
| 194 | 208 | 'label' => __( 'Configuration', 'wpdirectorykit' ), |
| 195 | 209 | ] |
| 196 | 210 | ); |
| 211 | + | |
| 212 | + if(wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')){ | |
| 213 | + $this->add_control( | |
| 214 | + 'is_ajax_enable', | |
| 215 | + [ | |
| 216 | + 'label' => __( 'Enable Reload content with ajax', 'wpdirectorykit' ), | |
| 217 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 218 | + 'label_on' => __( 'True', 'wpdirectorykit' ), | |
| 219 | + 'label_off' => __( 'False', 'wpdirectorykit' ), | |
| 220 | + 'return_value' => 'yes', | |
| 221 | + 'default' => '', | |
| 222 | + | |
| 223 | + ] | |
| 224 | + ); | |
| 225 | + } | |
| 197 | 226 | |
| 198 | 227 | $this->add_control( |
| 199 | 228 | 'auto_search_enable', |
| 200 | 229 | [ |
| @@ -206,9 +235,22 @@ | ||
| 206 | 235 | 'default' => '', |
| 207 | 236 | ] |
| 208 | 237 | ); |
| 209 | 238 | |
| 239 | + | |
| 210 | 240 | $this->add_control( |
| 241 | + 'ai_search_enable', | |
| 242 | + [ | |
| 243 | + 'label' => __( 'AI Search Enable', 'wpdirectorykit' ), | |
| 244 | + 'type' => Controls_Manager::SWITCHER, | |
| 245 | + 'label_on' => __( 'Show', 'wpdirectorykit' ), | |
| 246 | + 'label_off' => __( 'Hide', 'wpdirectorykit' ), | |
| 247 | + 'return_value' => 'yes', | |
| 248 | + 'default' => '', | |
| 249 | + ] | |
| 250 | + ); | |
| 251 | + | |
| 252 | + $this->add_control( | |
| 211 | 253 | 'section_config_more', |
| 212 | 254 | [ |
| 213 | 255 | 'label' => __( 'Field more hide', 'wpdirectorykit' ), |
| 214 | 256 | 'type' => Controls_Manager::SWITCHER, |
| @@ -220,8 +262,20 @@ | ||
| 220 | 262 | '{{WRAPPER}} .wdk-field-group-additional' => 'display: {{VALUE}};', |
| 221 | 263 | ], |
| 222 | 264 | ] |
| 223 | 265 | ); |
| 266 | + | |
| 267 | + $this->add_control( | |
| 268 | + 'section_more_before_buttons', | |
| 269 | + [ | |
| 270 | + 'label' => __( 'Show Additional Fields Before Search Buttons', 'wpdirectorykit' ), | |
| 271 | + 'type' => Controls_Manager::SWITCHER, | |
| 272 | + 'label_on' => __( 'Yes', 'wpdirectorykit' ), | |
| 273 | + 'label_off' => __( 'None', 'wpdirectorykit' ), | |
| 274 | + 'return_value' => 'yes', | |
| 275 | + 'default' => '', | |
| 276 | + ] | |
| 277 | + ); | |
| 224 | 278 | |
| 225 | 279 | $this->add_control( |
| 226 | 280 | 'section_config_more_limit', |
| 227 | 281 | [ |
| @@ -242,9 +296,9 @@ | ||
| 242 | 296 | $this->add_control( |
| 243 | 297 | 'conf_link', |
| 244 | 298 | [ |
| 245 | 299 | 'label' => __( 'Open results on page', 'wpdirectorykit' ), |
| 246 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 300 | + 'type' => \Elementor\Controls_Manager::SELECT2, | |
| 247 | 301 | 'default' => '', |
| 248 | 302 | 'options' => $pages |
| 249 | 303 | ] |
| 250 | 304 | ); |
| @@ -278,9 +332,9 @@ | ||
| 278 | 332 | |
| 279 | 333 | $this->add_control( |
| 280 | 334 | 'field_button_icon', |
| 281 | 335 | [ |
| 282 | - 'label' => __( 'Icon', 'text-domain' ), | |
| 336 | + 'label' => __( 'Icon', 'wpdirectorykit' ), | |
| 283 | 337 | 'type' => Controls_Manager::ICONS, |
| 284 | 338 | ] |
| 285 | 339 | ); |
| 286 | 340 | |
| @@ -286,13 +340,13 @@ | ||
| 286 | 340 | |
| 287 | 341 | $this->add_control( |
| 288 | 342 | 'field_button_icon_position', |
| 289 | 343 | [ |
| 290 | - 'label' => esc_html__('icon Position', 'wdk-compare-listing'), | |
| 344 | + 'label' => esc_html__('icon Position', 'wpdirectorykit'), | |
| 291 | 345 | 'type' => Controls_Manager::SELECT, |
| 292 | 346 | 'options' => [ |
| 293 | - 'left' => esc_html__('Left', 'wdk-compare-listing'), | |
| 294 | - 'right' => esc_html__('Right', 'wdk-compare-listing'), | |
| 347 | + 'left' => esc_html__('Left', 'wpdirectorykit'), | |
| 348 | + 'right' => esc_html__('Right', 'wpdirectorykit'), | |
| 295 | 349 | ], |
| 296 | 350 | 'default' => 'left', |
| 297 | 351 | ] |
| 298 | 352 | ); |
| @@ -320,16 +374,27 @@ | ||
| 320 | 374 | $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); |
| 321 | 375 | $order_i = 0; |
| 322 | 376 | foreach($fields as $field) |
| 323 | 377 | { |
| 324 | - $fields_list[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field); | |
| 378 | + $fields_list[wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field); | |
| 325 | 379 | } |
| 380 | + | |
| 381 | + // build raw_options preserving order | |
| 382 | + $raw = []; | |
| 383 | + foreach ( $fields_list as $k => $v ) { | |
| 384 | + $raw[] = [ | |
| 385 | + 'value' => (string) $k, | |
| 386 | + 'label' => $v, | |
| 387 | + ]; | |
| 388 | + } | |
| 389 | + | |
| 326 | 390 | $this->add_control( |
| 327 | 391 | 'tab_field', |
| 328 | 392 | [ |
| 329 | 393 | 'label' => __( 'Tab', 'wpdirectorykit' ), |
| 330 | - 'type' => Controls_Manager::SELECT, | |
| 394 | + 'type' => \Wdk\Includes\Controls\Wdk_Field_Selector::INIT, | |
| 331 | 395 | 'options' => $fields_list, |
| 396 | + 'raw_options' => $raw, | |
| 332 | 397 | 'default' => 'results', |
| 333 | 398 | ] |
| 334 | 399 | ); |
| 335 | 400 | |
| @@ -349,8 +414,9 @@ | ||
| 349 | 414 | 'important_note', |
| 350 | 415 | [ |
| 351 | 416 | 'label' => '', |
| 352 | 417 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 418 | + /* translators: 1: URL. */ | |
| 353 | 419 | 'raw' => wdk_sprintf(__( 'Manage Search Form <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_searchform')), |
| 354 | 420 | 'content_classes' => 'wdk_elementor_hint', |
| 355 | 421 | 'separator' => 'after', |
| 356 | 422 | ] |
| @@ -374,39 +440,36 @@ | ||
| 374 | 440 | $WMVC->model('category_m'); |
| 375 | 441 | $WMVC->model('location_m'); |
| 376 | 442 | $categories_data = $WMVC->category_m->get_by(array('(parent_id = 0 OR parent_id IS NULL)' => NULL)); |
| 377 | 443 | $categories_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); |
| 378 | - $order_i = 0; | |
| 379 | - | |
| 380 | 444 | foreach($categories_data as $category) |
| 381 | 445 | { |
| 382 | - $categories_list[(++$order_i).'__'.wmvc_show_data('idcategory', $category)] = '#'.wmvc_show_data('idcategory', $category).' '.wmvc_show_data('category_title', $category); | |
| 446 | + $categories_list[wmvc_show_data('idcategory', $category)] = '#'.wmvc_show_data('idcategory', $category).' '.wmvc_show_data('category_title', $category); | |
| 383 | 447 | } |
| 448 | + | |
| 384 | 449 | $this->add_control( |
| 385 | 450 | 'custom_category_root', |
| 386 | 451 | [ |
| 387 | 452 | 'label' => __( 'Custom Category Root', 'wpdirectorykit' ), |
| 388 | - 'type' => Controls_Manager::SELECT, | |
| 453 | + 'type' => Controls_Manager::SELECT2, | |
| 389 | 454 | 'options' => $categories_list, |
| 390 | - 'default' => 'results', | |
| 455 | + 'default' => '', | |
| 391 | 456 | ] |
| 392 | 457 | ); |
| 393 | 458 | |
| 394 | 459 | $locations_data = $WMVC->location_m->get_by(array('(parent_id = 0 OR parent_id IS NULL)' => NULL)); |
| 395 | 460 | $locations_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); |
| 396 | - $order_i = 0; | |
| 397 | - | |
| 398 | 461 | foreach($locations_data as $location) |
| 399 | 462 | { |
| 400 | - $locations_list[(++$order_i).'__'.wmvc_show_data('idlocation', $location)] = '#'.wmvc_show_data('idlocation', $location).' '.wmvc_show_data('location_title', $location); | |
| 463 | + $locations_list[wmvc_show_data('idlocation', $location)] = '#'.wmvc_show_data('idlocation', $location).' '.wmvc_show_data('location_title', $location); | |
| 401 | 464 | } |
| 402 | 465 | $this->add_control( |
| 403 | 466 | 'custom_location_root', |
| 404 | 467 | [ |
| 405 | 468 | 'label' => __( 'Custom Location Root', 'wpdirectorykit' ), |
| 406 | - 'type' => Controls_Manager::SELECT, | |
| 469 | + 'type' => Controls_Manager::SELECT2, | |
| 407 | 470 | 'options' => $locations_list, |
| 408 | - 'default' => 'results', | |
| 471 | + 'default' => '', | |
| 409 | 472 | ] |
| 410 | 473 | ); |
| 411 | 474 | |
| 412 | 475 | |
| @@ -424,24 +487,26 @@ | ||
| 424 | 487 | ); |
| 425 | 488 | |
| 426 | 489 | $fields_data = wdk_cached_field_get(); |
| 427 | 490 | $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); |
| 428 | - $order_i = 0; | |
| 429 | 491 | $fields_allow_types = array(); |
| 430 | 492 | $fields_allow_tree_types = array(); |
| 431 | 493 | |
| 432 | - $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit'); | |
| 433 | - $fields_list [(++$order_i).'__search'] = esc_html__('Smart Search', 'wpdirectorykit'); | |
| 494 | + $fields_list ['section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit'); | |
| 495 | + $fields_list ['search'] = esc_html__('Smart Search', 'wpdirectorykit'); | |
| 434 | 496 | |
| 435 | - if(function_exists('run_wdk_bookings')) | |
| 436 | - $fields_list [(++$order_i).'__booking_date'] = esc_html__('Booking Date', 'wpdirectorykit'); | |
| 497 | + if(function_exists('run_wdk_bookings')) { | |
| 498 | + $fields_list ['booking_date'] = esc_html__('Booking Date', 'wpdirectorykit'); | |
| 499 | + $fields_list ['booking_guest'] = esc_html__('Booking Guests', 'wpdirectorykit'); | |
| 500 | + } | |
| 437 | 501 | |
| 438 | - $fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit'); | |
| 439 | - $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit'); | |
| 440 | - $fields_list [(++$order_i).'__category_id'] = esc_html__('Category', 'wpdirectorykit'); | |
| 441 | - $fields_allow_tree_types[] = $order_i.'__category_id'; | |
| 442 | - $fields_list [(++$order_i).'__location_id'] = esc_html__('Location', 'wpdirectorykit'); | |
| 443 | - $fields_allow_tree_types[] = $order_i.'__location_id'; | |
| 502 | + $fields_list ['post_title'] = esc_html__('WP Title', 'wpdirectorykit'); | |
| 503 | + $fields_list ['post_title'] = esc_html__('WP Title', 'wpdirectorykit'); | |
| 504 | + $fields_list ['address'] = esc_html__('Address', 'wpdirectorykit'); | |
| 505 | + $fields_list ['category_id'] = esc_html__('Category', 'wpdirectorykit'); | |
| 506 | + $fields_allow_tree_types[] = 'category_id'; | |
| 507 | + $fields_list ['location_id'] = esc_html__('Location', 'wpdirectorykit'); | |
| 508 | + $fields_allow_tree_types[] = 'location_id'; | |
| 444 | 509 | |
| 445 | 510 | foreach($fields_data as $field) |
| 446 | 511 | { |
| 447 | 512 | if(in_array(wmvc_show_data('field_type', $field),array('TEXTAREA','TEXTAREA_WYSIWYG'))) { |
| @@ -446,18 +511,27 @@ | ||
| 446 | 511 | { |
| 447 | 512 | if(in_array(wmvc_show_data('field_type', $field),array('TEXTAREA','TEXTAREA_WYSIWYG'))) { |
| 448 | 513 | continue; |
| 449 | 514 | } else if(in_array(wmvc_show_data('field_type', $field),array('SECTION'))) { |
| 450 | - $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --'; | |
| 515 | + $fields_list ['section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --'; | |
| 451 | 516 | } else { |
| 452 | - $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).']'; | |
| 517 | + $fields_list[wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']'; | |
| 453 | 518 | } |
| 454 | 519 | |
| 455 | 520 | if(wmvc_show_data('field_type', $field) == 'NUMBER') { |
| 456 | - $fields_allow_types[] = $order_i.'__'.wmvc_show_data('idfield', $field); | |
| 521 | + $fields_allow_types[] = ''.wmvc_show_data('idfield', $field); | |
| 457 | 522 | } |
| 458 | 523 | } |
| 459 | 524 | |
| 525 | + // build raw_options preserving order | |
| 526 | + $raw = []; | |
| 527 | + foreach ( $fields_list as $k => $v ) { | |
| 528 | + $raw[] = [ | |
| 529 | + 'value' => (string) $k, | |
| 530 | + 'label' => $v, | |
| 531 | + ]; | |
| 532 | + } | |
| 533 | + | |
| 460 | 534 | $repeater = new Repeater(); |
| 461 | 535 | $repeater->start_controls_tabs( 'custom_fields_repeat' ); |
| 462 | 536 | |
| 463 | 537 | $repeater->add_control( |
| @@ -463,11 +537,12 @@ | ||
| 463 | 537 | $repeater->add_control( |
| 464 | 538 | 'field_id', |
| 465 | 539 | [ |
| 466 | 540 | 'label' => __( 'Field id', 'wpdirectorykit' ), |
| 467 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 541 | + 'type' => \Wdk\Includes\Controls\Wdk_Field_Selector::INIT, | |
| 468 | 542 | 'default' => '', |
| 469 | 543 | 'options' => $fields_list, |
| 544 | + 'raw_options' => $raw, | |
| 470 | 545 | 'separator' => 'after', |
| 471 | 546 | ] |
| 472 | 547 | ); |
| 473 | 548 | |
| @@ -646,9 +721,42 @@ | ||
| 646 | 721 | 'default' => 'results', |
| 647 | 722 | ] |
| 648 | 723 | ); |
| 649 | 724 | |
| 725 | + | |
| 650 | 726 | $this->add_responsive_control( |
| 727 | + 'form_fields_align', | |
| 728 | + [ | |
| 729 | + 'label' => __( 'Align', 'wpdirectorykit' ), | |
| 730 | + 'type' => Controls_Manager::CHOOSE, | |
| 731 | + 'options' => [ | |
| 732 | + 'left' => [ | |
| 733 | + 'title' => esc_html__( 'Left', 'wpdirectorykit' ), | |
| 734 | + 'icon' => 'eicon-text-align-left', | |
| 735 | + ], | |
| 736 | + 'center' => [ | |
| 737 | + 'title' => esc_html__( 'Center', 'wpdirectorykit' ), | |
| 738 | + 'icon' => 'eicon-text-align-center', | |
| 739 | + ], | |
| 740 | + 'right' => [ | |
| 741 | + 'title' => esc_html__( 'Right', 'wpdirectorykit' ), | |
| 742 | + 'icon' => 'eicon-text-align-right', | |
| 743 | + ], | |
| 744 | + ], | |
| 745 | + 'render_type' => 'template', | |
| 746 | + 'selectors_dictionary' => [ | |
| 747 | + 'left' => 'justify-content: flex-start;', | |
| 748 | + 'center' => 'justify-content: center;', | |
| 749 | + 'right' => 'justify-content: flex-end;', | |
| 750 | + ], | |
| 751 | + | |
| 752 | + 'selectors' => [ | |
| 753 | + '{{WRAPPER}} .wdk-search .wdk-search-form > .wdk-row ' => '{{VALUE}};', | |
| 754 | + ], | |
| 755 | + ] | |
| 756 | + ); | |
| 757 | + | |
| 758 | + $this->add_responsive_control( | |
| 651 | 759 | 'design_layout', |
| 652 | 760 | [ |
| 653 | 761 | 'label' => __( 'Design Layout', 'wpdirectorykit' ), |
| 654 | 762 | 'type' => Controls_Manager::SELECT, |
| @@ -919,8 +1027,23 @@ | ||
| 919 | 1027 | ] |
| 920 | 1028 | ); |
| 921 | 1029 | |
| 922 | 1030 | $this->add_responsive_control( |
| 1031 | + 'button_wrapper', | |
| 1032 | + [ | |
| 1033 | + 'label' => __( 'Button Wrapper Hide', 'wpdirectorykit' ), | |
| 1034 | + 'type' => Controls_Manager::SWITCHER, | |
| 1035 | + 'label_on' => __( 'Show', 'wpdirectorykit' ), | |
| 1036 | + 'label_off' => __( 'Hide', 'wpdirectorykit' ), | |
| 1037 | + 'return_value' => 'none', | |
| 1038 | + 'default' => '', | |
| 1039 | + 'selectors' => [ | |
| 1040 | + '{{WRAPPER}} .wdk-search .wdk-col-btns' => 'display: {{VALUE}};', | |
| 1041 | + ], | |
| 1042 | + ] | |
| 1043 | + ); | |
| 1044 | + | |
| 1045 | + $this->add_responsive_control( | |
| 923 | 1046 | 'button_column_inline', |
| 924 | 1047 | [ |
| 925 | 1048 | 'label' => __( 'Column Buttons Cell', 'wpdirectorykit' ), |
| 926 | 1049 | 'type' => Controls_Manager::SELECT, |
| @@ -1503,9 +1626,9 @@ | ||
| 1503 | 1626 | ], |
| 1504 | 1627 | [ |
| 1505 | 1628 | 'key'=>'field_button', |
| 1506 | 1629 | 'label'=> esc_html__('Search Button', 'wpdirectorykit'), |
| 1507 | - 'selector_hide'=>'{{WRAPPER}} .wdk-field .wdk-field-btn button.wdk-search-start', | |
| 1630 | + 'selector_hide'=>'{{WRAPPER}} .wdk-field .wdk-field-group-search button.wdk-search-start', | |
| 1508 | 1631 | 'selector'=>'{{WRAPPER}} .wdk-field button.wdk-search-start', |
| 1509 | 1632 | 'selector_hover'=>'{{WRAPPER}} .wdk-field button.wdk-search-start%1$s', |
| 1510 | 1633 | 'options'=>'full', |
| 1511 | 1634 | ], |
| @@ -1517,8 +1640,16 @@ | ||
| 1517 | 1640 | 'selector_hover'=>'{{WRAPPER}} .wdk-field button.wdk-search-start.wdk-search-reset%1$s', |
| 1518 | 1641 | 'options'=>['typo','color','border','border_radius','shadow','transition','background_group'], |
| 1519 | 1642 | ], |
| 1520 | 1643 | [ |
| 1644 | + 'key'=>'field_button_ai_search', | |
| 1645 | + 'label'=> esc_html__('Ai Search Button', 'wpdirectorykit'), | |
| 1646 | + 'selector_hide'=>'{{WRAPPER}} .wdk-field-group.wdk-field-group-ai-search', | |
| 1647 | + 'selector'=>'{{WRAPPER}} .wdk-field .wdk-ai-search', | |
| 1648 | + 'selector_hover'=>'{{WRAPPER}} .wdk-field .wdk-ai-search%1$s', | |
| 1649 | + 'options'=>['typo','color','border','border_radius','shadow','transition','background_group'], | |
| 1650 | + ], | |
| 1651 | + [ | |
| 1521 | 1652 | 'key'=>'field_button_more', |
| 1522 | 1653 | 'label'=> esc_html__('Button More', 'wpdirectorykit'), |
| 1523 | 1654 | 'selector_hide'=>'{{WRAPPER}} .wdk-field .wdk-field-group-additional', |
| 1524 | 1655 | 'selector'=>'{{WRAPPER}} .wdk-field button.wdk-search-additional-btn', |
| @@ -1644,12 +1775,12 @@ | ||
| 1644 | 1775 | if(!empty($item['selector_hide'])) { |
| 1645 | 1776 | $this->add_responsive_control( |
| 1646 | 1777 | $item['key'].'_hide', |
| 1647 | 1778 | [ |
| 1648 | - 'label' => esc_html__( 'Hide Element', 'wdk-svg-map' ), | |
| 1779 | + 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ), | |
| 1649 | 1780 | 'type' => Controls_Manager::SWITCHER, |
| 1650 | - 'none' => esc_html__( 'Hide', 'wdk-svg-map' ), | |
| 1651 | - 'block' => esc_html__( 'Show', 'wdk-svg-map' ), | |
| 1781 | + 'none' => esc_html__( 'Hide', 'wpdirectorykit' ), | |
| 1782 | + 'block' => esc_html__( 'Show', 'wpdirectorykit' ), | |
| 1652 | 1783 | 'return_value' => 'none', |
| 1653 | 1784 | 'default' => ($item['key'] == 'field_button_reset' ) ? 'none':'', |
| 1654 | 1785 | 'selectors' => [ |
| 1655 | 1786 | $item['selector_hide'] => 'display: {{VALUE}};', |
| @@ -2008,11 +2139,11 @@ | ||
| 2008 | 2139 | wp_enqueue_script('wdk-suggestion'); |
| 2009 | 2140 | wp_enqueue_style('wdk-treefield'); |
| 2010 | 2141 | |
| 2011 | 2142 | |
| 2012 | - wp_enqueue_script('select2'); | |
| 2143 | + wp_enqueue_script('select2-select2'); | |
| 2013 | 2144 | wp_enqueue_script('wdk-select2'); |
| 2014 | - wp_enqueue_style('select2'); | |
| 2145 | + wp_enqueue_style('select2-select2'); | |
| 2015 | 2146 | |
| 2016 | 2147 | wp_enqueue_script( 'ion.range-slider' ); |
| 2017 | 2148 | wp_enqueue_style('ion.range-slider'); |
| 2018 | 2149 | wp_enqueue_style('wdk-slider-range'); |
| @@ -2017,8 +2148,15 @@ | ||
| 2017 | 2148 | wp_enqueue_style('ion.range-slider'); |
| 2018 | 2149 | wp_enqueue_style('wdk-slider-range'); |
| 2019 | 2150 | wp_enqueue_script('wdk-slider-range'); |
| 2020 | 2151 | |
| 2152 | + wp_enqueue_style('jquery-confirm'); | |
| 2153 | + wp_enqueue_script('jquery-confirm'); | |
| 2154 | + | |
| 2021 | 2155 | wp_enqueue_style( 'wdk-treefield-checkboxes'); |
| 2022 | 2156 | wp_enqueue_script( 'wdk-treefield-checkboxes'); |
| 2157 | + | |
| 2158 | + if( wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results')) { | |
| 2159 | + wp_enqueue_script( 'wdk-ajax-loading-listings'); | |
| 2160 | + } | |
| 2023 | 2161 | } |
| 2024 | 2162 | } |