aboutsummaryrefslogtreecommitdiff
path: root/views/default/layout/objects
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-24 05:16:04 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-24 05:16:04 +0000
commit54dac8c96380082136b38532707c7b1e031549e8 (patch)
tree8b18fe197739f37835b6b45029f6e6bb83579ae8 /views/default/layout/objects
parentb9dba608b5e72f55754ef1abd17753a31f4bcc07 (diff)
downloadelgg-54dac8c96380082136b38532707c7b1e031549e8.tar.gz
elgg-54dac8c96380082136b38532707c7b1e031549e8.tar.bz2
creating standard list body for plugins
git-svn-id: http://code.elgg.org/elgg/trunk@7717 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/layout/objects')
-rw-r--r--views/default/layout/objects/list/body.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/views/default/layout/objects/list/body.php b/views/default/layout/objects/list/body.php
new file mode 100644
index 000000000..9bef21da9
--- /dev/null
+++ b/views/default/layout/objects/list/body.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * List body
+ *
+ * Sample output
+ * <ul elgg-list-metadata><li>Public</li><li>Like this</li></ul>
+ * <h3><a href="">Title</a></h3>
+ * <p class="elgg-list-subtitle">Posted 3 hours ago by George</p>
+ * <p class="elgg-tags"><a href="">one</a>, <a href="">two</a></p>
+ * <div class="elgg-list-content">Excerpt text</div>
+ *
+ * @uses $vars['entity'] ElggEntity
+ * @uses $vars['title'] Title link (optional)
+ * @uses $vars['metadata'] HTML for entity metadata and actions (optional)
+ * @uses $vars['subtitle'] HTML for the subtitle (optional)
+ * @uses $vars['tags'] HTML for the tags (optional)
+ * @uses $vars['content'] HTML for the entity content (optional)
+ */
+
+$entity = $vars['entity'];
+
+$title_link = elgg_get_array_value('title', $vars, '');
+if (!$title_link) {
+ $params = array(
+ 'text' => $entity->title,
+ 'href' => $entity->getURL(),
+ );
+ $title_link = elgg_view('output/url', $params);
+}
+
+$metadata = elgg_get_array_value('metadata', $vars, '');
+$subtitle = elgg_get_array_value('subtitle', $vars, '');
+$content = elgg_get_array_value('content', $vars, '');
+
+$tags = elgg_get_array_value('tags', $vars, '');
+if (!$tags) {
+ $tag_text = elgg_view('output/tags', array('tags' => $entity->tags));
+ if ($tag_text) {
+ $tags = '<p class="elgg-tags">' . $tag_text . '</p>';
+ }
+}
+
+if ($metadata) {
+ echo $metadata;
+}
+echo "<h3>$title_link</h3>";
+echo "<p class=\"elgg-list-subtitle\">$subtitle</p>";
+echo $tags;
+if ($content) {
+ echo "<div class=\"elgg-list-content\">$content</div>";
+}