Skip to content

Commit

Permalink
use LayoutHelper in function
Browse files Browse the repository at this point in the history
  • Loading branch information
hans2103 committed Sep 3, 2020
1 parent e1e81ff commit 0d1156a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions libraries/src/HTML/Helpers/ActionsDropdown.php
Expand Up @@ -10,7 +10,9 @@

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

/**
* HTML utility class for building a dropdown menu
Expand Down Expand Up @@ -225,13 +227,14 @@ public static function divider()
*/
public static function addCustomItem($label, $icon = '', $id = '', $task = '')
{
$icon = LayoutHelper::render('joomla.icon.iconclass', $icon);

static::$dropDownList[] = '<li>'
. '<a href = "javascript://" onclick="Joomla.listItemTask(\'' . $id . '\', \'' . $task . '\')">'
. ($icon ? '<span class="' . $icon . '" aria-hidden="true"></span> ' : '')
. $label
. '</a>'
. HTMLHelper::link(
'javascript://',
($icon ? LayoutHelper::render('joomla.icon.iconclass', ['icon' => $icon, 'html' => true] . ' ') : '') . $label,
[
'onclick' => 'Joomla.listItemTask(\'' . $id . '\', \'' . $task . '\')'
]
)
. '</li>';
}
}

0 comments on commit 0d1156a

Please sign in to comment.