helpers/icon: allow for img urls outside of icons
Icon images where restricted to img/icons, this did not allow modules to use custom images. Left behaviour for img urls without slash untouched.
This commit is contained in:
parent
d6283f1451
commit
270520eac3
library/Icinga/Web/View/helpers
|
@ -87,7 +87,11 @@ $this->addHelperFunction('icon', function ($img, $title = null, array $propertie
|
|||
$properties['class'] = 'icon';
|
||||
}
|
||||
|
||||
return $view->img('img/icons/' . $img, $properties);
|
||||
if (strpos($img, '/') === false) {
|
||||
return $view->img('img/icons/' . $img, $properties);
|
||||
} else {
|
||||
return $view->img($img, $properties);
|
||||
}
|
||||
}
|
||||
|
||||
$ariaHidden = array_key_exists('aria-hidden', $properties) ? $properties['aria-hidden'] : null;
|
||||
|
|
Loading…
Reference in New Issue