Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions administrator/modules/mod_submenu/Menu/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Menu\MenuItem;
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;
Expand Down Expand Up @@ -177,7 +176,7 @@ public static function preprocess($parent)
$iconImage = '&nbsp;<span class="badge badge-secondary">' . substr($iconImage, 6) . '</span>';
}

$item->title = $item->title . $iconImage;
$item->iconImage = $iconImage;
}
}

Expand Down
46 changes: 22 additions & 24 deletions administrator/modules/mod_submenu/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,46 @@
<?php $params = $item->getParams(); ?>
<?php // Only if Menu-show = true
if ($params->get('menu_show', 1)) : ?>
<?php
if (!empty($params->get('menu_image'))) :
$image = htmlspecialchars($params->get('menu_image'), ENT_QUOTES, 'UTF-8');
$class = htmlspecialchars($params->get('menu_image_css'), ENT_QUOTES, 'UTF-8');
$alt = $params->get('menu_text') ? '' : htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8');
endif;
?>
<a class="flex-grow-1" href="<?php echo $item->link; ?>"<?php echo !empty($item->target) ? ' target="' . $item->target . '"' : ''; ?>>
<?php if (!empty($params->get('menu_image'))) : ?>
<?php
$image = htmlspecialchars($params->get('menu_image'), ENT_QUOTES, 'UTF-8');
$class = htmlspecialchars($params->get('menu_image_css'), ENT_QUOTES, 'UTF-8');
$alt = $params->get('menu_text') ? '' : htmlspecialchars(Text::_($item->title), ENT_QUOTES, 'UTF-8');
?>
<?php echo HTMLHelper::_('image', $image, $alt, 'class="' . $class . '"'); ?>
<?php endif; ?>
<?php echo ($params->get('menu_text', 1)) ? Text::_($item->title) : ''; ?>
<?php echo ($params->get('menu_text', 1)) ? htmlspecialchars(Text::_($item->title), ENT_QUOTES, 'UTF-8') . $item->iconImage : ''; ?>
<?php if ($item->ajaxbadge) : ?>
<span class="menu-badge">
<span class="fa fa-spin fa-spinner mt-1 system-counter" data-url="<?php echo $item->ajaxbadge; ?>"></span>
</span>
<?php endif; ?>
</a>
<?php if ($params->get('menu-quicktask', false)) : ?>
<span class="menu-quicktask">
<?php
$link = $params->get('menu-quicktask-link');
$icon = $params->get('menu-quicktask-icon', 'plus');
<?php $permission = $params->get('menu-quicktask-permission'); ?>
<?php $scope = $item->scope !== 'default' ? $item->scope : null; ?>
<?php if (!$permission || $user->authorise($permission, $scope)) : ?>
<span class="menu-quicktask">
<?php
$link = $params->get('menu-quicktask-link');
$icon = $params->get('menu-quicktask-icon', 'plus');

$title = $params->get('menu-quicktask-title');
$title = Text::_($params->get('menu-quicktask-title'));

if (empty($params->get('menu-quicktask-title')))
{
$title = Text::_('MOD_MENU_QUICKTASK_NEW');
$sronly = Text::_($item->title) . ' - ' . Text::_('MOD_MENU_QUICKTASK_NEW');
}
if (empty($params->get('menu-quicktask-title')))
{
$title = Text::_('MOD_MENU_QUICKTASK_NEW');
}

$permission = $params->get('menu-quicktask-permission');
$scope = $item->scope !== 'default' ? $item->scope : null;
?>
<?php if (!$permission || $user->authorise($permission, $scope)) : ?>
$sronly = Text::_($item->title) . ' - ' . $title;
?>
<a href="<?php echo $link; ?>">
<span class="fa fa-<?php echo $icon; ?> fa-xs" title="<?php echo htmlentities($title); ?>" aria-hidden="true"></span>
<span class="sr-only"><?php echo htmlentities($sronly); ?></span>
</a>
<?php endif; ?>
</span>
</span>
<?php endif; ?>
<?php endif; ?>
<?php if ($item->dashboard) : ?>
<span class="menu-dashboard">
Expand Down