PluginProbe
WP Directory Kit / 1.3.1
WP Directory Kit v1.3.1
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 1.4.0 1.4.1 All 35 releases
wpdirectorykit / elementor-elements / views / wdk-field-files.php

wdk-field-files.php in WP Directory Kit 1.3.1, at elementor-elements/views/wdk-field-files.php

121 lines 6.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 Listing Images.
4 * This is the template that elementor element images, results
5 *
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 ?>
13 <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>">
14 <div class="wdk-field-files <?php if(wmvc_show_data('enable_js_gallery', $settings, false, TRUE, TRUE)):?> wdk_js_gallery <?php endif;?>">
15 <?php if(count($images)>0):?>
16 <?php $images_opened_tag = false; ?>
17 <?php foreach($images as $image):?>
18 <?php
19 if($is_edit_mode) {
20 $src = $image;
21 $image = array('src' => $src,'title'=>esc_html__('Image Title', 'wpdirectorykit'));
22 } else {
23 $src = $image['src'];
24 }
25 ?>
26 <?php
27 if(!in_array(wdk_file_extension($image['src']), array('jpg','jpeg','bmp','png','webp')))
28 continue;
29
30 if(!$images_opened_tag):?>
31 <div class="wdk-row">
32 <?php $images_opened_tag=true; endif;?>
33
34 <div class="wdk-col">
35 <figure>
36 <a class="wdk-listing-image-card" href="<?php echo esc_url($image['src']);?>">
37 <img src="<?php echo esc_url($src);?>" class="wdk-listing-image <?php if($settings['enable_fixed_height']!='yes'):?> auto_height <?php endif;?>" alt="<?php echo esc_attr(wmvc_show_data('alt',$image,'',TRUE,TRUE));?>">
38 </a>
39
40 <figcaption>
41 <a class="skip" href="<?php echo esc_url($image['src']);?>" target="_blank">
42 <?php echo esc_html(wmvc_show_data('title',$image,'',TRUE,TRUE));?>
43 </a>
44 </figcaption>
45 </figure>
46 </div>
47 <?php endforeach;?>
48 <?php if($images_opened_tag):?>
49 </div>
50 <?php endif;?>
51 <?php endif;?>
52
53 <?php if(wmvc_show_data('files_section_hide', $settings, '',TRUE,TRUE) !='yes'):?>
54 <?php if($is_edit_mode):?>
55 <div class="files-row">
56 <ul class="files">
57 <li class="list-item">
58 <a class="file-link" href="<?php echo esc_url(WPDIRECTORYKIT_URL.'public/img/filetype/xlsx.png');?>" target="_blank" title="<?php echo esc_attr__('Excel Worksheet', 'wpdirectorykit');?> ">
59 <img src="<?php echo esc_url(WPDIRECTORYKIT_URL.'public/img/filetype/xlsx.png');?>" class="wdk-listing-file-icon" alt="">
60 <?php echo esc_html__('Excel Worksheet', 'wpdirectorykit');?>
61 </a>
62 </li>
63 <li class="list-item">
64 <a class="file-link" href="<?php echo esc_url(WPDIRECTORYKIT_URL.'public/img/filetype/docx.png');?>" target="_blank" title="<?php echo esc_attr__('Document Worksheet', 'wpdirectorykit');?> ">
65 <img src="<?php echo esc_url(WPDIRECTORYKIT_URL.'public/img/filetype/docx.png');?>" class="wdk-listing-file-icon" alt="">
66 <?php echo esc_html__('Document Worksheet', 'wpdirectorykit');?>
67 </a>
68 </li>
69 <li class="list-item">
70 <a class="file-link" href="<?php echo esc_url(WPDIRECTORYKIT_URL.'public/img/filetype/pdf.png');?>" target="_blank" title="<?php echo esc_attr__('Pdf Worksheet', 'wpdirectorykit');?>">
71 <img src="<?php echo esc_url(WPDIRECTORYKIT_URL.'public/img/filetype/pdf.png');?>" class="wdk-listing-file-icon" alt="">
72 <?php echo esc_html__('Pdf Worksheet', 'wpdirectorykit');?>
73 </a>
74 </li>
75 <li class="list-item">
76 <a class="file-link" href="<?php echo esc_url(WPDIRECTORYKIT_URL.'public/img/filetype/txt.png');?>" target="_blank" title="<?php echo esc_attr__('Txt Worksheet', 'wpdirectorykit');?> ">
77 <img src="<?php echo esc_url(WPDIRECTORYKIT_URL.'public/img/filetype/txt.png');?>" class="wdk-listing-file-icon" alt="">
78 <?php echo esc_html__('Txt Worksheet', 'wpdirectorykit');?>
79 </a>
80 </li>
81 </ul>
82 </div>
83 <?php else:?>
84 <?php if(count($images)>0):?>
85 <?php $files_opened_tag = false; ?>
86 <?php foreach($images as $image):?>
87 <?php
88 if(in_array(wdk_file_extension($image['src']), array('jpg','jpeg','bmp','png','webp')))
89 continue;
90
91 if(!$files_opened_tag):?>
92 <div class="files-row">
93 <ul class="files">
94 <?php $files_opened_tag = true; endif;?>
95
96 <?php
97 if(file_exists(WPDIRECTORYKIT_PATH.'/public/img/filetype/'.wdk_file_extension($image['src']).'.png')) {
98 $src = WPDIRECTORYKIT_URL.'public/img/filetype/'.wdk_file_extension($image['src']).'.png';
99 } else {
100 $src = WPDIRECTORYKIT_URL.'public/img/filetype/_blank.png';
101 }
102 ?>
103
104 <li class="list-item">
105 <a class="file-link" href="<?php echo esc_url($image['src']);?>" target="_blank" title="<?php echo esc_attr(wmvc_show_data('title',$image,'',TRUE,TRUE));?>">
106 <img src="<?php echo esc_url($src);?>" class="wdk-listing-file-icon" alt="<?php echo esc_attr(wmvc_show_data('alt',$image,'',TRUE,TRUE));?>">
107 <?php echo esc_html(wmvc_show_data('title',$image,'',TRUE,TRUE));?>
108 </a>
109 </li>
110 <?php endforeach;?>
111 <?php if($files_opened_tag):?>
112 </ul>
113 </div>
114 <?php endif;?>
115 <?php endif;?>
116 <?php endif;?>
117 <?php endif;?>
118 </div>
119 </div>
120
121