PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
wpdirectorykit / elementor-elements / views / wdk-listings-results.php

wdk-listings-results.php in WP Directory Kit 1.5.9, at elementor-elements/views/wdk-listings-results.php

267 lines 15.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Element Listings Results.
4 * This is the template that elementor element listings, list, grid
5 *
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12
13 ?>
14 <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>">
15 <div class="wdk-listings-results
16 <?php echo esc_attr(wmvc_show_data('styles_thmbn_des_type',$settings, ''));?> view-<?php echo esc_attr(wmvc_show_data('layout_type',$settings, ''));?>
17 <?php if(wmvc_show_data('enable_separed_styles',$settings, '') == true):?> enable_separed_styles <?php endif;?>
18 <?php if
19 (
20 wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results') &&
21 isset($settings['is_ajax_enable']) && $settings['is_ajax_enable'] == 'yes'
22 ):?>
23 ajax_results_enabled
24 <?php endif;?>
25 "
26 data-el_id="<?php echo esc_attr($this->get_id());?>"
27 data-el_type="<?php echo esc_attr($this->get_name());?>"
28 <?php
29 $post_id = get_the_ID();
30 $post_object_id = get_queried_object_id();
31 if($post_object_id)
32 $post_id = $post_object_id;
33
34 global $wdk_listing_page_id;
35 if(!empty($wdk_listing_page_id))
36 $post_id = $wdk_listing_page_id;
37 ?>
38 data-el_page_id="<?php echo esc_attr($post_id);?>"
39
40 <?php if($settings['get_filters_enable'] == 'yes'):?> id="results" <?php endif;?>>
41 <?php if($settings['get_filters_enable'] == 'yes'
42 && !(
43 $settings['sorting_enable'] != 'yes' &&
44 $settings['view_type_enable'] != 'yes' &&
45 $settings['show_numbers_results_enable'] != 'yes'
46 )):?>
47 <div class="wdk-filter-head">
48 <?php if($settings['sorting_enable'] == 'yes'):?>
49 <div class="filter-group order">
50 <?php \Elementor\Icons_Manager::render_icon( $settings['filter_group_box_icon'], [ 'aria-hidden' => 'true' ] );?>
51 <select name="order_by" class='wdk-order'>
52 <?php if(!empty($custom_order)):?>
53 <?php foreach ($custom_order as $item):?>
54 <?php
55 if (strpos($item['key'], '__') !== FALSE) {
56 $item['key'] = substr($item['key'], strpos($item['key'], '__') + 2);
57 }
58 if(!empty($item['order_type'])) {
59 $item['key'] .= ' '.$item['order_type'];
60 }
61 ?>
62 <option value="<?php echo esc_attr($item['key']);?>" <?php echo (wmvc_show_data('order_by', $_GET, '') == $item['key'])?'selected="selected"':''; ?>><?php
63 // Dynamic field values are registered in the translation catalog separately.
64 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
65 echo esc_html__(wmvc_show_data('title', $item), 'wpdirectorykit');?></option>
66 <?php endforeach;?>
67 <?php else:?>
68 <option value="post_id DESC" <?php echo !empty(wmvc_show_data('order_by', $_GET, '') =='post_id DESC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Latest', 'wpdirectorykit');?></option>
69 <option value="post_id ASC" <?php echo (wmvc_show_data('order_by', $_GET, '') =='post_id ASC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Oldest', 'wpdirectorykit');?></option>
70 <option value="post_title ASC" <?php echo !empty(wmvc_show_data('order_by', $_GET, '') =='post_title ASC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Title Asc', 'wpdirectorykit');?></option>
71 <option value="post_title DESC" <?php echo !empty(wmvc_show_data('order_by', $_GET, '') =='post_title DESC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Title Desc', 'wpdirectorykit');?></option>
72 <?php endif;?>
73 </select>
74 </div>
75 <?php endif;?>
76 <?php if($settings['view_type_enable'] == 'yes'):?>
77 <div class="filter-group wmvc-view-type">
78 <a class="nav-link <?php echo (wmvc_show_data('layout_type', $settings, '') =='list')?'active':''; ?>" data-id="list" href="#list-view"><i class="fa fa-list-ul"></i></a>
79 <a class="nav-link <?php echo (wmvc_show_data('layout_type', $settings, '') =='grid')?'active':''; ?>" data-id="grid" href="#grid-view"><i class="fa fa-th"></i></a>
80 </div>
81 <?php endif;?>
82 <?php if($settings['show_numbers_results_enable'] == 'yes'):?>
83 <div class="filter-group filter-status">
84 <span><?php echo esc_html($listings_count);?> <?php echo esc_html__('Listings', 'wpdirectorykit');?></span>
85 </div>
86 <?php endif;?>
87 </div>
88 <?php endif;?>
89 <?php if(!empty($results)):?>
90 <?php if($settings['layout_type'] == 'carousel'):?>
91 <div class="wdk_results_listings_slider_box <?php echo esc_attr($settings['layout_carousel_animation_style']).'_animation';?> <?php echo esc_attr(join(' ', [$settings['styles_carousel_dots_position_style'], $settings['styles_carousel_arrows_position']]));?>">
92 <div class="wdk_results_listings_slider_body">
93 <div class="wdk_results_listings_slider_ini">
94 <?php else:?>
95 <div class="wdk-row wdk-inner-listings-results <?php if(isset($settings['is_mobile_view_enable']) && $settings['is_mobile_view_enable'] == 'yes'):?> WdkScrollMobileSwipe_enable <?php endif;?>">
96 <?php endif;?>
97 <?php foreach($results as $listing):?>
98 <div class="wdk-col">
99 <div class="wdk-card--wrapper <?php if(isset($settings['is_complete_link']) && $settings['is_complete_link'] == 'yes'):?> hover_link elementor-clickable <?php endif;?>" <?php if(isset($settings['is_complete_link']) && $settings['is_complete_link'] == 'yes'):?> onclick="location.href='<?php echo esc_url( get_permalink($listing) ); ?>'" <?php endif;?>>
100 <?php if
101 (
102 wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout') &&
103 isset($settings['is_custom_layout_enable']) && $settings['is_custom_layout_enable'] == 'yes'
104 && isset($settings['custom_layout_id_list']) && isset($settings['custom_layout_id_grid'])
105 ):?>
106 <?php if($settings['layout_type'] == 'list' && (!empty($settings['custom_layout_id_list']) || !empty($settings['custom_layout_live_list']))):?>
107 <?php
108 $content = '';
109 global $wdk_listing_id;
110 $wdk_listing_id = wmvc_show_data('post_id', $listing);
111 $content = wdk_render_elementor_template( empty( $settings['custom_layout_id_list'] ) ? $settings['custom_layout_live_list'] : $settings['custom_layout_id_list'], true);
112 ?>
113 <?php if(true || !$is_edit_mode):?>
114 <?php
115 $allowed_tags = array_merge(
116 wp_kses_allowed_html('post'),
117 array('style' => array())
118 );
119 echo wp_kses($content, $allowed_tags);
120 ?>
121 <?php else:?>
122 <?php echo esc_html__( 'Listings Card Grid From Extern Layout', 'wpdirectorykit' );?>
123 <?php endif;?>
124 <?php elseif(($settings['layout_type'] == 'grid' || $settings['layout_type'] == 'carousel') && (!empty($settings['custom_layout_id_grid']) || !empty($settings['custom_layout_live_grid']))):?>
125 <?php
126 $content = '';
127 global $wdk_listing_id;
128 $wdk_listing_id = wmvc_show_data('post_id', $listing);
129 $content = wdk_render_elementor_template( empty( $settings['custom_layout_id_grid'] ) ? $settings['custom_layout_live_grid'] : $settings['custom_layout_id_grid'], true);
130 ?>
131 <?php if(true || !$is_edit_mode):?>
132 <?php
133 $allowed_tags = array_merge(
134 wp_kses_allowed_html('post'),
135 array('style' => array())
136 );
137 echo wp_kses($content, $allowed_tags);
138 ?>
139 <?php else:?>
140 <?php echo esc_html__( 'Listings Card List From Extern Layout', 'wpdirectorykit' );?>
141 <?php endif;?>
142 <?php else:?>
143 <?php
144 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
145 echo wdk_listing_card($listing, $settings);?>
146 <?php endif;?>
147 <?php else:?>
148 <?php
149 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
150 echo wdk_listing_card($listing, $settings);?>
151 <?php endif;?>
152 </div>
153 </div>
154 <?php endforeach;?>
155 <?php if($settings['layout_type'] == 'carousel'):?>
156 </div>
157 <div class="wdk_slider_arrows">
158 <a title="<?php echo esc_attr__('prev slider', 'wpdirectorykit');?>" href="#" class="wdk-slider-prev wdk_lr_slider_arrow">
159 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?>
160 </a>
161 <a title="<?php echo esc_attr__('next slider', 'wpdirectorykit');?>" href="#" class="wdk-slider-next wdk_lr_slider_arrow">
162 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?>
163 </a>
164 </div>
165 </div>
166 </div>
167 <?php else:?>
168 </div>
169 <?php endif;?>
170 <?php else:?>
171 <p class="wdk_alert wdk_alert-danger"><?php echo esc_html__('Results not found', 'wpdirectorykit');?></p>
172 <?php endif;?>
173 <?php if($settings['layout_type'] != 'carousel'):?>
174 <?php echo wp_kses_post(wmvc_xss_clean($pagination_output)); ?>
175 <?php endif;?>
176 </div>
177 <?php if($settings['layout_type'] == 'carousel'):?>
178 <script>
179 jQuery(document).ready(function($){
180 var el = $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_results_listings_slider_ini').slick({
181 dots: true,
182 arrows: true,
183 rtl: localStorage.getItem('siteDirection') == "rtl" ? true : false,
184 <?php if(!empty(wmvc_show_data('layout_carousel_is_centerMode', $settings))):?>
185 centerMode: <?php echo esc_js(wmvc_show_data('layout_carousel_is_centerMode', $settings, 'true'))
186 ;?>,
187 <?php endif;?>
188 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? esc_html(wmvc_show_data('layout_carousel_columns', $settings, '3')) : 3;?>,
189 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? esc_html(wmvc_show_data('layout_carousel_columns', $settings, '3')) : 3;?>,
190 <?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?>
191 infinite: <?php echo esc_js(wmvc_show_data('layout_carousel_is_infinite', $settings, 'true'))
192 ;?>,
193 <?php endif;?>
194 <?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?>
195 autoplay: <?php echo esc_js(wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false'))
196 ;?>,
197 <?php endif;?>
198 nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-next'),
199 prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-prev'),
200 customPaging: function(slider, i) {
201 // this example would render "tabs" with titles
202 return '<span class="wdk_lr_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_icon'], [ 'aria-hidden' => 'true' ] ); ?></span>';
203 },
204 responsive: [
205 {
206 breakpoint: 991,
207 settings: {
208 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? esc_html(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')) : 2;?>,
209 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? esc_html(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')) : 2;?>,
210 }
211 },
212 {
213 breakpoint: 768,
214 settings: {
215 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? esc_html(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')) : 1;?>,
216 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? esc_html(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')) : 1;?>,
217 }
218 },
219 ]
220 }).on('breakpoint', function(event, slick, breakpoint){
221 wdk_result_listings_thumbnail_slider(el);
222
223 if (typeof wdk_favorite == 'function') {
224 wdk_favorite('.wdk_results_listings_slider_ini');
225 }
226
227 if (typeof wdk_init_compare_elem == 'function') {
228 wdk_init_compare_elem();
229 }
230
231 if (typeof wdk_popup_listings == 'function') {
232 wdk_popup_listings();
233 }
234
235 });
236
237 wdk_slick_slider_init(el, ()=>{
238 wdk_result_listings_thumbnail_slider(el);
239
240 if (typeof wdk_favorite == 'function') {
241 wdk_favorite('.wdk_results_listings_slider_ini');
242 }
243
244 if (typeof wdk_init_compare_elem == 'function') {
245 wdk_init_compare_elem();
246 }
247
248
249 if (typeof wdk_popup_listings == 'function') {
250 wdk_popup_listings();
251 }
252 });
253 })
254 </script>
255 <?php endif;?>
256 <?php if($is_edit_mode):?>
257 <script>
258 jQuery(document).ready(function($){
259 if(typeof wdk_result_listings_thumbnail_slider == 'function') {
260 wdk_result_listings_thumbnail_slider();
261 }
262 })
263 </script>
264 <?php endif;?>
265 </div>
266
267