Last active
November 20, 2018 07:01
-
-
Save hansspiess/79ddcd2b893916a081e2 to your computer and use it in GitHub Desktop.
Implement Icon Font with Joomla 2.5 pagination.php
This file contains hidden or 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
;to be placed in ROOT/language/overrides/ | |
JLIB_HTML_START="<i class=\"fa fa-fast-backward\"></i>" | |
JPREV="<i class=\"fa fa-backward\"></i>" | |
JNEXT="<i class=\"fa fa-forward\"></i>" | |
JLIB_HTML_END="<i class=\"fa fa-fast-forward\"></i>" |
This file contains hidden or 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
<?php | |
/** | |
* Override Method to create an active pagination link to the item without breaking the html with complex language strings | |
* | |
* to be placed in ROOT/Templates/YOURTEMPLATE/html/ | |
* | |
* @param JPaginationObject &$item The object with which to make an active link. | |
* | |
* @return string HTML link | |
* | |
* @since 11.1 | |
*/ | |
function pagination_item_active(&$item) | |
{ | |
$app = JFactory::getApplication(); | |
if ($app->isAdmin()) | |
{ | |
if ($item->base > 0) | |
{ | |
return "<a title=\"" . strip_tags($item->text) . "\" onclick=\"document.adminForm." . $this->prefix . "limitstart.value=" . $item->base | |
. "; Joomla.submitform();return false;\">" . $item->text . "</a>"; | |
} | |
else | |
{ | |
return "<a title=\"" . strip_tags($item->text) . "\" onclick=\"document.adminForm." . $this->prefix | |
. "limitstart.value=0; Joomla.submitform();return false;\">" . $item->text . "</a>"; | |
} | |
} | |
else | |
{ | |
return "<a title=\"" . strip_tags($item->text) . "\" href=\"" . $item->link . "\" class=\"pagenav\">" . $item->text . "</a>"; | |
} | |
} | |
function pagination_item_inactive(&$item) | |
{ | |
$app = JFactory::getApplication(); | |
if ($app->isAdmin()) | |
{ | |
return "<span>" . $item->text . "</span>"; | |
} | |
else | |
{ | |
return "<span class=\"pagenav\">" . $item->text . "</span>"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hans this is wonderful!
What needs to be done to adjust this for joomla 3.x?
With original code it works in joomla 3.9 but I am afraid to use it since it has some deprecated code.