Commit 3a32cda3 by rajshah

fix the xls document type in resource listing block v0.2

parent 12611fef
...@@ -6,8 +6,8 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc ...@@ -6,8 +6,8 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
if ($enable_resources_listing): if ($enable_resources_listing):
$resources_items = $resources_listing['resources_items'] ?: []; $resources_items = $resources_listing['resources_items'] ?: [];
if (isset($resources_items) && is_array($resources_items) && !empty($resources_items)): if (isset($resources_items) && is_array($resources_items) && !empty($resources_items)):
?> ?>
<section class="resource-listing py-80 makura-new"> <section class="resource-listing py-80 makura-new">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-4 col-xl-3"> <div class="col-lg-4 col-xl-3">
...@@ -85,25 +85,25 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc ...@@ -85,25 +85,25 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
$subtype = $upload_downloadable_resource['subtype']; $subtype = $upload_downloadable_resource['subtype'];
switch (strtolower($subtype)) { switch (strtolower($subtype)) {
case 'pdf': case 'pdf':
$icon = 'PDF'; $icon_url = get_field('pdf_image', 'option');
break; break;
case 'doc': case 'doc':
case 'docx': case 'docx':
$icon = 'DOC'; $icon_url = get_field('doc_image', 'option');
break; break;
case 'xls': case 'xls':
case 'xlsx': case 'xlsx':
case 'vnd.ms-excel': case 'vnd.ms-excel':
case 'vnd.openxmlformats-officedocument.spreadsheetml.sheet': case 'vnd.openxmlformats-officedocument.spreadsheetml.sheet':
$icon = 'XLS'; $icon_url = get_field('xls_image', 'option');
break; break;
case 'ppt': case 'ppt':
case 'pptx': case 'pptx':
case 'vnd.openxmlformats-officedocument.presentationml.presentation': case 'vnd.openxmlformats-officedocument.presentationml.presentation':
$icon = 'PPT'; $icon_url = get_field('ppt_image', 'option');
break; break;
default: default:
$icon = 'PDF'; $icon_url = get_field('default_image', 'option');
} }
endif; endif;
endif; endif;
...@@ -116,8 +116,7 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc ...@@ -116,8 +116,7 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
</div> </div>
</div> </div>
</div> </div>
<?php } <?php }endforeach; ?>
endforeach; ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
...@@ -127,8 +126,6 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc ...@@ -127,8 +126,6 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
</div> </div>
</div> </div>
</div> </div>
</section> </section>
<?php endif; <?php endif; endif; endif; ?>
endif;
endif; ?>
<!-- !Resources - Resources Listing --> <!-- !Resources - Resources Listing -->
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment