[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_banners/tmpl/clients/ -> 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\Text;
  16  use Joomla\CMS\Layout\LayoutHelper;
  17  use Joomla\CMS\Object\CMSObject;
  18  use Joomla\CMS\Router\Route;
  19  
  20  /** @var \Joomla\Component\Banners\Administrator\View\Clients\HtmlView $this */
  21  
  22  /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
  23  $wa = $this->document->getWebAssetManager();
  24  $wa->useScript('table.columns')
  25      ->useScript('multiselect');
  26  
  27  $purchaseTypes = [
  28      '1' => 'UNLIMITED',
  29      '2' => 'YEARLY',
  30      '3' => 'MONTHLY',
  31      '4' => 'WEEKLY',
  32      '5' => 'DAILY',
  33  ];
  34  
  35  $user       = Factory::getUser();
  36  $userId     = $user->get('id');
  37  $listOrder  = $this->escape($this->state->get('list.ordering'));
  38  $listDirn   = $this->escape($this->state->get('list.direction'));
  39  $params     = $this->state->params ?? new CMSObject();
  40  ?>
  41  <form action="<?php echo Route::_('index.php?option=com_banners&view=clients'); ?>" method="post" name="adminForm" id="adminForm">
  42      <div class="row">
  43          <div class="col-md-12">
  44              <div id="j-main-container" class="j-main-container">
  45                  <?php
  46                  // Search tools bar
  47                  echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]);
  48                  ?>
  49                  <?php if (empty($this->items)) : ?>
  50                      <div class="alert alert-info">
  51                          <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  52                          <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
  53                      </div>
  54                  <?php else : ?>
  55                      <table class="table">
  56                          <caption class="visually-hidden">
  57                              <?php echo Text::_('COM_BANNERS_CLIENTS_TABLE_CAPTION'); ?>,
  58                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  59                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  60                          </caption>
  61                          <thead>
  62                              <tr>
  63                                  <td class="w-1 text-center">
  64                                      <?php echo HTMLHelper::_('grid.checkall'); ?>
  65                                  </td>
  66                                  <th scope="col" class="w-1 text-center">
  67                                      <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
  68                                  </th>
  69                                  <th scope="col">
  70                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_BANNERS_HEADING_CLIENT', 'a.name', $listDirn, $listOrder); ?>
  71                                  </th>
  72                                  <th scope="col" class="w-15 d-none d-md-table-cell">
  73                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_BANNERS_HEADING_CONTACT', 'a.contact', $listDirn, $listOrder); ?>
  74                                  </th>
  75                                  <th scope="col" class="w-3 text-center d-none d-md-table-cell">
  76                                      <span class="icon-check" aria-hidden="true" title="<?php echo Text::_('COM_BANNERS_COUNT_PUBLISHED_ITEMS'); ?>"></span>
  77                                      <span class="visually-hidden"><?php echo Text::_('COM_BANNERS_COUNT_PUBLISHED_ITEMS'); ?></span>
  78                                  </th>
  79                                  <th scope="col" class="w-3 text-center d-none d-md-table-cell">
  80                                      <span class="icon-times" aria-hidden="true" title="<?php echo Text::_('COM_BANNERS_COUNT_UNPUBLISHED_ITEMS'); ?>"></span>
  81                                      <span class="visually-hidden"><?php echo Text::_('COM_BANNERS_COUNT_UNPUBLISHED_ITEMS'); ?></span>
  82                                  </th>
  83                                  <th scope="col" class="w-3 text-center d-none d-md-table-cell">
  84                                      <span class="icon-folder icon-fw" aria-hidden="true" title="<?php echo Text::_('COM_BANNERS_COUNT_ARCHIVED_ITEMS'); ?>"></span>
  85                                      <span class="visually-hidden"><?php echo Text::_('COM_BANNERS_COUNT_ARCHIVED_ITEMS'); ?></span>
  86                                  </th>
  87                                  <th scope="col" class="w-3 text-center d-none d-md-table-cell">
  88                                      <span class="icon-trash" aria-hidden="true" title="<?php echo Text::_('COM_BANNERS_COUNT_TRASHED_ITEMS'); ?>"></span>
  89                                      <span class="visually-hidden"><?php echo Text::_('COM_BANNERS_COUNT_TRASHED_ITEMS'); ?></span>
  90                                  </th>
  91                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  92                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_BANNERS_HEADING_PURCHASETYPE', 'a.purchase_type', $listDirn, $listOrder); ?>
  93                                  </th>
  94                                  <th scope="col" class="w-3 d-none d-md-table-cell">
  95                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  96                                  </th>
  97                              </tr>
  98                          </thead>
  99                          <tbody>
 100                              <?php foreach ($this->items as $i => $item) :
 101                                  $canCreate  = $user->authorise('core.create', 'com_banners');
 102                                  $canEdit    = $user->authorise('core.edit', 'com_banners');
 103                                  $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || is_null($item->checked_out);
 104                                  $canChange  = $user->authorise('core.edit.state', 'com_banners') && $canCheckin;
 105                                  ?>
 106                                  <tr class="row<?php echo $i % 2; ?>">
 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">
 111                                          <?php echo HTMLHelper::_('jgrid.published', $item->state, $i, 'clients.', $canChange); ?>
 112                                      </td>
 113                                      <th scope="row" class="has-context">
 114                                          <div>
 115                                              <?php if ($item->checked_out) : ?>
 116                                                  <?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'clients.', $canCheckin); ?>
 117                                              <?php endif; ?>
 118                                              <?php if ($canEdit) : ?>
 119                                                  <a href="<?php echo Route::_('index.php?option=com_banners&task=client.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->name); ?>">
 120                                                      <?php echo $this->escape($item->name); ?></a>
 121                                              <?php else : ?>
 122                                                  <?php echo $this->escape($item->name); ?>
 123                                              <?php endif; ?>
 124                                          </div>
 125                                      </th>
 126                                      <td class="small d-none d-md-table-cell">
 127                                          <?php echo $item->contact; ?>
 128                                      </td>
 129                                      <td class="text-center btns d-none d-md-table-cell itemnumber">
 130                                          <a class="btn <?php echo ($item->count_published > 0) ? 'btn-success' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=1'); ?>"
 131                                          aria-describedby="tip-publish<?php echo $i; ?>">
 132                                              <?php echo $item->count_published; ?>
 133                                          </a>
 134                                          <div role="tooltip" id="tip-publish<?php echo $i; ?>">
 135                                              <?php echo Text::_('COM_BANNERS_COUNT_PUBLISHED_ITEMS'); ?>
 136                                          </div>
 137                                      </td>
 138                                      <td class="text-center btns d-none d-md-table-cell itemnumber">
 139                                          <a class="btn <?php echo ($item->count_unpublished > 0) ? 'btn-danger' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=0'); ?>"
 140                                          aria-describedby="tip-unpublish<?php echo $i; ?>">
 141                                              <?php echo $item->count_unpublished; ?>
 142                                          </a>
 143                                          <div role="tooltip" id="tip-unpublish<?php echo $i; ?>">
 144                                              <?php echo Text::_('COM_BANNERS_COUNT_UNPUBLISHED_ITEMS'); ?>
 145                                          </div>
 146                                      </td>
 147                                      <td class="text-center btns d-none d-md-table-cell itemnumber">
 148                                          <a class="btn <?php echo ($item->count_archived > 0) ? 'btn-info' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=2'); ?>"
 149                                          aria-describedby="tip-archived<?php echo $i; ?>">
 150                                              <?php echo $item->count_archived; ?>
 151                                          </a>
 152                                          <div role="tooltip" id="tip-archived<?php echo $i; ?>">
 153                                              <?php echo Text::_('COM_BANNERS_COUNT_ARCHIVED_ITEMS'); ?>
 154                                          </div>
 155                                      </td>
 156                                      <td class="text-center btns d-none d-md-table-cell itemnumber">
 157                                          <a class="btn <?php echo ($item->count_trashed > 0) ? 'btn-dark' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=-2'); ?>"
 158                                          aria-describedby="tip-trashed<?php echo $i; ?>">
 159                                              <?php echo $item->count_trashed; ?>
 160                                          </a>
 161                                          <div role="tooltip" id="tip-trashed<?php echo $i; ?>">
 162                                              <?php echo Text::_('COM_BANNERS_COUNT_TRASHED_ITEMS'); ?>
 163                                          </div>
 164                                      </td>
 165                                      <td class="small d-none d-md-table-cell">
 166                                          <?php if ($item->purchase_type < 0) : ?>
 167                                              <?php echo Text::sprintf('COM_BANNERS_DEFAULT', Text::_('COM_BANNERS_FIELD_VALUE_' . $purchaseTypes[$params->get('purchase_type')])); ?>
 168                                          <?php else : ?>
 169                                              <?php echo Text::_('COM_BANNERS_FIELD_VALUE_' . $purchaseTypes[$item->purchase_type]); ?>
 170                                          <?php endif; ?>
 171                                      </td>
 172                                      <td class="d-none d-md-table-cell">
 173                                          <?php echo $item->id; ?>
 174                                      </td>
 175                                  </tr>
 176                              <?php endforeach; ?>
 177                          </tbody>
 178                      </table>
 179  
 180                      <?php // Load the pagination. ?>
 181                      <?php echo $this->pagination->getListFooter(); ?>
 182  
 183                  <?php endif; ?>
 184  
 185                  <input type="hidden" name="task" value="">
 186                  <input type="hidden" name="boxchecked" value="0">
 187                  <?php echo HTMLHelper::_('form.token'); ?>
 188              </div>
 189          </div>
 190      </div>
 191  </form>


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