[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_fields/tmpl/groups/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_fields
   6   *
   7   * @copyright   (C) 2016 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\Factory;
  14  use Joomla\CMS\HTML\HTMLHelper;
  15  use Joomla\CMS\Language\Multilanguage;
  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\Fields\Administrator\Helper\FieldsHelper;
  21  
  22  /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
  23  $wa = $this->document->getWebAssetManager();
  24  $wa->useScript('table.columns')
  25      ->useScript('multiselect');
  26  
  27  $app       = Factory::getApplication();
  28  $user      = Factory::getUser();
  29  $userId    = $user->get('id');
  30  
  31  $component = '';
  32  $parts     = FieldsHelper::extract($this->state->get('filter.context'));
  33  
  34  if ($parts) {
  35      $component = $this->escape($parts[0]);
  36  }
  37  
  38  $listOrder = $this->escape($this->state->get('list.ordering'));
  39  $listDirn  = $this->escape($this->state->get('list.direction'));
  40  $ordering  = ($listOrder == 'a.ordering');
  41  $saveOrder = ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc');
  42  
  43  if ($saveOrder && !empty($this->items)) {
  44      $saveOrderingUrl = 'index.php?option=com_fields&task=groups.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
  45      HTMLHelper::_('draggablelist.draggable');
  46  }
  47  
  48  $context = $this->escape($this->state->get('filter.context'));
  49  
  50  $searchToolsOptions = [];
  51  
  52  // Only show field contexts filter if there are more than one option
  53  if (count($this->filterForm->getField('context')->options) > 1) {
  54      $searchToolsOptions['selectorFieldName'] = 'context';
  55  }
  56  ?>
  57  
  58  <form action="<?php echo Route::_('index.php?option=com_fields&view=groups&context=' . $context); ?>" method="post" name="adminForm" id="adminForm">
  59      <div class="row">
  60          <div class="col-md-12">
  61              <div id="j-main-container" class="j-main-container">
  62                  <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => $searchToolsOptions)); ?>
  63                  <?php if (empty($this->items)) : ?>
  64                      <div class="alert alert-info">
  65                          <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  66                          <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
  67                      </div>
  68                  <?php else : ?>
  69                      <table class="table" id="fieldgroupList">
  70                          <caption class="visually-hidden">
  71                              <?php echo Text::_('COM_FIELDS_GROUPS_TABLE_CAPTION'); ?>,
  72                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  73                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  74                          </caption>
  75                          <thead>
  76                              <tr>
  77                                  <td class="w-1 text-center">
  78                                      <?php echo HTMLHelper::_('grid.checkall'); ?>
  79                                  </td>
  80                                  <th scope="col" class="w-1 text-center d-none d-md-table-cell">
  81                                      <?php echo HTMLHelper::_('searchtools.sort', '', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
  82                                  </th>
  83                                  <th scope="col" class="w-1 text-center">
  84                                      <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
  85                                  </th>
  86                                  <th scope="col">
  87                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  88                                  </th>
  89                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  90                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
  91                                  </th>
  92                                  <?php if (Multilanguage::isEnabled()) : ?>
  93                                      <th scope="col" class="w-5 d-none d-md-table-cell">
  94                                          <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
  95                                      </th>
  96                                  <?php endif; ?>
  97                                  <th scope="col" class="w-1 d-none d-md-table-cell">
  98                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  99                                  </th>
 100                              </tr>
 101                          </thead>
 102                          <tbody <?php if ($saveOrder) :
 103                              ?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>" data-nested="true"<?php
 104                                 endif; ?>>
 105                              <?php foreach ($this->items as $i => $item) : ?>
 106                                  <?php $ordering   = ($listOrder == 'a.ordering'); ?>
 107                                  <?php $canEdit    = $user->authorise('core.edit', $component . '.fieldgroup.' . $item->id); ?>
 108                                  <?php $canCheckin = $user->authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out); ?>
 109                                  <?php $canEditOwn = $user->authorise('core.edit.own', $component . '.fieldgroup.' . $item->id) && $item->created_by == $userId; ?>
 110                                  <?php $canChange  = $user->authorise('core.edit.state', $component . '.fieldgroup.' . $item->id) && $canCheckin; ?>
 111                                  <tr class="row<?php echo $i % 2; ?>" data-draggable-group="0" item-id="<?php echo $item->id; ?>">
 112                                      <td class="text-center">
 113                                          <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?>
 114                                      </td>
 115                                      <td class="text-center d-none d-md-table-cell">
 116                                          <?php $iconClass = ''; ?>
 117                                          <?php if (!$canChange) : ?>
 118                                              <?php $iconClass = ' inactive'; ?>
 119                                          <?php elseif (!$saveOrder) : ?>
 120                                              <?php $iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED'); ?>
 121                                          <?php endif; ?>
 122                                          <span class="sortable-handler<?php echo $iconClass; ?>">
 123                                              <span class="icon-ellipsis-v" aria-hidden="true"></span>
 124                                          </span>
 125                                          <?php if ($canChange && $saveOrder) : ?>
 126                                              <input type="text" class="hidden" name="order[]" size="5" value="<?php echo $item->ordering; ?>">
 127                                          <?php endif; ?>
 128                                      </td>
 129                                      <td class="text-center">
 130                                          <?php echo HTMLHelper::_('jgrid.published', $item->state, $i, 'groups.', $canChange, 'cb'); ?>
 131                                      </td>
 132                                      <th scope="row">
 133                                          <div class="break-word">
 134                                              <?php if ($item->checked_out) : ?>
 135                                                  <?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'groups.', $canCheckin); ?>
 136                                              <?php endif; ?>
 137                                              <?php if ($canEdit || $canEditOwn) : ?>
 138                                                  <a href="<?php echo Route::_('index.php?option=com_fields&task=group.edit&id=' . $item->id . '&context=' . $context); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>">
 139                                                      <?php echo $this->escape($item->title); ?></a>
 140                                              <?php else : ?>
 141                                                  <?php echo $this->escape($item->title); ?>
 142                                              <?php endif; ?>
 143                                              <div class="small break-word">
 144                                                  <?php if ($item->note) : ?>
 145                                                      <?php echo Text::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note)); ?>
 146                                                  <?php endif; ?>
 147                                              </div>
 148                                          </div>
 149                                      </th>
 150                                      <td class="small d-none d-md-table-cell">
 151                                          <?php echo $this->escape($item->access_level); ?>
 152                                      </td>
 153                                      <?php if (Multilanguage::isEnabled()) : ?>
 154                                          <td class="small d-none d-md-table-cell">
 155                                              <?php echo LayoutHelper::render('joomla.content.language', $item); ?>
 156                                          </td>
 157                                      <?php endif; ?>
 158                                      <td class="d-none d-md-table-cell">
 159                                          <span><?php echo (int) $item->id; ?></span>
 160                                      </td>
 161                                  </tr>
 162                              <?php endforeach; ?>
 163                          </tbody>
 164                      </table>
 165  
 166                      <?php // load the pagination. ?>
 167                      <?php echo $this->pagination->getListFooter(); ?>
 168  
 169                      <?php //Load the batch processing form. ?>
 170                      <?php if (
 171                      $user->authorise('core.create', $component)
 172                          && $user->authorise('core.edit', $component)
 173                          && $user->authorise('core.edit.state', $component)
 174  ) : ?>
 175                          <?php echo HTMLHelper::_(
 176                              'bootstrap.renderModal',
 177                              'collapseModal',
 178                              array(
 179                                      'title' => Text::_('COM_FIELDS_VIEW_GROUPS_BATCH_OPTIONS'),
 180                                      'footer' => $this->loadTemplate('batch_footer')
 181                                  ),
 182                              $this->loadTemplate('batch_body')
 183                          ); ?>
 184                      <?php endif; ?>
 185                  <?php endif; ?>
 186                  <input type="hidden" name="task" value="">
 187                  <input type="hidden" name="boxchecked" value="0">
 188                  <?php echo HTMLHelper::_('form.token'); ?>
 189              </div>
 190          </div>
 191      </div>
 192  </form>


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