30
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-05-29 04:30:46 +00:00

Float params have changed

This commit is contained in:
chmst 2021-08-15 21:58:38 +02:00
parent e3f4a72281
commit f80b667017
2 changed files with 51 additions and 46 deletions

View File

@ -28,7 +28,6 @@ $canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $this->ca
$canEditOwn = $user->authorise('core.edit.own', 'com_weblinks.category.' . $this->category->id); $canEditOwn = $user->authorise('core.edit.own', 'com_weblinks.category.' . $this->category->id);
$canCreate = $user->authorise('core.create', 'com_weblinks.category.' . $this->category->id); $canCreate = $user->authorise('core.create', 'com_weblinks.category.' . $this->category->id);
$n = count($this->items);
$listOrder = $this->escape($this->state->get('list.ordering')); $listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction')); $listDirn = $this->escape($this->state->get('list.direction'));
?> ?>
@ -156,13 +155,16 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php if (($this->params->get('show_link_description')) && ($item->description != '')) : ?> <?php if (($this->params->get('show_link_description')) && ($item->description != '')) : ?>
<div class="mt-2 mb-2"> <div class="mt-2 mb-2">
<?php $images = json_decode($item->images); ?> <?php $images = json_decode($item->images); ?>
<?php if (!empty($images->image_first)) : ?> <?php if (!empty($images->image_first)) : ?>
<?php $imgfloat = (empty($images->float_first)) ? $this->params->get('float_first') : $images->float_first; ?> <?php $imgFloat = '' ;?>
<?php if (!empty($images->float_first)) : ?>
<?php $imgFloat = $images->float_first == 'right' ? 'float-end' : 'float-start'; ?>
<?php endif; ?>
<?php $img = HTMLHelper::cleanImageURL($images->image_first); ?> <?php $img = HTMLHelper::cleanImageURL($images->image_first); ?>
<?php $alt = empty($images->image_first_alt) && empty($images->image_first_alt_empty) <?php $alt = empty($images->image_first_alt) && empty($images->image_first_alt_empty)
? '' ? ''
: 'alt="' . htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8') . '"'; ?> : 'alt="' . htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<figure class="item-image"> <figure class="item-image <?php echo $imgFloat; ?>">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>" <img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?> itemprop="thumbnail" /> <?php echo $alt; ?> itemprop="thumbnail" />
<?php if (!empty($images->image_first_caption)) : ?> <?php if (!empty($images->image_first_caption)) : ?>
@ -172,12 +174,15 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php endif; ?> <?php endif; ?>
<?php if (!empty($images->image_second)) : ?> <?php if (!empty($images->image_second)) : ?>
<?php $imgfloat = (empty($images->float_second)) ? $this->params->get('float_second') : $images->float_second; ?> <?php $imgFloat = ''; ?>
<?php if (!empty($images->float_second)) : ?>
<?php $imgFloat = $images->float_second == 'right' ? 'float-end' : 'float-start'; ?>
<?php endif; ?>
<?php $img = HTMLHelper::cleanImageURL($images->image_second); ?> <?php $img = HTMLHelper::cleanImageURL($images->image_second); ?>
<?php $alt = empty($images->image_second_alt) && empty($images->image_second_alt_empty) <?php $alt = empty($images->image_second_alt) && empty($images->image_second_alt_empty)
? '' ? ''
: 'alt="' . htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8') . '"'; ?> : 'alt="' . htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<figure class="item-image"> <figure class="item-image <?php echo $imgFloat; ?>">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>" <img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?> itemprop="thumbnail" /> <?php echo $alt; ?> itemprop="thumbnail" />
<?php if (!empty($images->image_second_caption)) : ?> <?php if (!empty($images->image_second_caption)) : ?>

View File

@ -45,55 +45,55 @@ if (!$canEdit)
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?> <?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $this->item->event->beforeDisplayContent; ?> <?php echo $this->item->event->beforeDisplayContent; ?>
<div itemprop="articleBody"> <div itemprop="articleBody">
<div class="p-3">
<a href="<?php echo $weblinkUrl; ?>" target="_blank" itemprop="url"> <a href="<?php echo $weblinkUrl; ?>" target="_blank" itemprop="url">
<?php echo $weblinkUrl; ?> <?php echo $weblinkUrl; ?>
</a> </a>
</div>
<?php if (($this->params->get('show_link_description')) && ($this->item->description != '')) : ?> <div class="p-3">
<div class="mt-2 mb-2"> <?php $images = json_decode($this->item->images); ?>
<?php $images = json_decode($this->item->images); ?> <?php if (!empty($images->image_first)) : ?>
<?php if (!empty($images->image_first)) : ?> <?php $imgFloat = '' ;?>
<?php $imgFloat = ''; <?php if (!empty($images->float_first)) : ?>
if (!empty($images->float_first)) : <?php $imgFloat = $images->float_first == 'right' ? 'float-end' : 'float-start'; ?>
$imgFloat = $images->float_first == 'right' ? 'float-end' : 'float-start';
endif;
$img = HTMLHelper::cleanImageURL($images->image_first);
$alt = empty($images->image_first_alt) && empty($images->image_first_alt_empty)
? ''
: 'alt="' . htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8') . '"';
?>
<figure class="item-image <?php echo $imgFloat; ?>">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?> itemprop="thumbnail" />
<?php if (!empty($images->image_first_caption)) : ?>
<figcaption class="caption"><?php echo htmlspecialchars($images->image_first_caption, ENT_COMPAT, 'UTF-8'); ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?> <?php endif; ?>
<?php $img = HTMLHelper::cleanImageURL($images->image_first); ?>
<?php $alt = empty($images->image_first_alt) && empty($images->image_first_alt_empty)
? ''
: 'alt="' . htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<figure class="item-image <?php echo $imgFloat; ?>">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?> itemprop="thumbnail" />
<?php if (!empty($images->image_first_caption)) : ?>
<figcaption class="caption"><?php echo htmlspecialchars($images->image_first_caption, ENT_COMPAT, 'UTF-8'); ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<?php if (!empty($images->image_second)) : ?> <?php if (!empty($images->image_second)) : ?>
<?php $imgFloat = ''; <?php $imgFloat = ''; ?>
if (!empty($images->float_second)) : <?php if (!empty($images->float_second)) : ?>
$imgFloat = $images->float_second == 'right' ? 'float-end' : 'float-start'; <?php $imgFloat = $images->float_second == 'right' ? 'float-end' : 'float-start'; ?>
endif;
$img = HTMLHelper::cleanImageURL($images->image_second);
$alt = empty($images->image_first_alt) && empty($images->image_second_alt_empty)
? ''
: 'alt="' . htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8') . '"';
?>
<figure class="item-image <?php echo $imgFloat; ?>">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?> itemprop="thumbnail" />
<?php if (!empty($images->image_second_caption)) : ?>
<figcaption class="caption"><?php echo htmlspecialchars($images->image_second_caption, ENT_COMPAT, 'UTF-8'); ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?> <?php endif; ?>
<?php $img = HTMLHelper::cleanImageURL($images->image_second); ?>
<?php $alt = empty($images->image_second_alt) && empty($images->image_second_alt_empty)
? ''
: 'alt="' . htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<figure class="item-image <?php echo $imgFloat; ?>">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?> itemprop="thumbnail" />
<?php if (!empty($images->image_second_caption)) : ?>
<figcaption class="caption"><?php echo htmlspecialchars($images->image_second_caption, ENT_COMPAT, 'UTF-8'); ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<?php if (!empty($this->item->description)) : ?>
<?php echo $this->item->description; ?> <?php echo $this->item->description; ?>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div> </div>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?> <?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $this->item->event->afterDisplayContent; ?> <?php echo $this->item->event->afterDisplayContent; ?>