30
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-09-23 10:39:10 +00:00

fix no weblinks found, add new button

This commit is contained in:
chmst 2021-08-12 09:13:58 +02:00
parent efe415d633
commit fb07654070

View File

@ -33,39 +33,42 @@ $listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction')); $listDirn = $this->escape($this->state->get('list.direction'));
?> ?>
<?php if (empty($this->items)) : ?> <div class="com-weblinks-category__items">
<p> <?php echo Text::_('COM_WEBLINKS_NO_WEBLINKS'); ?></p> <form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php else : ?> <?php if ($this->params->get('filter_field')) : ?>
<div class="com-weblinks-category__items"> <div class="com-weblinks-category__filter btn-group">
<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm"> <label class="filter-search-lbl visually-hidden" for="filter-search">
<?php if ($this->params->get('filter_field')) : ?> <?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>
<div class="com-weblinks-category__filter btn-group"> </label>
<label class="filter-search-lbl visually-hidden" for="filter-search"> <input
<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?> type="text"
</label> name="filter-search"
<input id="filter-search"
type="text" value="<?php echo $this->escape($this->state->get('list.filter')); ?>"
name="filter-search" class="inputbox" onchange="document.adminForm.submit();"
id="filter-search" placeholder="<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>"
value="<?php echo $this->escape($this->state->get('list.filter')); ?>" >
class="inputbox" onchange="document.adminForm.submit();" <button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
placeholder="<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" <button type="reset" name="filter-clear-button" class="btn btn-secondary"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
> </div>
<button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button> <?php endif; ?>
<button type="reset" name="filter-clear-button" class="btn btn-secondary" onclick="document.getElementById('filter-search').value = '';document.adminForm.submit();"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button> <?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="com-weblinks-category__pagination btn-group float-end">
<label for="limit" class="visually-hidden">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<?php if ($this->params->get('show_no_contacts', 1)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_WEBLINKS_NO_WEBLINKS'); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?> <?php else : ?>
<div class="com-weblinks-category__pagination btn-group float-end">
<label for="limit" class="visually-hidden">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<ul class="category list-unstyled"> <ul class="category list-unstyled">
<?php foreach ($this->items as $i => $item) : ?> <?php foreach ($this->items as $i => $item) : ?>
<?php // Shouldn't this be checked in the model?The pagination will be affected <?php // Shouldn't this be checked in the model?The pagination will be affected
@ -198,8 +201,6 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?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="com-contact-category__counter w-100"> <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)) : ?>
@ -211,6 +212,11 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php echo $this->pagination->getPagesLinks(); ?> <?php echo $this->pagination->getPagesLinks(); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</form>
</div> <?php endif; ?>
<?php endif; ?>
<?php if ($canCreate) : ?>
<?php echo HTMLHelper::_('weblinkicon.create', $this->category, $this->category->params); ?>
<?php endif; ?>
</form>
</div>