| @@ -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') |
| @@ -133,9 +134,9 @@ | ||
| 133 | 134 | $this->data['is_edit_mode']= false; |
| 134 | 135 | if(Plugin::$instance->editor->is_edit_mode()) |
| 135 | 136 | $this->data['is_edit_mode']= true; |
| 136 | 137 | |
| 137 | - echo $this->view('wdk-locations-tree', $this->data); | |
| 138 | + $this->view('wdk-locations-tree', $this->data, true); | |
| 138 | 139 | } |
| 139 | 140 | |
| 140 | 141 | |
| 141 | 142 | private function generate_controls_conf() { |
| @@ -156,9 +157,9 @@ | ||
| 156 | 157 | $this->add_control( |
| 157 | 158 | 'conf_link', |
| 158 | 159 | [ |
| 159 | 160 | 'label' => __( 'Open results on page', 'wpdirectorykit' ), |
| 160 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 161 | + 'type' => \Elementor\Controls_Manager::SELECT2, | |
| 161 | 162 | 'default' => '', |
| 162 | 163 | 'options' => $pages |
| 163 | 164 | ] |
| 164 | 165 | ); |
| @@ -163,8 +164,21 @@ | ||
| 163 | 164 | ] |
| 164 | 165 | ); |
| 165 | 166 | |
| 166 | 167 | $this->add_control( |
| 168 | + 'disable_empty_listings', | |
| 169 | + [ | |
| 170 | + 'label' => __( 'Disable With Empty Listings', 'wpdirectorykit' ), | |
| 171 | + 'type' => \Elementor\Controls_Manager::SWITCHER, | |
| 172 | + 'label_on' => __( 'On', 'wpdirectorykit' ), | |
| 173 | + 'label_off' => __( 'Off', 'wpdirectorykit' ), | |
| 174 | + 'return_value' => 'yes', | |
| 175 | + 'default' => '', | |
| 176 | + 'separator' => 'before', | |
| 177 | + ] | |
| 178 | + ); | |
| 179 | + | |
| 180 | + $this->add_control( | |
| 167 | 181 | 'show_icon', |
| 168 | 182 | [ |
| 169 | 183 | 'label' => __( 'Enable Location Icons', 'wpdirectorykit' ), |
| 170 | 184 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| @@ -202,8 +216,9 @@ | ||
| 202 | 216 | 'important_note', |
| 203 | 217 | [ |
| 204 | 218 | 'label' => '', |
| 205 | 219 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 220 | + /* translators: 1: URL. */ | |
| 206 | 221 | 'raw' => wdk_sprintf(__( 'Manage Locations <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_location')), |
| 207 | 222 | 'content_classes' => 'wdk_elementor_hint', |
| 208 | 223 | ] |
| 209 | 224 | ); |
| @@ -325,13 +340,27 @@ | ||
| 325 | 340 | 'key'=>'title', |
| 326 | 341 | 'label'=> esc_html__('Title', 'wpdirectorykit'), |
| 327 | 342 | 'selector'=>'.title', |
| 328 | 343 | 'selector_hover'=>'.title%1$s', |
| 329 | - 'options'=>['color','background','border','border_radius','padding','shadow','transition','margin','padding'], | |
| 344 | + 'options'=>['typo','color','background','border','border_radius','padding','shadow','transition','margin','padding'], | |
| 330 | 345 | ], |
| 331 | 346 | [ |
| 347 | + 'key'=>'location_image', | |
| 348 | + 'label'=> esc_html__('Location Image', 'wpdirectorykit'), | |
| 349 | + 'selector'=>'.title .wdk-image', | |
| 350 | + 'selector_hover'=>'.title%1$s .wdk-image', | |
| 351 | + 'options'=>['margin','background','border','border_radius','padding','shadow','transition','image_size_control', 'css_filters','image_fit_control'], | |
| 352 | + ], | |
| 353 | + [ | |
| 354 | + 'key'=>'location_icon', | |
| 355 | + 'label'=> esc_html__('Location Icon', 'wpdirectorykit'), | |
| 356 | + 'selector'=>'.title .wdk-icon', | |
| 357 | + 'selector_hover'=>'.title%1$s .wdk-icon', | |
| 358 | + 'options'=>['margin','color','background','border','border_radius','padding','shadow','image_size_control','image_fit_control'], | |
| 359 | + ], | |
| 360 | + [ | |
| 332 | 361 | 'key'=>'item_button', |
| 333 | - 'label'=> esc_html__('Item Box', 'wpdirectorykit'), | |
| 362 | + 'label'=> esc_html__('Sub Location List Item', 'wpdirectorykit'), | |
| 334 | 363 | 'selector'=>'.wdk-locations .wdk-link', |
| 335 | 364 | 'selector_hover'=>'.wdk-locations .wdk-link%1$s', |
| 336 | 365 | 'options'=>['color','background','border','border_radius','padding','shadow','transition'], |
| 337 | 366 | ], |
| @@ -336,30 +365,16 @@ | ||
| 336 | 365 | 'options'=>['color','background','border','border_radius','padding','shadow','transition'], |
| 337 | 366 | ], |
| 338 | 367 | [ |
| 339 | 368 | 'key'=>'item_icon', |
| 340 | - 'label'=> esc_html__('Item Icon', 'wpdirectorykit'), | |
| 369 | + 'label'=> esc_html__('Sub Location List item Icon', 'wpdirectorykit'), | |
| 341 | 370 | 'selector'=>'.wdk-locations .wdk-link i', |
| 342 | 371 | 'selector_hover'=>'.wdk-locations .wdk-link%1$s i', |
| 343 | 372 | 'options'=>['margin','color','background','border','border_radius','padding','shadow'], |
| 344 | 373 | ], |
| 345 | 374 | [ |
| 346 | - 'key'=>'location_icon', | |
| 347 | - 'label'=> esc_html__('Location Icon', 'wpdirectorykit'), | |
| 348 | - 'selector'=>'.title .wdk-icon', | |
| 349 | - 'selector_hover'=>'.title%1$s .wdk-icon', | |
| 350 | - 'options'=>['margin','color','background','border','border_radius','padding','shadow','image_size_control','image_fit_control'], | |
| 351 | - ], | |
| 352 | - [ | |
| 353 | - 'key'=>'location_image', | |
| 354 | - 'label'=> esc_html__('Location Image', 'wpdirectorykit'), | |
| 355 | - 'selector'=>'.title .wdk-image', | |
| 356 | - 'selector_hover'=>'.title%1$s .wdk-image', | |
| 357 | - 'options'=>['margin','background','border','border_radius','padding','shadow','transition','image_size_control', 'css_filters','image_fit_control'], | |
| 358 | - ], | |
| 359 | - [ | |
| 360 | 375 | 'key'=>'item_title', |
| 361 | - 'label'=> esc_html__('Item Title', 'wpdirectorykit'), | |
| 376 | + 'label'=> esc_html__('Sub Location List Item Title', 'wpdirectorykit'), | |
| 362 | 377 | 'selector'=>'.wdk-locations .wdk-link .wdk-title', |
| 363 | 378 | 'selector_hover'=>'.wdk-locations .wdk-link%1$s .wdk-title', |
| 364 | 379 | 'options'=>['margin','typo','color','background','border','border_radius','padding'], |
| 365 | 380 | ], |
| @@ -364,9 +379,9 @@ | ||
| 364 | 379 | 'options'=>['margin','typo','color','background','border','border_radius','padding'], |
| 365 | 380 | ], |
| 366 | 381 | [ |
| 367 | 382 | 'key'=>'item_count', |
| 368 | - 'label'=> esc_html__('Item Count', 'wpdirectorykit'), | |
| 383 | + 'label'=> esc_html__('Sub Location List Item Count', 'wpdirectorykit'), | |
| 369 | 384 | 'selector'=>'.wdk-locations .wdk-link .wdk-count', |
| 370 | 385 | 'selector_hover'=>'.wdk-locations .wdk-link%1$s .wdk-count', |
| 371 | 386 | 'options'=>['margin','typo','color','background','border','border_radius','padding'], |
| 372 | 387 | ], |
| @@ -426,8 +441,12 @@ | ||
| 426 | 441 | ] |
| 427 | 442 | ); |
| 428 | 443 | } |
| 429 | 444 | |
| 445 | + if(empty($item['selector_hide'])) { | |
| 446 | + $item['selector_hide'] = $item['selector']; | |
| 447 | + } | |
| 448 | + | |
| 430 | 449 | $this->add_responsive_control( |
| 431 | 450 | $item['key'].'_hide', |
| 432 | 451 | [ |
| 433 | 452 | 'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ), |
| @@ -436,9 +455,9 @@ | ||
| 436 | 455 | 'block' => esc_html__( 'Show', 'wpdirectorykit' ), |
| 437 | 456 | 'return_value' => 'none', |
| 438 | 457 | 'default' => '', |
| 439 | 458 | 'selectors' => [ |
| 440 | - '{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};', | |
| 459 | + '{{WRAPPER}} '.$item['selector_hide'] => 'display: {{VALUE}};', | |
| 441 | 460 | ], |
| 442 | 461 | ] |
| 443 | 462 | ); |
| 444 | 463 | $selectors = array( |
| @@ -465,9 +484,9 @@ | ||
| 465 | 484 | $item['key'].'_size', |
| 466 | 485 | [ |
| 467 | 486 | 'label' => __( 'Size', 'wpdirectorykit' ), |
| 468 | 487 | 'type' => Controls_Manager::SLIDER, |
| 469 | - 'size_units' => [ 'px'], | |
| 488 | + 'size_units' => [ 'px','em', 'vw', '%', 'custom' ], | |
| 470 | 489 | 'range' => [ |
| 471 | 490 | 'px' => [ |
| 472 | 491 | 'min' => 1, |
| 473 | 492 | 'max' => 60, |