PageRenderTime 43ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/templates/hathor/html/com_modules/modules/default.php

https://github.com/ianmacl/page_objects
PHP | 211 lines | 188 code | 13 blank | 10 comment | 22 complexity | e856d0986efbeff919db91e2bc573539 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: default.php 20196 2011-01-09 02:40:25Z ian $
  4. * @package Joomla.Administrator
  5. * @subpackage templates.hathor
  6. * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. * @since 1.6
  9. */
  10. // No direct access.
  11. defined('_JEXEC') or die;
  12. // Include the component HTML helpers.
  13. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
  14. JHtml::_('behavior.tooltip');
  15. JHtml::_('script','system/multiselect.js',false,true);
  16. $client = $this->state->get('filter.client_id') ? 'administrator' : 'site';
  17. $user = JFactory::getUser();
  18. $listOrder = $this->state->get('list.ordering');
  19. $listDirn = $this->state->get('list.direction');
  20. $canOrder = $user->authorise('core.edit.state', 'com_modules');
  21. $saveOrder = $listOrder == 'ordering';
  22. ?>
  23. <form action="<?php echo JRoute::_('index.php?option=com_modules'); ?>" method="post" name="adminForm" id="adminForm">
  24. <fieldset id="filter-bar">
  25. <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend>
  26. <div class="filter-search">
  27. <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
  28. <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_MODULES_MODULES_FILTER_SEARCH_DESC'); ?>" />
  29. <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
  30. <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
  31. </div>
  32. <div class="filter-select">
  33. <label class="selectlabel" for="filter_client_id">
  34. <?php echo JText::_('JGLOBAL_FILTER_CLIENT'); ?>
  35. </label>
  36. <select name="filter_client_id" id="filter_client_id" class="inputbox">
  37. <?php echo JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'));?>
  38. </select>
  39. <label class="selectlabel" for="filter_state">
  40. <?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?>
  41. </label>
  42. <select name="filter_state" id="filter_state" class="inputbox">
  43. <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
  44. <?php echo JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state'));?>
  45. </select>
  46. <label class="selectlabel" for="filter_position">
  47. <?php echo JText::_('COM_MODULES_OPTION_SELECT_POSITION'); ?>
  48. </label>
  49. <select name="filter_position" id="filter_position" class="inputbox">
  50. <option value=""><?php echo JText::_('COM_MODULES_OPTION_SELECT_POSITION');?></option>
  51. <?php echo JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position'));?>
  52. </select>
  53. <label class="selectlabel" for="filter_module">
  54. <?php echo JText::_('COM_MODULES_OPTION_SELECT_MODULE'); ?>
  55. </label>
  56. <select name="filter_module" id="filter_module" class="inputbox">
  57. <option value=""><?php echo JText::_('COM_MODULES_OPTION_SELECT_MODULE');?></option>
  58. <?php echo JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module'));?>
  59. </select>
  60. <label class="selectlabel" for="filter_access">
  61. <?php echo JText::_('JOPTION_SELECT_ACCESS'); ?>
  62. </label>
  63. <select name="filter_access" id="filter_access" class="inputbox">
  64. <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option>
  65. <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?>
  66. </select>
  67. <label class="selectlabel" for="filter_language">
  68. <?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?>
  69. </label>
  70. <select name="filter_language" id="filter_language" class="inputbox">
  71. <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE');?></option>
  72. <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'));?>
  73. </select>
  74. <button type="button" id="filter-go" onclick="this.form.submit();">
  75. <?php echo JText::_('JSUBMIT'); ?></button>
  76. </div>
  77. </fieldset>
  78. <div class="clr"> </div>
  79. <table class="adminlist" id="modules-mgr">
  80. <thead>
  81. <tr>
  82. <th class="checkmark-col">
  83. <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('TPL_HATHOR_CHECKMARK_ALL'); ?>" onclick="checkAll(this)" />
  84. </th>
  85. <th class="title">
  86. <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'title', $listDirn, $listOrder); ?>
  87. </th>
  88. <th class="width-5">
  89. <?php echo JHtml::_('grid.sort', 'JPUBLISHED', 'published', $listDirn, $listOrder); ?>
  90. </th>
  91. <th class="width-20">
  92. <?php echo JHtml::_('grid.sort', 'COM_MODULES_HEADING_POSITION', 'position', $listDirn, $listOrder); ?>
  93. </th>
  94. <th class="nowrap ordering-col">
  95. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'ordering', $listDirn, $listOrder); ?>
  96. <?php if ($canOrder && $saveOrder) :?>
  97. <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'modules.saveorder'); ?>
  98. <?php endif; ?>
  99. </th>
  100. <th class="width-10">
  101. <?php echo JHtml::_('grid.sort', 'COM_MODULES_HEADING_MODULE', 'name', $listDirn, $listOrder); ?>
  102. </th>
  103. <th class="width-10">
  104. <?php echo JHtml::_('grid.sort', 'COM_MODULES_HEADING_PAGES', 'pages', $listDirn, $listOrder); ?>
  105. </th>
  106. <th class="title access-col">
  107. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access', $listDirn, $listOrder); ?>
  108. </th>
  109. <th class="language-col">
  110. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language_title', $listDirn, $listOrder); ?>
  111. </th>
  112. <th class="nowrap id-col">
  113. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'id', $listDirn, $listOrder); ?>
  114. </th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. <?php foreach ($this->items as $i => $item) :
  119. $ordering = ($listOrder == 'ordering');
  120. $canCreate = $user->authorise('core.create', 'com_modules');
  121. $canEdit = $user->authorise('core.edit', 'com_modules');
  122. $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
  123. $canChange = $user->authorise('core.edit.state', 'com_modules') && $canCheckin;
  124. ?>
  125. <tr class="row<?php echo $i % 2; ?>">
  126. <td class="center">
  127. <?php echo JHtml::_('grid.id', $i, $item->id); ?>
  128. </td>
  129. <td>
  130. <?php if ($item->checked_out) : ?>
  131. <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'modules.', $canCheckin); ?>
  132. <?php endif; ?>
  133. <?php if ($canEdit) : ?>
  134. <a href="<?php echo JRoute::_('index.php?option=com_modules&task=module.edit&id='.(int) $item->id); ?>">
  135. <?php echo $this->escape($item->title); ?></a>
  136. <?php else : ?>
  137. <?php echo $this->escape($item->title); ?>
  138. <?php endif; ?>
  139. <?php if (!empty($item->note)) : ?>
  140. <p class="smallsub">
  141. <?php echo JText::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note));?></p>
  142. <?php endif; ?>
  143. </td>
  144. <td class="center">
  145. <?php echo JHtml::_('jgrid.published', $item->published, $i, 'modules.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
  146. </td>
  147. <td class="center">
  148. <?php echo $item->position; ?>
  149. </td>
  150. <td class="order">
  151. <?php if ($canChange) : ?>
  152. <?php if ($saveOrder) :?>
  153. <?php if ($listDirn == 'asc') : ?>
  154. <span><?php echo $this->pagination->orderUpIcon($i, (@$this->items[$i-1]->position == $item->position), 'modules.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  155. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, (@$this->items[$i+1]->position == $item->position), 'modules.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  156. <?php elseif ($listDirn == 'desc') : ?>
  157. <span><?php echo $this->pagination->orderUpIcon($i, (@$this->items[$i-1]->position == $item->position), 'modules.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  158. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, (@$this->items[$i+1]->position == $item->position), 'modules.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  159. <?php endif; ?>
  160. <?php endif; ?>
  161. <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
  162. <input type="text" name="order[]" value="<?php echo $item->ordering;?>" <?php echo $disabled ?> class="text-area-order" title="<?php echo $item->title; ?> order" />
  163. <?php else : ?>
  164. <?php echo $item->ordering; ?>
  165. <?php endif; ?>
  166. </td>
  167. <td class="left">
  168. <?php echo $item->name;?>
  169. </td>
  170. <td class="center">
  171. <?php echo $item->pages; ?>
  172. </td>
  173. <td class="center">
  174. <?php echo $this->escape($item->access_level); ?>
  175. </td>
  176. <td class="center">
  177. <?php if ($item->language==''):?>
  178. <?php echo JText::_('JDEFAULT'); ?>
  179. <?php elseif ($item->language=='*'):?>
  180. <?php echo JText::alt('JALL','language'); ?>
  181. <?php else:?>
  182. <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
  183. <?php endif;?>
  184. </td>
  185. <td class="center">
  186. <?php echo (int) $item->id; ?>
  187. </td>
  188. </tr>
  189. <?php endforeach; ?>
  190. </tbody>
  191. </table>
  192. <?php echo $this->pagination->getListFooter(); ?>
  193. <input type="hidden" name="task" value="" />
  194. <input type="hidden" name="boxchecked" value="0" />
  195. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  196. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  197. <?php echo JHtml::_('form.token'); ?>
  198. </form>