From 607c2d8d9284923e890e8937f28716bb5d3cdfd2 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 8 Oct 2008 15:13:43 +0000 Subject: Default icon overrides. git-svn-id: https://code.elgg.org/elgg/trunk@2226 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'engine/lib/entities.php') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 3adf4b8ee..ba376917b 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1873,9 +1873,17 @@ // Fail, so use default if (!$url) { - $test = elgg_view("icon/entity/default/{$size}",array('entity' => $entity)); - if (!empty($test)) return $test; - + $type = $entity->getType(); + $subtype = $entity->getSubtype(); + + if (!empty($subtype)) { + $overrideurl = elgg_view("icon/{$type}/{$subtype}/{$size}",array('entity' => $entity)); + if (!empty($overrideurl)) return $overrideurl; + } + + $overrideurl = elgg_view("icon/{$type}/default/{$size}",array('entity' => $entity)); + if (!empty($overrideurl)) return $overrideurl; + $url = $CONFIG->url . "_graphics/icons/default/$size.png"; } -- cgit v1.2.3