[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_users/tmpl/users/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_users
   6   *
   7   * @copyright   (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Access\Access;
  14  use Joomla\CMS\Factory;
  15  use Joomla\CMS\HTML\HTMLHelper;
  16  use Joomla\CMS\Language\Text;
  17  use Joomla\CMS\Layout\LayoutHelper;
  18  use Joomla\CMS\Plugin\PluginHelper;
  19  use Joomla\CMS\Router\Route;
  20  use Joomla\CMS\String\PunycodeHelper;
  21  
  22  /** @var \Joomla\Component\Users\Administrator\View\Users\HtmlView $this */
  23  
  24  
  25  /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
  26  $wa = $this->document->getWebAssetManager();
  27  $wa->useScript('table.columns')
  28      ->useScript('multiselect');
  29  
  30  $listOrder  = $this->escape($this->state->get('list.ordering'));
  31  $listDirn   = $this->escape($this->state->get('list.direction'));
  32  $loggeduser = Factory::getUser();
  33  $mfa        = PluginHelper::isEnabled('multifactorauth');
  34  
  35  ?>
  36  <form action="<?php echo Route::_('index.php?option=com_users&view=users'); ?>" method="post" name="adminForm" id="adminForm">
  37      <div class="row">
  38          <div class="col-md-12">
  39              <div id="j-main-container" class="j-main-container">
  40                  <?php
  41                  // Search tools bar
  42                  echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
  43                  ?>
  44                  <?php if (empty($this->items)) : ?>
  45                      <div class="alert alert-info">
  46                          <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  47                          <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
  48                      </div>
  49                  <?php else : ?>
  50                      <table class="table" id="userList">
  51                          <caption class="visually-hidden">
  52                              <?php echo Text::_('COM_USERS_USERS_TABLE_CAPTION'); ?>,
  53                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  54                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  55                          </caption>
  56                          <thead>
  57                              <tr>
  58                                  <td class="w-1 text-center">
  59                                      <?php echo HTMLHelper::_('grid.checkall'); ?>
  60                                  </td>
  61                                  <th scope="col">
  62                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_USERS_HEADING_NAME', 'a.name', $listDirn, $listOrder); ?>
  63                                  </th>
  64                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  65                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_USERNAME', 'a.username', $listDirn, $listOrder); ?>
  66                                  </th>
  67                                  <th scope="col" class="w-5 text-center d-md-table-cell">
  68                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_USERS_HEADING_ENABLED', 'a.block', $listDirn, $listOrder); ?>
  69                                  </th>
  70                                  <th scope="col" class="w-5 text-center d-md-table-cell">
  71                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_USERS_HEADING_ACTIVATED', 'a.activation', $listDirn, $listOrder); ?>
  72                                  </th>
  73                                  <?php if ($mfa) : ?>
  74                                  <th scope="col" class="w-5 text-center d-none d-md-table-cell">
  75                                      <?php echo Text::_('COM_USERS_HEADING_MFA'); ?>
  76                                  </th>
  77                                  <?php endif; ?>
  78                                  <th scope="col" class="w-12 d-none d-md-table-cell">
  79                                      <?php echo Text::_('COM_USERS_HEADING_GROUPS'); ?>
  80                                  </th>
  81                                  <th scope="col" class="w-12 d-none d-xl-table-cell">
  82                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_EMAIL', 'a.email', $listDirn, $listOrder); ?>
  83                                  </th>
  84                                  <th scope="col" class="w-12 d-none d-xl-table-cell">
  85                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_USERS_HEADING_LAST_VISIT_DATE', 'a.lastvisitDate', $listDirn, $listOrder); ?>
  86                                  </th>
  87                                  <th scope="col" class="w-12 d-none d-xl-table-cell">
  88                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_USERS_HEADING_REGISTRATION_DATE', 'a.registerDate', $listDirn, $listOrder); ?>
  89                                  </th>
  90                                  <th scope="col" class="w-5 d-none d-md-table-cell">
  91                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  92                                  </th>
  93                              </tr>
  94                          </thead>
  95                          <tbody>
  96                          <?php foreach ($this->items as $i => $item) :
  97                              $canEdit   = $this->canDo->get('core.edit');
  98                              $canChange = $loggeduser->authorise('core.edit.state', 'com_users');
  99  
 100                              // If this group is super admin and this user is not super admin, $canEdit is false
 101                              if ((!$loggeduser->authorise('core.admin')) && Access::check($item->id, 'core.admin')) {
 102                                  $canEdit   = false;
 103                                  $canChange = false;
 104                              }
 105                              ?>
 106                              <tr class="row<?php echo $i % 2; ?>">
 107                                  <td class="text-center">
 108                                      <?php if ($canEdit || $canChange) : ?>
 109                                          <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->name); ?>
 110                                      <?php endif; ?>
 111                                  </td>
 112                                  <th scope="row">
 113                                      <div class="name break-word">
 114                                      <?php if ($canEdit) : ?>
 115                                          <a href="<?php echo Route::_('index.php?option=com_users&task=user.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::sprintf('COM_USERS_EDIT_USER', $this->escape($item->name)); ?>">
 116                                              <?php echo $this->escape($item->name); ?></a>
 117                                      <?php else : ?>
 118                                          <?php echo $this->escape($item->name); ?>
 119                                      <?php endif; ?>
 120                                      </div>
 121                                      <div class="btn-group">
 122                                          <?php echo HTMLHelper::_('users.addNote', $item->id); ?>
 123                                          <?php if ($item->note_count > 0) : ?>
 124                                          <button type="button" class="btn btn-secondary btn-sm dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
 125                                              <span class="visually-hidden"><?php echo Text::_('JGLOBAL_TOGGLE_DROPDOWN'); ?></span>
 126                                          </button>
 127                                          <div class="dropdown-menu">
 128                                              <?php echo HTMLHelper::_('users.filterNotes', $item->note_count, $item->id); ?>
 129                                              <?php echo HTMLHelper::_('users.notes', $item->note_count, $item->id); ?>
 130                                          </div>
 131                                          <?php endif; ?>
 132                                      </div>
 133                                      <?php echo HTMLHelper::_('users.notesModal', $item->note_count, $item->id); ?>
 134                                      <?php if ($item->requireReset == '1') : ?>
 135                                          <span class="badge bg-warning text-dark"><?php echo Text::_('COM_USERS_PASSWORD_RESET_REQUIRED'); ?></span>
 136                                      <?php endif; ?>
 137                                  </th>
 138                                  <td class="break-word d-none d-md-table-cell">
 139                                      <?php echo $this->escape($item->username); ?>
 140                                  </td>
 141                                  <td class="text-center d-md-table-cell">
 142                                      <?php $self = $loggeduser->id == $item->id; ?>
 143                                      <?php if ($canChange) : ?>
 144                                          <?php echo HTMLHelper::_('jgrid.state', HTMLHelper::_('users.blockStates', $self), $item->block, $i, 'users.', !$self); ?>
 145                                      <?php else : ?>
 146                                          <?php echo HTMLHelper::_('jgrid.state', HTMLHelper::_('users.blockStates', $self), $item->block, $i, 'users.', false); ?>
 147                                      <?php endif; ?>
 148                                  </td>
 149                                  <td class="text-center d-md-table-cell">
 150                                      <?php
 151                                      $activated = empty($item->activation) ? 0 : 1;
 152                                      echo HTMLHelper::_('jgrid.state', HTMLHelper::_('users.activateStates'), $activated, $i, 'users.', (bool) $activated);
 153                                      ?>
 154                                  </td>
 155                                  <?php if ($mfa) : ?>
 156                                  <td class="text-center d-none d-md-table-cell">
 157                                      <span class="tbody-icon">
 158                                      <?php if ($item->mfaRecords > 0 || !empty($item->otpKey)) : ?>
 159                                          <span class="icon-check" aria-hidden="true" aria-describedby="tip-mfa<?php echo $i; ?>"></span>
 160                                          <div role="tooltip" id="tip-mfa<?php echo $i; ?>">
 161                                              <?php echo Text::_('COM_USERS_MFA_ACTIVE'); ?>
 162                                          </div>
 163                                      <?php else : ?>
 164                                          <span class="icon-times" aria-hidden="true" aria-describedby="tip-mfa<?php echo $i; ?>"></span>
 165                                          <div role="tooltip" id="tip-mfa<?php echo $i; ?>">
 166                                              <?php echo Text::_('COM_USERS_MFA_NOTACTIVE'); ?>
 167                                          </div>
 168                                      <?php endif; ?>
 169                                      </span>
 170                                  </td>
 171                                  <?php endif; ?>
 172                                  <td class="d-none d-md-table-cell">
 173                                      <?php if (substr_count($item->group_names, "\n") > 1) : ?>
 174                                          <span tabindex="0"><?php echo Text::_('COM_USERS_USERS_MULTIPLE_GROUPS'); ?></span>
 175                                          <div role="tooltip" id="tip<?php echo $i; ?>">
 176                                              <strong><?php echo Text::_('COM_USERS_HEADING_GROUPS'); ?></strong>
 177                                              <ul><li><?php echo str_replace("\n", '</li><li>', $item->group_names); ?></li></ul>
 178                                          </div>
 179                                      <?php else : ?>
 180                                          <?php echo nl2br($item->group_names, false); ?>
 181                                      <?php endif; ?>
 182                                      <a  class="btn btn-sm btn-secondary"
 183                                          href="<?php echo Route::_('index.php?option=com_users&view=debuguser&user_id=' . (int) $item->id); ?>">
 184                                          <?php echo Text::_('COM_USERS_DEBUG_PERMISSIONS'); ?>
 185                                      </a>
 186                                  </td>
 187                                  <td class="d-none d-xl-table-cell break-word">
 188                                      <?php echo PunycodeHelper::emailToUTF8($this->escape($item->email)); ?>
 189                                  </td>
 190                                  <td class="d-none d-xl-table-cell">
 191                                      <?php if ($item->lastvisitDate !== null) : ?>
 192                                          <?php echo HTMLHelper::_('date', $item->lastvisitDate, Text::_('DATE_FORMAT_LC6')); ?>
 193                                      <?php else : ?>
 194                                          <?php echo Text::_('JNEVER'); ?>
 195                                      <?php endif; ?>
 196                                  </td>
 197                                  <td class="d-none d-xl-table-cell">
 198                                      <?php echo HTMLHelper::_('date', $item->registerDate, Text::_('DATE_FORMAT_LC6')); ?>
 199                                  </td>
 200                                  <td class="d-none d-md-table-cell">
 201                                      <?php echo (int) $item->id; ?>
 202                                  </td>
 203                              </tr>
 204                          <?php endforeach; ?>
 205                          </tbody>
 206                      </table>
 207  
 208                      <?php // load the pagination. ?>
 209                      <?php echo $this->pagination->getListFooter(); ?>
 210  
 211                      <?php // Load the batch processing form if user is allowed ?>
 212                      <?php if (
 213                      $loggeduser->authorise('core.create', 'com_users')
 214                          && $loggeduser->authorise('core.edit', 'com_users')
 215                          && $loggeduser->authorise('core.edit.state', 'com_users')
 216  ) : ?>
 217                          <?php echo HTMLHelper::_(
 218                              'bootstrap.renderModal',
 219                              'collapseModal',
 220                              array(
 221                                  'title'  => Text::_('COM_USERS_BATCH_OPTIONS'),
 222                                  'footer' => $this->loadTemplate('batch_footer'),
 223                              ),
 224                              $this->loadTemplate('batch_body')
 225                          ); ?>
 226                      <?php endif; ?>
 227                  <?php endif; ?>
 228  
 229                  <input type="hidden" name="task" value="">
 230                  <input type="hidden" name="boxchecked" value="0">
 231                  <?php echo HTMLHelper::_('form.token'); ?>
 232              </div>
 233          </div>
 234      </div>
 235  </form>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer