aboutsummaryrefslogtreecommitdiff
path: root/mod/riverdashboard
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-17 01:36:31 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-17 01:36:31 +0000
commitce9103a0bcb606cc6b8b177c2244efdc17c9b547 (patch)
tree217877ac7b6674d7b3385d6169bf72094a2fb2a8 /mod/riverdashboard
parentbc21e6778ffd5b4b4f2828fd720dc6590870f46f (diff)
downloadelgg-ce9103a0bcb606cc6b8b177c2244efdc17c9b547.tar.gz
elgg-ce9103a0bcb606cc6b8b177c2244efdc17c9b547.tar.bz2
updated riverdashboard to load the river item class
git-svn-id: http://code.elgg.org/elgg/trunk@7651 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard')
-rw-r--r--mod/riverdashboard/endpoint/ping.php2
-rw-r--r--mod/riverdashboard/index.php2
-rw-r--r--mod/riverdashboard/start.php15
-rw-r--r--mod/riverdashboard/views/default/river/item/list.php2
4 files changed, 11 insertions, 10 deletions
diff --git a/mod/riverdashboard/endpoint/ping.php b/mod/riverdashboard/endpoint/ping.php
index 239582bf2..94c6fe377 100644
--- a/mod/riverdashboard/endpoint/ping.php
+++ b/mod/riverdashboard/endpoint/ping.php
@@ -21,7 +21,7 @@ $last_reload = time() - $seconds_passed;
// @todo Remove this when elgg_get_river-items() supports 1.7-style API and count => TRUE and not group by object_guid
// river table does not have columns expected by get_access_sql_suffix so we modify its output
-$access = str_replace("and enabled='yes'", '', str_replace('owner_guid', 'subject_guid', get_access_sql_suffix_new('r', 'e')));
+$access = str_replace("and enabled='yes'", '', str_replace('owner_guid', 'subject_guid', riverdashboard_get_access_sql_suffix('r', 'e')));
$q = "SELECT COUNT(id) as all_activity FROM {$CONFIG->dbprefix}river r, {$CONFIG->dbprefix}entities e
WHERE r.posted > $last_reload AND r.object_guid = e.guid AND ($access)";
diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php
index be516b150..2bc5f949c 100644
--- a/mod/riverdashboard/index.php
+++ b/mod/riverdashboard/index.php
@@ -41,7 +41,7 @@ switch($orient) {
$title .= elgg_view_title($title_wording);
$extend = elgg_view("activity/extend");
-$river = elgg_view_river_items_new($subject_guid, 0, $relationship_type, $type, $subtype, '', 20, 0, 0, TRUE);
+$river = riverdashboard_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '', 20, 0, 0, TRUE);
// Replacing callback calls in the nav with something meaningless
$river = str_replace('callback=true', 'replaced=88,334', $river);
diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php
index f7421e1cd..71eef330e 100644
--- a/mod/riverdashboard/start.php
+++ b/mod/riverdashboard/start.php
@@ -104,7 +104,7 @@ function riverdashboard_ecml_views_hook($hook, $entity_type, $return_value, $par
*
* @return array|false Depending on success
*/
-function elgg_get_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '',
+function riverdashboard_get_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '',
$type = '', $subtype = '', $action_type = '', $limit = 10, $offset = 0, $posted_min = 0,
$posted_max = 0) {
@@ -144,7 +144,7 @@ $posted_max = 0) {
$where = array();
// river table does not have columns expected by get_access_sql_suffix so we modify its output
$where[] = str_replace("and enabled='yes'", '',
- str_replace('owner_guid', 'subject_guid', get_access_sql_suffix_new('er', 'e')));
+ str_replace('owner_guid', 'subject_guid', riverdashboard_get_access_sql_suffix('er', 'e')));
if (empty($subject_relationship)) {
if (!empty($subject_guid)) {
@@ -205,7 +205,8 @@ $posted_max = 0) {
" ORDER BY e.last_action desc LIMIT {$offset}, {$limit}";
// Get data
- return get_data($sql);
+ //return get_data($sql);
+ return get_data($sql, 'elgg_row_to_elgg_river_item');
}
/**
@@ -221,7 +222,7 @@ $posted_max = 0) {
*
* @return string
*/
-function get_access_sql_suffix_new($table_prefix_one = '', $table_prefix_two = '', $owner = null) {
+function riverdashboard_get_access_sql_suffix($table_prefix_one = '', $table_prefix_two = '', $owner = null) {
global $ENTITY_SHOW_HIDDEN_OVERRIDE, $CONFIG;
$sql = "";
@@ -314,14 +315,14 @@ function get_access_sql_suffix_new($table_prefix_one = '', $table_prefix_two = '
*
* @return string Human-readable river.
*/
-function elgg_view_river_items_new($subject_guid = 0, $object_guid = 0, $subject_relationship = '',
+function riverdashboard_view_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '',
$type = '', $subtype = '', $action_type = '', $limit = 20, $posted_min = 0,
$posted_max = 0, $pagination = true) {
// Get input from outside world and sanitise it
$offset = (int) get_input('offset', 0);
- $riveritems = elgg_get_river_items($subject_guid, $object_guid, $subject_relationship, $type,
+ $riveritems = riverdashboard_get_river_items($subject_guid, $object_guid, $subject_relationship, $type,
$subtype, $action_type, ($limit + 1), $offset, $posted_min, $posted_max);
// Get river items, if they exist
@@ -346,7 +347,7 @@ $posted_max = 0, $pagination = true) {
*
* @return string|false Depending on success
*/
-function elgg_view_river_item_new($item) {
+function riverdashboard_view_river_item($item) {
if (isset($item->view)) {
$object = get_entity($item->object_guid);
$subject = get_entity($item->subject_guid);
diff --git a/mod/riverdashboard/views/default/river/item/list.php b/mod/riverdashboard/views/default/river/item/list.php
index d09f5de1c..fb0656022 100644
--- a/mod/riverdashboard/views/default/river/item/list.php
+++ b/mod/riverdashboard/views/default/river/item/list.php
@@ -5,7 +5,7 @@ if (isset($vars['items']) && is_array($vars['items'])) {
$i = 0;
if (!empty($vars['items'])) {
foreach($vars['items'] as $item) {
- echo elgg_view_river_item_new($item);
+ echo riverdashboard_view_river_item($item);
$i++;
if ($i >= $vars['limit']) {
break;