aboutsummaryrefslogtreecommitdiff
path: root/views/default/river/elements
diff options
context:
space:
mode:
authorEvan Winslow <evan@elgg.org>2011-06-08 02:31:30 -0700
committerEvan Winslow <evan@elgg.org>2011-06-08 02:31:30 -0700
commit1fd8bd6e296e2b1fc960fde1dd204b6c4e3e8aec (patch)
tree36da4522942dd749e82e9f33c0213cbedbb3d5f2 /views/default/river/elements
parent8ddeb1f6e37dc1647e9bee4f3cfe35adcb2ca004 (diff)
downloadelgg-1fd8bd6e296e2b1fc960fde1dd204b6c4e3e8aec.tar.gz
elgg-1fd8bd6e296e2b1fc960fde1dd204b6c4e3e8aec.tar.bz2
River revamp for 1.8
Diffstat (limited to 'views/default/river/elements')
-rw-r--r--views/default/river/elements/body.php55
-rw-r--r--views/default/river/elements/summary.php36
2 files changed, 74 insertions, 17 deletions
diff --git a/views/default/river/elements/body.php b/views/default/river/elements/body.php
index f9ecbc03c..a76cae909 100644
--- a/views/default/river/elements/body.php
+++ b/views/default/river/elements/body.php
@@ -6,28 +6,49 @@
*/
$item = $vars['item'];
-$subject = $item->getSubjectEntity();
+
+$menu = elgg_view_menu('river', array('item' => $item, 'sort_by' => 'priority'));
// river item header
-$params = array(
- 'href' => $subject->getURL(),
- 'text' => $subject->name,
-);
-$subject_link = elgg_view('output/url', $params);
$timestamp = elgg_get_friendly_time($item->getPostedTime());
-$header = elgg_view_menu('river', array('item' => $item, 'sort_by' => 'priority'));
-$header .= "$subject_link <span class=\"elgg-river-timestamp\">$timestamp</span>";
+$summary = elgg_extract('summary', $vars, elgg_view('river/elements/summary', array('item' => $vars['item'])));
+if ($summary === false) {
+ $subject = $item->getSubjectEntity();
+ $summary = elgg_view('output/url', array(
+ 'href' => $subject->getURL(),
+ 'text' => $subject->name,
+ 'class' => 'elgg-river-subject',
+ ));
+}
+
+$message = elgg_extract('message', $vars, false);
+if ($message !== false) {
+ $message = "<div class=\"elgg-river-message\">$message</div>";
+}
-// body
-$body = elgg_view($item->getView(), array('item' => $item));
+$attachments = elgg_extract('attachments', $vars, false);
+if ($attachments !== false) {
+ $attachments = "<div class=\"elgg-river-attachments\">$attachments</div>";
+}
-// footer
$footer = elgg_view('river/elements/footer', $vars);
-echo elgg_view('page/components/module', array(
- 'header' => $header,
- 'body' => $body,
- 'footer' => $footer,
- 'class' => 'mbn',
-)); \ No newline at end of file
+$group_string = '';
+$object = $item->getObjectEntity();
+$container = $object->getContainerEntity();
+if ($container instanceof ElggGroup && $container->guid != elgg_get_page_owner_guid()) {
+ $group_link = elgg_view('output/url', array(
+ 'href' => $container->getURL(),
+ 'text' => $container->name,
+ ));
+ $group_string = elgg_echo('river:ingroup', array($group_link));
+}
+
+echo <<<RIVER
+$menu
+<div class="elgg-river-summary">$summary $group_string <span class="elgg-river-timestamp">$timestamp</span></div>
+$message
+$attachments
+$footer
+RIVER;
diff --git a/views/default/river/elements/summary.php b/views/default/river/elements/summary.php
new file mode 100644
index 000000000..eee8754e2
--- /dev/null
+++ b/views/default/river/elements/summary.php
@@ -0,0 +1,36 @@
+<?php
+
+$item = $vars['item'];
+
+$subject = $item->getSubjectEntity();
+$object = $item->getObjectEntity();
+$target = $object->getContainerEntity();
+
+$subject_link = elgg_view('output/url', array(
+ 'href' => $subject->getURL(),
+ 'text' => $subject->name,
+ 'class' => 'elgg-river-subject',
+));
+
+$object_link = elgg_view('output/url', array(
+ 'href' => $object->getURL(),
+ 'text' => $object->title ? $object->title : $object->name,
+ 'class' => 'elgg-river-object',
+));
+
+$action = $item->action_type;
+$type = $item->type;
+$subtype = $item->subtype ? $item->subtype : 'default';
+
+$container = $object->getContainerEntity();
+if ($container instanceof ElggGroup) {
+ $params = array(
+ 'href' => $container->getURL(),
+ 'text' => $container->name,
+ );
+ $group_link = elgg_view('output/url', $params);
+ $group_string = elgg_echo('river:ingroup', array($group_link));
+}
+
+
+echo elgg_echo("river:$action:$type:$subtype", array($subject_link, $object_link)); \ No newline at end of file