[ 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_menus 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\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 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('com_menus.admin-items-modal'); 30 31 $function = $app->input->get('function', 'jSelectMenuItem', 'cmd'); 32 $editor = $app->input->getCmd('editor', ''); 33 $listOrder = $this->escape($this->state->get('list.ordering')); 34 $listDirn = $this->escape($this->state->get('list.direction')); 35 $link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' . Session::getFormToken() . '=1'; 36 $multilang = Multilanguage::isEnabled(); 37 38 if (!empty($editor)) { 39 // This view is used also in com_menus. Load the xtd script only if the editor is set! 40 $this->document->addScriptOptions('xtd-menus', array('editor' => $editor)); 41 $onclick = "jSelectMenuItem"; 42 $link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&editor=' . $editor . '&' . Session::getFormToken() . '=1'; 43 } 44 ?> 45 <div class="container-popup"> 46 <form action="<?php echo Route::_($link); ?>" method="post" name="adminForm" id="adminForm"> 47 <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('selectorFieldName' => 'menutype'))); ?> 48 49 <?php if (empty($this->items)) : ?> 50 <div class="alert alert-info"> 51 <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span> 52 <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?> 53 </div> 54 <?php else : ?> 55 <table class="table table-sm"> 56 <caption class="visually-hidden"> 57 <?php echo Text::_('COM_MENUS_ITEMS_TABLE_CAPTION'); ?>, 58 <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>, 59 <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span> 60 </caption> 61 <thead> 62 <tr> 63 <th scope="col" class="w-1 text-center"> 64 <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?> 65 </th> 66 <th scope="col" class="title"> 67 <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> 68 </th> 69 <th scope="col" class="d-none d-md-table-cell"> 70 <?php echo HTMLHelper::_('searchtools.sort', 'COM_MENUS_HEADING_MENU', 'menutype_title', $listDirn, $listOrder); ?> 71 </th> 72 <th scope="col" class="w-5 text-center d-none d-md-table-cell"> 73 <?php echo HTMLHelper::_('searchtools.sort', 'COM_MENUS_HEADING_HOME', 'a.home', $listDirn, $listOrder); ?> 74 </th> 75 <th scope="col" class="w-10 d-none d-md-table-cell"> 76 <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?> 77 </th> 78 <?php if ($multilang) : ?> 79 <th scope="col" class="w-15 d-none d-md-table-cell"> 80 <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?> 81 </th> 82 <?php endif; ?> 83 <th scope="col" class="w-1 d-none d-md-table-cell"> 84 <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> 85 </th> 86 </tr> 87 </thead> 88 <tbody> 89 <?php foreach ($this->items as $i => $item) : ?> 90 <?php $uselessMenuItem = in_array($item->type, array('separator', 'heading', 'alias', 'url', 'container')); ?> 91 <?php if ($item->language && $multilang) { 92 if ($item->language !== '*') { 93 $language = $item->language; 94 } else { 95 $language = ''; 96 } 97 } elseif (!$multilang) { 98 $language = ''; 99 } 100 ?> 101 <tr class="row<?php echo $i % 2; ?>"> 102 <td class="text-center"> 103 <?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'items.', false, 'cb', $item->publish_up, $item->publish_down); ?> 104 </td> 105 <th scope="row"> 106 <?php $prefix = LayoutHelper::render('joomla.html.treeprefix', array('level' => $item->level)); ?> 107 <?php echo $prefix; ?> 108 <?php if (!$uselessMenuItem) : ?> 109 <a class="select-link" href="javascript:void(0)" data-function="<?php echo $this->escape($function); ?>" data-id="<?php echo $item->id; ?>" data-title="<?php echo $this->escape($item->title); ?>" data-uri="<?php echo 'index.php?Itemid=' . $item->id; ?>" data-language="<?php echo $this->escape($language); ?>"> 110 <?php echo $this->escape($item->title); ?></a> 111 <?php else : ?> 112 <?php echo $this->escape($item->title); ?> 113 <?php endif; ?> 114 <?php echo HTMLHelper::_('menus.visibility', $item->params); ?> 115 <div> 116 <?php echo $prefix; ?> 117 <span class="small"> 118 <?php if (empty($item->note)) : ?> 119 <?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?> 120 <?php else : ?> 121 <?php echo Text::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note)); ?> 122 <?php endif; ?> 123 </span> 124 </div> 125 <div title="<?php echo $this->escape($item->path); ?>"> 126 <?php echo $prefix; ?> 127 <span class="small" title="<?php echo isset($item->item_type_desc) ? htmlspecialchars($this->escape($item->item_type_desc), ENT_COMPAT, 'UTF-8') : ''; ?>"> 128 <?php echo $this->escape($item->item_type); ?> 129 </span> 130 </div> 131 <?php if ($item->type === 'component' && !$item->enabled) : ?> 132 <div> 133 <span class="badge bg-secondary"> 134 <?php echo Text::_($item->enabled === null ? 'JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND' : 'COM_MENUS_LABEL_DISABLED'); ?> 135 </span> 136 </div> 137 <?php endif; ?> 138 </th> 139 <td class="small d-none d-md-table-cell"> 140 <?php echo $this->escape($item->menutype_title); ?> 141 </td> 142 <td class="text-center d-none d-md-table-cell"> 143 <?php if ($item->type == 'component') : ?> 144 <?php if ($item->language == '*' || $item->home == '0') : ?> 145 <?php echo HTMLHelper::_('jgrid.isdefault', $item->home, $i, 'items.', ($item->language != '*' || !$item->home) && false && !$item->protected, 'cb', null, 'home', 'circle'); ?> 146 <?php else : ?> 147 <?php if ($item->language_image) : ?> 148 <?php echo HTMLHelper::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true); ?> 149 <?php else : ?> 150 <span class="badge bg-secondary" title="<?php echo $item->language_title; ?>"><?php echo $item->language; ?></span> 151 <?php endif; ?> 152 <?php endif; ?> 153 <?php endif; ?> 154 </td> 155 <td class="small d-none d-md-table-cell"> 156 <?php echo $this->escape($item->access_level); ?> 157 </td> 158 <?php if ($multilang) : ?> 159 <td class="small d-none d-md-table-cell"> 160 <?php if ($item->language == '') : ?> 161 <?php echo Text::_('JDEFAULT'); ?> 162 <?php elseif ($item->language == '*') : ?> 163 <?php echo Text::alt('JALL', 'language'); ?> 164 <?php else : ?> 165 <?php echo LayoutHelper::render('joomla.content.language', $item); ?> 166 <?php endif; ?> 167 </td> 168 <?php endif; ?> 169 <td class="d-none d-md-table-cell"> 170 <?php echo (int) $item->id; ?> 171 </td> 172 </tr> 173 <?php endforeach; ?> 174 </tbody> 175 </table> 176 177 <?php // load the pagination. ?> 178 <?php echo $this->pagination->getListFooter(); ?> 179 180 <?php endif; ?> 181 182 <input type="hidden" name="task" value=""> 183 <input type="hidden" name="boxchecked" value="0"> 184 <input type="hidden" name="function" value="<?php echo $function; ?>"> 185 <input type="hidden" name="forcedLanguage" value="<?php echo $app->input->get('forcedLanguage', '', 'cmd'); ?>"> 186 <?php echo HTMLHelper::_('form.token'); ?> 187 188 </form> 189 </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 |