aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-10-25 16:34:22 -0700
committerCash Costello <cash.costello@gmail.com>2011-10-25 16:34:22 -0700
commit01119f1713739c4d9b0c2aaa00168a498569c37f (patch)
tree0a09b2166085b5f477761f7131c23e4e6f633958 /views
parent65bd37c1f0e3e3adb04bd48dad6183bcd3c7e26c (diff)
parent5c43ddc2d58dbe7a280742131f221e4947f73125 (diff)
downloadelgg-01119f1713739c4d9b0c2aaa00168a498569c37f.tar.gz
elgg-01119f1713739c4d9b0c2aaa00168a498569c37f.tar.bz2
Merge pull request #80 from cash/styling_content
Fixes #3960 and #2292 making it easier to style and extend content pages
Diffstat (limited to 'views')
-rw-r--r--views/default/object/elements/full.php45
-rw-r--r--views/default/object/elements/summary.php3
2 files changed, 48 insertions, 0 deletions
diff --git a/views/default/object/elements/full.php b/views/default/object/elements/full.php
new file mode 100644
index 000000000..4a2991442
--- /dev/null
+++ b/views/default/object/elements/full.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Object full rendering
+ *
+ * Sample output
+ * <h2>Title</h3>
+ * <div class="elgg-content">
+ * <div class="elgg-image-block">
+ * </div>
+ * <div class="elgg-output">
+ * </div>
+ * </div>
+ *
+ * @uses $vars['entity'] ElggEntity
+ * @uses $vars['title'] Title (false for no title)
+ * @uses $vars['icon'] HTML for the content icon
+ * @uses $vars['summary'] HTML for the content summary
+ * @uses $vars['body'] HTML for the content body
+ * @uses $vars['class'] Optional additional class for the content wrapper
+ */
+
+$title = elgg_extract('title', $vars);
+$icon = elgg_extract('icon', $vars);
+$summary = elgg_extract('summary', $vars);
+$body = elgg_extract('body', $vars);
+$class = elgg_extract('class', $vars);
+if ($class) {
+ $class = "elgg-content $class";
+} else {
+ $class = "elgg-content";
+}
+
+if ($title) {
+ $title = elgg_view_title($title);
+}
+
+$header = elgg_view_image_block($icon, $summary);
+
+echo <<<HTML
+$title
+<div class="$class">
+$header
+$body
+</div>
+HTML;
diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php
index 3ca4de2be..8d82bc52a 100644
--- a/views/default/object/elements/summary.php
+++ b/views/default/object/elements/summary.php
@@ -49,6 +49,9 @@ if ($metadata) {
echo "<h3>$title_link</h3>";
echo "<div class=\"elgg-subtext\">$subtitle</div>";
echo $tags;
+
+echo elgg_view('object/summary/extend', $vars);
+
if ($content) {
echo "<div class=\"elgg-content\">$content</div>";
}