/administrator/templates/hathor/html/com_users/users/default.php

https://bitbucket.org/eternaware/joomus · PHP · 202 lines · 177 code · 15 blank · 10 comment · 15 complexity · c93730861b0bc2e6e84266a69ff460fe MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Administrator
  4. * @subpackage Template.hathor
  5. *
  6. * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. defined('_JEXEC') or die;
  10. // Include the component HTML helpers.
  11. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
  12. // Load the tooltip behavior.
  13. JHtml::_('behavior.tooltip');
  14. JHtml::_('behavior.multiselect');
  15. JHtml::_('behavior.modal');
  16. $canDo = UsersHelper::getActions();
  17. $listOrder = $this->escape($this->state->get('list.ordering'));
  18. $listDirn = $this->escape($this->state->get('list.direction'));
  19. $loggeduser = JFactory::getUser();
  20. ?>
  21. <form action="<?php echo JRoute::_('index.php?option=com_users&view=users');?>" method="post" name="adminForm" id="adminForm">
  22. <fieldset id="filter-bar">
  23. <legend class="element-invisible"><?php echo JText::_('COM_USERS_SEARCH_USERS'); ?></legend>
  24. <div class="filter-search">
  25. <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('COM_USERS_SEARCH_USERS'); ?></label>
  26. <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_USERS_SEARCH_USERS'); ?>" />
  27. <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
  28. <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_RESET'); ?></button>
  29. </div>
  30. <div class="filter-select">
  31. <span class="faux-label")><?php echo JText::_('COM_USERS_FILTER_LABEL'); ?></span>
  32. <label class="selectlabel" for="filter_state">
  33. <?php echo JText::_('COM_USERS_FILTER_LABEL'); ?>
  34. </label>
  35. <select name="filter_state" class="inputbox" id="filter_state">
  36. <option value="*"><?php echo JText::_('COM_USERS_FILTER_STATE');?></option>
  37. <?php echo JHtml::_('select.options', UsersHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state'));?>
  38. </select>
  39. <label class="selectlabel" for="filter_active">
  40. <?php echo JText::_('COM_USERS_FILTER_ACTIVE'); ?>
  41. </label>
  42. <select name="filter_active" class="inputbox" id="filter_active">
  43. <option value="*"><?php echo JText::_('COM_USERS_FILTER_ACTIVE');?></option>
  44. <?php echo JHtml::_('select.options', UsersHelper::getActiveOptions(), 'value', 'text', $this->state->get('filter.active'));?>
  45. </select>
  46. <label class="selectlabel" for="filter_group_id">
  47. <?php echo JText::_('COM_USERS_FILTER_USERGROUP'); ?>
  48. </label>
  49. <select name="filter_group_id" class="inputbox" id="filter_group_id">
  50. <option value=""><?php echo JText::_('COM_USERS_FILTER_USERGROUP');?></option>
  51. <?php echo JHtml::_('select.options', UsersHelper::getGroups(), 'value', 'text', $this->state->get('filter.group_id'));?>
  52. </select>
  53. <label class="selectlabel" for="filter_range">
  54. <?php echo JText::_('COM_USERS_FILTER_FILTER_DATE'); ?>
  55. </label>
  56. <select name="filter_range" class="inputbox" id="filter_range" >
  57. <option value=""><?php echo JText::_('COM_USERS_OPTION_FILTER_DATE');?></option>
  58. <?php echo JHtml::_('select.options', Usershelper::getRangeOptions(), 'value', 'text', $this->state->get('filter.range'));?>
  59. </select>
  60. <button type="submit" id="filter-go">
  61. <?php echo JText::_('JSUBMIT'); ?></button>
  62. </div>
  63. </fieldset>
  64. <div class="clr"> </div>
  65. <table class="adminlist">
  66. <thead>
  67. <tr>
  68. <th class="checkmark-col">
  69. <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
  70. </th>
  71. <th class="title">
  72. <?php echo JHtml::_('grid.sort', 'COM_USERS_HEADING_NAME', 'a.name', $listDirn, $listOrder); ?>
  73. </th>
  74. <th class="nowrap width-10">
  75. <?php echo JHtml::_('grid.sort', 'JGLOBAL_USERNAME', 'a.username', $listDirn, $listOrder); ?>
  76. </th>
  77. <th class="nowrap width-5">
  78. <?php echo JHtml::_('grid.sort', 'COM_USERS_HEADING_ENABLED', 'a.block', $listDirn, $listOrder); ?>
  79. </th>
  80. <th class="nowrap width-5">
  81. <?php echo JHtml::_('grid.sort', 'COM_USERS_HEADING_ACTIVATED', 'a.activation', $listDirn, $listOrder); ?>
  82. </th>
  83. <th class="nowrap width-10">
  84. <?php echo JText::_('COM_USERS_HEADING_GROUPS'); ?>
  85. </th>
  86. <th class="nowrap width-15">
  87. <?php echo JHtml::_('grid.sort', 'JGLOBAL_EMAIL', 'a.email', $listDirn, $listOrder); ?>
  88. </th>
  89. <th class="nowrap width-15">
  90. <?php echo JHtml::_('grid.sort', 'COM_USERS_HEADING_LAST_VISIT_DATE', 'a.lastvisitDate', $listDirn, $listOrder); ?>
  91. </th>
  92. <th class="nowrap width-15">
  93. <?php echo JHtml::_('grid.sort', 'COM_USERS_HEADING_REGISTRATION_DATE', 'a.registerDate', $listDirn, $listOrder); ?>
  94. </th>
  95. <th class="nowrap id-col">
  96. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  97. </th>
  98. </tr>
  99. </thead>
  100. <tbody>
  101. <?php foreach ($this->items as $i => $item) :
  102. $canEdit = $canDo->get('core.edit');
  103. $canChange = $loggeduser->authorise('core.edit.state', 'com_users');
  104. // If this group is super admin and this user is not super admin, $canEdit is false
  105. if ((!$loggeduser->authorise('core.admin')) && JAccess::check($item->id, 'core.admin')) {
  106. $canEdit = false;
  107. $canChange = false;
  108. }
  109. ?>
  110. <tr class="row<?php echo $i % 2; ?>">
  111. <td>
  112. <?php if ($canEdit) : ?>
  113. <?php echo JHtml::_('grid.id', $i, $item->id); ?>
  114. <?php endif; ?>
  115. </td>
  116. <td>
  117. <div class="fltrt">
  118. <?php echo JHtml::_('users.filterNotes', $item->note_count, $item->id); ?>
  119. <?php echo JHtml::_('users.notes', $item->note_count, $item->id); ?>
  120. <?php echo JHtml::_('users.addNote', $item->id); ?>
  121. </div>
  122. <?php if ($canEdit) : ?>
  123. <a href="<?php echo JRoute::_('index.php?option=com_users&task=user.edit&id='.(int) $item->id); ?>" title="<?php echo JText::sprintf('COM_USERS_EDIT_USER', $this->escape($item->name)); ?>">
  124. <?php echo $this->escape($item->name); ?></a>
  125. <?php else : ?>
  126. <?php echo $this->escape($item->name); ?>
  127. <?php endif; ?>
  128. <?php if (JDEBUG) : ?>
  129. <div class="fltrt"><div class="button2-left smallsub"><div class="blank"><a href="<?php echo JRoute::_('index.php?option=com_users&view=debuguser&user_id='.(int) $item->id);?>">
  130. <?php echo JText::_('COM_USERS_DEBUG_USER');?></a></div></div></div>
  131. <?php endif; ?>
  132. </td>
  133. <td class="center">
  134. <?php echo $this->escape($item->username); ?>
  135. </td>
  136. <td class="center">
  137. <?php if ($canChange) : ?>
  138. <?php if ($loggeduser->id != $item->id) : ?>
  139. <?php echo JHtml::_('grid.boolean', $i, !$item->block, 'users.unblock', 'users.block'); ?>
  140. <?php else : ?>
  141. <?php echo JHtml::_('grid.boolean', $i, !$item->block, 'users.block', null); ?>
  142. <?php endif; ?>
  143. <?php else : ?>
  144. <?php echo JText::_($item->block ? 'JNO' : 'JYES'); ?>
  145. <?php endif; ?>
  146. </td>
  147. <td class="center">
  148. <?php echo JHtml::_('grid.boolean', $i, !$item->activation, 'users.activate', null); ?>
  149. </td>
  150. <td class="center">
  151. <?php if (substr_count($item->group_names, "\n") > 1) : ?>
  152. <span class="hasTip" title="<?php echo JText::_('COM_USERS_HEADING_GROUPS').'::'.nl2br($item->group_names); ?>"><?php echo JText::_('COM_USERS_USERS_MULTIPLE_GROUPS'); ?></span>
  153. <?php else : ?>
  154. <?php echo nl2br($item->group_names); ?>
  155. <?php endif; ?>
  156. </td>
  157. <td class="center">
  158. <?php echo $this->escape($item->email); ?>
  159. </td>
  160. <td class="center">
  161. <?php if ($item->lastvisitDate != '0000-00-00 00:00:00'): ?>
  162. <?php echo JHtml::_('date', $item->lastvisitDate, 'Y-m-d H:i:s'); ?>
  163. <?php else:?>
  164. <?php echo JText::_('JNEVER'); ?>
  165. <?php endif;?>
  166. </td>
  167. <td class="center">
  168. <?php echo JHtml::_('date', $item->registerDate, 'Y-m-d H:i:s'); ?>
  169. </td>
  170. <td class="center">
  171. <?php echo (int) $item->id; ?>
  172. </td>
  173. </tr>
  174. <?php endforeach; ?>
  175. </tbody>
  176. </table>
  177. <?php //Load the batch processing form. ?>
  178. <?php echo $this->loadTemplate('batch'); ?>
  179. <?php echo $this->pagination->getListFooter(); ?>
  180. <div>
  181. <input type="hidden" name="task" value="" />
  182. <input type="hidden" name="boxchecked" value="0" />
  183. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  184. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  185. <?php echo JHtml::_('form.token'); ?>
  186. </div>
  187. </form>