Skip to content

Instantly share code, notes, and snippets.

@hansspiess
Last active November 20, 2018 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hansspiess/79ddcd2b893916a081e2 to your computer and use it in GitHub Desktop.
Save hansspiess/79ddcd2b893916a081e2 to your computer and use it in GitHub Desktop.
Implement Icon Font with Joomla 2.5 pagination.php
;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>"
<?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>";
}
}
@Cyrusxxx
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment