PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/administrator/templates/bluestork/html/pagination.php

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