[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_contact/tmpl/contacts/ -> default.php (source)

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


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