| 1 |
<?php |
| 2 |
|
| 3 |
namespace Wdk\Elementor\Widgets; |
| 4 |
|
| 5 |
use Wdk\Elementor\Widgets\WdkElementorBase; |
| 6 |
use Elementor\Widget_Base; |
| 7 |
use Elementor\Controls_Manager; |
| 8 |
use Elementor\Utils; |
| 9 |
use Elementor\Typography; |
| 10 |
use Elementor\Editor; |
| 11 |
use Elementor\Plugin; |
| 12 |
use Elementor\Repeater; |
| 13 |
use Elementor\Core\Schemes; |
| 14 |
use Elementor\Icons_Manager; |
| 15 |
use Elementor\Group_Control_Typography; |
| 16 |
use Elementor\Group_Control_Border; |
| 17 |
use Elementor\Group_Control_Box_Shadow; |
| 18 |
|
| 19 |
if (!defined('ABSPATH')) |
| 20 |
exit; // Exit if accessed directly |
| 21 |
|
| 22 |
/** |
| 23 |
* @since 1.1.0 |
| 24 |
*/ |
| 25 |
class WdkListingsResults extends WdkElementorBase { |
| 26 |
|
| 27 |
public function __construct($data = array(), $args = null) { |
| 28 |
|
| 29 |
\Elementor\Controls_Manager::add_tab( |
| 30 |
'tab_conf', |
| 31 |
esc_html__('Settings', 'wpdirectorykit') |
| 32 |
); |
| 33 |
|
| 34 |
\Elementor\Controls_Manager::add_tab( |
| 35 |
'tab_layout', |
| 36 |
esc_html__('Layout', 'wpdirectorykit') |
| 37 |
); |
| 38 |
|
| 39 |
\Elementor\Controls_Manager::add_tab( |
| 40 |
'tab_content', |
| 41 |
esc_html__('Main', 'wpdirectorykit') |
| 42 |
); |
| 43 |
|
| 44 |
if ($this->is_edit_mode_load()) { |
| 45 |
$this->enqueue_styles_scripts(); |
| 46 |
} |
| 47 |
parent::__construct($data, $args); |
| 48 |
} |
| 49 |
|
| 50 |
/** |
| 51 |
* Retrieve the widget name. |
| 52 |
* |
| 53 |
* @since 1.1.0 |
| 54 |
* |
| 55 |
* @access public |
| 56 |
* |
| 57 |
* @return string Widget name. |
| 58 |
*/ |
| 59 |
public function get_name() { |
| 60 |
return 'wdk-listings-results'; |
| 61 |
} |
| 62 |
|
| 63 |
/** |
| 64 |
* Retrieve the widget title. |
| 65 |
* |
| 66 |
* @since 1.1.0 |
| 67 |
* |
| 68 |
* @access public |
| 69 |
* |
| 70 |
* @return string Widget title. |
| 71 |
*/ |
| 72 |
public function get_title() { |
| 73 |
return esc_html__('Wdk Listings Results', 'wpdirectorykit'); |
| 74 |
} |
| 75 |
|
| 76 |
/** |
| 77 |
* Retrieve the widget icon. |
| 78 |
* |
| 79 |
* @since 1.1.0 |
| 80 |
* |
| 81 |
* @access public |
| 82 |
* |
| 83 |
* @return string Widget icon. |
| 84 |
*/ |
| 85 |
public function get_icon() { |
| 86 |
return 'eicon-products'; |
| 87 |
} |
| 88 |
|
| 89 |
/** |
| 90 |
* Register the widget controls. |
| 91 |
* |
| 92 |
* Adds different input fields to allow the user to change and customize the widget settings. |
| 93 |
* |
| 94 |
* @since 1.1.0 |
| 95 |
* |
| 96 |
* @access protected |
| 97 |
*/ |
| 98 |
protected function register_controls() { |
| 99 |
$this->generate_controls_conf(); |
| 100 |
$this->generate_controls_layout(); |
| 101 |
$this->generate_controls_styles(); |
| 102 |
$this->generate_controls_content(); |
| 103 |
|
| 104 |
$this->insert_pro_message('tab_conf'); |
| 105 |
parent::register_controls(); |
| 106 |
} |
| 107 |
|
| 108 |
/** |
| 109 |
* Render the widget output on the frontend. |
| 110 |
* |
| 111 |
* Written in PHP and used to generate the final HTML. |
| 112 |
* |
| 113 |
* @since 1.1.0 |
| 114 |
* |
| 115 |
* @access protected |
| 116 |
*/ |
| 117 |
protected function render() { |
| 118 |
parent::render(); |
| 119 |
$this->data['id_element'] = $this->get_id(); |
| 120 |
$this->data['settings'] = $this->get_settings(); |
| 121 |
|
| 122 |
$this->data['listings_count'] = 0; |
| 123 |
$this->data['results'] = array(); |
| 124 |
$this->data['pagination_output'] = ''; |
| 125 |
|
| 126 |
$columns = array('ID', 'location_id', 'category_id', 'post_title', 'post_date', 'search', 'order_by','is_featured', 'address'); |
| 127 |
$external_columns = array('location_id', 'category_id', 'post_title'); |
| 128 |
$custom_parameters = array(); |
| 129 |
$skip_postget = FALSE; |
| 130 |
|
| 131 |
$custom_parameters['order_by'] = $this->WMVC->db->prefix.'wdk_listings.rank DESC'; |
| 132 |
|
| 133 |
$this->data['custom_order'] = array(); |
| 134 |
if($this->data['settings']['custom_order_list']) { |
| 135 |
foreach($this->data['settings']['custom_order_list'] as $item){ |
| 136 |
if(empty($item['title']) || empty($item['key'])) continue; |
| 137 |
$this->data['custom_order'][] = array('title'=>$item['title'],'key'=>$item['key']); |
| 138 |
} |
| 139 |
} |
| 140 |
|
| 141 |
if(!empty($this->data['settings']['specific_user'])) { |
| 142 |
$custom_parameters['search_agents_ids'] = $this->data['settings']['specific_user']; |
| 143 |
} |
| 144 |
|
| 145 |
if($this->data['settings']['conf_results_type'] == 'results_listings') { |
| 146 |
$controller = 'listing'; |
| 147 |
$offset = NULL; |
| 148 |
|
| 149 |
if($this->data['settings']['get_filters_enable'] != 'yes') |
| 150 |
$skip_postget = TRUE; |
| 151 |
|
| 152 |
if(!isset($_GET['order_by'])) { |
| 153 |
/* if detected custom field for order */ |
| 154 |
if(!empty($this->data['settings']['conf_order_by_custom'])) { |
| 155 |
$custom_parameters['order_by'] .= ', '.$this->data['settings']['conf_order_by_custom'].' '.$this->data['settings']['conf_order']; |
| 156 |
} else { |
| 157 |
$custom_parameters['order_by'] .= ', '.$this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order']; |
| 158 |
} |
| 159 |
} |
| 160 |
|
| 161 |
if(!empty($this->data['settings']['conf_query'])) { |
| 162 |
$qr_string = trim($this->data['settings']['conf_query'],'?'); |
| 163 |
$string_par = array(); |
| 164 |
parse_str($qr_string, $string_par); |
| 165 |
$custom_parameters += array_map('trim', $string_par); |
| 166 |
} |
| 167 |
if($this->data['settings']['only_is_featured'] == 'yes') { |
| 168 |
$custom_parameters['is_featured'] = 'on'; |
| 169 |
} |
| 170 |
|
| 171 |
if($this->data['settings']['conf_pagination_enable'] == 'yes' && $this->data['settings']['get_filters_enable'] == 'yes') { |
| 172 |
|
| 173 |
wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters, $skip_postget); |
| 174 |
$total_items = $this->WMVC->listing_m->total(array('is_activated' => 1,'is_approved'=>1)); |
| 175 |
$current_page = 1; |
| 176 |
if(isset($_GET['wmvc_paged'])) |
| 177 |
$current_page = intval(wmvc_xss_clean($_GET['wmvc_paged'])); |
| 178 |
|
| 179 |
if(empty($this->data['settings']['per_page'])) |
| 180 |
$this->data['settings']['per_page'] = 6; |
| 181 |
|
| 182 |
$offset = $this->data['settings']['per_page']*($current_page-1); |
| 183 |
|
| 184 |
if(function_exists('wdk_wp_frontend_paginate') && $total_items > $this->data['settings']['per_page']) |
| 185 |
$this->data['pagination_output'] = wdk_wp_frontend_paginate($total_items, $this->data['settings']['per_page'], 'wmvc_paged', array(), TRUE, |
| 186 |
FALSE, FALSE, $this->data['settings']['limit_pagination']); |
| 187 |
|
| 188 |
$this->data['listings_count'] = $total_items; |
| 189 |
} else { |
| 190 |
wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters, $skip_postget); |
| 191 |
$total_items = $this->WMVC->listing_m->total(array('is_activated' => 1,'is_approved'=>1)); |
| 192 |
|
| 193 |
$this->data['listings_count'] = $total_items; |
| 194 |
} |
| 195 |
|
| 196 |
wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters, $skip_postget); |
| 197 |
|
| 198 |
$this->data['results'] = $this->WMVC->listing_m->get_pagination($this->data['settings']['per_page'], $offset, array('is_activated' => 1,'is_approved'=>1)); |
| 199 |
|
| 200 |
/*, array('sw_listing.rank DESC')*/ |
| 201 |
|
| 202 |
} else if($this->data['settings']['conf_results_type'] == 'custom_listings') { |
| 203 |
$listings_ids = array(); |
| 204 |
foreach($this->data['settings']['conf_custom_results'] as $listing) { |
| 205 |
if(isset($listing['listing_post_id']) && !empty($listing['listing_post_id'])) { |
| 206 |
$listings_ids [] = $listing['listing_post_id']; |
| 207 |
} |
| 208 |
} |
| 209 |
|
| 210 |
if($this->data['settings']['layout_type'] != 'carousel' && $this->data['settings']['custom_listings_enable_pagination'] == 'yes' && !empty($this->data['settings']['custom_listings_per_page'])) { |
| 211 |
|
| 212 |
$this->data['listings_count'] = $total_items = 0; |
| 213 |
|
| 214 |
if(!empty($listings_ids)) |
| 215 |
{ |
| 216 |
$this->WMVC->db->where( $this->WMVC->db->prefix.'wdk_listings.post_id IN(' . implode(',', $listings_ids) . ')', null, false); |
| 217 |
$total_items = $this->WMVC->listing_m->total(array('is_activated' => 1,'is_approved'=>1)); |
| 218 |
$this->data['listings_count'] = $total_items; |
| 219 |
} |
| 220 |
|
| 221 |
$current_page = 1; |
| 222 |
if(isset($_GET['wmvc_paged'])) |
| 223 |
$current_page = intval(wmvc_xss_clean($_GET['wmvc_paged'])); |
| 224 |
|
| 225 |
$limit = $this->data['settings']['custom_listings_per_page']; |
| 226 |
|
| 227 |
$offset = $limit *($current_page-1); |
| 228 |
|
| 229 |
if(function_exists('wdk_wp_frontend_paginate')) |
| 230 |
$this->data['pagination_output'] = wdk_wp_frontend_paginate($total_items, $limit, 'wmvc_paged', array(), TRUE, FALSE, FALSE, |
| 231 |
$this->data['settings']['limit_pagination']); |
| 232 |
|
| 233 |
$this->WMVC->db->limit($limit); |
| 234 |
$this->WMVC->db->offset($offset); |
| 235 |
} |
| 236 |
|
| 237 |
/* where in */ |
| 238 |
if(!empty($listings_ids)){ |
| 239 |
$this->WMVC->db->where( $this->WMVC->db->prefix.'wdk_listings.post_id IN(' . implode(',', $listings_ids) . ')', null, false); |
| 240 |
$this->WMVC->db->where(array('is_activated' => 1, 'is_approved'=>1)); |
| 241 |
$this->WMVC->db->order_by('FIELD('.$this->WMVC->db->prefix.'wdk_listings.post_id, '. implode(',', $listings_ids) . ')'); |
| 242 |
|
| 243 |
if($this->data['settings']['conf_pagination_enable'] == 'yes' && !empty($this->data['settings']['per_page'])) { |
| 244 |
|
| 245 |
|
| 246 |
} |
| 247 |
$this->data['results'] = $this->WMVC->listing_m->get(); |
| 248 |
} |
| 249 |
|
| 250 |
/* hide filter header on specific results */ |
| 251 |
$this->data['settings']['get_filters_enable'] = ''; |
| 252 |
} |
| 253 |
|
| 254 |
if(!empty($this->data['results']) && $this->data['listings_count'] == 0) |
| 255 |
$this->data['listings_count'] = wmvc_count($this->data['results']); |
| 256 |
|
| 257 |
$this->data['settings']['content_button_icon'] = $this->generate_icon($this->data['settings']['content_button_icon']); |
| 258 |
|
| 259 |
$this->data['is_edit_mode'] = false; |
| 260 |
if(Plugin::$instance->editor->is_edit_mode()) |
| 261 |
$this->data['is_edit_mode'] = true; |
| 262 |
|
| 263 |
if(isset($_GET['wmvc_view_type']) && $this->data['settings']['get_filters_enable'] == 'yes') { |
| 264 |
if(wmvc_xss_clean($_GET['wmvc_view_type']) == 'grid') |
| 265 |
$this->data['settings']['layout_type'] = 'grid'; |
| 266 |
if(wmvc_xss_clean($_GET['wmvc_view_type']) == 'list') |
| 267 |
$this->data['settings']['layout_type'] = 'list'; |
| 268 |
} |
| 269 |
echo $this->view('wdk-listings-results', $this->data); |
| 270 |
} |
| 271 |
|
| 272 |
|
| 273 |
private function generate_controls_conf() { |
| 274 |
$this->start_controls_section( |
| 275 |
'tab_conf_main_section', |
| 276 |
[ |
| 277 |
'label' => esc_html__('Main', 'wpdirectorykit'), |
| 278 |
'tab' => 'tab_conf', |
| 279 |
] |
| 280 |
); |
| 281 |
|
| 282 |
|
| 283 |
$this->add_control( |
| 284 |
'specific_user_hr', |
| 285 |
[ |
| 286 |
'type' => \Elementor\Controls_Manager::DIVIDER, |
| 287 |
] |
| 288 |
); |
| 289 |
|
| 290 |
$this->add_control( |
| 291 |
'is_mobile_view_enable', |
| 292 |
[ |
| 293 |
'label' => __( 'Horizontal mobile view', 'wpdirectorykit' ), |
| 294 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 295 |
'label_on' => __( 'True', 'wpdirectorykit' ), |
| 296 |
'label_off' => __( 'False', 'wpdirectorykit' ), |
| 297 |
'return_value' => 'yes', |
| 298 |
'default' => '', |
| 299 |
] |
| 300 |
); |
| 301 |
|
| 302 |
$this->add_control( |
| 303 |
'conf_results_type', |
| 304 |
[ |
| 305 |
'label' => __( 'Results type', 'wpdirectorykit' ), |
| 306 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 307 |
'default' => 'results_listings', |
| 308 |
'options' => [ |
| 309 |
'results_listings' => __( 'Results Listings', 'wpdirectorykit' ), |
| 310 |
'custom_listings' => __( 'Specific Listings', 'wpdirectorykit' ), |
| 311 |
], |
| 312 |
'separator' => 'after', |
| 313 |
] |
| 314 |
); |
| 315 |
|
| 316 |
$this->add_control( |
| 317 |
'get_filters_enable', |
| 318 |
[ |
| 319 |
'label' => __( 'Filtering based on URL enable', 'wpdirectorykit' ), |
| 320 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 321 |
'label_on' => __( 'True', 'wpdirectorykit' ), |
| 322 |
'label_off' => __( 'False', 'wpdirectorykit' ), |
| 323 |
'return_value' => 'yes', |
| 324 |
'default' => 'yes', |
| 325 |
'conditions' => [ |
| 326 |
'terms' => [ |
| 327 |
[ |
| 328 |
'name' => 'conf_results_type', |
| 329 |
'operator' => '==', |
| 330 |
'value' => 'results_listings', |
| 331 |
] |
| 332 |
], |
| 333 |
], |
| 334 |
] |
| 335 |
); |
| 336 |
|
| 337 |
$this->add_control( |
| 338 |
'show_numbers_results_enable', |
| 339 |
[ |
| 340 |
'label' => __( 'Show number of results Enable', 'wpdirectorykit' ), |
| 341 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 342 |
'label_on' => __( 'True', 'wpdirectorykit' ), |
| 343 |
'label_off' => __( 'False', 'wpdirectorykit' ), |
| 344 |
'return_value' => 'yes', |
| 345 |
'default' => 'yes', |
| 346 |
'conditions' => [ |
| 347 |
'terms' => [ |
| 348 |
[ |
| 349 |
'name' => 'conf_results_type', |
| 350 |
'operator' => '==', |
| 351 |
'value' => 'results_listings', |
| 352 |
] |
| 353 |
], |
| 354 |
], |
| 355 |
] |
| 356 |
); |
| 357 |
|
| 358 |
$this->add_control( |
| 359 |
'view_type_enable', |
| 360 |
[ |
| 361 |
'label' => __( 'View Type Grid/List Enable', 'wpdirectorykit' ), |
| 362 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 363 |
'label_on' => __( 'True', 'wpdirectorykit' ), |
| 364 |
'label_off' => __( 'False', 'wpdirectorykit' ), |
| 365 |
'return_value' => 'yes', |
| 366 |
'default' => 'yes', |
| 367 |
'conditions' => [ |
| 368 |
'terms' => [ |
| 369 |
[ |
| 370 |
'name' => 'conf_results_type', |
| 371 |
'operator' => '==', |
| 372 |
'value' => 'results_listings', |
| 373 |
] |
| 374 |
], |
| 375 |
], |
| 376 |
] |
| 377 |
); |
| 378 |
|
| 379 |
$this->add_control( |
| 380 |
'sorting_enable', |
| 381 |
[ |
| 382 |
'label' => __( 'Sorting Filter Enable', 'wpdirectorykit' ), |
| 383 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 384 |
'label_on' => __( 'True', 'wpdirectorykit' ), |
| 385 |
'label_off' => __( 'False', 'wpdirectorykit' ), |
| 386 |
'return_value' => 'yes', |
| 387 |
'default' => 'yes', |
| 388 |
'conditions' => [ |
| 389 |
'terms' => [ |
| 390 |
[ |
| 391 |
'name' => 'conf_results_type', |
| 392 |
'operator' => '==', |
| 393 |
'value' => 'results_listings', |
| 394 |
] |
| 395 |
], |
| 396 |
], |
| 397 |
] |
| 398 |
); |
| 399 |
|
| 400 |
$this->add_control( |
| 401 |
'conf_pagination_enable', |
| 402 |
[ |
| 403 |
'label' => __( 'Pagination Enable', 'wpdirectorykit' ), |
| 404 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 405 |
'label_on' => __( 'Show', 'wpdirectorykit' ), |
| 406 |
'label_off' => __( 'Hide', 'wpdirectorykit' ), |
| 407 |
'return_value' => 'yes', |
| 408 |
'default' => '', |
| 409 |
'description' => esc_html__( 'Filtering based on URL must be enabled for this functionality', 'wpdirectorykit' ), |
| 410 |
'conditions' => [ |
| 411 |
'terms' => [ |
| 412 |
[ |
| 413 |
'name' => 'conf_results_type', |
| 414 |
'operator' => '==', |
| 415 |
'value' => 'results_listings', |
| 416 |
],/* |
| 417 |
[ |
| 418 |
'name' => 'get_filters_enable', |
| 419 |
'operator' => '==', |
| 420 |
'value' => 'yes', |
| 421 |
]*/ |
| 422 |
], |
| 423 |
] |
| 424 |
] |
| 425 |
); |
| 426 |
|
| 427 |
$this->add_control( |
| 428 |
'limit_pagination', |
| 429 |
[ |
| 430 |
'label' => __('Limit Pagination Items', 'wpdirectorykit'), |
| 431 |
'type' => Controls_Manager::SELECT, |
| 432 |
'label_block' => true, |
| 433 |
'options' => [ |
| 434 |
'1' => __('3 numbers', 'wpdirectorykit'), |
| 435 |
'2' => __('5 numbers', 'wpdirectorykit'), |
| 436 |
'3' => __('7 numbers', 'wpdirectorykit'), |
| 437 |
], |
| 438 |
'default' => '1', |
| 439 |
] |
| 440 |
); |
| 441 |
|
| 442 |
/* conf_results_type :: results_listings */ |
| 443 |
if(true){ |
| 444 |
$this->add_control( |
| 445 |
'conf_results_type_results_listings_header', |
| 446 |
[ |
| 447 |
'label' => esc_html__('Results listings', 'wpdirectorykit'), |
| 448 |
'type' => Controls_Manager::HEADING, |
| 449 |
'separator' => 'before', |
| 450 |
'conditions' => [ |
| 451 |
'terms' => [ |
| 452 |
[ |
| 453 |
'name' => 'conf_results_type', |
| 454 |
'operator' => '==', |
| 455 |
'value' => 'results_listings', |
| 456 |
] |
| 457 |
], |
| 458 |
], |
| 459 |
] |
| 460 |
); |
| 461 |
|
| 462 |
$this->add_control( |
| 463 |
'per_page', |
| 464 |
[ |
| 465 |
'label' => __( 'Limit Results (Per page)', 'wpdirectorykit' ), |
| 466 |
'type' => \Elementor\Controls_Manager::NUMBER, |
| 467 |
'min' => 1, |
| 468 |
'max' => 250, |
| 469 |
'step' => 1, |
| 470 |
'default' => 6, |
| 471 |
'conditions' => [ |
| 472 |
'terms' => [ |
| 473 |
[ |
| 474 |
'name' => 'conf_results_type', |
| 475 |
'operator' => '==', |
| 476 |
'value' => 'results_listings', |
| 477 |
] |
| 478 |
], |
| 479 |
], |
| 480 |
] |
| 481 |
); |
| 482 |
|
| 483 |
$this->add_control( |
| 484 |
'only_is_featured', |
| 485 |
[ |
| 486 |
'label' => __( 'Only show featured', 'wpdirectorykit' ), |
| 487 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 488 |
'label_on' => __( 'True', 'wpdirectorykit' ), |
| 489 |
'label_off' => __( 'False', 'wpdirectorykit' ), |
| 490 |
'return_value' => 'yes', |
| 491 |
'default' => '', |
| 492 |
'conditions' => [ |
| 493 |
'terms' => [ |
| 494 |
[ |
| 495 |
'name' => 'conf_results_type', |
| 496 |
'operator' => '==', |
| 497 |
'value' => 'results_listings', |
| 498 |
] |
| 499 |
], |
| 500 |
], |
| 501 |
] |
| 502 |
); |
| 503 |
|
| 504 |
$this->add_control( |
| 505 |
'conf_query', |
| 506 |
[ |
| 507 |
'label' => __( 'Query', 'wpdirectorykit' ), |
| 508 |
'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 509 |
'rows' => 5, |
| 510 |
'default' => '', |
| 511 |
'placeholder' => __( 'Type your query here, example xxx', 'wpdirectorykit' ), |
| 512 |
'description' => '<span style="word-break: break-all;">'.__( 'Example (same like on url):', 'wpdirectorykit' ). |
| 513 |
' field_6_min=100&field_6_max=200&field_5=rent&is_featured=on&search_category=3&search_location=4&search_agents_ids=3'. |
| 514 |
'</span>', |
| 515 |
'conditions' => [ |
| 516 |
'terms' => [ |
| 517 |
[ |
| 518 |
'name' => 'conf_results_type', |
| 519 |
'operator' => '==', |
| 520 |
'value' => 'results_listings', |
| 521 |
] |
| 522 |
], |
| 523 |
], |
| 524 |
] |
| 525 |
); |
| 526 |
|
| 527 |
|
| 528 |
$dbusers = get_users( array( 'search' => '', |
| 529 |
'orderby' => 'display_name', 'order' => 'ASC', 'role__in' => [ 'administrator', 'super-admin','wdk_agent','wdk_agency'])); |
| 530 |
|
| 531 |
$users = array('0'=>esc_html__('Not Selected', 'wpdirectorykit')); |
| 532 |
foreach($dbusers as $dbuser) { |
| 533 |
$users[wmvc_show_data('ID', $dbuser)] = '#'.wmvc_show_data('ID', $dbuser).', '.wmvc_show_data('display_name', $dbuser); |
| 534 |
} |
| 535 |
|
| 536 |
$this->add_control( |
| 537 |
'specific_user', |
| 538 |
[ |
| 539 |
'label' => __( 'Filter by Agent', 'wpdirectorykit' ), |
| 540 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 541 |
'default' => '0', |
| 542 |
'label_block' => true, |
| 543 |
'options' => $users, |
| 544 |
] |
| 545 |
); |
| 546 |
|
| 547 |
$this->add_control( |
| 548 |
'conf_order_by', |
| 549 |
[ |
| 550 |
'label' => __('Default Order By Column', 'wpdirectorykit'), |
| 551 |
'type' => Controls_Manager::SELECT, |
| 552 |
'label_block' => true, |
| 553 |
'options' => [ |
| 554 |
'none' => __('None', 'wpdirectorykit'), |
| 555 |
'post_id' => __('ID', 'wpdirectorykit'), |
| 556 |
'post_title' => __('Title', 'wpdirectorykit'), |
| 557 |
], |
| 558 |
'default' => 'post_id', |
| 559 |
'conditions' => [ |
| 560 |
'terms' => [ |
| 561 |
[ |
| 562 |
'name' => 'conf_results_type', |
| 563 |
'operator' => '==', |
| 564 |
'value' => 'results_listings', |
| 565 |
] |
| 566 |
], |
| 567 |
], |
| 568 |
] |
| 569 |
); |
| 570 |
|
| 571 |
$this->add_control( |
| 572 |
'conf_order_by_custom', |
| 573 |
[ |
| 574 |
'label' => __('Default Custom Order By', 'wpdirectorykit'), |
| 575 |
'description' => __('Custom Order By', 'wpdirectorykit'), |
| 576 |
'description' => '<span style="word-break: break-all;">'.__( 'Example:', 'wpdirectorykit' ). |
| 577 |
'<br> RAND() - return random results'. |
| 578 |
'<br> field_13_NUMBER - where 13 is field id, NUMBER - field type'. |
| 579 |
'<br> field_4_NUMBER - where 4 is field id, NUMBER - field type'. |
| 580 |
'<br> field_6_DROPDOWN - where 6 is field id, DROPDOWN - field type'. |
| 581 |
'<br> category_title - Category Title'. |
| 582 |
'<br> location_title - Location Title'. |
| 583 |
'</span>', |
| 584 |
'type' => Controls_Manager::TEXT, |
| 585 |
'label_block' => true, |
| 586 |
'default' => 'post_id', |
| 587 |
'conditions' => [ |
| 588 |
'terms' => [ |
| 589 |
[ |
| 590 |
'name' => 'conf_results_type', |
| 591 |
'operator' => '==', |
| 592 |
'value' => 'results_listings', |
| 593 |
] |
| 594 |
], |
| 595 |
], |
| 596 |
] |
| 597 |
); |
| 598 |
|
| 599 |
|
| 600 |
$this->add_control( |
| 601 |
'conf_order', |
| 602 |
[ |
| 603 |
'label' => __('Default Listing Order', 'wpdirectorykit'), |
| 604 |
'type' => Controls_Manager::SELECT, |
| 605 |
'label_block' => true, |
| 606 |
'options' => [ |
| 607 |
'asc' => __('Ascending', 'wpdirectorykit'), |
| 608 |
'desc' => __('Descending', 'wpdirectorykit') |
| 609 |
], |
| 610 |
'default' => 'desc', |
| 611 |
'conditions' => [ |
| 612 |
'terms' => [ |
| 613 |
[ |
| 614 |
'name' => 'conf_results_type', |
| 615 |
'operator' => '==', |
| 616 |
'value' => 'results_listings', |
| 617 |
] |
| 618 |
], |
| 619 |
], |
| 620 |
] |
| 621 |
); |
| 622 |
} |
| 623 |
|
| 624 |
if(true) { |
| 625 |
|
| 626 |
|
| 627 |
$this->add_control( |
| 628 |
'conf_results_type_custom_listings_header', |
| 629 |
[ |
| 630 |
'label' => esc_html__('Custom listings', 'wpdirectorykit'), |
| 631 |
'type' => Controls_Manager::HEADING, |
| 632 |
'separator' => 'before', |
| 633 |
'conditions' => [ |
| 634 |
'terms' => [ |
| 635 |
[ |
| 636 |
'name' => 'conf_results_type', |
| 637 |
'operator' => '==', |
| 638 |
'value' => 'custom_listings', |
| 639 |
] |
| 640 |
], |
| 641 |
], |
| 642 |
] |
| 643 |
); |
| 644 |
|
| 645 |
$this->add_control( |
| 646 |
'custom_listings_enable_pagination', |
| 647 |
[ |
| 648 |
'label' => __( 'Enable Pagination', 'wpdirectorykit' ), |
| 649 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 650 |
'label_on' => __( 'True', 'wpdirectorykit' ), |
| 651 |
'label_off' => __( 'False', 'wpdirectorykit' ), |
| 652 |
'return_value' => 'yes', |
| 653 |
'default' => '', |
| 654 |
'conditions' => [ |
| 655 |
'terms' => [ |
| 656 |
[ |
| 657 |
'name' => 'conf_results_type', |
| 658 |
'operator' => '==', |
| 659 |
'value' => 'custom_listings', |
| 660 |
] |
| 661 |
], |
| 662 |
], |
| 663 |
] |
| 664 |
); |
| 665 |
|
| 666 |
$this->add_control( |
| 667 |
'custom_listings_per_page', |
| 668 |
[ |
| 669 |
'label' => __( 'Limit Listings (Per page)', 'wpdirectorykit' ), |
| 670 |
'type' => \Elementor\Controls_Manager::NUMBER, |
| 671 |
'min' => 1, |
| 672 |
'max' => 50, |
| 673 |
'step' => 1, |
| 674 |
'default' => 6, |
| 675 |
'conditions' => [ |
| 676 |
'terms' => [ |
| 677 |
[ |
| 678 |
'name' => 'conf_results_type', |
| 679 |
'operator' => '==', |
| 680 |
'value' => 'custom_listings', |
| 681 |
], |
| 682 |
[ |
| 683 |
'name' => 'custom_listings_enable_pagination', |
| 684 |
'operator' => '==', |
| 685 |
'value' => 'yes', |
| 686 |
] |
| 687 |
], |
| 688 |
], |
| 689 |
] |
| 690 |
); |
| 691 |
|
| 692 |
|
| 693 |
if(true){ |
| 694 |
$repeater = new Repeater(); |
| 695 |
$repeater->start_controls_tabs( 'listings' ); |
| 696 |
$repeater->add_control( |
| 697 |
'listing_post_id', |
| 698 |
[ |
| 699 |
'label' => __( 'ID Post Listing', 'wpdirectorykit' ), |
| 700 |
'type' => \Elementor\Controls_Manager::NUMBER, |
| 701 |
'min' => 1, |
| 702 |
'step' => 1, |
| 703 |
] |
| 704 |
); |
| 705 |
$repeater->end_controls_tabs(); |
| 706 |
|
| 707 |
|
| 708 |
$this->add_control( |
| 709 |
'conf_custom_results', |
| 710 |
[ |
| 711 |
'type' => Controls_Manager::REPEATER, |
| 712 |
'fields' => $repeater->get_controls(), |
| 713 |
'default' => [ |
| 714 |
], |
| 715 |
'title_field' => '{{{ listing_post_id }}}', |
| 716 |
'conditions' => [ |
| 717 |
'terms' => [ |
| 718 |
[ |
| 719 |
'name' => 'conf_results_type', |
| 720 |
'operator' => '==', |
| 721 |
'value' => 'custom_listings', |
| 722 |
] |
| 723 |
], |
| 724 |
], |
| 725 |
] |
| 726 |
); |
| 727 |
|
| 728 |
} |
| 729 |
} |
| 730 |
|
| 731 |
$this->add_control( |
| 732 |
'important_note', |
| 733 |
[ |
| 734 |
'label' => '', |
| 735 |
'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 736 |
'raw' => wdk_sprintf(__( 'Edit Result Card Designer <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_resultitem')), |
| 737 |
'content_classes' => 'wdk_elementor_hint', |
| 738 |
] |
| 739 |
); |
| 740 |
|
| 741 |
$this->end_controls_section(); |
| 742 |
|
| 743 |
$this->start_controls_section( |
| 744 |
'tab_conf_main_section_order', |
| 745 |
[ |
| 746 |
'label' => esc_html__('Custom Order', 'wpdirectorykit'), |
| 747 |
'tab' => 'tab_conf', |
| 748 |
] |
| 749 |
); |
| 750 |
|
| 751 |
$repeater_order = new Repeater(); |
| 752 |
$repeater_order->start_controls_tabs( 'orders' ); |
| 753 |
$repeater_order->add_control( |
| 754 |
'key', |
| 755 |
[ |
| 756 |
'label' => __( 'Order Key', 'wpdirectorykit' ), |
| 757 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 758 |
'placeholder' => 'post_id ASC', |
| 759 |
'description' => '<span style="word-break: break-all;">'.__( 'Custom Fields Order Example:', 'wpdirectorykit' ). |
| 760 |
'<br> field_13_NUMBER ASC - where 13 is field id, NUMBER - field type'. |
| 761 |
'<br> field_4_NUMBER DESC - where 4 is field id, NUMBER - field type'. |
| 762 |
'<br> field_6_DROPDOWN ASC - where 6 is field id, DROPDOWN - field type'. |
| 763 |
'<br> category_title - Category Title'. |
| 764 |
'<br> location_title - Location Title'. |
| 765 |
'</span>', |
| 766 |
] |
| 767 |
); |
| 768 |
$repeater_order->add_control( |
| 769 |
'title', |
| 770 |
[ |
| 771 |
'label' => __( 'Title', 'wpdirectorykit' ), |
| 772 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 773 |
'placeholder' => __( 'Title', 'wpdirectorykit' ), |
| 774 |
] |
| 775 |
); |
| 776 |
$repeater_order->end_controls_tabs(); |
| 777 |
|
| 778 |
$this->add_control( |
| 779 |
'custom_order_list', |
| 780 |
[ |
| 781 |
'type' => Controls_Manager::REPEATER, |
| 782 |
'fields' => $repeater_order->get_controls(), |
| 783 |
'default' => [ |
| 784 |
], |
| 785 |
'title_field' => '{{{ title }}}', |
| 786 |
] |
| 787 |
); |
| 788 |
|
| 789 |
$this->end_controls_section(); |
| 790 |
|
| 791 |
|
| 792 |
if(wdk_get_option('wdk_sub_listings_enable')) { |
| 793 |
|
| 794 |
$this->start_controls_section( |
| 795 |
'tab_conf_main_section_subslistings', |
| 796 |
[ |
| 797 |
'label' => esc_html__('Related Listings', 'wpdirectorykit'), |
| 798 |
'tab' => 'tab_conf', |
| 799 |
] |
| 800 |
); |
| 801 |
|
| 802 |
$WMVC = &wdk_get_instance(); |
| 803 |
$WMVC->model('field_m'); |
| 804 |
$fields_data = $WMVC->field_m->get(); |
| 805 |
$fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit')); |
| 806 |
$order_i = 0; |
| 807 |
|
| 808 |
$fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit'); |
| 809 |
$fields_list [(++$order_i).'__idlisting'] = esc_html__('Id listing', 'wpdirectorykit'); |
| 810 |
$fields_list [(++$order_i).'__post_id'] = esc_html__('Post Id', 'wpdirectorykit'); |
| 811 |
$fields_list [(++$order_i).'__counter_views'] = esc_html__('Views counter', 'wpdirectorykit'); |
| 812 |
$fields_list [(++$order_i).'__lat'] = esc_html__('Gps Lat', 'wpdirectorykit'); |
| 813 |
$fields_list [(++$order_i).'__lng'] = esc_html__('Gps Lng', 'wpdirectorykit'); |
| 814 |
$fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit'); |
| 815 |
$fields_list [(++$order_i).'__date_modified'] = esc_html__('Date Modified', 'wpdirectorykit'); |
| 816 |
$fields_list [(++$order_i).'__post_title'] = esc_html__('WP Title', 'wpdirectorykit'); |
| 817 |
$fields_list [(++$order_i).'__post_content'] = esc_html__('WP Content', 'wpdirectorykit'); |
| 818 |
$fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit'); |
| 819 |
$fields_list [(++$order_i).'__category_id'] = esc_html__('Category', 'wpdirectorykit'); |
| 820 |
$fields_list [(++$order_i).'__location_id'] = esc_html__('Location', 'wpdirectorykit'); |
| 821 |
|
| 822 |
foreach($fields_data as $field) |
| 823 |
{ |
| 824 |
if(wmvc_show_data('field_type', $field) == 'SECTION') { |
| 825 |
$fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --'; |
| 826 |
} else { |
| 827 |
$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).']'; |
| 828 |
} |
| 829 |
} |
| 830 |
|
| 831 |
$this->add_responsive_control( |
| 832 |
'related_fields_header', |
| 833 |
[ |
| 834 |
'label' => esc_html__('Fields', 'wpdirectorykit'), |
| 835 |
'type' => Controls_Manager::HEADING, |
| 836 |
] |
| 837 |
); |
| 838 |
|
| 839 |
$this->add_control( |
| 840 |
'related_fields_header_hr', |
| 841 |
[ |
| 842 |
'type' => \Elementor\Controls_Manager::DIVIDER, |
| 843 |
] |
| 844 |
); |
| 845 |
|
| 846 |
$repeater_sublistings_fields = new Repeater(); |
| 847 |
$repeater_sublistings_fields->start_controls_tabs( 'related_fields' ); |
| 848 |
$repeater_sublistings_fields->add_control( |
| 849 |
'field', |
| 850 |
[ |
| 851 |
'label' => __( 'Field', 'wpdirectorykit' ), |
| 852 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 853 |
'options' => $fields_list, |
| 854 |
] |
| 855 |
); |
| 856 |
|
| 857 |
$repeater_sublistings_fields->add_control( |
| 858 |
'is_stars', |
| 859 |
[ |
| 860 |
'label' => __( 'Show like stars', 'wpdirectorykit' ), |
| 861 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 862 |
'label_on' => __( 'On', 'wpdirectorykit' ), |
| 863 |
'label_off' => __( 'Off', 'wpdirectorykit' ), |
| 864 |
'return_value' => 'yes', |
| 865 |
'default' => '', |
| 866 |
'description' => esc_html__( 'Numeric values required', 'wpdirectorykit' ), |
| 867 |
] |
| 868 |
); |
| 869 |
|
| 870 |
$repeater_sublistings_fields->add_control( |
| 871 |
'is_link', |
| 872 |
[ |
| 873 |
'label' => __( 'Set field like link', 'wpdirectorykit' ), |
| 874 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 875 |
'label_on' => __( 'On', 'wpdirectorykit' ), |
| 876 |
'label_off' => __( 'Off', 'wpdirectorykit' ), |
| 877 |
'return_value' => 'yes', |
| 878 |
'default' => 'yes', |
| 879 |
] |
| 880 |
); |
| 881 |
|
| 882 |
$repeater_sublistings_fields->end_controls_tabs(); |
| 883 |
|
| 884 |
$this->add_control( |
| 885 |
'related_fields_list', |
| 886 |
[ |
| 887 |
'label' => esc_html__('Fields For Query Similar Listings', 'wpdirectorykit'), |
| 888 |
'type' => Controls_Manager::REPEATER, |
| 889 |
'fields' => $repeater_sublistings_fields->get_controls(), |
| 890 |
'default' => [ |
| 891 |
[ |
| 892 |
'field' => '63', |
| 893 |
'is_stars' => 'yes', |
| 894 |
'is_link' => '', |
| 895 |
], |
| 896 |
[ |
| 897 |
'field' => 'post_title', |
| 898 |
'is_link' => 'yes', |
| 899 |
], |
| 900 |
[ |
| 901 |
'field' => '64', |
| 902 |
'is_link' => '', |
| 903 |
], |
| 904 |
], |
| 905 |
'title_field' => '{{{ field }}}', |
| 906 |
] |
| 907 |
); |
| 908 |
|
| 909 |
$this->add_control( |
| 910 |
'related_fields_header_hr2', |
| 911 |
[ |
| 912 |
'type' => \Elementor\Controls_Manager::DIVIDER, |
| 913 |
] |
| 914 |
); |
| 915 |
|
| 916 |
$this->add_responsive_control( |
| 917 |
'related_fields_border', |
| 918 |
[ |
| 919 |
'label' => esc_html__('Line Bottom', 'wpdirectorykit'), |
| 920 |
'type' => Controls_Manager::HEADING, |
| 921 |
] |
| 922 |
); |
| 923 |
|
| 924 |
$this->add_control( |
| 925 |
'related_fields_border_width', |
| 926 |
[ |
| 927 |
'label' => __( 'Speed', 'wpdirectorykit' ), |
| 928 |
'type' => \Elementor\Controls_Manager::NUMBER, |
| 929 |
'min' => 0, |
| 930 |
'max' => 10, |
| 931 |
'step' => 1, |
| 932 |
'default' => 1, |
| 933 |
'selectors' => [ |
| 934 |
'{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part ul > li:not(:last-child)' => 'border-bottom-width: {{SIZE}}{{UNIT}};', |
| 935 |
], |
| 936 |
] |
| 937 |
); |
| 938 |
|
| 939 |
$this->add_responsive_control( |
| 940 |
'related_fields_border_color', |
| 941 |
[ |
| 942 |
'label' => esc_html__( 'Color', 'wpdirectorykit' ), |
| 943 |
'type' => Controls_Manager::COLOR, |
| 944 |
'selectors' => [ |
| 945 |
'{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part ul > li:not(:last-child)' => 'border-bottom-color: {{VALUE}};', |
| 946 |
], |
| 947 |
] |
| 948 |
); |
| 949 |
|
| 950 |
$this->add_responsive_control( |
| 951 |
'related_fields_styles', |
| 952 |
[ |
| 953 |
'label' => esc_html__('Styles', 'wpdirectorykit'), |
| 954 |
'type' => Controls_Manager::HEADING, |
| 955 |
] |
| 956 |
); |
| 957 |
|
| 958 |
$this->add_control( |
| 959 |
'related_fields_header_hr3', |
| 960 |
[ |
| 961 |
'type' => \Elementor\Controls_Manager::DIVIDER, |
| 962 |
] |
| 963 |
); |
| 964 |
|
| 965 |
$selectors = array( |
| 966 |
'normal' => '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part a, {{WRAPPER}} .wdk-listing-card .wdk-sublistings-part span', |
| 967 |
'hover'=>'{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part a%1$s' |
| 968 |
); |
| 969 |
$this->generate_renders_tabs($selectors, 'related_fields_dynamic', ['color','typo','padding','shadow','transition']); |
| 970 |
|
| 971 |
$this->add_control( |
| 972 |
'related_fields_part_styles', |
| 973 |
[ |
| 974 |
'label' => esc_html__('Card Part', 'wpdirectorykit'), |
| 975 |
'type' => Controls_Manager::HEADING, |
| 976 |
] |
| 977 |
); |
| 978 |
|
| 979 |
$this->add_control( |
| 980 |
'related_fields_header_hr4', |
| 981 |
[ |
| 982 |
'type' => \Elementor\Controls_Manager::DIVIDER, |
| 983 |
] |
| 984 |
); |
| 985 |
|
| 986 |
$selectors = array( |
| 987 |
'normal' => '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part', |
| 988 |
); |
| 989 |
$this->generate_renders_tabs($selectors, 'related_fields_part_dynamic', ['margin','background','border','border_radius','padding','shadow','transition']); |
| 990 |
|
| 991 |
$this->add_control( |
| 992 |
'related_fields_star_styles', |
| 993 |
[ |
| 994 |
'label' => esc_html__('Stars', 'wpdirectorykit'), |
| 995 |
'type' => Controls_Manager::HEADING, |
| 996 |
] |
| 997 |
); |
| 998 |
|
| 999 |
$this->add_control( |
| 1000 |
'related_fields_header_hr5', |
| 1001 |
[ |
| 1002 |
'type' => \Elementor\Controls_Manager::DIVIDER, |
| 1003 |
] |
| 1004 |
); |
| 1005 |
|
| 1006 |
$selectors = array( |
| 1007 |
'active' => '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part .stars-lst span i.star-active', |
| 1008 |
'deactive' => '{{WRAPPER}} .wdk-listing-card .wdk-sublistings-part .stars-lst span i.innactive', |
| 1009 |
); |
| 1010 |
$this->generate_renders_tabs($selectors, 'related_fields_star_dynamic', ['margin','padding','font-size', 'color']); |
| 1011 |
|
| 1012 |
$this->end_controls_section(); |
| 1013 |
} |
| 1014 |
} |
| 1015 |
|
| 1016 |
private function generate_controls_layout() { |
| 1017 |
$this->start_controls_section( |
| 1018 |
'tab_content', |
| 1019 |
[ |
| 1020 |
'label' => esc_html__('Basic', 'wpdirectorykit'), |
| 1021 |
'tab' => 'tab_layout', |
| 1022 |
] |
| 1023 |
); |
| 1024 |
|
| 1025 |
$this->add_control( |
| 1026 |
'layout_type', |
| 1027 |
[ |
| 1028 |
'label' => __( 'Layout Type', 'wpdirectorykit' ), |
| 1029 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 1030 |
'default' => 'grid', |
| 1031 |
'options' => [ |
| 1032 |
'grid' => __( 'Grid', 'wpdirectorykit' ), |
| 1033 |
'list' => __( 'List', 'wpdirectorykit' ), |
| 1034 |
'carousel' => __( 'Carousel', 'wpdirectorykit' ), |
| 1035 |
], |
| 1036 |
] |
| 1037 |
); |
| 1038 |
|
| 1039 |
|
| 1040 |
$this->add_control( |
| 1041 |
'enable_separed_styles', |
| 1042 |
[ |
| 1043 |
'label' => __( 'Different styles for grid/list', 'wpdirectorykit' ), |
| 1044 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 1045 |
'label_on' => __( 'On', 'wpdirectorykit' ), |
| 1046 |
'label_off' => __( 'Off', 'wpdirectorykit' ), |
| 1047 |
'return_value' => 'true', |
| 1048 |
'default' => '', |
| 1049 |
'conditions' => [ |
| 1050 |
'relation' => 'or', |
| 1051 |
'terms' => [ |
| 1052 |
[ |
| 1053 |
'name' => 'layout_type', |
| 1054 |
'operator' => '==', |
| 1055 |
'value' => 'grid', |
| 1056 |
], |
| 1057 |
[ |
| 1058 |
'name' => 'layout_type', |
| 1059 |
'operator' => '==', |
| 1060 |
'value' => 'list', |
| 1061 |
] |
| 1062 |
], |
| 1063 |
], |
| 1064 |
] |
| 1065 |
); |
| 1066 |
|
| 1067 |
$this->add_responsive_control( |
| 1068 |
'row_gap_col', |
| 1069 |
[ |
| 1070 |
'label' => __( 'Columns', 'wpdirectorykit' ), |
| 1071 |
'type' => Controls_Manager::SELECT, |
| 1072 |
'options' => [ |
| 1073 |
'' => esc_html__('Default', 'wpdirectorykit'), |
| 1074 |
'auto' => esc_html__('Auto', 'wpdirectorykit'), |
| 1075 |
'100%' => '1', |
| 1076 |
'50%' => '2', |
| 1077 |
'calc(100% / 3)' => '3', |
| 1078 |
'25%' => '4', |
| 1079 |
'20%' => '5', |
| 1080 |
'auto_flexible' => 'auto flexible', |
| 1081 |
], |
| 1082 |
'selectors_dictionary' => [ |
| 1083 |
'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto', |
| 1084 |
'100%' => 'width:100%;-webkit-flex:0 0 100%;flex:0 0 100%', |
| 1085 |
'50%' => 'width:50%;-webkit-flex:0 0 50%;flex:0 0 50%', |
| 1086 |
'calc(100% / 3)' => 'width:calc(100% / 3);-webkit-flex:0 0 calc(100% / 3);flex:0 0 calc(100% / 3)', |
| 1087 |
'25%' => 'width:25%;-webkit-flex:0 0 25%;flex:0 0 25%', |
| 1088 |
'20%' => 'width:20%;-webkit-flex:0 0 20%;flex:0 0 20%', |
| 1089 |
'auto' => 'width:auto;-webkit-flex:0 0 auto;flex:0 0 auto', |
| 1090 |
'auto_flexible' => 'width:auto;-webkit-flex:1 2 auto;flex:1 2 auto', |
| 1091 |
], |
| 1092 |
'selectors' => [ |
| 1093 |
'{{WRAPPER}} .wdk-row .wdk-col' => '{{UNIT}}', |
| 1094 |
], |
| 1095 |
'default' => 'calc(100% / 3)', |
| 1096 |
'separator' => 'before', |
| 1097 |
'conditions' => [ |
| 1098 |
'terms' => [ |
| 1099 |
[ |
| 1100 |
'name' => 'layout_type', |
| 1101 |
'operator' => '==', |
| 1102 |
'value' => 'grid', |
| 1103 |
] |
| 1104 |
], |
| 1105 |
], |
| 1106 |
] |
| 1107 |
); |
| 1108 |
|
| 1109 |
$this->add_responsive_control( |
| 1110 |
'column_gap', |
| 1111 |
[ |
| 1112 |
'label' => esc_html__('Columns Gap', 'wpdirectorykit'), |
| 1113 |
'type' => Controls_Manager::SLIDER, |
| 1114 |
'default' => [ |
| 1115 |
'size' => 10, |
| 1116 |
], |
| 1117 |
'range' => [ |
| 1118 |
'px' => [ |
| 1119 |
'min' => 0, |
| 1120 |
'max' => 60, |
| 1121 |
], |
| 1122 |
], |
| 1123 |
'selectors' => [ |
| 1124 |
'{{WRAPPER}} .wdk-row .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};;', |
| 1125 |
'{{WRAPPER}} .wdk-row' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};', |
| 1126 |
], |
| 1127 |
'conditions' => [ |
| 1128 |
'terms' => [ |
| 1129 |
[ |
| 1130 |
'name' => 'layout_type', |
| 1131 |
'operator' => '==', |
| 1132 |
'value' => 'grid', |
| 1133 |
], |
| 1134 |
], |
| 1135 |
], |
| 1136 |
] |
| 1137 |
); |
| 1138 |
|
| 1139 |
$this->add_responsive_control( |
| 1140 |
'row_gap', |
| 1141 |
[ |
| 1142 |
'label' => esc_html__('Rows Gap', 'wpdirectorykit'), |
| 1143 |
'type' => Controls_Manager::SLIDER, |
| 1144 |
'default' => [ |
| 1145 |
'size' => 10, |
| 1146 |
], |
| 1147 |
'range' => [ |
| 1148 |
'px' => [ |
| 1149 |
'min' => 0, |
| 1150 |
'max' => 60, |
| 1151 |
], |
| 1152 |
], |
| 1153 |
'selectors' => [ |
| 1154 |
'{{WRAPPER}} .wdk-row .wdk-col' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 1155 |
'{{WRAPPER}} .wdk-row' => 'margin-bottom: -{{SIZE}}{{UNIT}};', |
| 1156 |
], |
| 1157 |
'conditions' => [ |
| 1158 |
'terms' => [ |
| 1159 |
[ |
| 1160 |
'name' => 'layout_type', |
| 1161 |
'operator' => '!=', |
| 1162 |
'value' => 'carousel', |
| 1163 |
] |
| 1164 |
], |
| 1165 |
], |
| 1166 |
] |
| 1167 |
); |
| 1168 |
|
| 1169 |
$this->add_responsive_control( |
| 1170 |
'thumbnail_width', |
| 1171 |
[ |
| 1172 |
'label' => esc_html__('Thumbnail width (For List Version)', 'wpdirectorykit'), |
| 1173 |
'type' => Controls_Manager::SLIDER, |
| 1174 |
'default' => [ |
| 1175 |
'size' => 270, |
| 1176 |
'unit' => 'px', |
| 1177 |
], |
| 1178 |
'size_units' => [ 'px', '%' ], |
| 1179 |
'range' => [ |
| 1180 |
'px' => [ |
| 1181 |
'min' => 0, |
| 1182 |
'max' => 600, |
| 1183 |
], |
| 1184 |
'%' => [ |
| 1185 |
'min' => 0, |
| 1186 |
'max' => 100, |
| 1187 |
], |
| 1188 |
], |
| 1189 |
'selectors' => [ |
| 1190 |
'{{WRAPPER}} .wdk-element .wdk-listing-card.list .wdk-thumbnail' => 'flex: 0 0 {{SIZE}}{{UNIT}};', |
| 1191 |
], |
| 1192 |
'conditions' => [ |
| 1193 |
'terms' => [ |
| 1194 |
[ |
| 1195 |
'name' => 'layout_type', |
| 1196 |
'operator' => '==', |
| 1197 |
'value' => 'list', |
| 1198 |
] |
| 1199 |
], |
| 1200 |
], |
| 1201 |
] |
| 1202 |
); |
| 1203 |
|
| 1204 |
/* Carousel Grid Config */ |
| 1205 |
if(true) { |
| 1206 |
$this->add_responsive_control( |
| 1207 |
'carousel_column_gap_carousel', |
| 1208 |
[ |
| 1209 |
'label' => esc_html__('Slider Gap', 'wpdirectorykit'), |
| 1210 |
'type' => Controls_Manager::SLIDER, |
| 1211 |
'range' => [ |
| 1212 |
'px' => [ |
| 1213 |
'min' => 0, |
| 1214 |
'max' => 60, |
| 1215 |
], |
| 1216 |
], |
| 1217 |
'selectors' => [ |
| 1218 |
'{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini ' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};', |
| 1219 |
], |
| 1220 |
'conditions' => [ |
| 1221 |
'terms' => [ |
| 1222 |
[ |
| 1223 |
'name' => 'layout_type', |
| 1224 |
'operator' => '==', |
| 1225 |
'value' => 'carousel', |
| 1226 |
] |
| 1227 |
], |
| 1228 |
], |
| 1229 |
] |
| 1230 |
); |
| 1231 |
|
| 1232 |
$this->add_responsive_control ( |
| 1233 |
'carousel_column_gap', |
| 1234 |
[ |
| 1235 |
'label' => esc_html__('Columns Gap', 'wpdirectorykit'), |
| 1236 |
'type' => Controls_Manager::SLIDER, |
| 1237 |
'default' => [ |
| 1238 |
'size' => 10, |
| 1239 |
], |
| 1240 |
'range' => [ |
| 1241 |
'px' => [ |
| 1242 |
'min' => 0, |
| 1243 |
'max' => 60, |
| 1244 |
], |
| 1245 |
], |
| 1246 |
'selectors' => [ |
| 1247 |
'{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini .wdk-col' => 'padding-left: {{SIZE}}{{UNIT}};padding-right: {{SIZE}}{{UNIT}};', |
| 1248 |
'{{WRAPPER}} .slick-slider.wdk_results_listings_slider_ini' => 'margin-left: -{{SIZE}}{{UNIT}};margin-right: -{{SIZE}}{{UNIT}};', |
| 1249 |
], |
| 1250 |
'conditions' => [ |
| 1251 |
'terms' => [ |
| 1252 |
[ |
| 1253 |
'name' => 'layout_type', |
| 1254 |
'operator' => '==', |
| 1255 |
'value' => 'carousel', |
| 1256 |
] |
| 1257 |
], |
| 1258 |
], |
| 1259 |
] |
| 1260 |
); |
| 1261 |
|
| 1262 |
$this->add_responsive_control( |
| 1263 |
'carousel_column_gap_top', |
| 1264 |
[ |
| 1265 |
'label' => esc_html__('Columns Gap Top', 'wpdirectorykit'), |
| 1266 |
'type' => Controls_Manager::SLIDER, |
| 1267 |
'default' => [ |
| 1268 |
'size' => 0, |
| 1269 |
], |
| 1270 |
'range' => [ |
| 1271 |
'px' => [ |
| 1272 |
'min' => 0, |
| 1273 |
'max' => 60, |
| 1274 |
], |
| 1275 |
], |
| 1276 |
'selectors' => [ |
| 1277 |
'{{WRAPPER}} .wdk_results_listings_slider_box' => 'padding-top: {{SIZE}}{{UNIT}};', |
| 1278 |
], |
| 1279 |
'conditions' => [ |
| 1280 |
'terms' => [ |
| 1281 |
[ |
| 1282 |
'name' => 'layout_type', |
| 1283 |
'operator' => '==', |
| 1284 |
'value' => 'carousel', |
| 1285 |
] |
| 1286 |
], |
| 1287 |
], |
| 1288 |
] |
| 1289 |
); |
| 1290 |
|
| 1291 |
$this->add_responsive_control( |
| 1292 |
'carousel_column_gap_bottom', |
| 1293 |
[ |
| 1294 |
'label' => esc_html__('Columns Gap Bottom', 'wpdirectorykit'), |
| 1295 |
'type' => Controls_Manager::SLIDER, |
| 1296 |
'default' => [ |
| 1297 |
'size' => 10, |
| 1298 |
], |
| 1299 |
'range' => [ |
| 1300 |
'px' => [ |
| 1301 |
'min' => 0, |
| 1302 |
'max' => 60, |
| 1303 |
], |
| 1304 |
], |
| 1305 |
'selectors' => [ |
| 1306 |
'{{WRAPPER}} .wdk_results_listings_slider_box' => 'padding-bottom: {{SIZE}}{{UNIT}};', |
| 1307 |
], |
| 1308 |
'conditions' => [ |
| 1309 |
'terms' => [ |
| 1310 |
[ |
| 1311 |
'name' => 'layout_type', |
| 1312 |
'operator' => '==', |
| 1313 |
'value' => 'carousel', |
| 1314 |
] |
| 1315 |
], |
| 1316 |
], |
| 1317 |
] |
| 1318 |
); |
| 1319 |
} |
| 1320 |
|
| 1321 |
$this->add_responsive_control( |
| 1322 |
'thumbn_slider_h', |
| 1323 |
[ |
| 1324 |
'label' => esc_html__('Thumbnail Slider', 'wpdirectorykit'), |
| 1325 |
'type' => Controls_Manager::HEADING, |
| 1326 |
'separator' => 'before', |
| 1327 |
] |
| 1328 |
); |
| 1329 |
|
| 1330 |
$this->add_responsive_control( |
| 1331 |
'thumbn_slider_arrow_left', |
| 1332 |
[ |
| 1333 |
'label' => esc_html__('Icon Left', 'wpdirectorykit'), |
| 1334 |
'type' => Controls_Manager::ICONS, |
| 1335 |
'label_block' => true, |
| 1336 |
] |
| 1337 |
); |
| 1338 |
|
| 1339 |
$this->add_responsive_control( |
| 1340 |
'thumbn_slider_arrow_right', |
| 1341 |
[ |
| 1342 |
'label' => esc_html__('Icon Right', 'wpdirectorykit'), |
| 1343 |
'type' => Controls_Manager::ICONS, |
| 1344 |
'label_block' => true, |
| 1345 |
] |
| 1346 |
); |
| 1347 |
|
| 1348 |
$this->end_controls_section(); |
| 1349 |
|
| 1350 |
$this->start_controls_section( |
| 1351 |
'layout_carousel_sec', |
| 1352 |
[ |
| 1353 |
'label' => esc_html__('Carousel Options', 'wpdirectorykit'), |
| 1354 |
'tab' => 'tab_layout', |
| 1355 |
'conditions' => [ |
| 1356 |
'terms' => [ |
| 1357 |
[ |
| 1358 |
'name' => 'layout_type', |
| 1359 |
'operator' => '==', |
| 1360 |
'value' => 'carousel', |
| 1361 |
] |
| 1362 |
], |
| 1363 |
], |
| 1364 |
] |
| 1365 |
); |
| 1366 |
|
| 1367 |
$this->add_control( |
| 1368 |
'layout_carousel_is_infinite', |
| 1369 |
[ |
| 1370 |
'label' => __( 'Infinite', 'wpdirectorykit' ), |
| 1371 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 1372 |
'label_on' => __( 'On', 'wpdirectorykit' ), |
| 1373 |
'label_off' => __( 'Off', 'wpdirectorykit' ), |
| 1374 |
'return_value' => 'true', |
| 1375 |
'default' => 'true', |
| 1376 |
] |
| 1377 |
); |
| 1378 |
|
| 1379 |
$this->add_control( |
| 1380 |
'layout_carousel_is_autoplay', |
| 1381 |
[ |
| 1382 |
'label' => __( 'Autoplay', 'wpdirectorykit' ), |
| 1383 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 1384 |
'label_on' => __( 'On', 'wpdirectorykit' ), |
| 1385 |
'label_off' => __( 'Off', 'wpdirectorykit' ), |
| 1386 |
'return_value' => 'true', |
| 1387 |
'default' => '', |
| 1388 |
] |
| 1389 |
); |
| 1390 |
|
| 1391 |
$this->add_control( |
| 1392 |
'layout_carousel_speed', |
| 1393 |
[ |
| 1394 |
'label' => __( 'Speed', 'wpdirectorykit' ), |
| 1395 |
'type' => \Elementor\Controls_Manager::NUMBER, |
| 1396 |
'min' => 0, |
| 1397 |
'max' => 100000, |
| 1398 |
'step' => 100, |
| 1399 |
'default' => 500, |
| 1400 |
] |
| 1401 |
); |
| 1402 |
|
| 1403 |
$this->add_control( |
| 1404 |
'layout_carousel_animation_style', |
| 1405 |
[ |
| 1406 |
'label' => __( 'Animation Style', 'wpdirectorykit' ), |
| 1407 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 1408 |
'default' => 'fade', |
| 1409 |
'options' => [ |
| 1410 |
'slide' => __( 'Slide', 'wpdirectorykit' ), |
| 1411 |
'fade' => __( 'Fade', 'wpdirectorykit' ), |
| 1412 |
'fade_in_in' => __( 'Fade in', 'wpdirectorykit' ), |
| 1413 |
], |
| 1414 |
] |
| 1415 |
); |
| 1416 |
|
| 1417 |
$this->add_control( |
| 1418 |
'layout_carousel_cssease', |
| 1419 |
[ |
| 1420 |
'label' => __( 'cssEase', 'wpdirectorykit' ), |
| 1421 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 1422 |
'default' => 'linear', |
| 1423 |
'options' => [ |
| 1424 |
'linear' => __( 'linear', 'wpdirectorykit' ), |
| 1425 |
'ease' => __( 'ease', 'wpdirectorykit' ), |
| 1426 |
'ease-in' => __( 'ease-in', 'wpdirectorykit' ), |
| 1427 |
'ease-out' => __( 'ease-out', 'wpdirectorykit' ), |
| 1428 |
'ease-in-out' => __( 'ease-in-out', 'wpdirectorykit' ), |
| 1429 |
'step-start' => __( 'step-start', 'wpdirectorykit' ), |
| 1430 |
'step-end' => __( 'step-end', 'wpdirectorykit' ), |
| 1431 |
], |
| 1432 |
] |
| 1433 |
); |
| 1434 |
|
| 1435 |
$this->add_responsive_control( |
| 1436 |
'layout_carousel_columns', |
| 1437 |
[ |
| 1438 |
'label' => __( 'Count grid', 'wpdirectorykit' ), |
| 1439 |
'type' => \Elementor\Controls_Manager::NUMBER, |
| 1440 |
'min' => 1, |
| 1441 |
'max' => 10, |
| 1442 |
'step' => 1, |
| 1443 |
'default' => 3, |
| 1444 |
] |
| 1445 |
); |
| 1446 |
|
| 1447 |
$this->end_controls_section(); |
| 1448 |
|
| 1449 |
} |
| 1450 |
|
| 1451 |
private function generate_controls_styles() { |
| 1452 |
$this->start_controls_section( |
| 1453 |
'sstyles_thmbn_section', |
| 1454 |
[ |
| 1455 |
'label' => esc_html__('Section Image', 'wpdirectorykit'), |
| 1456 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1457 |
] |
| 1458 |
); |
| 1459 |
|
| 1460 |
$this->add_responsive_control( |
| 1461 |
'styles_thmbn_des_type', |
| 1462 |
[ |
| 1463 |
'label' => __( 'Design type', 'wpdirectorykit' ), |
| 1464 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 1465 |
'default' => 'wdk_size_image_cover', |
| 1466 |
'options' => [ |
| 1467 |
'wdk_size_image_ori' => __( 'Default Sizes', 'wpdirectorykit' ), |
| 1468 |
'wdk_size_image_cover' => __( 'Image auto crop/resize', 'wpdirectorykit' ), |
| 1469 |
], |
| 1470 |
] |
| 1471 |
); |
| 1472 |
|
| 1473 |
$this->add_responsive_control( |
| 1474 |
'styles_thmbn_des_height', |
| 1475 |
[ |
| 1476 |
'label' => esc_html__('Height Grid View', 'wpdirectorykit'), |
| 1477 |
'type' => Controls_Manager::SLIDER, |
| 1478 |
'range' => [ |
| 1479 |
'px' => [ |
| 1480 |
'min' => 50, |
| 1481 |
'max' => 1500, |
| 1482 |
], |
| 1483 |
'vw' => [ |
| 1484 |
'min' => 0, |
| 1485 |
'max' => 100, |
| 1486 |
], |
| 1487 |
'%' => [ |
| 1488 |
'min' => 0, |
| 1489 |
'max' => 100, |
| 1490 |
], |
| 1491 |
], |
| 1492 |
'size_units' => [ 'px', 'vw','%' ], |
| 1493 |
'default' => [ |
| 1494 |
'size' => 350, |
| 1495 |
'unit' => 'px', |
| 1496 |
], |
| 1497 |
'selectors' => [ |
| 1498 |
'{{WRAPPER}} .wdk-listings-results.wdk_size_image_cover .wdk-listing-card:not(.list) .wdk-thumbnail .wdk-image' => 'height: {{SIZE}}{{UNIT}}', |
| 1499 |
], |
| 1500 |
'conditions' => [ |
| 1501 |
'relation' => 'or', |
| 1502 |
'terms' => [ |
| 1503 |
[ |
| 1504 |
'name' => 'styles_thmbn_des_type', |
| 1505 |
'operator' => '==', |
| 1506 |
'value' => 'wdk_size_image_cover', |
| 1507 |
], |
| 1508 |
[ |
| 1509 |
'name' => 'styles_thmbn_des_type', |
| 1510 |
'operator' => '==', |
| 1511 |
'value' => 'wdk_image_cover', |
| 1512 |
] |
| 1513 |
], |
| 1514 |
] |
| 1515 |
] |
| 1516 |
); |
| 1517 |
|
| 1518 |
if(false) |
| 1519 |
$this->add_responsive_control( |
| 1520 |
'styles_thmbn_des_height_list', |
| 1521 |
[ |
| 1522 |
'label' => esc_html__('Height List view', 'wpdirectorykit'), |
| 1523 |
'type' => Controls_Manager::SLIDER, |
| 1524 |
'range' => [ |
| 1525 |
'px' => [ |
| 1526 |
'min' => 50, |
| 1527 |
'max' => 1500, |
| 1528 |
], |
| 1529 |
'vw' => [ |
| 1530 |
'min' => 0, |
| 1531 |
'max' => 100, |
| 1532 |
], |
| 1533 |
], |
| 1534 |
'size_units' => [ 'px', 'vw'], |
| 1535 |
'selectors' => [ |
| 1536 |
'{{WRAPPER}} .wdk-listings-results.wdk_size_image_cover .wdk-listing-card.list .wdk-thumbnail' => 'height: {{SIZE}}{{UNIT}}', |
| 1537 |
], |
| 1538 |
'separator' => 'after', |
| 1539 |
'conditions' => [ |
| 1540 |
'relation' => 'or', |
| 1541 |
'terms' => [ |
| 1542 |
[ |
| 1543 |
'name' => 'styles_thmbn_des_type', |
| 1544 |
'operator' => '==', |
| 1545 |
'value' => 'wdk_size_image_cover', |
| 1546 |
], |
| 1547 |
[ |
| 1548 |
'name' => 'styles_thmbn_des_type', |
| 1549 |
'operator' => '==', |
| 1550 |
'value' => 'wdk_image_cover', |
| 1551 |
] |
| 1552 |
], |
| 1553 |
] |
| 1554 |
] |
| 1555 |
); |
| 1556 |
|
| 1557 |
$this->end_controls_section(); |
| 1558 |
|
| 1559 |
$this->start_controls_section( |
| 1560 |
'styles_carousel_arrows_section', |
| 1561 |
[ |
| 1562 |
'label' => esc_html__('Carousel Arrows', 'wpdirectorykit'), |
| 1563 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1564 |
'conditions' => [ |
| 1565 |
'terms' => [ |
| 1566 |
[ |
| 1567 |
'name' => 'layout_type', |
| 1568 |
'operator' => '==', |
| 1569 |
'value' => 'carousel', |
| 1570 |
] |
| 1571 |
], |
| 1572 |
], |
| 1573 |
] |
| 1574 |
); |
| 1575 |
|
| 1576 |
$this->add_responsive_control( |
| 1577 |
'styles_carousel_arrows_hide', |
| 1578 |
[ |
| 1579 |
'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ), |
| 1580 |
'type' => Controls_Manager::SWITCHER, |
| 1581 |
'none' => esc_html__( 'Hide', 'wpdirectorykit' ), |
| 1582 |
'block' => esc_html__( 'Show', 'wpdirectorykit' ), |
| 1583 |
'return_value' => 'none', |
| 1584 |
'default' => '', |
| 1585 |
'selectors' => [ |
| 1586 |
'{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows' => 'display: {{VALUE}};', |
| 1587 |
], |
| 1588 |
] |
| 1589 |
); |
| 1590 |
|
| 1591 |
$this->add_responsive_control( |
| 1592 |
'styles_carousel_arrows_position', |
| 1593 |
[ |
| 1594 |
'label' => __( 'Position', 'wpdirectorykit' ), |
| 1595 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 1596 |
'default' => 'wdk_slider_arrows_bottom', |
| 1597 |
'options' => [ |
| 1598 |
'wdk_slider_arrows_bottom' => __( 'Bottom', 'wpdirectorykit' ), |
| 1599 |
'wdk_slider_arrows_middle' => __( 'Center', 'wpdirectorykit' ), |
| 1600 |
'wdk_slider_arrows_top' => __( 'Top', 'wpdirectorykit' ), |
| 1601 |
], |
| 1602 |
] |
| 1603 |
); |
| 1604 |
|
| 1605 |
if(false) |
| 1606 |
$this->add_responsive_control( |
| 1607 |
'styles_carousel_arrows_position_style', |
| 1608 |
[ |
| 1609 |
'label' => __( 'Position Style', 'wpdirectorykit' ), |
| 1610 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 1611 |
'default' => 'wdk_slider_arrows_out', |
| 1612 |
'options' => [ |
| 1613 |
'wdk_slider_arrows_out' => __( 'Out', 'wpdirectorykit' ), |
| 1614 |
'wdk_slider_arrows_in' => __( 'In', 'wpdirectorykit' ), |
| 1615 |
], |
| 1616 |
] |
| 1617 |
); |
| 1618 |
|
| 1619 |
$this->add_responsive_control( |
| 1620 |
'styles_carousel_arrows_align', |
| 1621 |
[ |
| 1622 |
'label' => __( 'Align', 'wpdirectorykit' ), |
| 1623 |
'type' => Controls_Manager::CHOOSE, |
| 1624 |
'options' => [ |
| 1625 |
'left' => [ |
| 1626 |
'title' => esc_html__( 'Left', 'wpdirectorykit' ), |
| 1627 |
'icon' => 'eicon-text-align-left', |
| 1628 |
], |
| 1629 |
'center' => [ |
| 1630 |
'title' => esc_html__( 'Center', 'wpdirectorykit' ), |
| 1631 |
'icon' => 'eicon-text-align-center', |
| 1632 |
], |
| 1633 |
'right' => [ |
| 1634 |
'title' => esc_html__( 'Right', 'wpdirectorykit' ), |
| 1635 |
'icon' => 'eicon-text-align-right', |
| 1636 |
], |
| 1637 |
'justify' => [ |
| 1638 |
'title' => esc_html__( 'Justified', 'wpdirectorykit' ), |
| 1639 |
'icon' => 'eicon-text-align-justify', |
| 1640 |
], |
| 1641 |
], |
| 1642 |
'render_type' => 'ui', |
| 1643 |
'selectors_dictionary' => [ |
| 1644 |
'left' => 'justify-content: flex-start;', |
| 1645 |
'center' => 'justify-content: center;', |
| 1646 |
'right' => 'justify-content: flex-end;', |
| 1647 |
'justify' => 'justify-content: space-between;', |
| 1648 |
], |
| 1649 |
'selectors' => [ |
| 1650 |
'{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows' => '{{VALUE}};', |
| 1651 |
], |
| 1652 |
'conditions' => [ |
| 1653 |
'terms' => [ |
| 1654 |
[ |
| 1655 |
'name' => 'styles_carousel_arrows_position', |
| 1656 |
'operator' => '!=', |
| 1657 |
'value' => 'wdk_slider_arrows_middle', |
| 1658 |
] |
| 1659 |
], |
| 1660 |
], |
| 1661 |
] |
| 1662 |
); |
| 1663 |
|
| 1664 |
$this->add_responsive_control( |
| 1665 |
'styles_carousel_arrows_icon_left_h', |
| 1666 |
[ |
| 1667 |
'label' => esc_html__('Arrow left', 'wpdirectorykit'), |
| 1668 |
'type' => Controls_Manager::HEADING, |
| 1669 |
'separator' => 'before', |
| 1670 |
] |
| 1671 |
); |
| 1672 |
|
| 1673 |
$this->add_responsive_control( |
| 1674 |
'styles_carousel_arrows_s_m_left_margin', |
| 1675 |
[ |
| 1676 |
'label' => esc_html__( 'Margin', 'wpdirectorykit' ), |
| 1677 |
'type' => Controls_Manager::DIMENSIONS, |
| 1678 |
'size_units' => [ 'px', 'em', '%' ], |
| 1679 |
'allowed_dimensions' => 'horizontal', |
| 1680 |
'selectors' => [ |
| 1681 |
'{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow.wdk-slider-prev' => 'margin-right:{{RIGHT}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};', |
| 1682 |
], |
| 1683 |
] |
| 1684 |
); |
| 1685 |
|
| 1686 |
$this->add_responsive_control( |
| 1687 |
'styles_carousel_arrows_icon_left', |
| 1688 |
[ |
| 1689 |
'label' => esc_html__('Icon', 'wpdirectorykit'), |
| 1690 |
'type' => Controls_Manager::ICONS, |
| 1691 |
'label_block' => true, |
| 1692 |
'default' => [ |
| 1693 |
'value' => 'fa fa-angle-left', |
| 1694 |
'library' => 'solid', |
| 1695 |
], |
| 1696 |
] |
| 1697 |
); |
| 1698 |
|
| 1699 |
$this->add_responsive_control( |
| 1700 |
'styles_carousel_arrows_icon_right_h', |
| 1701 |
[ |
| 1702 |
'label' => esc_html__('Arrow right', 'wpdirectorykit'), |
| 1703 |
'type' => Controls_Manager::HEADING, |
| 1704 |
'separator' => 'before', |
| 1705 |
] |
| 1706 |
); |
| 1707 |
|
| 1708 |
$this->add_responsive_control( |
| 1709 |
'styles_carousel_arrows_s_m_right_margin', |
| 1710 |
[ |
| 1711 |
'label' => esc_html__( 'Margin', 'wpdirectorykit' ), |
| 1712 |
'type' => Controls_Manager::DIMENSIONS, |
| 1713 |
'size_units' => [ 'px', 'em', '%' ], |
| 1714 |
'allowed_dimensions' => 'horizontal', |
| 1715 |
'selectors' => [ |
| 1716 |
'{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow.wdk-slider-next' => 'margin-right:{{RIGHT}}{{UNIT}}; margin-left:{{LEFT}}{{UNIT}};', |
| 1717 |
], |
| 1718 |
] |
| 1719 |
); |
| 1720 |
|
| 1721 |
$this->add_responsive_control( |
| 1722 |
'styles_carousel_arrows_icon_right', |
| 1723 |
[ |
| 1724 |
'label' => esc_html__('Icon', 'wpdirectorykit'), |
| 1725 |
'type' => Controls_Manager::ICONS, |
| 1726 |
'label_block' => true, |
| 1727 |
'default' => [ |
| 1728 |
'value' => 'fa fa-angle-right', |
| 1729 |
'library' => 'solid', |
| 1730 |
], |
| 1731 |
] |
| 1732 |
); |
| 1733 |
|
| 1734 |
$selectors = array( |
| 1735 |
'normal' => '{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow', |
| 1736 |
'hover'=>'{{WRAPPER}} .wdk_results_listings_slider_box .wdk_slider_arrows .wdk_lr_slider_arrow%1$s' |
| 1737 |
); |
| 1738 |
$this->generate_renders_tabs($selectors, 'styles_carousel_arrows_dynamic', ['margin','color','background','border','border_radius','padding','shadow','transition','font-size','hover_animation']); |
| 1739 |
|
| 1740 |
$this->end_controls_section(); |
| 1741 |
|
| 1742 |
$this->start_controls_section( |
| 1743 |
'styles_carousel_dots_section', |
| 1744 |
[ |
| 1745 |
'label' => esc_html__('Section Dots', 'wpdirectorykit'), |
| 1746 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1747 |
'conditions' => [ |
| 1748 |
'terms' => [ |
| 1749 |
[ |
| 1750 |
'name' => 'layout_type', |
| 1751 |
'operator' => '==', |
| 1752 |
'value' => 'carousel', |
| 1753 |
] |
| 1754 |
], |
| 1755 |
], |
| 1756 |
] |
| 1757 |
); |
| 1758 |
|
| 1759 |
$this->add_responsive_control( |
| 1760 |
'styles_carousel_dots_hide', |
| 1761 |
[ |
| 1762 |
'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ), |
| 1763 |
'type' => Controls_Manager::SWITCHER, |
| 1764 |
'none' => esc_html__( 'Hide', 'wpdirectorykit' ), |
| 1765 |
'block' => esc_html__( 'Show', 'wpdirectorykit' ), |
| 1766 |
'return_value' => 'none', |
| 1767 |
'default' => '', |
| 1768 |
'selectors' => [ |
| 1769 |
'{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots' => 'display: {{VALUE}} !important;', |
| 1770 |
], |
| 1771 |
] |
| 1772 |
); |
| 1773 |
|
| 1774 |
$this->add_responsive_control( |
| 1775 |
'styles_carousel_dots_position_style', |
| 1776 |
[ |
| 1777 |
'label' => __( 'Position Style', 'wpdirectorykit' ), |
| 1778 |
'type' => \Elementor\Controls_Manager::SELECT, |
| 1779 |
'default' => 'wdk_slider_dots_out', |
| 1780 |
'options' => [ |
| 1781 |
'wdk_slider_dots_out' => __( 'Out', 'wpdirectorykit' ), |
| 1782 |
'wdk_slider_dots_in' => __( 'In', 'wpdirectorykit' ), |
| 1783 |
], |
| 1784 |
] |
| 1785 |
); |
| 1786 |
|
| 1787 |
$this->add_responsive_control( |
| 1788 |
'styles_carousel_dots_align', |
| 1789 |
[ |
| 1790 |
'label' => __( 'Position', 'wpdirectorykit' ), |
| 1791 |
'type' => Controls_Manager::CHOOSE, |
| 1792 |
'options' => [ |
| 1793 |
'left' => [ |
| 1794 |
'title' => esc_html__( 'Left', 'wpdirectorykit' ), |
| 1795 |
'icon' => 'eicon-text-align-left', |
| 1796 |
], |
| 1797 |
'center' => [ |
| 1798 |
'title' => esc_html__( 'Center', 'wpdirectorykit' ), |
| 1799 |
'icon' => 'eicon-text-align-center', |
| 1800 |
], |
| 1801 |
'right' => [ |
| 1802 |
'title' => esc_html__( 'Right', 'wpdirectorykit' ), |
| 1803 |
'icon' => 'eicon-text-align-right', |
| 1804 |
], |
| 1805 |
'justify' => [ |
| 1806 |
'title' => esc_html__( 'Justified', 'wpdirectorykit' ), |
| 1807 |
'icon' => 'eicon-text-align-justify', |
| 1808 |
], |
| 1809 |
], |
| 1810 |
'render_type' => 'ui', |
| 1811 |
'selectors_dictionary' => [ |
| 1812 |
'left' => 'justify-content: flex-start;', |
| 1813 |
'center' => 'justify-content: center;', |
| 1814 |
'right' => 'justify-content: flex-end;', |
| 1815 |
'justify' => 'justify-content: space-between;', |
| 1816 |
], |
| 1817 |
'selectors' => [ |
| 1818 |
'{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots' => '{{VALUE}};', |
| 1819 |
], |
| 1820 |
] |
| 1821 |
); |
| 1822 |
|
| 1823 |
$this->add_responsive_control( |
| 1824 |
'styles_carousel_dots_icon', |
| 1825 |
[ |
| 1826 |
'label' => esc_html__('Icon', 'wpdirectorykit'), |
| 1827 |
'type' => Controls_Manager::ICONS, |
| 1828 |
'label_block' => true, |
| 1829 |
'default' => [ |
| 1830 |
'value' => 'fas fa-circle', |
| 1831 |
'library' => 'solid', |
| 1832 |
], |
| 1833 |
] |
| 1834 |
); |
| 1835 |
|
| 1836 |
$selectors = array( |
| 1837 |
'normal' => '{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots li .wdk_lr_dot', |
| 1838 |
'hover'=>'{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots li .wdk_lr_dot%1$s', |
| 1839 |
'active'=>'{{WRAPPER}} .wdk_results_listings_slider_box .slick-dots li.slick-active .wdk_lr_dot' |
| 1840 |
); |
| 1841 |
|
| 1842 |
$this->generate_renders_tabs($selectors, 'styles_carousel_dots_dynamic', ['margin','color','background','border','border_radius','padding','shadow','transition','font-size','hover_animation']); |
| 1843 |
|
| 1844 |
$this->end_controls_section(); |
| 1845 |
} |
| 1846 |
|
| 1847 |
private function generate_controls_content() { |
| 1848 |
|
| 1849 |
$this->start_controls_section( |
| 1850 |
'content_thumbnail_section', |
| 1851 |
[ |
| 1852 |
'label' => esc_html__('Colors', 'wpdirectorykit'), |
| 1853 |
'tab' => '1', |
| 1854 |
] |
| 1855 |
); |
| 1856 |
|
| 1857 |
$this->add_control( |
| 1858 |
'content_thumbnail_section_header', |
| 1859 |
[ |
| 1860 |
'label' => esc_html__('Color Hover Thumbnail', 'wpdirectorykit'), |
| 1861 |
'type' => Controls_Manager::HEADING, |
| 1862 |
] |
| 1863 |
); |
| 1864 |
|
| 1865 |
$this->add_responsive_control( |
| 1866 |
'content_thumbnail_section_d_background', |
| 1867 |
[ |
| 1868 |
'label' => esc_html__( 'Color', 'wpdirectorykit' ), |
| 1869 |
'description' => esc_html__( 'Set some opacity for color', 'wpdirectorykit' ), |
| 1870 |
'type' => Controls_Manager::COLOR, |
| 1871 |
'selectors' => [ |
| 1872 |
'{{WRAPPER}} .wdk-listing-card .wdk-thumbnail::before, {{WRAPPER}} .wdk-listing-card .wdk-thumbnail::after,{{WRAPPER}} .wdk-listing-card .overlay' => 'background-color: {{VALUE}};', |
| 1873 |
], |
| 1874 |
] |
| 1875 |
); |
| 1876 |
|
| 1877 |
$this->add_control( |
| 1878 |
'content_thumbnail_section_header_f', |
| 1879 |
[ |
| 1880 |
'label' => esc_html__('Shadow around Card, for Featured Listings', 'wpdirectorykit'), |
| 1881 |
'type' => Controls_Manager::HEADING, |
| 1882 |
] |
| 1883 |
); |
| 1884 |
|
| 1885 |
$this->add_group_control( |
| 1886 |
Group_Control_Box_Shadow::get_type(), |
| 1887 |
[ |
| 1888 |
'name' => 'content_thumbnail_section_d_featured', |
| 1889 |
'exclude' => [ |
| 1890 |
'field_shadow_position', |
| 1891 |
], |
| 1892 |
'selector' => '{{WRAPPER}} .wdk-listing-card.is_featured', |
| 1893 |
] |
| 1894 |
); |
| 1895 |
|
| 1896 |
$this->end_controls_section(); |
| 1897 |
|
| 1898 |
|
| 1899 |
$items = [ |
| 1900 |
[ |
| 1901 |
'key'=>'content_card', |
| 1902 |
'label'=> esc_html__('Card', 'wpdirectorykit'), |
| 1903 |
'selector'=>'.wdk-element .wdk-listing-card', |
| 1904 |
'options'=>'full', |
| 1905 |
], |
| 1906 |
[ |
| 1907 |
'key'=>'content_label', |
| 1908 |
'label'=> esc_html__('Over Image Top', 'wpdirectorykit'), |
| 1909 |
'selector'=>'.wdk-element .wdk-listing-card .wdk-thumbnail .wdk-over-image-top span', |
| 1910 |
'options'=>'full', |
| 1911 |
], |
| 1912 |
[ |
| 1913 |
'key'=>'content_type', |
| 1914 |
'label'=> esc_html__('Over Image Bottom', 'wpdirectorykit'), |
| 1915 |
'selector'=>'.wdk-element .wdk-listing-card .wdk-thumbnail .wdk-over-image-bottom', |
| 1916 |
'is_featured'=>'.wdk-element .wdk-listing-card.is_featured .wdk-thumbnail .wdk-over-image-bottom', |
| 1917 |
'options'=>'full', |
| 1918 |
], |
| 1919 |
[ |
| 1920 |
'key'=>'content_title', |
| 1921 |
'label'=> esc_html__('Title Part', 'wpdirectorykit'), |
| 1922 |
'selector'=>'.wdk-element .wdk-listing-card .wdk-title .title', |
| 1923 |
'options'=>'full', |
| 1924 |
], |
| 1925 |
[ |
| 1926 |
'key'=>'content_description', |
| 1927 |
'label'=> esc_html__('Subtitle part', 'wpdirectorykit'), |
| 1928 |
'selector'=>'.wdk-element .wdk-listing-card .wdk-subtitle-part', |
| 1929 |
'options'=>'full', |
| 1930 |
], |
| 1931 |
[ |
| 1932 |
'key'=>'content_items', |
| 1933 |
'label'=> esc_html__('Features part', 'wpdirectorykit'), |
| 1934 |
'selector'=>'.wdk-element .wdk-listing-card .wdk-features-part span', |
| 1935 |
'options'=>'full', |
| 1936 |
], |
| 1937 |
[ |
| 1938 |
'key'=>'wdk-divider', |
| 1939 |
'label'=> esc_html__('Divider', 'wpdirectorykit'), |
| 1940 |
'selector'=>'.wdk-element .wdk-listing-card .wdk-divider', |
| 1941 |
'options'=>'full', |
| 1942 |
], |
| 1943 |
[ |
| 1944 |
'key'=>'content_price', |
| 1945 |
'label'=> esc_html__('Pricing part', 'wpdirectorykit'), |
| 1946 |
'selector'=>'.wdk-element .wdk-listing-card .wdk-footer .wdk-price', |
| 1947 |
'options'=>'full', |
| 1948 |
], |
| 1949 |
[ |
| 1950 |
'key'=>'content_button', |
| 1951 |
'label'=> esc_html__('Button Open', 'wpdirectorykit'), |
| 1952 |
'selector'=>'.wdk-element .wdk-listing-card .wdk-footer .wdk-btn', |
| 1953 |
'options'=>['margin','align','typo','color','background_group','border','border_radius','padding','shadow','transition'], |
| 1954 |
], |
| 1955 |
]; |
| 1956 |
|
| 1957 |
$this->_generate_options_card($items,[ |
| 1958 |
'terms' => [ |
| 1959 |
[ |
| 1960 |
'name' => 'enable_separed_styles', |
| 1961 |
'operator' => '!=', |
| 1962 |
'value' => 'true', |
| 1963 |
] |
| 1964 |
], |
| 1965 |
]); |
| 1966 |
|
| 1967 |
$items = [ |
| 1968 |
[ |
| 1969 |
'key'=>'content_card_grid', |
| 1970 |
'label'=> esc_html__('Card (Grid)', 'wpdirectorykit'), |
| 1971 |
'selector'=>'.wdk-element .wdk-listing-card.grid', |
| 1972 |
'options'=>'full', |
| 1973 |
], |
| 1974 |
[ |
| 1975 |
'key'=>'content_label_grid', |
| 1976 |
'label'=> esc_html__('Over Image Top (Grid)', 'wpdirectorykit'), |
| 1977 |
'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-thumbnail .wdk-over-image-top span', |
| 1978 |
'options'=>'full', |
| 1979 |
], |
| 1980 |
[ |
| 1981 |
'key'=>'content_type_grid', |
| 1982 |
'label'=> esc_html__('Over Image Bottom (Grid)', 'wpdirectorykit'), |
| 1983 |
'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-thumbnail .wdk-over-image-bottom', |
| 1984 |
'is_featured'=>'.wdk-element .wdk-listing-card.grid.is_featured .wdk-thumbnail .wdk-over-image-bottom', |
| 1985 |
'options'=>'full', |
| 1986 |
], |
| 1987 |
[ |
| 1988 |
'key'=>'content_title_grid', |
| 1989 |
'label'=> esc_html__('Title Part (Grid)', 'wpdirectorykit'), |
| 1990 |
'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-title .title', |
| 1991 |
'options'=>'full', |
| 1992 |
], |
| 1993 |
[ |
| 1994 |
'key'=>'content_description_grid', |
| 1995 |
'label'=> esc_html__('Subtitle part (Grid)', 'wpdirectorykit'), |
| 1996 |
'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-subtitle-part', |
| 1997 |
'options'=>'full', |
| 1998 |
], |
| 1999 |
[ |
| 2000 |
'key'=>'content_items_grid', |
| 2001 |
'label'=> esc_html__('Features part (Grid)', 'wpdirectorykit'), |
| 2002 |
'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-features-part span', |
| 2003 |
'options'=>'full', |
| 2004 |
], |
| 2005 |
[ |
| 2006 |
'key'=>'wdk-divider_grid', |
| 2007 |
'label'=> esc_html__('Divider (Grid)', 'wpdirectorykit'), |
| 2008 |
'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-divider', |
| 2009 |
'options'=>'full', |
| 2010 |
], |
| 2011 |
[ |
| 2012 |
'key'=>'content_price_grid', |
| 2013 |
'label'=> esc_html__('Pricing part (Grid)', 'wpdirectorykit'), |
| 2014 |
'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-footer .wdk-price', |
| 2015 |
'options'=>'full', |
| 2016 |
], |
| 2017 |
[ |
| 2018 |
'key'=>'content_button_grid', |
| 2019 |
'label'=> esc_html__('Button Open (Grid)', 'wpdirectorykit'), |
| 2020 |
'selector'=>'.wdk-element .wdk-listing-card.grid .wdk-footer .wdk-btn', |
| 2021 |
'options'=>['margin','align','typo','color','background_group','border','border_radius','padding','shadow','transition'], |
| 2022 |
], |
| 2023 |
]; |
| 2024 |
|
| 2025 |
$this->_generate_options_card($items,[ |
| 2026 |
'terms' => [ |
| 2027 |
[ |
| 2028 |
'name' => 'enable_separed_styles', |
| 2029 |
'operator' => '==', |
| 2030 |
'value' => 'true', |
| 2031 |
] |
| 2032 |
], |
| 2033 |
]); |
| 2034 |
|
| 2035 |
$items = [ |
| 2036 |
[ |
| 2037 |
'key'=>'content_card_list', |
| 2038 |
'label'=> esc_html__('Card (List)', 'wpdirectorykit'), |
| 2039 |
'selector'=>'.wdk-element .wdk-listing-card.list', |
| 2040 |
'options'=>'full', |
| 2041 |
], |
| 2042 |
[ |
| 2043 |
'key'=>'content_label_list', |
| 2044 |
'label'=> esc_html__('Over Image Top (List)', 'wpdirectorykit'), |
| 2045 |
'selector'=>'.wdk-element .wdk-listing-card.list .wdk-thumbnail .wdk-over-image-top span', |
| 2046 |
'options'=>'full', |
| 2047 |
], |
| 2048 |
[ |
| 2049 |
'key'=>'content_type_list', |
| 2050 |
'label'=> esc_html__('Over Image Bottom (List)', 'wpdirectorykit'), |
| 2051 |
'selector'=>'.wdk-element .wdk-listing-card.list .wdk-thumbnail .wdk-over-image-bottom', |
| 2052 |
'is_featured'=>'.wdk-element .wdk-listing-card.list.is_featured .wdk-thumbnail .wdk-over-image-bottom', |
| 2053 |
'options'=>'full', |
| 2054 |
], |
| 2055 |
[ |
| 2056 |
'key'=>'content_title_list', |
| 2057 |
'label'=> esc_html__('Title Part (List)', 'wpdirectorykit'), |
| 2058 |
'selector'=>'.wdk-element .wdk-listing-card.list .wdk-title .title', |
| 2059 |
'options'=>'full', |
| 2060 |
], |
| 2061 |
[ |
| 2062 |
'key'=>'content_description_list', |
| 2063 |
'label'=> esc_html__('Subtitle part (List)', 'wpdirectorykit'), |
| 2064 |
'selector'=>'.wdk-element .wdk-listing-card.list .wdk-subtitle-part', |
| 2065 |
'options'=>'full', |
| 2066 |
], |
| 2067 |
[ |
| 2068 |
'key'=>'content_items_list', |
| 2069 |
'label'=> esc_html__('Features part (List)', 'wpdirectorykit'), |
| 2070 |
'selector'=>'.wdk-element .wdk-listing-card.list .wdk-features-part span', |
| 2071 |
'options'=>'full', |
| 2072 |
], |
| 2073 |
[ |
| 2074 |
'key'=>'wdk-divider_list', |
| 2075 |
'label'=> esc_html__('Divider (List)', 'wpdirectorykit'), |
| 2076 |
'selector'=>'.wdk-element .wdk-listing-card.list .wdk-divider', |
| 2077 |
'options'=>'full', |
| 2078 |
], |
| 2079 |
[ |
| 2080 |
'key'=>'content_price_list', |
| 2081 |
'label'=> esc_html__('Pricing part (List)', 'wpdirectorykit'), |
| 2082 |
'selector'=>'.wdk-element .wdk-listing-card.list .wdk-footer .wdk-price', |
| 2083 |
'options'=>'full', |
| 2084 |
], |
| 2085 |
[ |
| 2086 |
'key'=>'content_button_list', |
| 2087 |
'label'=> esc_html__('Button Open (List)', 'wpdirectorykit'), |
| 2088 |
'selector'=>'.wdk-element .wdk-listing-card.list .wdk-footer .wdk-btn', |
| 2089 |
'options'=>['margin','align','typo','color','background_group','border','border_radius','padding','shadow','transition'], |
| 2090 |
], |
| 2091 |
]; |
| 2092 |
|
| 2093 |
$this->_generate_options_card($items,[ |
| 2094 |
'terms' => [ |
| 2095 |
[ |
| 2096 |
'name' => 'enable_separed_styles', |
| 2097 |
'operator' => '==', |
| 2098 |
'value' => 'true', |
| 2099 |
] |
| 2100 |
], |
| 2101 |
]); |
| 2102 |
|
| 2103 |
|
| 2104 |
$this->start_controls_section( |
| 2105 |
'pagination_styles', |
| 2106 |
[ |
| 2107 |
'label' => esc_html__('Pagination Section', 'wpdirectorykit'), |
| 2108 |
'tab' => '1', |
| 2109 |
] |
| 2110 |
); |
| 2111 |
$this->add_responsive_control( |
| 2112 |
'pagination_styles_align', |
| 2113 |
[ |
| 2114 |
'label' => __( 'Align', 'wpdirectorykit' ), |
| 2115 |
'type' => Controls_Manager::CHOOSE, |
| 2116 |
'options' => [ |
| 2117 |
'left' => [ |
| 2118 |
'title' => esc_html__( 'Left', 'wpdirectorykit' ), |
| 2119 |
'icon' => 'eicon-text-align-left', |
| 2120 |
], |
| 2121 |
'center' => [ |
| 2122 |
'title' => esc_html__( 'Center', 'wpdirectorykit' ), |
| 2123 |
'icon' => 'eicon-text-align-center', |
| 2124 |
], |
| 2125 |
'right' => [ |
| 2126 |
'title' => esc_html__( 'Right', 'wpdirectorykit' ), |
| 2127 |
'icon' => 'eicon-text-align-right', |
| 2128 |
], |
| 2129 |
], |
| 2130 |
'render_type' => 'ui', |
| 2131 |
'selectors_dictionary' => [ |
| 2132 |
'left' => 'justify-content: flex-start;', |
| 2133 |
'center' => 'justify-content: center;', |
| 2134 |
'right' => 'justify-content: flex-end;', |
| 2135 |
], |
| 2136 |
'selectors' => [ |
| 2137 |
'{{WRAPPER}} .wdk-pagination.pagination' => '{{VALUE}};', |
| 2138 |
], |
| 2139 |
] |
| 2140 |
); |
| 2141 |
|
| 2142 |
$selectors = array( |
| 2143 |
'normal' => '{{WRAPPER}} .wdk-pagination.pagination', |
| 2144 |
); |
| 2145 |
|
| 2146 |
$this->generate_renders_tabs($selectors, 'pagination_styles_dynamic', 'block', ['align']); |
| 2147 |
|
| 2148 |
$this->add_control( |
| 2149 |
'pagination_styles_head', |
| 2150 |
[ |
| 2151 |
'label' => esc_html__('Pagination Links', 'wpdirectorykit'), |
| 2152 |
'type' => Controls_Manager::HEADING, |
| 2153 |
'separator' => 'before', |
| 2154 |
] |
| 2155 |
); |
| 2156 |
|
| 2157 |
$selectors = array( |
| 2158 |
'normal' => '{{WRAPPER}} .wdk-pagination.pagination .nav-links > *', |
| 2159 |
'hover'=>'{{WRAPPER}} .wdk-pagination.pagination .nav-links > *%1$s', |
| 2160 |
'active'=>'{{WRAPPER}} .wdk-pagination.pagination .nav-links > *.current' |
| 2161 |
); |
| 2162 |
$this->generate_renders_tabs($selectors, 'pagination_styles_items_dynamic', ['margin','align','typo','color','background','border','border_radius','padding','shadow','transition', 'width','height']); |
| 2163 |
|
| 2164 |
$this->end_controls_section(); |
| 2165 |
|
| 2166 |
$items = [ |
| 2167 |
/* header filter */ |
| 2168 |
[ |
| 2169 |
'key'=>'filter_section_box', |
| 2170 |
'label'=> esc_html__('Filter Box', 'wpdirectorykit'), |
| 2171 |
'selector'=>'.wdk-filter-head', |
| 2172 |
'options'=> ['margin','background','border','border_radius','padding','shadow'], |
| 2173 |
], |
| 2174 |
[ |
| 2175 |
'key'=>'filter_group_box', |
| 2176 |
'label'=> esc_html__('Group Box', 'wpdirectorykit'), |
| 2177 |
'selector'=>'.wdk-filter-head .filter-group', |
| 2178 |
'options'=>['margin','background','border','border_radius','padding','shadow'], |
| 2179 |
], |
| 2180 |
[ |
| 2181 |
'key'=>'filter_group_box_order_select', |
| 2182 |
'label'=> esc_html__('Select Order', 'wpdirectorykit'), |
| 2183 |
'selector'=>'.wdk-filter-head .filter-group .wdk-order', |
| 2184 |
'options'=>'full', |
| 2185 |
], |
| 2186 |
[ |
| 2187 |
'key'=>'filter_group_box_order', |
| 2188 |
'label'=> esc_html__('Group Box View Type', 'wpdirectorykit'), |
| 2189 |
'selector'=>'.wdk-filter-head .filter-group.wmvc-view-type', |
| 2190 |
'options'=>false, |
| 2191 |
], |
| 2192 |
[ |
| 2193 |
'key'=>'filter_group_box_view', |
| 2194 |
'label'=> esc_html__('View Type Icons', 'wpdirectorykit'), |
| 2195 |
'selector'=>'.wdk-filter-head .filter-group.wmvc-view-type a', |
| 2196 |
'hover_enable' => true, |
| 2197 |
'options'=>['align','font-size','color','background','border','border_radius','padding','shadow','transition','margin','width','height'], |
| 2198 |
], |
| 2199 |
[ |
| 2200 |
'key'=>'filter_group_box_filter-status', |
| 2201 |
'label'=> esc_html__('Listings Count', 'wpdirectorykit'), |
| 2202 |
'selector'=>'.wdk-filter-head .filter-group.filter-status', |
| 2203 |
'options'=>'text', |
| 2204 |
], |
| 2205 |
]; |
| 2206 |
|
| 2207 |
$this->start_controls_section( |
| 2208 |
'filter_section', |
| 2209 |
[ |
| 2210 |
'label' => esc_html__( 'Filter Header', 'wpdirectorykit' ), |
| 2211 |
'tab' => '1', |
| 2212 |
'conditions' => [ |
| 2213 |
'terms' => [ |
| 2214 |
[ |
| 2215 |
'name' => 'get_filters_enable', |
| 2216 |
'operator' => '==', |
| 2217 |
'value' => 'yes', |
| 2218 |
] |
| 2219 |
], |
| 2220 |
], |
| 2221 |
] |
| 2222 |
); |
| 2223 |
foreach ($items as $item) { |
| 2224 |
$this->add_control( |
| 2225 |
$item['key'].'_head', |
| 2226 |
[ |
| 2227 |
'label' => $item['label'], |
| 2228 |
'type' => Controls_Manager::HEADING, |
| 2229 |
'separator' => 'before', |
| 2230 |
] |
| 2231 |
); |
| 2232 |
|
| 2233 |
$this->add_responsive_control( |
| 2234 |
$item['key'].'_hide', |
| 2235 |
[ |
| 2236 |
'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ), |
| 2237 |
'type' => Controls_Manager::SWITCHER, |
| 2238 |
'none' => esc_html__( 'Hide', 'wpdirectorykit' ), |
| 2239 |
'block' => esc_html__( 'Show', 'wpdirectorykit' ), |
| 2240 |
'return_value' => 'none', |
| 2241 |
'default' => '', |
| 2242 |
'selectors' => [ |
| 2243 |
'{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};', |
| 2244 |
], |
| 2245 |
] |
| 2246 |
); |
| 2247 |
|
| 2248 |
if($item['options']){ |
| 2249 |
$selectors = array( |
| 2250 |
'normal' => '{{WRAPPER}} '.$item['selector'] |
| 2251 |
); |
| 2252 |
if(isset($item['hover_enable']) && $item['hover_enable']) |
| 2253 |
$selectors['hover'] = '{{WRAPPER}} '.$item['selector'].'%1$s'; |
| 2254 |
|
| 2255 |
|
| 2256 |
if( $item['key'] == 'filter_group_box_view') |
| 2257 |
$selectors['active'] = '{{WRAPPER}} '.$item['selector'].'.active'; |
| 2258 |
|
| 2259 |
$this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']); |
| 2260 |
} |
| 2261 |
/* special for some elements */ |
| 2262 |
if($item['key'] == 'filter_group_box_order') { |
| 2263 |
$this->add_responsive_control( |
| 2264 |
$item['key'].'_align', |
| 2265 |
[ |
| 2266 |
'label' => __( 'Position', 'wpdirectorykit' ), |
| 2267 |
'type' => Controls_Manager::CHOOSE, |
| 2268 |
'options' => [ |
| 2269 |
'left' => [ |
| 2270 |
'title' => esc_html__( 'Left', 'wpdirectorykit' ), |
| 2271 |
'icon' => 'eicon-text-align-left', |
| 2272 |
], |
| 2273 |
'center' => [ |
| 2274 |
'title' => esc_html__( 'Center', 'wpdirectorykit' ), |
| 2275 |
'icon' => 'eicon-text-align-center', |
| 2276 |
], |
| 2277 |
'right' => [ |
| 2278 |
'title' => esc_html__( 'Right', 'wpdirectorykit' ), |
| 2279 |
'icon' => 'eicon-text-align-right', |
| 2280 |
], |
| 2281 |
'justify' => [ |
| 2282 |
'title' => esc_html__( 'Justified', 'wpdirectorykit' ), |
| 2283 |
'icon' => 'eicon-text-align-justify', |
| 2284 |
], |
| 2285 |
], |
| 2286 |
'render_type' => 'ui', |
| 2287 |
'selectors_dictionary' => [ |
| 2288 |
'left' => 'justify-content: flex-start;', |
| 2289 |
'center' => 'justify-content: center;', |
| 2290 |
'right' => 'justify-content: flex-end;', |
| 2291 |
'justify' => 'justify-content: space-between;', |
| 2292 |
], |
| 2293 |
'selectors' => [ |
| 2294 |
'{{WRAPPER}} '.$item['selector'] => '{{VALUE}};', |
| 2295 |
], |
| 2296 |
] |
| 2297 |
); |
| 2298 |
} |
| 2299 |
if($item['key'] == 'filter_group_box') { |
| 2300 |
$this->add_control( |
| 2301 |
$item['key'].'_icon', |
| 2302 |
[ |
| 2303 |
'label' => esc_html__('Icon Order', 'wpdirectorykit'), |
| 2304 |
'type' => Controls_Manager::ICONS, |
| 2305 |
'label_block' => true, |
| 2306 |
'default' => [ |
| 2307 |
'value' => 'fa fa-filter', |
| 2308 |
'library' => 'solid', |
| 2309 |
], |
| 2310 |
] |
| 2311 |
); |
| 2312 |
$selectors = array( |
| 2313 |
'normal' => '{{WRAPPER}} '.$item['selector'].' i', |
| 2314 |
); |
| 2315 |
$this->generate_renders_tabs($selectors, $item['key'].'_icon_dynamic', ['margin']); |
| 2316 |
} |
| 2317 |
/* END special for some elements */ |
| 2318 |
} |
| 2319 |
$this->end_controls_section(); |
| 2320 |
} |
| 2321 |
|
| 2322 |
private function _generate_options_card($items, $conditions = NULL){ |
| 2323 |
|
| 2324 |
foreach ($items as $item) { |
| 2325 |
$this->start_controls_section( |
| 2326 |
$item['key'].'_section', |
| 2327 |
[ |
| 2328 |
'label' => $item['label'], |
| 2329 |
'tab' => '1', |
| 2330 |
'conditions' => $conditions |
| 2331 |
] |
| 2332 |
); |
| 2333 |
$this->add_responsive_control( |
| 2334 |
$item['key'].'_hide', |
| 2335 |
[ |
| 2336 |
'label' => esc_html__( 'Hide Element', 'wpdirectorykit' ), |
| 2337 |
'type' => Controls_Manager::SWITCHER, |
| 2338 |
'none' => esc_html__( 'Hide', 'wpdirectorykit' ), |
| 2339 |
'block' => esc_html__( 'Show', 'wpdirectorykit' ), |
| 2340 |
'return_value' => 'none', |
| 2341 |
'default' => '', |
| 2342 |
'selectors' => [ |
| 2343 |
'{{WRAPPER}} '.$item['selector'] => 'display: {{VALUE}};', |
| 2344 |
], |
| 2345 |
] |
| 2346 |
); |
| 2347 |
$selectors = array( |
| 2348 |
'normal' => '{{WRAPPER}} '.$item['selector'], |
| 2349 |
'hover'=>'{{WRAPPER}} '.$item['selector'].'%1$s' |
| 2350 |
); |
| 2351 |
|
| 2352 |
if(isset($item['is_featured'])) { |
| 2353 |
$selectors['featured'] = '{{WRAPPER}} '.$item['is_featured']; |
| 2354 |
} |
| 2355 |
|
| 2356 |
$this->generate_renders_tabs($selectors, $item['key'].'_dynamic', $item['options']); |
| 2357 |
|
| 2358 |
/* special for some elements */ |
| 2359 |
if (strpos($item['key'], 'content_description') !== FALSE ) { |
| 2360 |
|
| 2361 |
$key_option = $item['key'].'content_description_limit'; |
| 2362 |
if($item['key'] == 'content_description_limit') { |
| 2363 |
$key_option = 'content_description_limit'; |
| 2364 |
} |
| 2365 |
|
| 2366 |
$this->add_control( |
| 2367 |
$key_option, |
| 2368 |
[ |
| 2369 |
'label' => __( 'Limit Line (per field)', 'wpdirectorykit' ), |
| 2370 |
'type' => \Elementor\Controls_Manager::NUMBER, |
| 2371 |
'min' => 1, |
| 2372 |
'max' => 10, |
| 2373 |
'step' => 1, |
| 2374 |
'default' => 3, |
| 2375 |
'selectors' => [ |
| 2376 |
'{{WRAPPER}} .wdk-listing-card .wdk-subtitle-part span' => '-webkit-line-clamp: {{VALUE}};', |
| 2377 |
], |
| 2378 |
] |
| 2379 |
); |
| 2380 |
} |
| 2381 |
|
| 2382 |
if(strpos($item['key'], 'content_button') !== FALSE) { |
| 2383 |
|
| 2384 |
if($item['key'] == 'content_button') { |
| 2385 |
$this->add_control( |
| 2386 |
$item['key'].'_icon', |
| 2387 |
[ |
| 2388 |
'label' => esc_html__('Icon', 'wpdirectorykit'), |
| 2389 |
'type' => Controls_Manager::ICONS, |
| 2390 |
'label_block' => true, |
| 2391 |
'default' => [ |
| 2392 |
'value' => 'fa fa-angle-right', |
| 2393 |
'library' => 'solid', |
| 2394 |
], |
| 2395 |
] |
| 2396 |
); |
| 2397 |
$this->add_responsive_control( |
| 2398 |
$item['key'].'_text', |
| 2399 |
[ |
| 2400 |
'label' => __( 'Text of Link', 'wpdirectorykit' ), |
| 2401 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 2402 |
'default' => '', |
| 2403 |
] |
| 2404 |
); |
| 2405 |
} |
| 2406 |
|
| 2407 |
$selectors = array( |
| 2408 |
'normal' => '{{WRAPPER}} '.$item['selector'].' i', |
| 2409 |
); |
| 2410 |
$this->generate_renders_tabs($selectors, $item['key'].'_icon_dynamic', ['margin']); |
| 2411 |
} |
| 2412 |
|
| 2413 |
if(strpos($item['key'], 'content_label') !== FALSE) { |
| 2414 |
$this->add_control( |
| 2415 |
$item['key'].'_parent_head', |
| 2416 |
[ |
| 2417 |
'label' => esc_html__('Parent Box', 'wpdirectorykit'), |
| 2418 |
'type' => Controls_Manager::HEADING, |
| 2419 |
'separator' => 'before', |
| 2420 |
] |
| 2421 |
); |
| 2422 |
|
| 2423 |
$selectors = array( |
| 2424 |
'normal' => '{{WRAPPER}} .wdk-element .wdk-listing-card .wdk-over-image-top', |
| 2425 |
); |
| 2426 |
$this->generate_renders_tabs($selectors, $item['key'].'_parent_dynamic', ['margin']); |
| 2427 |
} |
| 2428 |
|
| 2429 |
if(strpos($item['key'], 'content_items') !== FALSE) { |
| 2430 |
$this->add_control( |
| 2431 |
$item['key'].'_parent_head', |
| 2432 |
[ |
| 2433 |
'label' => esc_html__('Parent Box', 'wpdirectorykit'), |
| 2434 |
'type' => Controls_Manager::HEADING, |
| 2435 |
'separator' => 'before', |
| 2436 |
] |
| 2437 |
); |
| 2438 |
|
| 2439 |
$selectors = array( |
| 2440 |
'normal' => '{{WRAPPER}} .wdk-element .wdk-listing-card .wdk-features-part', |
| 2441 |
); |
| 2442 |
$this->generate_renders_tabs($selectors, $item['key'].'_parent_dynamic', ['margin','align']); |
| 2443 |
} |
| 2444 |
|
| 2445 |
if(strpos($item['key'], 'content_label') !== FALSE) { |
| 2446 |
$this->add_responsive_control( |
| 2447 |
$item['key'] .'content_label_positions_y', |
| 2448 |
[ |
| 2449 |
'label' => __( 'Position Y', 'wpdirectorykit' ), |
| 2450 |
'type' => Controls_Manager::CHOOSE, |
| 2451 |
'options' => [ |
| 2452 |
'top' => [ |
| 2453 |
'title' => esc_html__( 'Top', 'wpdirectorykit' ), |
| 2454 |
'icon' => 'eicon-text-align-top', |
| 2455 |
], |
| 2456 |
'center' => [ |
| 2457 |
'title' => esc_html__( 'Center', 'wpdirectorykit' ), |
| 2458 |
'icon' => 'eicon-text-align-center', |
| 2459 |
], |
| 2460 |
'bottom' => [ |
| 2461 |
'title' => esc_html__( 'Bottom', 'wpdirectorykit' ), |
| 2462 |
'icon' => 'eicon-text-align-bottom', |
| 2463 |
], |
| 2464 |
], |
| 2465 |
'default' => 'left', |
| 2466 |
'render_type' => 'ui', |
| 2467 |
'selectors_dictionary' => [ |
| 2468 |
'top' => 'top:0;bottom:initial', |
| 2469 |
'center' => 'top:50%;transform: translateY(-50%)', |
| 2470 |
'bottom' => 'top:initial;bottom:0', |
| 2471 |
], |
| 2472 |
'selectors' => [ |
| 2473 |
'{{WRAPPER}} .wdk-listing-card .wdk-thumbnail .wdk-over-image-top' => '{{VALUE}};', |
| 2474 |
], |
| 2475 |
] |
| 2476 |
); |
| 2477 |
|
| 2478 |
$this->add_responsive_control( |
| 2479 |
$item['key'] .'content_label_positions_x', |
| 2480 |
[ |
| 2481 |
'label' => __( 'Position X', 'wpdirectorykit' ), |
| 2482 |
'type' => Controls_Manager::CHOOSE, |
| 2483 |
'options' => [ |
| 2484 |
'left' => [ |
| 2485 |
'title' => esc_html__( 'Left', 'wpdirectorykit' ), |
| 2486 |
'icon' => 'eicon-text-align-left', |
| 2487 |
], |
| 2488 |
'center' => [ |
| 2489 |
'title' => esc_html__( 'Center', 'wpdirectorykit' ), |
| 2490 |
'icon' => 'eicon-text-align-center', |
| 2491 |
], |
| 2492 |
'right' => [ |
| 2493 |
'title' => esc_html__( 'Right', 'wpdirectorykit' ), |
| 2494 |
'icon' => 'eicon-text-align-right', |
| 2495 |
], |
| 2496 |
], |
| 2497 |
'default' => 'left', |
| 2498 |
'render_type' => 'ui', |
| 2499 |
'selectors_dictionary' => [ |
| 2500 |
'left' => 'left:0', |
| 2501 |
'center' => 'left:50%;transform: translateX(-50%)', |
| 2502 |
'right' => 'left:initial; right:0', |
| 2503 |
], |
| 2504 |
'selectors' => [ |
| 2505 |
'{{WRAPPER}} .wdk-listing-card .wdk-thumbnail .wdk-over-image-top' => '{{VALUE}};', |
| 2506 |
], |
| 2507 |
] |
| 2508 |
); |
| 2509 |
} |
| 2510 |
|
| 2511 |
if(strpos($item['key'], 'content_type') !== FALSE) { |
| 2512 |
$this->add_responsive_control( |
| 2513 |
$item['key'] .'content_label_positions_y', |
| 2514 |
[ |
| 2515 |
'label' => __( 'Position Y', 'wpdirectorykit' ), |
| 2516 |
'type' => Controls_Manager::CHOOSE, |
| 2517 |
'options' => [ |
| 2518 |
'top' => [ |
| 2519 |
'title' => esc_html__( 'Top', 'wpdirectorykit' ), |
| 2520 |
'icon' => 'eicon-text-align-top', |
| 2521 |
], |
| 2522 |
'center' => [ |
| 2523 |
'title' => esc_html__( 'Center', 'wpdirectorykit' ), |
| 2524 |
'icon' => 'eicon-text-align-center', |
| 2525 |
], |
| 2526 |
'bottom' => [ |
| 2527 |
'title' => esc_html__( 'Bottom', 'wpdirectorykit' ), |
| 2528 |
'icon' => 'eicon-text-align-bottom', |
| 2529 |
], |
| 2530 |
], |
| 2531 |
'default' => 'left', |
| 2532 |
'render_type' => 'ui', |
| 2533 |
'selectors_dictionary' => [ |
| 2534 |
'top' => 'top:0;bottom:initial', |
| 2535 |
'center' => 'top:50%;transform: translateY(-50%)', |
| 2536 |
'bottom' => 'top:initial;bottom:0', |
| 2537 |
], |
| 2538 |
'selectors' => [ |
| 2539 |
'{{WRAPPER}} '.$item['selector'] => '{{VALUE}};', |
| 2540 |
], |
| 2541 |
] |
| 2542 |
); |
| 2543 |
|
| 2544 |
$this->add_responsive_control( |
| 2545 |
$item['key'] .'content_label_positions_x', |
| 2546 |
[ |
| 2547 |
'label' => __( 'Position X', 'wpdirectorykit' ), |
| 2548 |
'type' => Controls_Manager::CHOOSE, |
| 2549 |
'options' => [ |
| 2550 |
'left' => [ |
| 2551 |
'title' => esc_html__( 'Left', 'wpdirectorykit' ), |
| 2552 |
'icon' => 'eicon-text-align-left', |
| 2553 |
], |
| 2554 |
'center' => [ |
| 2555 |
'title' => esc_html__( 'Center', 'wpdirectorykit' ), |
| 2556 |
'icon' => 'eicon-text-align-center', |
| 2557 |
], |
| 2558 |
'right' => [ |
| 2559 |
'title' => esc_html__( 'Right', 'wpdirectorykit' ), |
| 2560 |
'icon' => 'eicon-text-align-right', |
| 2561 |
], |
| 2562 |
'justify' => [ |
| 2563 |
'title' => esc_html__( 'Justified', 'wpdirectorykit' ), |
| 2564 |
'icon' => 'eicon-text-align-justify', |
| 2565 |
], |
| 2566 |
], |
| 2567 |
'default' => 'left', |
| 2568 |
'render_type' => 'ui', |
| 2569 |
'selectors_dictionary' => [ |
| 2570 |
'top' => 'justify-content: flex-start;', |
| 2571 |
'center' => 'justify-content: center;', |
| 2572 |
'bottom' => 'justify-content: flex-end;', |
| 2573 |
'justify' => 'justify-content: stretch;', |
| 2574 |
], |
| 2575 |
'selectors' => [ |
| 2576 |
'{{WRAPPER}} '.$item['selector'] => '{{VALUE}};', |
| 2577 |
], |
| 2578 |
] |
| 2579 |
); |
| 2580 |
} |
| 2581 |
$this->end_controls_section(); |
| 2582 |
} |
| 2583 |
|
| 2584 |
} |
| 2585 |
|
| 2586 |
public function enqueue_styles_scripts() { |
| 2587 |
wp_enqueue_style('slick'); |
| 2588 |
wp_enqueue_style('slick-theme'); |
| 2589 |
wp_enqueue_script('slick'); |
| 2590 |
|
| 2591 |
wp_enqueue_style('wdk-notify'); |
| 2592 |
wp_enqueue_script('wdk-notify'); |
| 2593 |
|
| 2594 |
} |
| 2595 |
} |
| 2596 |
|