| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The template for Element Listing Field Value. |
| 5 |
* This is the template that elementor element, link, iframe, images |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
if (! defined('ABSPATH')) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
|
| 13 |
?> |
| 14 |
|
| 15 |
<div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element); ?>"> |
| 16 |
|
| 17 |
|
| 18 |
<?php if(wmvc_show_data('show_like_stars', $settings) == 'yes'):?> |
| 19 |
<?php |
| 20 |
global $wdk_listing_id; |
| 21 |
$stars = round(floatval(wdk_field_value( wmvc_show_data('field_id', $settings), $wdk_listing_id)),2); |
| 22 |
?> |
| 23 |
<span class="wdk-field-value-stars-lst"> |
| 24 |
<?php for ($i = 1; $i <= (int)wmvc_show_data('max_stars', $settings); $i++): ?> |
| 25 |
<?php if ($i <=$stars): ?> |
| 26 |
<span><?php \Elementor\Icons_Manager::render_icon( $settings['active_star_icon'], [ 'aria-hidden' => 'true', 'class' => 'star-active' ] ); ?></span> |
| 27 |
<?php elseif( abs($stars - $i) < 1): ?> |
| 28 |
<span><i class="fas fa-star-half-alt"></i></span> |
| 29 |
<?php else: ?> |
| 30 |
<span><?php \Elementor\Icons_Manager::render_icon( $settings['inactive_star_icon'], [ 'aria-hidden' => 'true', 'class' => 'innactive' ] ); ?></span> |
| 31 |
<?php endif; ?> |
| 32 |
<?php endfor; ?> |
| 33 |
</span> |
| 34 |
<?php elseif (wdk_field_option(wmvc_show_data('field_id', $settings), 'field_type') == 'FILEUPLOAD'): ?> |
| 35 |
<div class="wdk-field-files <?php if (wmvc_show_data('enable_js_gallery', $settings, false, TRUE, TRUE)): ?> wdk_js_gallery <?php endif; ?>"> |
| 36 |
<?php if (is_array($field_value) && count($field_value) > 0): ?> |
| 37 |
<div class="wdk-row"> |
| 38 |
<?php foreach ($field_value as $image): ?> |
| 39 |
<?php |
| 40 |
if ($is_edit_mode) { |
| 41 |
$src = $image; |
| 42 |
$image = array('src' => $src, 'title' => esc_html__('Image Title', 'wpdirectorykit')); |
| 43 |
} else { |
| 44 |
$src = $image['src']; |
| 45 |
} |
| 46 |
?> |
| 47 |
<?php |
| 48 |
if (!in_array(wdk_file_extension($image['src']), array('jpg', 'jpeg', 'bmp', 'png', 'webp'))) |
| 49 |
continue; |
| 50 |
?> |
| 51 |
|
| 52 |
<div class="wdk-col"> |
| 53 |
<figure> |
| 54 |
<a class="wdk-listing-image-card" href="<?php echo esc_url($image['src']); ?>"> |
| 55 |
<img src="<?php echo esc_url($src); ?>" class="wdk-listing-image" alt="<?php echo esc_attr(wmvc_show_data('alt', $image, '', TRUE, TRUE)); ?>"> |
| 56 |
</a> |
| 57 |
<?php if (false): ?> |
| 58 |
<figcaption> |
| 59 |
<a class="skip" href="<?php echo esc_url($image['src']); ?>" target="_blank"> |
| 60 |
<?php echo esc_html(wmvc_show_data('title', $image, '', TRUE, TRUE)); ?> |
| 61 |
</a> |
| 62 |
</figcaption> |
| 63 |
<?php endif; ?> |
| 64 |
</figure> |
| 65 |
</div> |
| 66 |
<?php endforeach; ?> |
| 67 |
</div> |
| 68 |
<?php endif; ?> |
| 69 |
|
| 70 |
<?php if (is_array($field_value) && count($field_value) > 0): ?> |
| 71 |
<div class="files-row"> |
| 72 |
<ul class="files"> |
| 73 |
<?php foreach ($field_value as $image): ?> |
| 74 |
<?php |
| 75 |
if ($is_edit_mode) { |
| 76 |
$src = $image; |
| 77 |
$image = array('src' => $src, 'title' => esc_html__('Image Title', 'wpdirectorykit')); |
| 78 |
} else { |
| 79 |
$src = $image['src']; |
| 80 |
} |
| 81 |
|
| 82 |
if (in_array(wdk_file_extension($image['src']), array('jpg', 'jpeg', 'bmp', 'png', 'webp'))) |
| 83 |
continue; |
| 84 |
|
| 85 |
if (file_exists(WPDIRECTORYKIT_PATH . '/public/img/filetype/' . wdk_file_extension($image['src']) . '.png')) { |
| 86 |
$src = WPDIRECTORYKIT_URL . 'public/img/filetype/' . wdk_file_extension($image['src']) . '.png'; |
| 87 |
} else { |
| 88 |
$src = WPDIRECTORYKIT_URL . 'public/img/filetype/_blank.png'; |
| 89 |
} |
| 90 |
?> |
| 91 |
|
| 92 |
<li class="list-item"> |
| 93 |
<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)); ?>"> |
| 94 |
<img src="<?php echo esc_url($src); ?>" class="wdk-listing-file-icon" alt="<?php echo esc_attr(wmvc_show_data('alt', $image, '', TRUE, TRUE)); ?>"> |
| 95 |
<?php echo esc_html(wmvc_show_data('title', $image, '', TRUE, TRUE)); ?> |
| 96 |
</a> |
| 97 |
</li> |
| 98 |
<?php endforeach; ?> |
| 99 |
</ul> |
| 100 |
</div> |
| 101 |
<?php endif; ?> |
| 102 |
</div> |
| 103 |
<?php else: ?> |
| 104 |
<div class="wdk-field-value <?php echo wp_kses_post(wdk_field_option(wmvc_show_data('field_id', $settings), 'field_type')); ?> <?php if (wmvc_show_data('field_id', $settings) == 'post_content'): ?> TEXTAREA <?php endif; ?>"> |
| 105 |
<?php if (wmvc_show_data('cover_in_listing_link', $settings) == 'yes'): ?> |
| 106 |
<?php |
| 107 |
global $wdk_listing_id; |
| 108 |
$url = '#'; |
| 109 |
if (wdk_is_listing_page_enabled() && isset($wdk_listing_id)) { |
| 110 |
$url = get_permalink($wdk_listing_id); |
| 111 |
} |
| 112 |
?> |
| 113 |
<a href="<?php echo $url; ?>"> |
| 114 |
<span class='prefix'><?php echo esc_html($field_prefix); ?></span> |
| 115 |
<span class="value <?php if (wmvc_show_data('text_limit_per_line', $settings)): ?> wdk-stroke <?php endif; ?>"> |
| 116 |
<?php if (wmvc_show_data('text_limit_worlds', $settings)): ?> |
| 117 |
<?php echo (wp_strip_all_tags(html_entity_decode(wp_trim_words($field_value, $settings['text_limit_worlds'], '...')))); ?> |
| 118 |
<?php else: ?> |
| 119 |
<?php echo wp_kses_post(wp_unslash(wdk_filter_decimal($field_value))); ?> |
| 120 |
<?php endif; ?> |
| 121 |
</span> |
| 122 |
<span class='suffix'><?php echo esc_html($field_suffix); ?></span> |
| 123 |
</a> |
| 124 |
|
| 125 |
<?php else: ?> |
| 126 |
<?php echo empty(wmvc_show_data('html_tag', $settings, 'span')) ? '<span>' : '<' . wmvc_show_data('html_tag', $settings, 'span') . '>'; ?> |
| 127 |
<span class='prefix'><?php echo esc_html($field_prefix); ?></span> |
| 128 |
|
| 129 |
|
| 130 |
<?php if (stripos($field_value, 'class="value"') !== FALSE): ?> |
| 131 |
<?php echo wp_kses_post(wdk_filter_decimal($field_value)); ?> |
| 132 |
<?php else: ?> |
| 133 |
<span class="value <?php if (wmvc_show_data('text_limit_per_line', $settings)): ?> wdk-stroke <?php endif; ?>"> |
| 134 |
<?php if (wmvc_show_data('text_limit_worlds', $settings)): ?> |
| 135 |
<?php echo (wp_strip_all_tags(html_entity_decode(wp_trim_words($field_value, $settings['text_limit_worlds'], '...')))); ?> |
| 136 |
<?php else: ?> |
| 137 |
<?php echo wp_kses_post(wp_unslash(wdk_filter_decimal($field_value))); ?> |
| 138 |
<?php endif; ?> |
| 139 |
</span> |
| 140 |
<?php endif; ?> |
| 141 |
|
| 142 |
<span class='suffix'><?php echo esc_html($field_suffix); ?></span> |
| 143 |
<?php echo empty(wmvc_show_data('html_tag', $settings, 'span')) ? '</span>' : '</' . wmvc_show_data('html_tag', $settings, 'span') . '>'; ?> |
| 144 |
<?php endif; ?> |
| 145 |
</div> |
| 146 |
<?php endif; ?> |
| 147 |
</div> |