[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_banners/tmpl/banners/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_banners
   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\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  
  21  /** @var \Joomla\Component\Banners\Administrator\View\Banners\HtmlView $this */
  22  
  23  /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
  24  $wa = $this->document->getWebAssetManager();
  25  $wa->useScript('table.columns')
  26      ->useScript('multiselect');
  27  
  28  $user      = Factory::getUser();
  29  $userId    = $user->get('id');
  30  $listOrder = $this->escape($this->state->get('list.ordering'));
  31  $listDirn  = $this->escape($this->state->get('list.direction'));
  32  $saveOrder = $listOrder == 'a.ordering';
  33  
  34  if ($saveOrder && !empty($this->items)) {
  35      $saveOrderingUrl = 'index.php?option=com_banners&task=banners.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
  36      HTMLHelper::_('draggablelist.draggable');
  37  }
  38  ?>
  39  <form action="<?php echo Route::_('index.php?option=com_banners&view=banners'); ?>" method="post" name="adminForm" id="adminForm">
  40      <div class="row">
  41          <div class="col-md-12">
  42              <div id="j-main-container" class="j-main-container">
  43                  <?php
  44                  // Search tools bar
  45                  echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]);
  46                  ?>
  47                  <?php if (empty($this->items)) : ?>
  48                      <div class="alert alert-info">
  49                          <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  50                          <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
  51                      </div>
  52                  <?php else : ?>
  53                      <table class="table" id="bannerList">
  54                          <caption class="visually-hidden">
  55                              <?php echo Text::_('COM_BANNERS_BANNERS_TABLE_CAPTION'); ?>,
  56                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  57                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  58                          </caption>
  59                          <thead>
  60                              <tr>
  61                                  <td class="w-1 text-center">
  62                                      <?php echo HTMLHelper::_('grid.checkall'); ?>
  63                                  </td>
  64                                  <th scope="col" class="w-1 text-center d-none d-md-table-cell">
  65                                      <?php echo HTMLHelper::_('searchtools.sort', '', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
  66                                  </th>
  67                                  <th scope="col" class="w-1 text-center">
  68                                      <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
  69                                  </th>
  70                                  <th scope="col">
  71                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_BANNERS_HEADING_NAME', 'a.name', $listDirn, $listOrder); ?>
  72                                  </th>
  73                                  <th scope="col" class="w-10 text-center d-none d-md-table-cell">
  74                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_BANNERS_HEADING_STICKY', 'a.sticky', $listDirn, $listOrder); ?>
  75                                  </th>
  76                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  77                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_BANNERS_HEADING_CLIENT', 'client_name', $listDirn, $listOrder); ?>
  78                                  </th>
  79                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  80                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_BANNERS_HEADING_IMPRESSIONS', 'impmade', $listDirn, $listOrder); ?>
  81                                  </th>
  82                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  83                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_BANNERS_HEADING_CLICKS', 'clicks', $listDirn, $listOrder); ?>
  84                                  </th>
  85                                  <?php if (Multilanguage::isEnabled()) : ?>
  86                                      <th scope="col" class="w-10 d-none d-md-table-cell">
  87                                          <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
  88                                      </th>
  89                                  <?php endif; ?>
  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 <?php if ($saveOrder) :
  96                              ?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>" data-nested="true"<?php
  97                                 endif; ?>>
  98                              <?php foreach ($this->items as $i => $item) :
  99                                  $ordering  = ($listOrder == 'ordering');
 100                                  $item->cat_link = Route::_('index.php?option=com_categories&extension=com_banners&task=edit&type=other&cid[]=' . $item->catid);
 101                                  $canCreate  = $user->authorise('core.create', 'com_banners.category.' . $item->catid);
 102                                  $canEdit    = $user->authorise('core.edit', 'com_banners.category.' . $item->catid);
 103                                  $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out);
 104                                  $canChange  = $user->authorise('core.edit.state', 'com_banners.category.' . $item->catid) && $canCheckin;
 105                                  ?>
 106                                  <tr class="row<?php echo $i % 2; ?>" data-draggable-group="<?php echo $item->catid; ?>">
 107                                      <td class="text-center">
 108                                          <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->name); ?>
 109                                      </td>
 110                                      <td class="text-center d-none d-md-table-cell">
 111                                          <?php
 112                                          $iconClass = '';
 113  
 114                                          if (!$canChange) {
 115                                              $iconClass = ' inactive';
 116                                          } elseif (!$saveOrder) {
 117                                              $iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
 118                                          }
 119                                          ?>
 120                                          <span class="sortable-handler <?php echo $iconClass ?>">
 121                                              <span class="icon-ellipsis-v" aria-hidden="true"></span>
 122                                          </span>
 123                                          <?php if ($canChange && $saveOrder) : ?>
 124                                              <input type="text" name="order[]" size="5"
 125                                                  value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
 126                                          <?php endif; ?>
 127                                      </td>
 128                                      <td class="text-center">
 129                                          <?php echo HTMLHelper::_('jgrid.published', $item->state, $i, 'banners.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
 130                                      </td>
 131                                      <th scope="row">
 132                                          <div class="break-word">
 133                                              <?php if ($item->checked_out) : ?>
 134                                                  <?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'banners.', $canCheckin); ?>
 135                                              <?php endif; ?>
 136                                              <?php if ($canEdit) : ?>
 137                                                  <a href="<?php echo Route::_('index.php?option=com_banners&task=banner.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->name); ?>">
 138                                                      <?php echo $this->escape($item->name); ?></a>
 139                                              <?php else : ?>
 140                                                  <?php echo $this->escape($item->name); ?>
 141                                              <?php endif; ?>
 142                                              <div class="small break-word">
 143                                                  <?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
 144                                              </div>
 145                                              <div class="small">
 146                                                  <?php echo Text::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
 147                                              </div>
 148                                          </div>
 149                                      </th>
 150                                      <td class="text-center d-none d-md-table-cell">
 151                                          <?php echo HTMLHelper::_('banner.pinned', $item->sticky, $i, $canChange); ?>
 152                                      </td>
 153                                      <td class="small d-none d-md-table-cell">
 154                                          <?php echo $item->client_name; ?>
 155                                      </td>
 156                                      <td class="small d-none d-md-table-cell">
 157                                          <?php echo Text::sprintf('COM_BANNERS_IMPRESSIONS', $item->impmade, $item->imptotal ?: Text::_('COM_BANNERS_UNLIMITED')); ?>
 158                                      </td>
 159                                      <td class="small d-none d-md-table-cell">
 160                                          <?php echo $item->clicks; ?> -
 161                                          <?php echo sprintf('%.2f%%', $item->impmade ? 100 * $item->clicks / $item->impmade : 0); ?>
 162                                      </td>
 163                                      <?php if (Multilanguage::isEnabled()) : ?>
 164                                          <td class="small d-none d-md-table-cell">
 165                                              <?php echo LayoutHelper::render('joomla.content.language', $item); ?>
 166                                          </td>
 167                                      <?php endif; ?>
 168                                      <td class="d-none d-md-table-cell">
 169                                          <?php echo $item->id; ?>
 170                                      </td>
 171                                  </tr>
 172                              <?php endforeach; ?>
 173                          </tbody>
 174                      </table>
 175  
 176                      <?php // Load the pagination. ?>
 177                      <?php echo $this->pagination->getListFooter(); ?>
 178  
 179                      <?php // Load the batch processing form. ?>
 180                      <?php if (
 181                      $user->authorise('core.create', 'com_banners')
 182                          && $user->authorise('core.edit', 'com_banners')
 183                          && $user->authorise('core.edit.state', 'com_banners')
 184  ) : ?>
 185                          <?php echo HTMLHelper::_(
 186                              'bootstrap.renderModal',
 187                              'collapseModal',
 188                              [
 189                                  'title' => Text::_('COM_BANNERS_BATCH_OPTIONS'),
 190                                  'footer' => $this->loadTemplate('batch_footer')
 191                              ],
 192                              $this->loadTemplate('batch_body')
 193                          ); ?>
 194                      <?php endif; ?>
 195                  <?php endif; ?>
 196  
 197                  <input type="hidden" name="task" value="">
 198                  <input type="hidden" name="boxchecked" value="0">
 199                  <?php echo HTMLHelper::_('form.token'); ?>
 200              </div>
 201          </div>
 202      </div>
 203  </form>


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