[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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


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