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

/templates/rhuk_milkyway/html/pagination.php

https://github.com/joebushi/joomla
PHP | 114 lines | 40 code | 14 blank | 60 comment | 2 complexity | c73ed46dd94a171100b95bd1d6c6ea6e MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. <?php
  2. /**
  3. * @version $Id$
  4. * @package Joomla.Site
  5. * @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
  6. * @license GNU General Public License version 2 or later; see LICENSE.txt
  7. */
  8. // no direct access
  9. defined('_JEXEC') or die;
  10. /**
  11. * This is a file to add template specific chrome to pagination rendering.
  12. *
  13. * pagination_list_footer
  14. * Input variable $list is an array with offsets:
  15. * $list[prefix] : string
  16. * $list[limit] : int
  17. * $list[limitstart] : int
  18. * $list[total] : int
  19. * $list[limitfield] : string
  20. * $list[pagescounter] : string
  21. * $list[pageslinks] : string
  22. *
  23. * pagination_list_render
  24. * Input variable $list is an array with offsets:
  25. * $list[all]
  26. * [data] : string
  27. * [active] : boolean
  28. * $list[start]
  29. * [data] : string
  30. * [active] : boolean
  31. * $list[previous]
  32. * [data] : string
  33. * [active] : boolean
  34. * $list[next]
  35. * [data] : string
  36. * [active] : boolean
  37. * $list[end]
  38. * [data] : string
  39. * [active] : boolean
  40. * $list[pages]
  41. * [{PAGE}][data] : string
  42. * [{PAGE}][active] : boolean
  43. *
  44. * pagination_item_active
  45. * Input variable $item is an object with fields:
  46. * $item->base : integer
  47. * $item->prefix : string
  48. * $item->link : string
  49. * $item->text : string
  50. *
  51. * pagination_item_inactive
  52. * Input variable $item is an object with fields:
  53. * $item->base : integer
  54. * $item->prefix : string
  55. * $item->link : string
  56. * $item->text : string
  57. *
  58. * This gives template designers ultimate control over how pagination is rendered.
  59. *
  60. * NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
  61. */
  62. function pagination_list_footer($list)
  63. {
  64. $html = "<div class=\"list-footer\">\n";
  65. $html .= "\n<div class=\"limit\">".JText::_('DISPLAY_NUM').$list['limitfield']."</div>";
  66. $html .= $list['pageslinks'];
  67. $html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
  68. $html .= "\n<input type=\"hidden\" name=\"" . $list['prefix'] . "limitstart\" value=\"".$list['limitstart']."\" />";
  69. $html .= "\n</div>";
  70. return $html;
  71. }
  72. function pagination_list_render($list)
  73. {
  74. // Initialise variables.
  75. $html = "<span class=\"pagination\">";
  76. $html .= '<span>&laquo;</span>'.$list['start']['data'];
  77. $html .= $list['previous']['data'];
  78. foreach($list['pages'] as $page)
  79. {
  80. if ($page['data']['active']) {
  81. $html .= '<strong>';
  82. }
  83. $html .= $page['data'];
  84. if ($page['data']['active']) {
  85. $html .= '</strong>';
  86. }
  87. }
  88. $html .= $list['next']['data'];
  89. $html .= $list['end']['data'];
  90. $html .= '<span>&raquo;</span>';
  91. $html .= "</span>";
  92. return $html;
  93. }
  94. function pagination_item_active(&$item) {
  95. return "<a href=\"".$item->link."\" title=\"".$item->text."\">".$item->text."</a>";
  96. }
  97. function pagination_item_inactive(&$item) {
  98. return "<span>".$item->text."</span>";
  99. }
  100. ?>