aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'views/default')
-rw-r--r--views/default/layout/objects/list/metadata.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/views/default/layout/objects/list/metadata.php b/views/default/layout/objects/list/metadata.php
new file mode 100644
index 000000000..ed3dfe046
--- /dev/null
+++ b/views/default/layout/objects/list/metadata.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * List metadata for objects
+ *
+ * @uses $vars['entity']
+ * @uses $vars['handler']
+ */
+
+$entity = $vars['entity'];
+$handler = $vars['handler'];
+
+?>
+<ul class="elgg-list-metadata">
+ <li>
+ <?php echo elgg_view('output/access', array('entity' => $entity)); ?>
+ </li>
+<?php
+if (isloggedin() && $entity->getOwnerGUID() != get_loggedin_userid()) {
+ $likes = elgg_view_likes($file);
+ echo "<li>$likes</li>";
+}
+
+// pass <li>your data</li> back from the view
+echo elgg_view("entity/metadata", array('entity' => $entity));
+
+// links to delete or edit.
+if ($entity->canEdit()) {
+
+ $edit_url = "pg/$handler/edit/{$entity->getGUID()}";
+ $edit_link = elgg_view('output/url', array(
+ 'href' => $edit_url,
+ 'text' => elgg_echo('edit'),
+ ));
+ echo "<li>$edit_link</li>";
+
+ $delete_url = "action/$handler/delete?guid={$entity->getGUID()}";
+ $delete_link = elgg_view('output/confirmlink', array(
+ 'href' => $delete_url,
+ 'text' => '<span class="elgg-icon elgg-icon-delete"></span>',
+ 'title' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ 'encode' => false,
+ ));
+ echo "<li>$delete_link</li>";
+}
+?>
+</ul>