[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Administrator 5 * @subpackage com_contact 6 * 7 * @copyright (C) 2009 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\Multilanguage; 16 use Joomla\CMS\Language\Text; 17 use Joomla\CMS\Layout\LayoutHelper; 18 use Joomla\CMS\Router\Route; 19 use Joomla\CMS\Session\Session; 20 use Joomla\Component\Contact\Site\Helper\RouteHelper; 21 22 $app = Factory::getApplication(); 23 24 if ($app->isClient('site')) { 25 Session::checkToken('get') or die(Text::_('JINVALID_TOKEN')); 26 } 27 28 /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ 29 $wa = $this->document->getWebAssetManager(); 30 $wa->useScript('com_contact.admin-contacts-modal'); 31 32 $function = $app->input->getCmd('function', 'jSelectContact'); 33 $editor = $app->input->getCmd('editor', ''); 34 $listOrder = $this->escape($this->state->get('list.ordering')); 35 $listDirn = $this->escape($this->state->get('list.direction')); 36 $onclick = $this->escape($function); 37 $multilang = Multilanguage::isEnabled(); 38 39 if (!empty($editor)) { 40 // This view is used also in com_menus. Load the xtd script only if the editor is set! 41 $this->document->addScriptOptions('xtd-contacts', array('editor' => $editor)); 42 $onclick = "jSelectContact"; 43 } 44 ?> 45 <div class="container-popup"> 46 47 <form action="<?php echo Route::_('index.php?option=com_contact&view=contacts&layout=modal&tmpl=component&editor=' . $editor . '&function=' . $function . '&' . Session::getFormToken() . '=1'); ?>" method="post" name="adminForm" id="adminForm"> 48 49 <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> 50 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 table-sm"> 58 <caption class="visually-hidden"> 59 <?php echo Text::_('COM_CONTACT_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 <th scope="col" class="w-1 text-center"> 66 <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?> 67 </th> 68 <th scope="col" class="title"> 69 <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.name', $listDirn, $listOrder); ?> 70 </th> 71 <th scope="col" class="w-10"> 72 <?php echo HTMLHelper::_('searchtools.sort', 'COM_CONTACT_FIELD_LINKED_USER_LABEL', 'ul.name', $listDirn, $listOrder); ?> 73 </th> 74 <th scope="col" class="w-15 d-none d-md-table-cell"> 75 <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?> 76 </th> 77 <?php if ($multilang) : ?> 78 <th scope="col" class="w-10 d-none d-md-table-cell"> 79 <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language_title', $listDirn, $listOrder); ?> 80 </th> 81 <?php endif; ?> 82 <th scope="col" class="w-1"> 83 <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> 84 </th> 85 </tr> 86 </thead> 87 <tbody> 88 <?php 89 $iconStates = array( 90 -2 => 'icon-trash', 91 0 => 'icon-times', 92 1 => 'icon-check', 93 2 => 'icon-folder', 94 ); 95 ?> 96 <?php foreach ($this->items as $i => $item) : ?> 97 <?php if ($item->language && $multilang) { 98 $tag = strlen($item->language); 99 if ($tag == 5) { 100 $lang = substr($item->language, 0, 2); 101 } elseif ($tag == 6) { 102 $lang = substr($item->language, 0, 3); 103 } else { 104 $lang = ''; 105 } 106 } elseif (!$multilang) { 107 $lang = ''; 108 } 109 ?> 110 <tr class="row<?php echo $i % 2; ?>"> 111 <td class="text-center"> 112 <span class="tbody-icon"> 113 <span class="<?php echo $iconStates[$this->escape($item->published)]; ?>" aria-hidden="true"></span> 114 </span> 115 </td> 116 <th scope="row"> 117 <a class="select-link" href="javascript:void(0)" data-function="<?php echo $this->escape($onclick); ?>" data-id="<?php echo $item->id; ?>" data-title="<?php echo $this->escape($item->name); ?>" data-uri="<?php echo $this->escape(RouteHelper::getContactRoute($item->id, $item->catid, $item->language)); ?>" data-language="<?php echo $this->escape($lang); ?>"> 118 <?php echo $this->escape($item->name); ?> 119 </a> 120 <div class="small"> 121 <?php echo Text::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?> 122 </div> 123 </th> 124 <td> 125 <?php if (!empty($item->linked_user)) : ?> 126 <?php echo $item->linked_user; ?> 127 <?php endif; ?> 128 </td> 129 <td class="small d-none d-md-table-cell"> 130 <?php echo $this->escape($item->access_level); ?> 131 </td> 132 <?php if ($multilang) : ?> 133 <td class="small d-none d-md-table-cell"> 134 <?php echo LayoutHelper::render('joomla.content.language', $item); ?> 135 </td> 136 <?php endif; ?> 137 <td> 138 <?php echo (int) $item->id; ?> 139 </td> 140 </tr> 141 <?php endforeach; ?> 142 </tbody> 143 </table> 144 145 <?php // load the pagination. ?> 146 <?php echo $this->pagination->getListFooter(); ?> 147 148 <?php endif; ?> 149 150 <input type="hidden" name="task" value=""> 151 <input type="hidden" name="forcedLanguage" value="<?php echo $app->input->get('forcedLanguage', '', 'CMD'); ?>"> 152 <?php echo HTMLHelper::_('form.token'); ?> 153 154 </form> 155 </div>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |