diff options
Diffstat (limited to 'views/default/object/default.php')
-rw-r--r-- | views/default/object/default.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/views/default/object/default.php b/views/default/object/default.php new file mode 100644 index 000000000..110648304 --- /dev/null +++ b/views/default/object/default.php @@ -0,0 +1,49 @@ +<?php +/** + * ElggObject default view. + * + * @warning This view may be used for other ElggEntity objects + * + * @package Elgg + * @subpackage Core + */ + +$icon = elgg_view_entity_icon($vars['entity'], 'small'); + +$title = $vars['entity']->title; +if (!$title) { + $title = $vars['entity']->name; +} +if (!$title) { + $title = get_class($vars['entity']); +} + +if (elgg_instanceof($vars['entity'], 'object')) { + $metadata = elgg_view('navigation/menu/metadata', $vars); +} + +$owner_link = ''; +$owner = $vars['entity']->getOwnerEntity(); +if ($owner) { + $owner_link = elgg_view('output/url', array( + 'href' => $owner->getURL(), + 'text' => $owner->name, + 'is_trusted' => true, + )); +} + +$date = elgg_view_friendly_time($vars['entity']->time_created); + +$subtitle = "$owner_link $date"; + +$params = array( + 'entity' => $vars['entity'], + 'title' => $title, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'tags' => $vars['entity']->tags, +); +$params = $params + $vars; +$body = elgg_view('object/elements/summary', $params); + +echo elgg_view_image_block($icon, $body, $vars); |