[ 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_templates 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\Text; 16 use Joomla\CMS\Layout\LayoutHelper; 17 use Joomla\CMS\Router\Route; 18 use Joomla\CMS\Session\Session; 19 20 /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ 21 $wa = $this->document->getWebAssetManager(); 22 $wa->useScript('table.columns') 23 ->useScript('multiselect'); 24 25 $user = Factory::getUser(); 26 $clientId = (int) $this->state->get('client_id', 0); 27 $listOrder = $this->escape($this->state->get('list.ordering')); 28 $listDirn = $this->escape($this->state->get('list.direction')); 29 ?> 30 <form action="<?php echo Route::_('index.php?option=com_templates&view=styles'); ?>" method="post" name="adminForm" id="adminForm"> 31 <div class="row"> 32 <div class="col-md-12"> 33 <div id="j-main-container" class="j-main-container"> 34 <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('selectorFieldName' => 'client_id'))); ?> 35 <?php if ($this->total > 0) : ?> 36 <table class="table" id="styleList"> 37 <caption class="visually-hidden"> 38 <?php echo Text::_('COM_TEMPLATES_STYLES_TABLE_CAPTION'); ?>, 39 <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>, 40 <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span> 41 </caption> 42 <thead> 43 <tr> 44 <td class="w-1 text-center"> 45 <?php echo HTMLHelper::_('grid.checkall'); ?> 46 </td> 47 <th scope="col"> 48 <?php echo HTMLHelper::_('searchtools.sort', 'COM_TEMPLATES_HEADING_STYLE', 'a.title', $listDirn, $listOrder); ?> 49 </th> 50 <th scope="col" class="w-5 text-center"> 51 <?php echo Text::_('COM_TEMPLATES_TEMPLATE_PREVIEW'); ?> 52 </th> 53 <th scope="col" class="w-12 text-center"> 54 <?php echo HTMLHelper::_('searchtools.sort', 'COM_TEMPLATES_HEADING_DEFAULT', 'a.home', $listDirn, $listOrder); ?> 55 </th> 56 <?php if ($clientId === 0) : ?> 57 <th scope="col" class="w-12 d-none d-md-table-cell"> 58 <?php echo Text::_('COM_TEMPLATES_HEADING_PAGES'); ?> 59 </th> 60 <?php endif; ?> 61 <th scope="col" class="w-12 d-none d-md-table-cell"> 62 <?php echo HTMLHelper::_('searchtools.sort', 'COM_TEMPLATES_HEADING_TEMPLATE', 'a.template', $listDirn, $listOrder); ?> 63 </th> 64 <th scope="col" class="w-5 d-none d-md-table-cell"> 65 <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> 66 </th> 67 </tr> 68 </thead> 69 <tbody> 70 <?php foreach ($this->items as $i => $item) : 71 $canCreate = $user->authorise('core.create', 'com_templates'); 72 $canEdit = $user->authorise('core.edit', 'com_templates'); 73 $canChange = $user->authorise('core.edit.state', 'com_templates'); 74 ?> 75 <tr class="row<?php echo $i % 2; ?>"> 76 <td class="w-1 text-center"> 77 <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?> 78 </td> 79 <th scope="row"> 80 <?php if ($canEdit) : ?> 81 <a href="<?php echo Route::_('index.php?option=com_templates&task=style.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>"> 82 <?php echo $this->escape($item->title); ?></a> 83 <?php else : ?> 84 <?php echo $this->escape($item->title); ?> 85 <?php endif; ?> 86 </th> 87 <td class="text-center"> 88 <?php if ($this->preview) : ?> 89 <?php $client = (int) $item->client_id === 1 ? 'administrator' : 'site'; ?> 90 <!-- external link icon generated by css --> 91 <a href="<?php echo Route::link($client, 'index.php?tp=1&templateStyle=' . (int) $item->id); ?>" target="_blank" class="jgrid" aria-labelledby="preview-<?php echo (int) $item->id; ?>"></a> 92 <div role="tooltip" id="preview-<?php echo (int) $item->id; ?>"><?php echo Text::sprintf('COM_TEMPLATES_TEMPLATE_NEW_PREVIEW', $item->title); ?></div> 93 <?php else : ?> 94 <span class="icon-eye-slash" aria-labelledby="nopreview-<?php echo (int) $item->id; ?>" aria-hidden="true"></span> 95 <div role="tooltip" id="nopreview-<?php echo (int) $item->id; ?>"><?php echo Text::_('COM_TEMPLATES_TEMPLATE_NO_PREVIEW'); ?></div> 96 <?php endif; ?> 97 </td> 98 <td class="text-center"> 99 <?php if ($item->home == '0' || $item->home == '1') : ?> 100 <?php echo HTMLHelper::_('jgrid.isdefault', $item->home != '0', $i, 'styles.', $canChange && $item->home != '1'); ?> 101 <?php elseif ($canChange) :?> 102 <a href="<?php echo Route::_('index.php?option=com_templates&task=styles.unsetDefault&cid[]=' . $item->id . '&' . Session::getFormToken() . '=1'); ?>"> 103 <?php if ($item->image) : ?> 104 <?php echo HTMLHelper::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => Text::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title)), true); ?> 105 <?php else : ?> 106 <span class="badge bg-secondary" title="<?php echo Text::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title); ?>"><?php echo $item->home; ?></span> 107 <?php endif; ?> 108 </a> 109 <?php else : ?> 110 <?php if ($item->image) : ?> 111 <?php echo HTMLHelper::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true); ?> 112 <?php else : ?> 113 <span class="badge bg-secondary" title="<?php echo $item->language_title; ?>"><?php echo $item->home; ?></span> 114 <?php endif; ?> 115 <?php endif; ?> 116 </td> 117 <?php if ($clientId === 0) : ?> 118 <td class="small d-none d-md-table-cell"> 119 <?php if ($item->home == '1') : ?> 120 <?php echo Text::_('COM_TEMPLATES_STYLES_PAGES_ALL'); ?> 121 <?php elseif ($item->home != '0' && $item->home != '1') : ?> 122 <?php echo Text::sprintf('COM_TEMPLATES_STYLES_PAGES_ALL_LANGUAGE', $this->escape($item->language_title)); ?> 123 <?php elseif ($item->assigned > 0) : ?> 124 <?php echo Text::sprintf('COM_TEMPLATES_STYLES_PAGES_SELECTED', $this->escape($item->assigned)); ?> 125 <?php else : ?> 126 <?php echo Text::_('COM_TEMPLATES_STYLES_PAGES_NONE'); ?> 127 <?php endif; ?> 128 </td> 129 <?php endif; ?> 130 <td class="small d-none d-md-table-cell"> 131 <a href="<?php echo Route::_('index.php?option=com_templates&view=template&id=' . (int) $item->e_id); ?>"> 132 <?php echo ucfirst($this->escape($item->template)); ?> 133 </a> 134 </td> 135 <td class="d-none d-md-table-cell"> 136 <?php echo (int) $item->id; ?> 137 </td> 138 </tr> 139 <?php endforeach; ?> 140 </tbody> 141 </table> 142 143 <?php // load the pagination. ?> 144 <?php echo $this->pagination->getListFooter(); ?> 145 146 <?php endif; ?> 147 148 <input type="hidden" name="task" value=""> 149 <input type="hidden" name="boxchecked" value="0"> 150 <?php echo HTMLHelper::_('form.token'); ?> 151 </div> 152 </div> 153 </div> 154 </form>
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 |