aboutsummaryrefslogtreecommitdiff
path: root/views/default/icon/default.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/icon/default.php')
-rw-r--r--views/default/icon/default.php23
1 files changed, 17 insertions, 6 deletions
diff --git a/views/default/icon/default.php b/views/default/icon/default.php
index 25175b0f4..7f13a1189 100644
--- a/views/default/icon/default.php
+++ b/views/default/icon/default.php
@@ -44,13 +44,24 @@ if (!isset($vars['height'])) {
$vars['height'] = $size != 'master' ? $icon_sizes[$size]['h'] : null;
}
-$img = elgg_view('output/img', array(
+$img_params = array(
'src' => $entity->getIconURL($vars['size']),
- 'alt' => $title,
- 'class' => $class,
- 'width' => $vars['width'],
- 'height' => $vars['height'],
-));
+ 'alt' => $title,
+);
+
+if (!empty($class)) {
+ $img_params['class'] = $class;
+}
+
+if (!empty($vars['width'])) {
+ $img_params['width'] = $vars['width'];
+}
+
+if (!empty($vars['height'])) {
+ $img_params['height'] = $vars['height'];
+}
+
+$img = elgg_view('output/img', $img_params);
if ($url) {
$params = array(