diff --git a/application/views/helpers/Icon.php b/application/views/helpers/Icon.php new file mode 100644 index 000000000..cb8525790 --- /dev/null +++ b/application/views/helpers/Icon.php @@ -0,0 +1,44 @@ + $val) { + $attributes[] = sprintf( + '%s="%s"', + filter_var($key, FILTER_SANITIZE_URL), + filter_var($val, FILTER_SANITIZE_FULL_SPECIAL_CHARS) + ); + } + if (! array_key_exists('alt', $properties)) { + $attributes[] = 'alt=""'; + } + if (! array_key_exists('class', $properties)) { + $attributes[] = 'class="icon"'; + } + if (! array_key_exists('title', $properties) && $title !== null) { + $attributes[] = 'title="' . htmlspecialchars($title) . '"'; + } + + return sprintf( + '', + Url::fromPath('img/icons/' . $img), + !empty($attributes) ? ' ' . implode(' ', $attributes) : '' + ); + } +} + +// @codingStandardsIgnoreStart diff --git a/public/css/icinga/monitoring-colors.less b/public/css/icinga/monitoring-colors.less index 9ba7962ab..73ef3cc22 100644 --- a/public/css/icinga/monitoring-colors.less +++ b/public/css/icinga/monitoring-colors.less @@ -99,10 +99,8 @@ table.action td.timesince { /* State row behaviour */ tr.state img.icon { - /* TODO: 1em? */ - height: 16px; - width: 16px; - float: right; + height: 1em; + width: 1em; } tr.state a {