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:
Thomas Gelf 2015-10-01 16:52:39 +02:00
parent d6283f1451
commit 270520eac3
1 changed files with 5 additions and 1 deletions
library/Icinga/Web/View/helpers

View File

@ -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;