PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/templates/beez/html/pagination.php

https://gitlab.com/endomorphosis/OLAAaction
PHP | 120 lines | 39 code | 15 blank | 66 comment | 2 complexity | 60603213141a205101cd078640eee659 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: pagination.php 14401 2010-01-26 14:10:00Z louis $
  4. * @package Joomla
  5. * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
  6. * @license GNU/GPL, see LICENSE.php
  7. * Joomla! is free software. This version may have been modified pursuant
  8. * to the GNU General Public License, and as distributed it includes or
  9. * is derivative of works licensed under the GNU General Public License or
  10. * other free or open source software licenses.
  11. * See COPYRIGHT.php for copyright notices and details.
  12. */
  13. // no direct access
  14. defined('_JEXEC') or die('Restricted access');
  15. /**
  16. * This is a file to add template specific chrome to pagination rendering.
  17. *
  18. * pagination_list_footer
  19. * Input variable $list is an array with offsets:
  20. * $list[limit] : int
  21. * $list[limitstart] : int
  22. * $list[total] : int
  23. * $list[limitfield] : string
  24. * $list[pagescounter] : string
  25. * $list[pageslinks] : string
  26. *
  27. * pagination_list_render
  28. * Input variable $list is an array with offsets:
  29. * $list[all]
  30. * [data] : string
  31. * [active] : boolean
  32. * $list[start]
  33. * [data] : string
  34. * [active] : boolean
  35. * $list[previous]
  36. * [data] : string
  37. * [active] : boolean
  38. * $list[next]
  39. * [data] : string
  40. * [active] : boolean
  41. * $list[end]
  42. * [data] : string
  43. * [active] : boolean
  44. * $list[pages]
  45. * [{PAGE}][data] : string
  46. * [{PAGE}][active] : boolean
  47. *
  48. * pagination_item_active
  49. * Input variable $item is an object with fields:
  50. * $item->base : integer
  51. * $item->link : string
  52. * $item->text : string
  53. *
  54. * pagination_item_inactive
  55. * Input variable $item is an object with fields:
  56. * $item->base : integer
  57. * $item->link : string
  58. * $item->text : string
  59. *
  60. * This gives template designers ultimate control over how pagination is rendered.
  61. *
  62. * NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
  63. */
  64. function pagination_list_footer($list)
  65. {
  66. // Initialize variables
  67. $lang =& JFactory::getLanguage();
  68. $html = "<div class=\"list-footer\">\n";
  69. $html .= "\n<div class=\"limit\">".JText::_('Display Num').$list['limitfield']."</div>";
  70. $html .= $list['pageslinks'];
  71. $html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
  72. $html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"".$list['limitstart']."\" />";
  73. $html .= "\n</div>";
  74. return $html;
  75. }
  76. function pagination_list_render($list)
  77. {
  78. // Initialize variables
  79. $lang =& JFactory::getLanguage();
  80. $html = "<ul class=\"pagination\">";
  81. $html .= $list['start']['data'];
  82. $html .= $list['previous']['data'];
  83. foreach( $list['pages'] as $page )
  84. {
  85. if($page['data']['active']) {
  86. // $html .= '<strong>';
  87. }
  88. $html .= $page['data'];
  89. if($page['data']['active']) {
  90. // $html .= '</strong>';
  91. }
  92. }
  93. $html .= $list['next']['data'];
  94. $html .= $list['end']['data'];
  95. // $html .= '&#171;';
  96. $html .= "</ul>";
  97. return $html;
  98. }
  99. function pagination_item_active(&$item) {
  100. return "<li><strong><a href=\"".$item->link."\" title=\"".$item->text."\">".$item->text."</a></strong></li>";
  101. }
  102. function pagination_item_inactive(&$item) {
  103. return "<li>".$item->text."</li>";
  104. }
  105. ?>