[ 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 mod_submenu 6 * 7 * @copyright (C) 2010 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\HTML\HTMLHelper; 14 use Joomla\CMS\Language\Text; 15 use Joomla\CMS\Router\Route; 16 17 /** @var \Joomla\CMS\Menu\MenuItem $root */ 18 ?> 19 <?php foreach ($root->getChildren() as $child) : ?> 20 <?php if ($child->hasChildren()) : ?> 21 <div class="module-wrapper"> 22 <div class="card"> 23 <?php 24 $child->img = $child->img ?? ''; 25 26 if (substr($child->img, 0, 6) === 'class:') { 27 $iconImage = '<span class="icon-' . substr($child->img, 6) . '" aria-hidden="true"></span>'; 28 } elseif (substr($child->img, 0, 6) === 'image:') { 29 $iconImage = '<img src="' . substr($child->img, 6) . '" aria-hidden="true">'; 30 } elseif (!empty($child->img)) { 31 $iconImage = '<img src="' . $child->img . '" aria-hidden="true">'; 32 } elseif ($child->icon) { 33 $iconImage = '<span class="icon-' . $child->icon . '" aria-hidden="true"></span>'; 34 } else { 35 $iconImage = ''; 36 } 37 ?> 38 <h2 class="card-header"> 39 <?php echo $iconImage; ?> 40 <?php echo Text::_($child->title); ?> 41 </h2> 42 <ul class="list-group list-group-flush"> 43 <?php foreach ($child->getChildren() as $item) : ?> 44 <?php $params = $item->getParams(); ?> 45 <?php // Only if Menu-show = true ?> 46 <?php if ($params->get('menu_show', 1)) : ?> 47 <li class="list-group-item d-flex align-items-center"> 48 <?php $class = $params->get('menu-quicktask') ? '' : 'class="flex-grow-1"'; ?> 49 <a <?php echo $class; ?> href="<?php echo $item->link; ?>" 50 <?php echo $item->target === '_blank' ? ' title="' . Text::sprintf('JBROWSERTARGET_NEW_TITLE', Text::_($item->title)) . '"' : ''; ?> 51 <?php echo $item->target ? ' target="' . $item->target . '"' : ''; ?>> 52 <?php if (!empty($params->get('menu_image'))) : ?> 53 <?php 54 $image = htmlspecialchars($params->get('menu_image'), ENT_QUOTES, 'UTF-8'); 55 $class = htmlspecialchars($params->get('menu_image_css'), ENT_QUOTES, 'UTF-8'); 56 $alt = $params->get('menu_text') ? '' : htmlspecialchars(Text::_($item->title), ENT_QUOTES, 'UTF-8'); 57 ?> 58 <?php echo HTMLHelper::_('image', $image, $alt, 'class="' . $class . '"'); ?> 59 <?php endif; ?> 60 <?php echo ($params->get('menu_text', 1)) ? htmlspecialchars(Text::_($item->title), ENT_QUOTES, 'UTF-8') : ''; ?> 61 <?php if ($item->ajaxbadge) : ?> 62 <span class="menu-badge"> 63 <span class="icon-spin icon-spinner mt-1 system-counter float-end" data-url="<?php echo $item->ajaxbadge; ?>"></span> 64 </span> 65 <?php endif; ?> 66 </a> 67 <?php echo $item->iconImage; ?> 68 <?php if ($params->get('menu-quicktask')) : ?> 69 <?php $permission = $params->get('menu-quicktask-permission'); ?> 70 <?php $scope = $item->scope !== 'default' ? $item->scope : null; ?> 71 <?php if (!$permission || $user->authorise($permission, $scope)) : ?> 72 <span class="menu-quicktask"> 73 <?php 74 $link = $params->get('menu-quicktask'); 75 $icon = $params->get('menu-quicktask-icon', 'plus'); 76 77 $title = Text::_($params->get('menu-quicktask-title')); 78 79 if (empty($params->get('menu-quicktask-title'))) { 80 $title = Text::_('MOD_MENU_QUICKTASK_NEW'); 81 } 82 83 $sronly = Text::_($item->title) . ' - ' . $title; 84 ?> 85 <a href="<?php echo $link; ?>"> 86 <span class="icon-<?php echo $icon; ?>" title="<?php echo htmlentities($title); ?>" aria-hidden="true"></span> 87 <span class="visually-hidden"><?php echo htmlentities($sronly); ?></span> 88 </a> 89 </span> 90 <?php endif; ?> 91 <?php endif; ?> 92 <?php if ($item->dashboard) : ?> 93 <span class="menu-dashboard"> 94 <a href="<?php echo Route::_('index.php?option=com_cpanel&view=cpanel&dashboard=' . $item->dashboard); ?>"> 95 <span class="icon-th-large" title="<?php echo htmlentities(Text::sprintf('MOD_MENU_DASHBOARD_LINK', Text::_($child->title))); ?>"></span> 96 </a> 97 </span> 98 <?php endif; ?> 99 </li> 100 <?php endif; ?> 101 <?php endforeach; ?> 102 </ul> 103 </div> 104 </div> 105 <?php endif; ?> 106 <?php endforeach; ?>
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 |