[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_modules/tmpl/modules/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_modules
   6   *
   7   * @copyright   (C) 2008 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\Helper\ModuleHelper;
  15  use Joomla\CMS\HTML\HTMLHelper;
  16  use Joomla\CMS\Language\Multilanguage;
  17  use Joomla\CMS\Language\Text;
  18  use Joomla\CMS\Layout\LayoutHelper;
  19  use Joomla\CMS\Router\Route;
  20  use Joomla\CMS\Session\Session;
  21  
  22  /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
  23  $wa = $this->document->getWebAssetManager();
  24  $wa->useScript('table.columns')
  25      ->useScript('multiselect');
  26  
  27  $clientId  = (int) $this->state->get('client_id', 0);
  28  $user      = Factory::getUser();
  29  $listOrder = $this->escape($this->state->get('list.ordering'));
  30  $listDirn  = $this->escape($this->state->get('list.direction'));
  31  $saveOrder = ($listOrder == 'a.ordering');
  32  
  33  if ($saveOrder && !empty($this->items)) {
  34      $saveOrderingUrl = 'index.php?option=com_modules&task=modules.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
  35      HTMLHelper::_('draggablelist.draggable');
  36  }
  37  ?>
  38  <form action="<?php echo Route::_('index.php?option=com_modules&view=modules&client_id=' . $clientId); ?>" method="post" name="adminForm" id="adminForm">
  39      <div id="j-main-container" class="j-main-container">
  40          <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
  41          <?php if ($this->total > 0) : ?>
  42              <table class="table" id="moduleList">
  43                  <caption class="visually-hidden">
  44                      <?php echo Text::_('COM_MODULES_TABLE_CAPTION'); ?>,
  45                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  46                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  47                  </caption>
  48                  <thead>
  49                      <tr>
  50                          <td class="w-1 text-center">
  51                              <?php echo HTMLHelper::_('grid.checkall'); ?>
  52                          </td>
  53                          <th scope="col" class="w-1 text-center d-none d-md-table-cell">
  54                              <?php echo HTMLHelper::_('searchtools.sort', '', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
  55                          </th>
  56                          <th scope="col" class="w-1 text-center">
  57                              <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?>
  58                          </th>
  59                          <th scope="col" class="title">
  60                              <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  61                          </th>
  62                          <th scope="col" class="w-10 d-none d-md-table-cell">
  63                              <?php echo HTMLHelper::_('searchtools.sort', 'COM_MODULES_HEADING_POSITION', 'a.position', $listDirn, $listOrder); ?>
  64                          </th>
  65                          <th scope="col" class="w-10 d-none d-md-table-cell">
  66                              <?php echo HTMLHelper::_('searchtools.sort', 'COM_MODULES_HEADING_MODULE', 'name', $listDirn, $listOrder); ?>
  67                          </th>
  68                          <?php if ($clientId === 0) : ?>
  69                          <th scope="col" class="w-10 d-none d-md-table-cell">
  70                              <?php echo HTMLHelper::_('searchtools.sort', 'COM_MODULES_HEADING_PAGES', 'pages', $listDirn, $listOrder); ?>
  71                          </th>
  72                          <?php endif; ?>
  73                          <th scope="col" class="w-10 d-none d-md-table-cell">
  74                              <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'ag.title', $listDirn, $listOrder); ?>
  75                          </th>
  76                          <?php if (($clientId === 0) && (Multilanguage::isEnabled())) : ?>
  77                          <th scope="col" class="w-10 d-none d-md-table-cell">
  78                              <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'l.title', $listDirn, $listOrder); ?>
  79                          </th>
  80                          <?php elseif ($clientId === 1 && ModuleHelper::isAdminMultilang()) : ?>
  81                          <th scope="col" class="w-10 d-none d-md-table-cell">
  82                              <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
  83                          </th>
  84                          <?php endif; ?>
  85                          <th scope="col" class="w-5 d-none d-md-table-cell">
  86                              <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  87                          </th>
  88                      </tr>
  89                  </thead>
  90                  <tbody <?php if ($saveOrder) :
  91                      ?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>" data-nested="false"<?php
  92                         endif; ?>>
  93                  <?php foreach ($this->items as $i => $item) :
  94                      $ordering   = ($listOrder == 'a.ordering');
  95                      $canCreate  = $user->authorise('core.create', 'com_modules');
  96                      $canEdit    = $user->authorise('core.edit', 'com_modules.module.' . $item->id);
  97                      $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || is_null($item->checked_out);
  98                      $canChange  = $user->authorise('core.edit.state', 'com_modules.module.' . $item->id) && $canCheckin;
  99                      ?>
 100                      <tr class="row<?php echo $i % 2; ?>" data-draggable-group="<?php echo $item->position ?: 'none'; ?>">
 101                          <td class="text-center">
 102                              <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?>
 103                          </td>
 104                          <td class="text-center d-none d-md-table-cell">
 105                              <?php
 106                              $iconClass = '';
 107                              if (!$canChange) {
 108                                  $iconClass = ' inactive';
 109                              } elseif (!$saveOrder) {
 110                                  $iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
 111                              }
 112                              ?>
 113                              <span class="sortable-handler<?php echo $iconClass; ?>">
 114                                  <span class="icon-ellipsis-v"></span>
 115                              </span>
 116                              <?php if ($canChange && $saveOrder) : ?>
 117                                  <input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
 118                              <?php endif; ?>
 119                          </td>
 120                          <td class="text-center">
 121                              <?php // Check if extension is enabled ?>
 122                              <?php if ($item->enabled > 0) : ?>
 123                                  <?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'modules.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
 124                              <?php else : ?>
 125                                  <?php // Extension is not enabled, show a message that indicates this. ?>
 126                                  <span class="tbody-icon" title="<?php echo Text::sprintf('COM_MODULES_MSG_MANAGE_EXTENSION_DISABLED', $this->escape($item->name)); ?>">
 127                                      <span class="icon-minus-circle" aria-hidden="true"></span>
 128                                  </span>
 129                              <?php endif; ?>
 130                          </td>
 131                          <th scope="row" class="has-context">
 132                              <div>
 133                                  <?php if ($item->checked_out) : ?>
 134                                      <?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'modules.', $canCheckin); ?>
 135                                  <?php endif; ?>
 136                                  <?php if ($canEdit) : ?>
 137                                      <a href="<?php echo Route::_('index.php?option=com_modules&task=module.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>">
 138                                          <?php echo $this->escape($item->title); ?></a>
 139                                  <?php else : ?>
 140                                      <?php echo $this->escape($item->title); ?>
 141                                  <?php endif; ?>
 142  
 143                                  <?php if (!empty($item->note)) : ?>
 144                                      <div class="small">
 145                                          <?php echo Text::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note)); ?>
 146                                      </div>
 147                                  <?php endif; ?>
 148                              </div>
 149                          </th>
 150                          <td class="d-none d-md-table-cell">
 151                              <?php if ($item->position) : ?>
 152                                  <span class="badge bg-info">
 153                                      <?php echo $item->position; ?>
 154                                  </span>
 155                              <?php else : ?>
 156                                  <span class="badge bg-secondary">
 157                                      <?php echo Text::_('JNONE'); ?>
 158                                  </span>
 159                              <?php endif; ?>
 160                          </td>
 161                          <td class="small d-none d-md-table-cell">
 162                              <?php echo $item->name; ?>
 163                          </td>
 164                          <?php if ($clientId === 0) : ?>
 165                          <td class="small d-none d-md-table-cell">
 166                              <?php echo $item->pages; ?>
 167                          </td>
 168                          <?php endif; ?>
 169                          <td class="small d-none d-md-table-cell">
 170                              <?php echo $this->escape($item->access_level); ?>
 171                          </td>
 172                          <?php if (($clientId === 0) && (Multilanguage::isEnabled())) : ?>
 173                          <td class="small d-none d-md-table-cell">
 174                              <?php echo LayoutHelper::render('joomla.content.language', $item); ?>
 175                          </td>
 176                          <?php elseif ($clientId === 1 && ModuleHelper::isAdminMultilang()) : ?>
 177                              <td class="small d-none d-md-table-cell">
 178                                  <?php if ($item->language == '') :?>
 179                                      <?php echo Text::_('JUNDEFINED'); ?>
 180                                  <?php elseif ($item->language == '*') :?>
 181                                      <?php echo Text::alt('JALL', 'language'); ?>
 182                                  <?php else :?>
 183                                      <?php echo $this->escape($item->language); ?>
 184                                  <?php endif; ?>
 185                              </td>
 186                          <?php endif; ?>
 187                          <td class="d-none d-md-table-cell">
 188                              <?php echo (int) $item->id; ?>
 189                          </td>
 190                      </tr>
 191                  <?php endforeach; ?>
 192                  </tbody>
 193              </table>
 194  
 195              <?php // load the pagination. ?>
 196              <?php echo $this->pagination->getListFooter(); ?>
 197  
 198          <?php endif; ?>
 199  
 200          <?php // Load the batch processing form. ?>
 201          <?php if (
 202          $user->authorise('core.create', 'com_modules')
 203              && $user->authorise('core.edit', 'com_modules')
 204              && $user->authorise('core.edit.state', 'com_modules')
 205  ) : ?>
 206              <?php echo HTMLHelper::_(
 207                  'bootstrap.renderModal',
 208                  'collapseModal',
 209                  array(
 210                      'title'  => Text::_('COM_MODULES_BATCH_OPTIONS'),
 211                      'footer' => $this->loadTemplate('batch_footer'),
 212                  ),
 213                  $this->loadTemplate('batch_body')
 214              ); ?>
 215          <?php endif; ?>
 216          <input type="hidden" name="task" value="">
 217          <input type="hidden" name="boxchecked" value="0">
 218          <?php echo HTMLHelper::_('form.token'); ?>
 219      </div>
 220  </form>


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