aboutsummaryrefslogtreecommitdiff
path: root/views/default/river
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-29 12:33:10 -0400
committercash <cash.costello@gmail.com>2011-10-29 12:33:10 -0400
commit82da6bff73a99d18bbe2363c7e30aaf6d3fc949f (patch)
treebdd9e5bbfc718404223fb2ccbb48fa7ddf38c8ad /views/default/river
parentf0c096448105b0f88c03221414ded5fb765fe595 (diff)
downloadelgg-82da6bff73a99d18bbe2363c7e30aaf6d3fc949f.tar.gz
elgg-82da6bff73a99d18bbe2363c7e30aaf6d3fc949f.tar.bz2
adds a river layout view that all river views should use
Diffstat (limited to 'views/default/river')
-rw-r--r--views/default/river/annotation/generic_comment/create.php2
-rw-r--r--views/default/river/elements/layout.php14
-rw-r--r--views/default/river/item.php28
-rw-r--r--views/default/river/relationship/friend/create.php2
-rw-r--r--views/default/river/user/default/profileiconupdate.php3
-rw-r--r--views/default/river/user/default/profileupdate.php2
6 files changed, 40 insertions, 11 deletions
diff --git a/views/default/river/annotation/generic_comment/create.php b/views/default/river/annotation/generic_comment/create.php
index d3db68e41..7d586450d 100644
--- a/views/default/river/annotation/generic_comment/create.php
+++ b/views/default/river/annotation/generic_comment/create.php
@@ -5,7 +5,7 @@
$object = $vars['item']->getObjectEntity();
$comment = $vars['item']->getAnnotation();
-echo elgg_view('river/item', array(
+echo elgg_view('river/elements/layout', array(
'item' => $vars['item'],
'message' => elgg_get_excerpt($comment->value),
));
diff --git a/views/default/river/elements/layout.php b/views/default/river/elements/layout.php
new file mode 100644
index 000000000..94622e272
--- /dev/null
+++ b/views/default/river/elements/layout.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Layout of a river item
+ *
+ * @uses $vars['item'] ElggRiverItem
+ */
+
+$item = $vars['item'];
+
+echo elgg_view('page/components/image_block', array(
+ 'image' => elgg_view('river/elements/image', $vars),
+ 'body' => elgg_view('river/elements/body', $vars),
+ 'class' => 'elgg-river-item',
+));
diff --git a/views/default/river/item.php b/views/default/river/item.php
index 94622e272..75767e08d 100644
--- a/views/default/river/item.php
+++ b/views/default/river/item.php
@@ -1,14 +1,30 @@
<?php
/**
- * Layout of a river item
+ * Primary river item view
+ *
+ * Calls the individual view saved for that river item. Most of these
+ * individual river views then use the views in river/elements.
*
* @uses $vars['item'] ElggRiverItem
*/
+// @todo remove this in Elgg 1.9
+global $_elgg_special_river_catch;
+if (!isset($_elgg_special_river_catch)) {
+ $_elgg_special_river_catch = false;
+}
+if ($_elgg_special_river_catch) {
+ // we changed the views a little in 1.8.1 so this catches the plugins that
+ // were updated in 1.8.0 and redirects to the layout view
+ echo elgg_view('river/elements/layout', $vars);
+ return true;
+}
+$_elgg_special_river_catch = true;
+
+
$item = $vars['item'];
-echo elgg_view('page/components/image_block', array(
- 'image' => elgg_view('river/elements/image', $vars),
- 'body' => elgg_view('river/elements/body', $vars),
- 'class' => 'elgg-river-item',
-));
+echo elgg_view($item->getView(), $vars);
+
+
+$_elgg_special_river_catch = false;
diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php
index a191e7b1e..0408d79e1 100644
--- a/views/default/river/relationship/friend/create.php
+++ b/views/default/river/relationship/friend/create.php
@@ -8,7 +8,7 @@ $object = $vars['item']->getObjectEntity();
$subject_icon = elgg_view_entity_icon($subject, 'tiny');
$object_icon = elgg_view_entity_icon($object, 'tiny');
-echo elgg_view('river/item', array(
+echo elgg_view('river/elements/layout', array(
'item' => $vars['item'],
'attachments' => $subject_icon . elgg_view_icon('arrow-right') . $object_icon,
));
diff --git a/views/default/river/user/default/profileiconupdate.php b/views/default/river/user/default/profileiconupdate.php
index 90daab1a7..160ffd252 100644
--- a/views/default/river/user/default/profileiconupdate.php
+++ b/views/default/river/user/default/profileiconupdate.php
@@ -3,7 +3,6 @@
* Update avatar river view
*/
-
$subject = $vars['item']->getSubjectEntity();
$subject_link = elgg_view('output/url', array(
@@ -15,7 +14,7 @@ $subject_link = elgg_view('output/url', array(
$string = elgg_echo('river:update:user:avatar', array($subject_link));
-echo elgg_view('river/item', array(
+echo elgg_view('river/elements/layout', array(
'item' => $vars['item'],
'summary' => $string,
'attachments' => elgg_view_entity_icon($subject, 'tiny', array('hover' => false)),
diff --git a/views/default/river/user/default/profileupdate.php b/views/default/river/user/default/profileupdate.php
index 69b69b106..ce72970d6 100644
--- a/views/default/river/user/default/profileupdate.php
+++ b/views/default/river/user/default/profileupdate.php
@@ -14,7 +14,7 @@ $subject_link = elgg_view('output/url', array(
$string = elgg_echo('river:update:user:profile', array($subject_link));
-echo elgg_view('river/item', array(
+echo elgg_view('river/elements/layout', array(
'item' => $vars['item'],
'summary' => $string,
));