[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_associations/tmpl/associations/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_associations
   6   *
   7   * @copyright   (C) 2017 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\Router\Route;
  18  use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
  19  
  20  /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
  21  $wa = $this->document->getWebAssetManager();
  22  $wa->useScript('com_associations.admin-associations-default')
  23      ->useScript('table.columns')
  24      ->useScript('multiselect');
  25  
  26  $listOrder        = $this->escape($this->state->get('list.ordering'));
  27  $listDirn         = $this->escape($this->state->get('list.direction'));
  28  $canManageCheckin = Factory::getUser()->authorise('core.manage', 'com_checkin');
  29  
  30  $iconStates = array(
  31      -2 => 'icon-trash',
  32      0  => 'icon-times',
  33      1  => 'icon-check',
  34      2  => 'icon-folder',
  35  );
  36  
  37  Text::script('COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT', true);
  38  
  39  ?>
  40  <form action="<?php echo Route::_('index.php?option=com_associations&view=associations'); ?>" method="post" name="adminForm" id="adminForm">
  41      <div class="row">
  42          <div class="col-md-12">
  43              <div id="j-main-container" class="j-main-container">
  44                  <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
  45                  <?php if ($this->state->get('itemtype') == '' || $this->state->get('language') == '') : ?>
  46                      <div class="alert alert-info">
  47                          <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  48                          <?php echo Text::_('COM_ASSOCIATIONS_NOTICE_NO_SELECTORS'); ?>
  49                      </div>
  50                  <?php elseif (empty($this->items)) : ?>
  51                      <div class="alert alert-info">
  52                          <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  53                          <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
  54                      </div>
  55                  <?php else : ?>
  56                      <table class="table" id="associationsList">
  57                          <caption class="visually-hidden">
  58                              <?php echo Text::_('COM_ASSOCIATIONS_TABLE_CAPTION'); ?>,
  59                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  60                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  61                          </caption>
  62                          <thead>
  63                              <tr>
  64                                  <?php if (!empty($this->typeSupports['state'])) : ?>
  65                                      <th scope="col" class="w-1 text-center">
  66                                          <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'state', $listDirn, $listOrder); ?>
  67                                      </th>
  68                                  <?php endif; ?>
  69                                  <th scope="col">
  70                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'title', $listDirn, $listOrder); ?>
  71                                  </th>
  72                                  <th scope="col" class="w-15">
  73                                      <?php echo Text::_('JGRID_HEADING_LANGUAGE'); ?>
  74                                  </th>
  75                                  <th scope="col" class="w-15">
  76                                      <?php echo Text::_('COM_ASSOCIATIONS_HEADING_ASSOCIATION'); ?>
  77                                  </th>
  78                                  <th scope="col" class="w-15">
  79                                      <?php echo Text::_('COM_ASSOCIATIONS_HEADING_NO_ASSOCIATION'); ?>
  80                                  </th>
  81                                  <?php if (!empty($this->typeFields['menutype'])) : ?>
  82                                      <th scope="col" class="w-10">
  83                                          <?php echo HTMLHelper::_('searchtools.sort', 'COM_ASSOCIATIONS_HEADING_MENUTYPE', 'menutype_title', $listDirn, $listOrder); ?>
  84                                      </th>
  85                                  <?php endif; ?>
  86                                  <?php if (!empty($this->typeFields['access'])) : ?>
  87                                      <th scope="col" class="w-5 d-none d-md-table-cell">
  88                                          <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?>
  89                                      </th>
  90                                  <?php endif; ?>
  91                                  <th scope="col" class="w-1 d-none d-md-table-cell">
  92                                      <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'id', $listDirn, $listOrder); ?>
  93                                  </th>
  94                              </tr>
  95                          </thead>
  96                          <tbody>
  97                          <?php foreach ($this->items as $i => $item) :
  98                              $canCheckin = true;
  99                              $canEdit    = AssociationsHelper::allowEdit($this->extensionName, $this->typeName, $item->id);
 100                              $canCheckin = $canManageCheckin || AssociationsHelper::canCheckinItem($this->extensionName, $this->typeName, $item->id);
 101                              $isCheckout = AssociationsHelper::isCheckoutItem($this->extensionName, $this->typeName, $item->id);
 102                              ?>
 103                              <tr class="row<?php echo $i % 2; ?>">
 104                                  <?php if (!empty($this->typeSupports['state'])) : ?>
 105                                      <td class="text-center">
 106                                          <span class="<?php echo $iconStates[$this->escape($item->state)]; ?>"></span>
 107                                      </td>
 108                                  <?php endif; ?>
 109                                  <th scope="row" class="has-context">
 110                                      <div class="break-word">
 111                                          <?php if (isset($item->level)) : ?>
 112                                              <?php echo LayoutHelper::render('joomla.html.treeprefix', array('level' => $item->level)); ?>
 113                                          <?php endif; ?>
 114                                          <?php if ($canCheckin && $isCheckout) : ?>
 115                                              <?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'associations.', $canCheckin); ?>
 116                                          <?php endif; ?>
 117                                          <?php if ($canEdit) : ?>
 118                                              <a class="hasTooltip" href="<?php echo Route::_($this->editUri . '&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>">
 119                                                  <?php echo $this->escape($item->title); ?></a>
 120                                          <?php else : ?>
 121                                              <span title="<?php echo Text::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>"><?php echo $this->escape($item->title); ?></span>
 122                                          <?php endif; ?>
 123                                          <?php if (!empty($this->typeFields['alias'])) : ?>
 124                                              <div class="small">
 125                                                  <?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
 126                                              </div>
 127                                          <?php endif; ?>
 128                                          <?php if (!empty($this->typeFields['catid'])) : ?>
 129                                              <div class="small">
 130                                                  <?php echo Text::_('JCATEGORY') . ": " . $this->escape($item->category_title); ?>
 131                                              </div>
 132                                          <?php endif; ?>
 133                                      </div>
 134                                  </th>
 135                                  <td class="small">
 136                                      <?php echo LayoutHelper::render('joomla.content.language', $item); ?>
 137                                  </td>
 138                                  <td>
 139                                      <?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, !$isCheckout, false); ?>
 140                                  </td>
 141                                  <td>
 142                                      <?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, !$isCheckout, true); ?>
 143                                  </td>
 144                                  <?php if (!empty($this->typeFields['menutype'])) : ?>
 145                                      <td class="small">
 146                                          <?php echo $this->escape($item->menutype_title); ?>
 147                                      </td>
 148                                  <?php endif; ?>
 149                                  <?php if (!empty($this->typeFields['access'])) : ?>
 150                                      <td class="small d-none d-md-table-cell">
 151                                          <?php echo $this->escape($item->access_level); ?>
 152                                      </td>
 153                                  <?php endif; ?>
 154                                  <td class="d-none d-md-table-cell">
 155                                      <?php echo $item->id; ?>
 156                                  </td>
 157                              </tr>
 158                          <?php endforeach; ?>
 159                          </tbody>
 160                      </table>
 161  
 162                      <?php // load the pagination. ?>
 163                      <?php echo $this->pagination->getListFooter(); ?>
 164  
 165                  <?php endif; ?>
 166                  <input type="hidden" name="task" value="">
 167                  <?php echo HTMLHelper::_('form.token'); ?>
 168              </div>
 169          </div>
 170      </div>
 171  </form>


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