[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Site 5 * @subpackage mod_menu 6 * 7 * @copyright (C) 2020 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\Utilities\ArrayHelper; 15 16 $attributes = []; 17 18 if ($item->anchor_title) { 19 $attributes['title'] = $item->anchor_title; 20 } 21 22 $attributes['class'] = 'mod-menu__heading nav-header'; 23 $attributes['class'] .= $item->anchor_css ? ' ' . $item->anchor_css : null; 24 25 $linktype = $item->title; 26 27 if ($item->menu_icon) { 28 // The link is an icon 29 if ($itemParams->get('menu_text', 1)) { 30 // If the link text is to be displayed, the icon is added with aria-hidden 31 $linktype = '<span class="p-2 ' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title; 32 } else { 33 // If the icon itself is the link, it needs a visually hidden text 34 $linktype = '<span class="p-2 ' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>'; 35 } 36 } elseif ($item->menu_image) { 37 // The link is an image, maybe with an own class 38 $image_attributes = []; 39 40 if ($item->menu_image_css) { 41 $image_attributes['class'] = $item->menu_image_css; 42 } 43 44 $linktype = HTMLHelper::_('image', $item->menu_image, $item->title, $image_attributes); 45 46 if ($itemParams->get('menu_text', 1)) { 47 $linktype .= '<span class="image-title">' . $item->title . '</span>'; 48 } 49 } 50 51 if ($showAll && $item->deeper) { 52 $attributes['class'] .= ' mm-collapsed mm-toggler mm-toggler-nolink'; 53 $attributes['aria-haspopup'] = 'true'; 54 $attributes['aria-expanded'] = 'false'; 55 echo '<button ' . ArrayHelper::toString($attributes) . '>' . $linktype . '</button>'; 56 } else { 57 echo '<span ' . ArrayHelper::toString($attributes) . '>' . $linktype . '</span>'; 58 }
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 |