aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-22 01:29:03 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-22 01:29:03 +0000
commited74eb05fb6602018eb940892e541fffa56e91c3 (patch)
treef3631235190bb84e7bff3db9ed3455cf1a27ac20
parentadfce2d6fc1d8921e7933176f6d666bdf58ca0a2 (diff)
downloadelgg-ed74eb05fb6602018eb940892e541fffa56e91c3.tar.gz
elgg-ed74eb05fb6602018eb940892e541fffa56e91c3.tar.bz2
Refs #2950: layout/objects/list/metadata => navigation/menu/metadata
git-svn-id: http://code.elgg.org/elgg/trunk@8404 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--views/default/navigation/menu/metadata.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/views/default/navigation/menu/metadata.php b/views/default/navigation/menu/metadata.php
new file mode 100644
index 000000000..3ce3573b9
--- /dev/null
+++ b/views/default/navigation/menu/metadata.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * List metadata for objects
+ *
+ * @uses $vars['entity'] ElggEntity
+ * @uses $vars['handler'] Page handler identifier
+ * @uses $vars['links'] Array of extra links
+ */
+
+$entity = $vars['entity'];
+$handler = elgg_extract('handler', $vars, '');
+
+?>
+<ul class="elgg-list-metadata">
+ <li>
+ <?php echo elgg_view('output/access', array('entity' => $entity)); ?>
+ </li>
+<?php
+
+if (isset($vars['links']) && is_array($vars['links'])) {
+ foreach ($vars['links'] as $link) {
+ echo "<li>$link</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() && $handler) {
+
+ $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'),
+ 'text_encode' => false,
+ ));
+ echo "<li>$delete_link</li>";
+}
+
+$likes = elgg_view_likes($entity);
+echo "<li>$likes</li>";
+
+?>
+</ul>