aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 13:16:56 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 13:16:56 +0000
commitdd687a5594994f41df26a781b878213271aad181 (patch)
tree874a3d955526aba591faef97f1746fb286287d3e /views/default
parent6a7e32601d151dd38af5baee53298523221bbdfa (diff)
downloadelgg-dd687a5594994f41df26a781b878213271aad181.tar.gz
elgg-dd687a5594994f41df26a781b878213271aad181.tar.bz2
added a general metadata view for lists
git-svn-id: http://code.elgg.org/elgg/trunk@7734 36083f99-b078-4883-b0ff-0f9b5a30f544
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>