Permalink
Browse files

[#30504] List All Tags doesn't have pagination

  • Loading branch information...
1 parent 8435437 commit e14fdd678cb498ed7fa985c57d1d651a4720b2f0 @dextercowley dextercowley committed with mbabker Apr 8, 2013
@@ -66,6 +66,11 @@ protected function populateState($ordering = null, $direction = null)
{
$this->setState('filter.published', 1);
}
+
+ // Optional filter text
+ $itemid = $pid . ':' . $app->input->getInt('Itemid', 0);
+ $filterSearch = $app->getUserStateFromRequest('com_tags.tags.list.' . $itemid . '.filter_search', 'filter-search', '', 'string');
+ $this->setState('list.filter', $filterSearch);
}
/**
@@ -103,6 +108,7 @@ public function getItems()
*/
protected function getListQuery()
{
+ $app = JFactory::getApplication('site');
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$pid = $this->getState('tag.parent_id');
@@ -142,7 +148,35 @@ protected function getListQuery()
$query->where($db->quoteName('language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')');
}
- $query->order($db->quoteName($orderby) . ' ' . $orderDirection);
+ // List state information
+ $format = $app->input->getWord('format');
+ if ($format == 'feed')
+ {
+ $limit = $app->getCfg('feed_limit');
+ }
+ else
+ {
+ if ($this->state->params->get('show_pagination_limit'))
+ {
+ $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
+ }
+ else
+ {
+ $limit = $this->state->params->get('maximum', 20);
+ }
+ }
+ $this->setState('list.limit', $limit);
+
+ $offset = $app->input->get('limitstart', 0, 'uint');
+ $this->setState('list.start', $offset);
+
+ // Optionally filter on entered value
+ if ($this->state->get('list.filter'))
+ {
+ $query->where($this->_db->quoteName('a.title') . ' LIKE ' . $this->_db->quote('%' . $this->state->get('list.filter') . '%'));
+ }
+
+ $query->order($db->quoteName($orderby) . ' ' . $orderDirection . ', a.title ASC');
return $query;
}
@@ -158,6 +158,18 @@
label="COM_TAGS_LIST_MAX_LABEL"
description="COM_TAGS_LIST_MAX_DESC"
/>
+ <field
+ name="filter_field"
+ type="list"
+ default=""
+ label="JGLOBAL_FILTER_FIELD_LABEL"
+ description="JGLOBAL_FILTER_FIELD_DESC"
+ >
+ <option value="">JGLOBAL_USE_GLOBAL</option>
+ <option value="0">JHIDE</option>
+ <option value="1">JSHOW</option>
+ </field>
+
<field
name="show_pagination_limit"
@@ -37,6 +37,34 @@
$n = count($this->items);
?>
+<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
+ <?php if ($this->params->get('filter_field') != 'hide' || $this->params->get('show_pagination_limit')) : ?>
+ <fieldset class="filters btn-toolbar">
+ <?php if ($this->params->get('filter_field') !== '0') : ?>
+ <div class="btn-group">
+ <label class="filter-search-lbl element-invisible" for="filter-search">
+ <?php echo JText::_('COM_TAGS_TITLE_FILTER_LABEL') . '&#160;'; ?>
+ </label>
+ <input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_TAGS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_TAGS_TITLE_FILTER_LABEL'); ?>" />
+ </div>
+ <?php endif; ?>
+ <?php if ($this->params->get('show_pagination_limit')) : ?>
+ <div class="btn-group pull-right">
+ <label for="limit" class="element-invisible">
+ <?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
+ </label>
+ <?php echo $this->pagination->getLimitBox(); ?>
+ </div>
+ <?php endif; ?>
+
+ <input type="hidden" name="filter_order" value="" />
+ <input type="hidden" name="filter_order_Dir" value="" />
+ <input type="hidden" name="limitstart" value="" />
+ <input type="hidden" name="task" value="" />
+ <div class="clearfix"></div>
+ </fieldset>
+ <?php endif; ?>
+
<?php if ($this->items == false || $n == 0) : ?>
<p><?php echo JText::_('COM_TAGS_NO_TAGS'); ?></p>
<?php else : ?>
@@ -87,3 +115,20 @@
<?php endforeach; ?>
<?php endif;?>
+
+<?php // Add pagination links ?>
+<?php if (!empty($this->items)) : ?>
+ <?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
+ <div class="pagination">
+
+ <?php if ($this->params->def('show_pagination_results', 1)) : ?>
+ <p class="counter pull-right">
+ <?php echo $this->pagination->getPagesCounter(); ?>
+ </p>
+ <?php endif; ?>
+
+ <?php echo $this->pagination->getPagesLinks(); ?>
+ </div>
+ <?php endif; ?>
+</form>
+<?php endif; ?>
@@ -28,6 +28,7 @@ $ -> Language fix or change
08-Apr-2013 Michael Babker
# [#29916] MySQL connections are not closed. Thanks Ian Goldstein
# [#30508] Fixed typo $text = $text = '..';. Thanks Piotr Konieczny
+ # [#30504] List All Tags doesn't have pagination. Thanks Mark Dexter
08-Apr-2013 Jean-Marie Simonet
$ Adding installation language pt-PT

0 comments on commit e14fdd6

Please sign in to comment.