aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-24 13:45:25 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-24 13:45:25 +0000
commit6ac720ccfc730919c9a81007c8cf743813b98014 (patch)
tree0384678e9adc8ca60b7f8cdba7e78c496f4a4010 /engine/lib
parent1239ef02578a14983ffd8c23642e2e9b656147dd (diff)
downloadelgg-6ac720ccfc730919c9a81007c8cf743813b98014.tar.gz
elgg-6ac720ccfc730919c9a81007c8cf743813b98014.tar.bz2
Minor fix to elgg_view_entity where ElggEntities are subclassed
git-svn-id: https://code.elgg.org/elgg/trunk@1106 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/elgglib.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index f99480f10..bd1f12448 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -262,12 +262,13 @@
);
$entity_class = get_class($entity);
+
if (isset($classes[$entity_class])) {
$entity_type = $classes[$entity_class];
} else {
foreach($classes as $class => $type) {
- if (is_subclass_of($entity,$class)) {
- $entity_type = $class;
+ if ($entity instanceof $class) {
+ $entity_type = $type;
break;
}
}
@@ -275,6 +276,7 @@
if (!isset($entity_class)) return false;
$subtype = $entity->getSubtype();
+
if (empty($subtype)) { $subtype = $entity_type; }
if (elgg_view_exists("{$entity_type}/{$subtype}",$viewtype)) {