Skip to content

Commit

Permalink
🗑️ housecleaning and apply suggestions by @degobbis
Browse files Browse the repository at this point in the history
  • Loading branch information
hans2103 committed Oct 21, 2020
1 parent a39a884 commit 883cbd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion layouts/joomla/searchtools/default/noitems.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
$data = $displayData;
?>
<div class="alert alert-info">
<?php echo HTMLHelper::_('icons.icon', 'fas fa-info-circle', Text::_('INFO')); ?>
<?php echo HTMLHelper::_('icons.icon', 'fas fa-circle', Text::_('INFO')); ?>
<?php echo $data['options']['noResultsText']; ?>
</div>
14 changes: 5 additions & 9 deletions libraries/src/HTML/Helpers/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,26 @@ abstract class Icons
* @param string $icon The funcitonal name for an icon.
* @param string $srOnly Screen Reader text if no visible text is placed
* @param array $attribs Attributes to be added to the wrapping element
* @param string $iconPrefix String prepend to icon className
* @param string $iconSuffix String append to icon className
*
*
* @return string
*
* @since 4.0
*/
public static function icon($icon = 'default', $srOnly = null, $attribs = [], $iconPrefix = 'icon-', $iconSuffix = null)
public static function icon($icon = 'default', $srOnly = null, $attribs = [])
{
$icon = $iconPrefix . $icon;

if (isset($iconSuffix))
if (isset($attribs['class']))
{
$icon = $icon . $iconSuffix;
$icon = $icon . ' ' . $attribs['class'];
}

$attribs['class'] = $icon;

if (!isset($attribs['aria-hidden']))
{
$attribs['aria-hidden'] = 'true';
}

$attribs['class'] = $iconPrefix . $icon;

if (isset($srOnly))
{
$text = htmlspecialchars($srOnly, ENT_COMPAT, 'UTF-8');
Expand Down

0 comments on commit 883cbd0

Please sign in to comment.