Skip to content
Closed
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
14 changes: 10 additions & 4 deletions layouts/joomla/button/iconclass.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
// Convert icomoon to fa
$icon = $displayData['icon'];

if(strpos($icon, 'fa-') == true || strpos($icon, 'icon-') == true){
if (strpos($icon, 'fa-') !== false)
{
$icon = 'fas ' . str_ireplace('fas ', '', $icon);
}
elseif (strpos($icon, 'icon-') !== false)
{
$icon = $icon;
}
elseif ($icon === 'archive' || $icon === 'folder-close' || $icon === 'folder-folder-2' || $icon === 'folder-minus' || $icon === 'folder-plus-2' || $icon === 'folder-remove' || $icon === 'drawer-2')
elseif ($icon === 'archive' || $icon === 'folder-close' || $icon === 'folder-folder-2' || $icon === 'folder-minus' || $icon === 'folder-plus-2' || $icon === 'folder-remove' || $icon === 'drawer-2')
{
$icon = 'fas fa-folder';
}
Expand Down Expand Up @@ -67,7 +72,7 @@
{
$icon = 'fas fa-compress';
}
elseif ($icon === 'purge')
elseif ($icon === 'purge' || $icon === 'trash')
{
$icon = 'fas fa-trash';
}
Expand Down Expand Up @@ -115,7 +120,8 @@
{
$icon = 'fas fa-arrows-alt';
}
else{
else
{
$icon = 'icon-' . $icon;
}
echo $icon;
11 changes: 8 additions & 3 deletions layouts/joomla/toolbar/iconclass.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
// Convert icomoon to fa
$icon = $displayData['icon'];

if(strpos($icon, 'fa-') == true || strpos($icon, 'icon-') == true){
if (strpos($icon, 'fa-') !== false)
{
$icon = 'fas ' . str_ireplace('fas ', '', $icon);
}
elseif (strpos($icon, 'icon-') !== false)
{
$icon = $icon;
}
elseif ($icon === 'archive' || $icon === 'folder-close' || $icon === 'folder-folder-2' || $icon === 'folder-minus' || $icon === 'folder-plus-2' || $icon === 'folder-remove' || $icon === 'drawer-2')
elseif ($icon === 'archive' || $icon === 'folder-close' || $icon === 'folder-folder-2' || $icon === 'folder-minus' || $icon === 'folder-plus-2' || $icon === 'folder-remove' || $icon === 'drawer-2')
{
$icon = 'fas fa-folder';
}
Expand Down Expand Up @@ -67,7 +72,7 @@
{
$icon = 'fas fa-compress';
}
elseif ($icon === 'purge')
elseif ($icon === 'purge' || $icon === 'trash')
{
$icon = 'fas fa-trash';
}
Expand Down
11 changes: 10 additions & 1 deletion libraries/src/HTML/Helpers/ActionsDropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,18 @@ public static function divider()
*/
public static function addCustomItem($label, $icon = '', $id = '', $task = '')
{
if (strpos($icon, 'fa-') !== false)
{
$icon = 'fas ' . str_ireplace('fas ', '', $icon);
}
elseif (strpos($icon, 'icon-') !== false)
{
$icon = $icon;
}

static::$dropDownList[] = '<li>'
. '<a href = "javascript://" onclick="Joomla.listItemTask(\'' . $id . '\', \'' . $task . '\')">'
. ($icon ? '<span class="icon-' . $icon . '" aria-hidden="true"></span> ' : '')
. ($icon ? '<span class="' . $icon . '" aria-hidden="true"></span> ' : '')
. $label
. '</a>'
. '</li>';
Expand Down
1 change: 1 addition & 0 deletions libraries/src/Toolbar/ToolbarButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ protected function renderButton(array &$options): string

// Isolate button class from icon class
$buttonClass = str_replace('fas fa-', '', $this->getName());
$buttonClass = str_ireplace('fa-', '', $buttonClass);
$iconclass = $options['btnClass'] ?? '';
$options['btnClass'] = 'button-' . $buttonClass . ' ' . $iconclass;

Expand Down