aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-10-29 09:35:46 -0700
committerCash Costello <cash.costello@gmail.com>2011-10-29 09:35:46 -0700
commit96fa5ba183d4ea5fb01d4f5a44c808dcb3291b72 (patch)
treebdd9e5bbfc718404223fb2ccbb48fa7ddf38c8ad /views
parentf0c096448105b0f88c03221414ded5fb765fe595 (diff)
parent82da6bff73a99d18bbe2363c7e30aaf6d3fc949f (diff)
downloadelgg-96fa5ba183d4ea5fb01d4f5a44c808dcb3291b72.tar.gz
elgg-96fa5ba183d4ea5fb01d4f5a44c808dcb3291b72.tar.bz2
Merge pull request #82 from cash/add_river_item_view
Fixes #4017 by making river/item the first view called by elgg_view_river_item()
Diffstat (limited to 'views')
-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,
));