[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_fields/tmpl/fields/ -> modal.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_fields
   6   *
   7   * @copyright   (C) 2016 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  
  20  if (Factory::getApplication()->isClient('site')) {
  21      Session::checkToken('get') or die(Text::_('JINVALID_TOKEN'));
  22  }
  23  
  24  /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
  25  $wa = $this->document->getWebAssetManager();
  26  $wa->useScript('com_fields.admin-fields-modal');
  27  
  28  $listOrder = $this->escape($this->state->get('list.ordering'));
  29  $listDirn  = $this->escape($this->state->get('list.direction'));
  30  $editor    = Factory::getApplication()->input->get('editor', '', 'cmd');
  31  ?>
  32  <div class="container-popup">
  33  
  34      <form action="<?php echo Route::_('index.php?option=com_fields&view=fields&layout=modal&tmpl=component&editor=' . $editor . '&' . Session::getFormToken() . '=1'); ?>" method="post" name="adminForm" id="adminForm">
  35  
  36          <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
  37          <?php if (empty($this->items)) : ?>
  38              <div class="alert alert-info">
  39                  <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  40                  <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
  41              </div>
  42          <?php else : ?>
  43              <table class="table" id="fieldList">
  44                  <caption class="visually-hidden">
  45                      <?php echo Text::_('COM_FIELDS_FIELDS_TABLE_CAPTION'); ?>,
  46                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  47                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  48                  </caption>
  49                  <thead>
  50                      <tr>
  51                          <th scope="col" class="w-1 text-center">
  52                              <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
  53                          </th>
  54                          <th scope="col" class="title">
  55                              <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  56                          </th>
  57                          <th scope="col" class="w-15 d-none d-md-table-cell">
  58                              <?php echo HTMLHelper::_('searchtools.sort', 'COM_FIELDS_FIELD_GROUP_LABEL', 'g.title', $listDirn, $listOrder); ?>
  59                          </th>
  60                          <th scope="col" class="w-10 d-none d-md-table-cell">
  61                              <?php echo HTMLHelper::_('searchtools.sort', 'COM_FIELDS_FIELD_TYPE_LABEL', 'a.type', $listDirn, $listOrder); ?>
  62                          </th>
  63                          <th scope="col" class="w-10 d-none d-md-table-cell">
  64                              <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
  65                          </th>
  66                          <th scope="col" class="w-10 d-none d-md-table-cell">
  67                              <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
  68                          </th>
  69                          <th scope="col" class="w-1 d-none d-md-table-cell">
  70                              <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  71                          </th>
  72                      </tr>
  73                  </thead>
  74                  <tbody>
  75                      <?php
  76                      $iconStates = array(
  77                          -2 => 'icon-trash',
  78                          0  => 'icon-times',
  79                          1  => 'icon-check',
  80                          2  => 'icon-folder',
  81                      );
  82                      foreach ($this->items as $i => $item) :
  83                          ?>
  84                      <tr class="row<?php echo $i % 2; ?>">
  85                          <td class="text-center">
  86                              <span class="tbody-icon">
  87                                  <span class="<?php echo $iconStates[$this->escape($item->state)]; ?>" aria-hidden="true"></span>
  88                              </span>
  89                          </td>
  90                          <th scope="row" class="has-context">
  91                              <a class="btn btn-sm btn-success w-100" href="#" onclick="Joomla.fieldIns('<?php echo $this->escape($item->id); ?>', '<?php echo $this->escape($editor); ?>');"><?php echo $this->escape($item->title); ?></a>
  92                          </th>
  93                          <td class="small d-none d-md-table-cell">
  94                              <a class="btn btn-sm btn-warning w-100" href="#" onclick="Joomla.fieldgroupIns('<?php echo $this->escape($item->group_id); ?>', '<?php echo $this->escape($editor); ?>');"><?php echo $item->group_id ? $this->escape($item->group_title) : Text::_('JNONE'); ?></a>
  95                          </td>
  96                          <td class="small d-none d-md-table-cell">
  97                              <?php echo $item->type; ?>
  98                          </td>
  99                          <td class="small d-none d-md-table-cell">
 100                              <?php echo $this->escape($item->access_level); ?>
 101                          </td>
 102                          <td class="small d-none d-md-table-cell">
 103                              <?php echo LayoutHelper::render('joomla.content.language', $item); ?>
 104                          </td>
 105                          <td class="d-none d-md-table-cell">
 106                              <?php echo (int) $item->id; ?>
 107                          </td>
 108                      </tr>
 109                      <?php endforeach; ?>
 110                  </tbody>
 111              </table>
 112  
 113              <?php // load the pagination. ?>
 114              <?php echo $this->pagination->getListFooter(); ?>
 115  
 116          <?php endif; ?>
 117  
 118          <input type="hidden" name="task" value="">
 119          <input type="hidden" name="boxchecked" value="0">
 120          <?php echo HTMLHelper::_('form.token'); ?>
 121  
 122      </form>
 123  </div>


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