30
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-06-07 08:50:49 +00:00

fix alt description for image

This commit is contained in:
chmst 2021-09-26 10:51:30 +02:00
parent 9f53917bf7
commit 859fb5a2a0

View File

@ -30,16 +30,28 @@ if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
</span>
<?php endif; ?>
</div>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
<?php if ($item->description) : ?>
<?php if ($this->params->get('show_subcat_desc_cat') == 1 && !empty($item->description)) : ?>
<div class="category-desc">
<?php echo HTMLHelper::_('content.prepare', $item->description, '', 'com_weblinks.categories'); ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_description_image') && !empty($item->getParams()->get('image'))) : ?>
<?php
$params = $item->getParams();
$img = HTMLHelper::cleanImageURL($params->get('image'));
$alt = '';
if (!empty($params->get('image_alt'))) :
$alt = 'alt="' . htmlspecialchars($params->get('image_alt'), ENT_COMPAT, 'UTF-8') . '"';
elseif (!empty($params->get('image_alt_empty'))) :
$alt = 'alt=""';
endif;
?>
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"<?php echo $alt; ?>>
<?php endif; ?>
<?php if ($this->params->get('show_description_image') && $item->getParams()->get('image')) : ?>
<img src="<?php echo $item->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($item->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8'); ?>">
<?php endif; ?> <?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
<?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
<button
type="button"
id="category-btn-<?php echo $item->id; ?>"