aboutsummaryrefslogtreecommitdiff
path: root/views/default/object/default.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/object/default.php')
-rw-r--r--views/default/object/default.php90
1 files changed, 40 insertions, 50 deletions
diff --git a/views/default/object/default.php b/views/default/object/default.php
index 6e03e9e78..be2be475e 100644
--- a/views/default/object/default.php
+++ b/views/default/object/default.php
@@ -1,61 +1,51 @@
<?php
/**
- * ElggEntity default view.
+ * ElggObject default view.
+ *
+ * @warning This view may be used for other ElggEntity objects
*
* @package Elgg
* @subpackage Core
*/
-if ($vars['full']) {
- echo elgg_view('export/entity', $vars);
-} else {
-
- $icon = elgg_view(
- 'graphics/icon', array(
- 'entity' => $vars['entity'],
- 'size' => 'small',
- )
- );
-
-
- $title = $vars['entity']->title;
- if (!$title) {
- $title = $vars['entity']->name;
- }
- if (!$title) {
- $title = get_class($vars['entity']);
- }
-
- $controls = "";
- if ($vars['entity']->canEdit()) {
- $delete = elgg_view('output/confirm_link', array(
- 'href' => "action/entities/delete?guid={$vars['entity']->guid}",
- 'text' => elgg_echo('delete')
- ));
- $controls .= " ($delete)";
- }
-
- $info = "<div><p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $title . "</a></b> $controls </p></div>";
-
- if (get_input('listtype') == "gallery") {
- $icon = "";
- }
-
- $owner = $vars['entity']->getOwnerEntity();
- $ownertxt = elgg_echo('unknown');
- if ($owner) {
- $ownertxt = "<a href=\"" . $owner->getURL() . "\">" . $owner->name . "</a>";
- }
-
- $info .= "<div>" . elgg_echo("entity:default:strapline", array(
- elgg_view_friendly_time($vars['entity']->time_created),
- $ownertxt
- ));
+$icon = elgg_view('graphics/icon', array(
+ 'entity' => $vars['entity'],
+ 'size' => 'small',
+));
- $info .= "</div>";
- $info = "<span title=\"" . elgg_echo('entity:default:missingsupport:popup') . "\">$info</span>";
- $icon = "<span title=\"" . elgg_echo('entity:default:missingsupport:popup') . "\">$icon</span>";
+$title = $vars['entity']->title;
+if (!$title) {
+ $title = $vars['entity']->name;
+}
+if (!$title) {
+ $title = get_class($vars['entity']);
+}
- echo elgg_view_listing($icon, $info);
+if (elgg_instanceof($vars['entity'], 'object')) {
+ $metadata = elgg_view('layout/objects/list/metadata', $vars);
}
+
+$owner_link = '';
+$owner = $vars['entity']->getOwnerEntity();
+if ($owner) {
+ $owner_link = elgg_view('output/url', array(
+ 'href' => $owner->getURL(),
+ 'text' => $owner->name,
+ ));
+}
+
+$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,
+);
+$body = elgg_view('layout/objects/list/body', $params);
+
+echo elgg_view_image_block($icon, $body);