main nav menu
http://prntscr.com/lo65ob
path: joomla4\administrator\modules\mod_menu\tmpl\default_submenu.php
aria-hidden - it's an attribute, not a class
must be like that
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Menu\Node\Separator;
/**
* =========================================================================================================
* IMPORTANT: The scope of this layout file is the `var \Joomla\Module\Menu\Administrator\Menu\CssMenu` object
* and NOT the module context.
* =========================================================================================================
*/
/** @var \Joomla\Module\Menu\Administrator\Menu\CssMenu $this */
$current = $this->tree->getCurrent();
$class = '';
// Build the CSS class suffix
if (!$this->enabled)
{
$class = ' class="disabled"';
}
elseif ($current instanceOf Separator)
{
$class = $current->get('title') ? ' class="menuitem-group"' : ' class="divider"';
}
elseif ($current->hasChildren())
{
$class = ' class="dropdown-submenu"';
if ($current->getLevel() == 1)
{
$class = ' class="parent"';
}
elseif ($current->get('class') === 'scrollable-menu')
{
$class = ' class="dropdown scrollable-menu"';
}
}
// Set the correct aria role and print the item
if ($current instanceOf Separator)
{
echo '<li' . $class . ' role="presentation">';
}
else
{
echo '<li' . $class . ' role="menuitem">';
}
// Print a link if it exists
$linkClass = [];
$dataToggle = '';
$iconClass = '';
if ($current->hasChildren())
{
$linkClass[] = 'has-arrow';
if ($current->getLevel() > 2)
{
$dataToggle = ' data-toggle="dropdown"';
}
}
else
{
$linkClass[] = 'no-dropdown';
}
// Implode out $linkClass for rendering
$linkClass = ' class="' . implode(' ', $linkClass) . '" ';
// Get the menu link
$link = $current->get('link');
// Get the menu icon
$icon = $this->tree->getIconClass();
$iconClass = ($icon != '' && $current->getLevel() == 1) ? '<span class="' . $icon . '" aria-hidden="true"></span>' : '';
if ($link !== null && $current->get('target') !== null && $current->get('target') !== '')
{
echo '<a' . $linkClass . $dataToggle . ' href="' . $link . '" target="' . $current->get('target') . '">'
. $iconClass
. '<span class="sidebar-item-title">' . Text::_($current->get('title')) . '</span></a>';
}
elseif ($link !== null)
{
echo '<a' . $linkClass . $dataToggle . ' href="' . $link . '">'
. $iconClass
. '<span class="sidebar-item-title">' . Text::_($current->get('title')) . '</span></a>';
}
elseif ($current->get('title') !== null && $current->get('class') !== 'separator')
{
echo '<a' . $linkClass . $dataToggle . '>'
. $iconClass
. '<span class="sidebar-item-title">' . Text::_($current->get('title')) . '</span></a>';
}
else
{
echo '<span>' . Text::_($current->get('title')) . '</span>';
}
// Recurse through children if they exist
if ($this->enabled && $current->hasChildren())
{
if ($current->getLevel() > 1)
{
$id = $current->get('id') ? ' id="menu-' . strtolower($current->get('id')) . '"' : '';
echo '<ul' . $id . ' class="collapse collapse-level-' . $current->getLevel() . '">';
}
else
{
echo '<ul id="collapse' . $this->tree->getCounter() . '" class="collapse-level-1 collapse" role="menu" aria-haspopup="true">';
}
// WARNING: Do not use direct 'include' or 'require' as it is important to isolate the scope for each call
$this->renderSubmenu(__FILE__);
echo '</ul>';
}
echo '</li>';
without a mess with double quotes and not like it is now
i had remove "\n", so now in source code it's in one line
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-11-28 18:36:16 |
Closed_By | ⇒ | joomla-cms-bot |
Status | Closed | ⇒ | Fixed in Code Base |
Closed_By | joomla-cms-bot | ⇒ | Quy |
Thanks for reporting. Already fixed per #23080.
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/23195