[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_newsfeeds/tmpl/newsfeeds/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_newsfeeds
   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\Associations;
  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  $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  $assoc     = Associations::isEnabled();
  32  
  33  if ($saveOrder && !empty($this->items)) {
  34      $saveOrderingUrl = 'index.php?option=com_newsfeeds&task=newsfeeds.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
  35      HTMLHelper::_('draggablelist.draggable');
  36  }
  37  ?>
  38  <form action="<?php echo Route::_('index.php?option=com_newsfeeds&view=newsfeeds'); ?>" method="post" name="adminForm" id="adminForm">
  39      <div class="row">
  40          <div class="col-md-12">
  41              <div id="j-main-container" class="j-main-container">
  42                  <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
  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="newsfeedList">
  50                          <caption class="visually-hidden">
  51                              <?php echo Text::_('COM_NEWSFEEDS_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" class="w-5 text-center">
  64                                      <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?>
  65                                  </th>
  66                                  <th scope="col" class="title">
  67                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.name', $listDirn, $listOrder); ?>
  68                                  </th>
  69                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  70                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?>
  71                                  </th>
  72                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  73                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_NEWSFEEDS_NUM_ARTICLES_HEADING', 'numarticles', $listDirn, $listOrder); ?>
  74                                  </th>
  75                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  76                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_NEWSFEEDS_CACHE_TIME_HEADING', 'a.cache_time', $listDirn, $listOrder); ?>
  77                                  </th>
  78                                  <?php if ($assoc) : ?>
  79                                  <th scope="col" class="w-10 d-none d-md-table-cell">
  80                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_NEWSFEEDS_HEADING_ASSOCIATION', 'association', $listDirn, $listOrder); ?>
  81                                  </th>
  82                                  <?php endif; ?>
  83                                  <?php if (Multilanguage::isEnabled()) : ?>
  84                                      <th scope="col" class="w-10 d-none d-md-table-cell">
  85                                          <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language_title', $listDirn, $listOrder); ?>
  86                                      </th>
  87                                  <?php endif; ?>
  88                                  <th scope="col" class="w-5 d-none d-md-table-cell">
  89                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  90                                  </th>
  91                              </tr>
  92                          </thead>
  93                          <tbody <?php if ($saveOrder) :
  94                              ?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>" data-nested="true"<?php
  95                                 endif; ?>>
  96                          <?php foreach ($this->items as $i => $item) :
  97                              $ordering   = ($listOrder == 'a.ordering');
  98                              $canCreate  = $user->authorise('core.create', 'com_newsfeeds.category.' . $item->catid);
  99                              $canEdit    = $user->authorise('core.edit', 'com_newsfeeds.category.' . $item->catid);
 100                              $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || is_null($item->checked_out);
 101                              $canEditOwn = $user->authorise('core.edit.own', 'com_newsfeeds.category.' . $item->catid) && $item->created_by == $user->id;
 102                              $canChange  = $user->authorise('core.edit.state', 'com_newsfeeds.category.' . $item->catid) && $canCheckin;
 103                              ?>
 104                              <tr class="row<?php echo $i % 2; ?>" data-draggable-group="<?php echo $item->catid; ?>">
 105                                  <td class="text-center">
 106                                      <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->name); ?>
 107                                  </td>
 108                                  <td class="text-center d-none d-md-table-cell">
 109                                      <?php
 110                                      $iconClass = '';
 111                                      if (!$canChange) {
 112                                          $iconClass = ' inactive';
 113                                      } elseif (!$saveOrder) {
 114                                          $iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
 115                                      }
 116                                      ?>
 117                                      <span class="sortable-handler<?php echo $iconClass ?>">
 118                                          <span class="icon-ellipsis-v" aria-hidden="true"></span>
 119                                      </span>
 120                                      <?php if ($canChange && $saveOrder) : ?>
 121                                          <input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
 122                                      <?php endif; ?>
 123                                  </td>
 124                                  <td class="text-center">
 125                                      <?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'newsfeeds.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
 126                                  </td>
 127                                  <th scope="row" class="has-context">
 128                                      <div>
 129                                          <?php if ($item->checked_out) : ?>
 130                                              <?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'newsfeeds.', $canCheckin); ?>
 131                                          <?php endif; ?>
 132                                          <?php if ($canEdit || $canEditOwn) : ?>
 133                                              <a href="<?php echo Route::_('index.php?option=com_newsfeeds&task=newsfeed.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->name); ?>">
 134                                                  <?php echo $this->escape($item->name); ?></a>
 135                                          <?php else : ?>
 136                                                  <?php echo $this->escape($item->name); ?>
 137                                          <?php endif; ?>
 138                                          <div class="small">
 139                                              <?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
 140                                          </div>
 141                                          <div class="small">
 142                                              <?php echo Text::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
 143                                          </div>
 144                                      </div>
 145                                  </th>
 146                                  <td class="small d-none d-md-table-cell">
 147                                      <?php echo $this->escape($item->access_level); ?>
 148                                  </td>
 149                                  <td class="d-none d-md-table-cell">
 150                                      <?php echo (int) $item->numarticles; ?>
 151                                  </td>
 152                                  <td class="d-none d-md-table-cell">
 153                                      <?php echo (int) $item->cache_time; ?>
 154                                  </td>
 155                                  <?php if ($assoc) : ?>
 156                                  <td class="d-none d-md-table-cell">
 157                                      <?php if ($item->association) : ?>
 158                                          <?php echo HTMLHelper::_('newsfeedsadministrator.association', $item->id); ?>
 159                                      <?php endif; ?>
 160                                  </td>
 161                                  <?php endif; ?>
 162                                  <?php if (Multilanguage::isEnabled()) : ?>
 163                                      <td class="small d-none d-md-table-cell">
 164                                          <?php echo LayoutHelper::render('joomla.content.language', $item); ?>
 165                                      </td>
 166                                  <?php endif; ?>
 167                                  <td class="d-none d-md-table-cell">
 168                                      <?php echo (int) $item->id; ?>
 169                                  </td>
 170                              </tr>
 171                          <?php endforeach; ?>
 172                          </tbody>
 173                      </table>
 174  
 175                      <?php // load the pagination. ?>
 176                      <?php echo $this->pagination->getListFooter(); ?>
 177  
 178                      <?php // Load the batch processing form if user is allowed ?>
 179                      <?php if (
 180                      $user->authorise('core.create', 'com_newsfeeds')
 181                          && $user->authorise('core.edit', 'com_newsfeeds')
 182                          && $user->authorise('core.edit.state', 'com_newsfeeds')
 183  ) : ?>
 184                          <?php echo HTMLHelper::_(
 185                              'bootstrap.renderModal',
 186                              'collapseModal',
 187                              array(
 188                                  'title'  => Text::_('COM_NEWSFEEDS_BATCH_OPTIONS'),
 189                                  'footer' => $this->loadTemplate('batch_footer'),
 190                              ),
 191                              $this->loadTemplate('batch_body')
 192                          ); ?>
 193                      <?php endif; ?>
 194                  <?php endif; ?>
 195                  <input type="hidden" name="task" value="">
 196                  <input type="hidden" name="boxchecked" value="0">
 197                  <?php echo HTMLHelper::_('form.token'); ?>
 198              </div>
 199          </div>
 200      </div>
 201  </form>


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