-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IS (list views) - Replace html/pagination.php::pagination_list_footer…
…() by JLayouts. Fixes #11246
- Loading branch information
Showing
4 changed files
with
162 additions
and
18 deletions.
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
administrator/templates/isis/html/layouts/joomla/pagination/link.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('JPATH_BASE') or die; | ||
|
||
/** @var JPaginationObject $item */ | ||
$item = $displayData['data']; | ||
|
||
if (!empty($displayData['pagOptions'])) | ||
{ | ||
$options = new Joomla\Registry\Registry($displayData['pagOptions']); | ||
$liClass = $options->get('liClass', ''); | ||
$addText = $options->get('addText', ''); | ||
} | ||
else | ||
{ | ||
$liClass = $addText = ''; | ||
} | ||
|
||
$display = $item->text; | ||
|
||
switch ((string) $item->text) | ||
{ | ||
// Check for "Start" item | ||
case JText::_('JLIB_HTML_START') : | ||
$icon = "icon-backward icon-first"; | ||
break; | ||
|
||
// Check for "Prev" item | ||
case JText::_('JPREV') : | ||
$item->text = JText::_('JPREVIOUS'); | ||
$icon = "icon-step-backward icon-previous"; | ||
break; | ||
|
||
// Check for "Next" item | ||
case JText::_('JNEXT') : | ||
$icon = "icon-step-forward icon-next"; | ||
break; | ||
|
||
// Check for "End" item | ||
case JText::_('JLIB_HTML_END') : | ||
$icon = "icon-forward icon-last"; | ||
break; | ||
|
||
default: | ||
$icon = null; | ||
break; | ||
} | ||
|
||
$item->text .= $addText ? $addText : ''; | ||
|
||
if ($icon !== null) | ||
{ | ||
$display = '<span class="' . $icon . '"></span>'; | ||
} | ||
|
||
if ($displayData['active']) | ||
{ | ||
if ($item->base > 0) | ||
{ | ||
$limit = 'limitstart.value=' . $item->base; | ||
} | ||
else | ||
{ | ||
$limit = 'limitstart.value=0'; | ||
} | ||
|
||
$cssClasses = array(); | ||
|
||
$title = ''; | ||
|
||
if (!is_numeric($item->text)) | ||
{ | ||
JHtml::_('bootstrap.tooltip'); | ||
$cssClasses[] = 'hasTooltip'; | ||
$title = ' title="' . $item->text . '" '; | ||
} | ||
|
||
$onClick = 'document.adminForm.' . $item->prefix . 'limitstart.value=' . ($item->base > 0 ? $item->base : '0') . '; Joomla.submitform();return false;'; | ||
} | ||
else | ||
{ | ||
$class = (property_exists($item, 'active') && $item->active) ? 'active' : 'disabled'; | ||
if ($class != 'active') | ||
{ | ||
$class .= $liClass ? ($class ? ' ' : '') . $liClass : ''; | ||
} | ||
} | ||
?> | ||
<?php if ($displayData['active']) : ?> | ||
<li<?php echo $liClass ? ' class="' . $liClass . '"' : ''; ?>> | ||
<a class="<?php echo implode(' ', $cssClasses); ?>" <?php echo $title; ?> href="#" onclick="<?php echo $onClick; ?>"> | ||
<?php echo $display; ?> | ||
</a> | ||
</li> | ||
<?php else : ?> | ||
<li class="<?php echo $class; ?>"> | ||
<span><?php echo $display; ?></span> | ||
</li> | ||
<?php endif; |
55 changes: 55 additions & 0 deletions
55
administrator/templates/isis/html/layouts/joomla/pagination/links.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('JPATH_BASE') or die; | ||
|
||
use Joomla\Registry\Registry; | ||
|
||
$list = $displayData['list']; | ||
$pages = $list['pages']; | ||
$pagesTotal = $list['pagesTotal']; | ||
|
||
$options = new Registry($displayData['options']); | ||
|
||
$showLimitBox = $options->get('showLimitBox', 0); | ||
$showPagesLinks = $options->get('showPagesLinks', true); | ||
$showLimitStart = $options->get('showLimitStart', true); | ||
?> | ||
|
||
<div class="pagination pagination-toolbar clearfix"> | ||
|
||
<?php if ($showLimitBox) : ?> | ||
<div class="limit pull-right"> | ||
<?php echo $list['limitfield']; ?> | ||
</div> | ||
<?php endif; ?> | ||
|
||
<?php if ($showPagesLinks && (!empty($pages))) : ?> | ||
<ul class="pagination-list"> | ||
<?php | ||
$pages['start']['pagOptions'] = array('addText' => ' (' . JText::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', 1, $pagesTotal) . ')'); | ||
echo JLayoutHelper::render('joomla.pagination.link', $pages['start']); | ||
echo JLayoutHelper::render('joomla.pagination.link', $pages['previous']); ?> | ||
<?php foreach ($pages['pages'] as $page) : | ||
$page['pagOptions'] = array('liClass' => 'hidden-phone'); | ||
?> | ||
<?php echo JLayoutHelper::render('joomla.pagination.link', $page); ?> | ||
<?php endforeach; ?> | ||
<?php | ||
echo JLayoutHelper::render('joomla.pagination.link', $pages['next']); | ||
$pages['end']['pagOptions'] = array('addText' => ' (' . JText::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', $pagesTotal, $pagesTotal) . ')'); | ||
echo JLayoutHelper::render('joomla.pagination.link', $pages['end']); ?> | ||
</ul> | ||
<?php endif; ?> | ||
|
||
<?php if ($showLimitStart) : ?> | ||
<input type="hidden" name="<?php echo $list['prefix']; ?>limitstart" value="<?php echo $list['limitstart']; ?>" /> | ||
<?php endif; ?> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters