32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-27 10:22:38 +00:00

Rebuild weblinks overview

This commit is contained in:
chmst 2021-08-11 12:38:04 +02:00
parent cbefa5cdf8
commit d195434aa9
2 changed files with 73 additions and 56 deletions

View File

@ -121,8 +121,8 @@
label="COM_WEBLINKS_FLOAT_FIRST_LABEL" label="COM_WEBLINKS_FLOAT_FIRST_LABEL"
useglobal="true" useglobal="true"
> >
<option value="right">COM_WEBLINKS_RIGHT</option> <option value="end">COM_WEBLINKS_RIGHT</option>
<option value="left">COM_WEBLINKS_LEFT</option> <option value="start">COM_WEBLINKS_LEFT</option>
<option value="none">COM_WEBLINKS_NONE</option> <option value="none">COM_WEBLINKS_NONE</option>
</field> </field>
@ -161,10 +161,10 @@
name="float_second" name="float_second"
type="list" type="list"
label="COM_WEBLINKS_FLOAT_SECOND_LABEL" label="COM_WEBLINKS_FLOAT_SECOND_LABEL"
useglobal="true"
> >
<option value="">JGLOBAL_USE_GLOBAL</option> <option value="end">COM_WEBLINKS_RIGHT</option>
<option value="right">COM_WEBLINKS_RIGHT</option> <option value="start">COM_WEBLINKS_LEFT</option>
<option value="left">COM_WEBLINKS_LEFT</option>
<option value="none">COM_WEBLINKS_NONE</option> <option value="none">COM_WEBLINKS_NONE</option>
</field> </field>

View File

@ -64,7 +64,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
</div> </div>
<?php endif; ?> <?php endif; ?>
<ul class="category list-group list-unstyled"> <ul class="category list-unstyled">
<?php foreach ($this->items as $i => $item) : ?> <?php foreach ($this->items as $i => $item) : ?>
@ -73,23 +73,20 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php <?php
// Shouldn't this be only for users with admin rights? // Shouldn't this be only for users with admin rights?
// @ToDo: what is the difference -class system-unbublished?
if ($item->state == 0) : ?> if ($item->state == 0) : ?>
<li class="system-unpublished list-group-item"> <li class="system-unpublished list-group mt-3">
<?php else : ?> <?php else : ?>
<li class="list-group-item"> <li class="list-group mt-3">
<?php endif; ?>
<?php if ($this->params->get('show_link_hits', 1)) : ?>
<span class="list-hits badge bg-info float-end">
<?php echo Text::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
</span>
<?php endif; ?> <?php endif; ?>
<?php if ($canEdit) : ?> <?php if ($canEdit) : ?>
<?php echo LayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $item)); ?> <div class="icons list-group-item">
<?php echo HTMLHelper::_('weblinkicon.edit', $item, $this->params); ?>
</div>
<?php endif; ?> <?php endif; ?>
<div class="list-title"> <div class="list-title list-group-item ">
<?php if (!$this->params->get('icons', 1)) : ?> <?php if (!$this->params->get('icons', 1)) : ?>
<?php echo Text::_('COM_WEBLINKS_LINK'); ?> <?php echo Text::_('COM_WEBLINKS_LINK'); ?>
<?php else : ?> <?php else : ?>
@ -144,56 +141,76 @@ $listDirn = $this->escape($this->state->get('list.direction'));
break; break;
} }
?> ?>
<?php if ($this->params->get('show_link_hits', 1)) : ?>
<div class="list-hits badge bg-info float-end">
<?php echo Text::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
</div> </div>
<?php endif; ?>
<?php if ($this->params->get('show_tags', 1) && !empty($item->tags->itemTags)) : ?> <?php if ($this->params->get('show_tags', 1) && !empty($item->tags->itemTags)) : ?>
<div class="mt-2 mb-2">
<?php echo LayoutHelper::render('joomla.content.tags', $item->tags->itemTags); ?> <?php echo LayoutHelper::render('joomla.content.tags', $item->tags->itemTags); ?>
</div>
<?php endif; ?> <?php endif; ?>
<?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">
<?php $images = json_decode($item->images); ?> <?php $images = json_decode($item->images); ?>
<?php if (isset($images->image_first) and !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 = (empty($images->float_first)) ? $this->params->get('float_first') : $images->float_first; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image"> <?php $img = HTMLHelper::cleanImageURL($images->image_first); ?>
<img <?php $alt = empty($images->image_first_alt) && empty($images->image_first_alt_empty)
<?php if ($images->image_first_caption) : ?> ? ''
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_first_caption) . '"'; ?> : 'alt="' . htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<figure class="item-image">
<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; ?> <?php endif; ?>
src="<?php echo htmlspecialchars($images->image_first); ?>" </figure>
alt="<?php echo htmlspecialchars($images->image_first_alt); ?>"/>
</div>
<?php endif; ?> <?php endif; ?>
<?php if (isset($images->image_second) and !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 = (empty($images->float_second)) ? $this->params->get('float_second') : $images->float_second; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image"> <?php $img = HTMLHelper::cleanImageURL($images->image_second); ?>
<img <?php $alt = empty($images->image_second_alt) && empty($images->image_second_alt_empty)
<?php if ($images->image_second_caption) : ?> ? ''
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_second_caption) . '"'; ?> : 'alt="' . htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8') . '"'; ?>
<figure class="item-image">
<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_second_caption, ENT_COMPAT, 'UTF-8'); ?></figcaption>
<?php endif; ?> <?php endif; ?>
src="<?php echo htmlspecialchars($images->image_second); ?>" </figure>
alt="<?php echo htmlspecialchars($images->image_second_alt); ?>"/> </div>
<?php endif; ?> <?php endif; ?>
<?php echo $item->description; ?> <?php echo $item->description; ?>
</div>
<?php endif; ?> <?php endif; ?>
</div>
</li> </li>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php // Code to add a link to submit a weblink. ?> <?php // Code to add a link to submit a weblink. ?>
<?php if ($this->params->get('show_pagination')) : ?> <?php if ($this->params->get('show_pagination')) : ?>
<div class="pagination"> <div class="com-contact-category__counter w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?> <?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter"> <p class="com-contact-category__counter counter float-end pt-3 pe-2">
<?php echo $this->pagination->getPagesCounter(); ?> <?php echo $this->pagination->getPagesCounter(); ?>
</p> </p>
<?php endif; ?> <?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?> <?php echo $this->pagination->getPagesLinks(); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</form> </form>
</div> </div>
<?php endif; ?> <?php endif; ?>