[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_users 6 * 7 * @copyright (C) 2009 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\Router\Route; 19 use Joomla\CMS\Session\Session; 20 use Joomla\Component\Users\Administrator\Helper\UsersHelper; 21 22 /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ 23 $wa = $this->document->getWebAssetManager(); 24 $wa->useScript('table.columns') 25 ->useScript('multiselect'); 26 27 $user = Factory::getUser(); 28 $listOrder = $this->escape($this->state->get('list.ordering')); 29 $listDirn = $this->escape($this->state->get('list.direction')); 30 $saveOrder = $listOrder == 'a.ordering'; 31 32 if ($saveOrder && !empty($this->items)) { 33 $saveOrderingUrl = 'index.php?option=com_users&task=levels.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1'; 34 HTMLHelper::_('draggablelist.draggable'); 35 } 36 ?> 37 <form action="<?php echo Route::_('index.php?option=com_users&view=levels'); ?>" method="post" id="adminForm" name="adminForm"> 38 <div class="row"> 39 <div class="col-md-12"> 40 <div id="j-main-container" class="j-main-container"> 41 <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('filterButton' => false))); ?> 42 43 <?php if (empty($this->items)) : ?> 44 <div class="alert alert-info"> 45 <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span> 46 <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?> 47 </div> 48 <?php else : ?> 49 <table class="table" id="levelList"> 50 <caption class="visually-hidden"> 51 <?php echo Text::_('COM_USERS_LEVELS_TABLE_CAPTION'); ?>, 52 <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>, 53 <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span> 54 </caption> 55 <thead> 56 <tr> 57 <td class="w-1 text-center"> 58 <?php echo HTMLHelper::_('grid.checkall'); ?> 59 </td> 60 <th scope="col" class="w-1 text-center d-none d-md-table-cell"> 61 <?php echo HTMLHelper::_('searchtools.sort', '', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?> 62 </th> 63 <th scope="col"> 64 <?php echo HTMLHelper::_('searchtools.sort', 'COM_USERS_HEADING_LEVEL_NAME', 'a.title', $listDirn, $listOrder); ?> 65 </th> 66 <th scope="col" class="d-none d-md-table-cell"> 67 <?php echo Text::_('COM_USERS_USER_GROUPS_HAVING_ACCESS'); ?> 68 </th> 69 <th scope="col" class="w-1 d-none d-md-table-cell"> 70 <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> 71 </th> 72 </tr> 73 </thead> 74 <tbody<?php if ($saveOrder) : 75 ?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>"<?php 76 endif; ?>> 77 <?php $count = count($this->items); ?> 78 <?php foreach ($this->items as $i => $item) : 79 $ordering = ($listOrder == 'a.ordering'); 80 $canCreate = $user->authorise('core.create', 'com_users'); 81 $canEdit = $user->authorise('core.edit', 'com_users'); 82 $canChange = $user->authorise('core.edit.state', 'com_users'); 83 84 // Decode level groups 85 $groups = json_decode($item->rules); 86 87 // If this group is super admin and this user is not super admin, $canEdit is false 88 if (!Factory::getUser()->authorise('core.admin') && $groups && Access::checkGroup($groups[0], 'core.admin')) { 89 $canEdit = false; 90 $canChange = false; 91 } 92 ?> 93 <tr class="row<?php echo $i % 2; ?>"> 94 <td class="text-center"> 95 <?php if ($canEdit) : ?> 96 <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?> 97 <?php endif; ?> 98 </td> 99 <td class="text-center d-none d-md-table-cell"> 100 <?php 101 $iconClass = ''; 102 if (!$canChange) { 103 $iconClass = ' inactive'; 104 } elseif (!$saveOrder) { 105 $iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED'); 106 } 107 ?> 108 <span class="sortable-handler<?php echo $iconClass ?>"> 109 <span class="icon-ellipsis-v" aria-hidden="true"></span> 110 </span> 111 <?php if ($canChange && $saveOrder) : ?> 112 <input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden"> 113 <?php endif; ?> 114 </td> 115 <th scope="row"> 116 <?php if ($canEdit) : ?> 117 <a href="<?php echo Route::_('index.php?option=com_users&task=level.edit&id=' . $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>"> 118 <?php echo $this->escape($item->title); ?></a> 119 <?php else : ?> 120 <?php echo $this->escape($item->title); ?> 121 <?php endif; ?> 122 </th> 123 <td class="d-none d-md-table-cell"> 124 <?php echo UsersHelper::getVisibleByGroups($item->rules); ?> 125 </td> 126 <td class="d-none d-md-table-cell"> 127 <?php echo (int) $item->id; ?> 128 </td> 129 </tr> 130 <?php endforeach; ?> 131 </tbody> 132 </table> 133 134 <?php // load the pagination. ?> 135 <?php echo $this->pagination->getListFooter(); ?> 136 137 <?php endif; ?> 138 <input type="hidden" name="task" value=""> 139 <input type="hidden" name="boxchecked" value="0"> 140 <?php echo HTMLHelper::_('form.token'); ?> 141 </div> 142 </div> 143 </div> 144 </form>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |