From ac4a1fc0f000f2018ff3bd10883f71d48aed6f62 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 17 Dec 2010 02:24:39 +0000 Subject: updated riverdashboard plugin to use new river display code - javascript code currently broken for comments and likes git-svn-id: http://code.elgg.org/elgg/trunk@7652 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/riverdashboard/index.php | 2 +- mod/riverdashboard/start.php | 22 +++- .../views/default/riverdashboard/css.php | 24 ++-- .../views/default/riverdashboard/js.php | 2 +- .../views/default/riverdashboard/river/body.php | 38 ++++++ .../views/default/riverdashboard/river/footer.php | 131 +++++++++++++++++++++ .../views/default/riverdashboard/rivercomment.php | 2 +- views/default/forms/likes/display.php | 2 +- 8 files changed, 206 insertions(+), 17 deletions(-) create mode 100644 mod/riverdashboard/views/default/riverdashboard/river/body.php create mode 100644 mod/riverdashboard/views/default/riverdashboard/river/footer.php diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php index 2bc5f949c..802536416 100644 --- a/mod/riverdashboard/index.php +++ b/mod/riverdashboard/index.php @@ -62,7 +62,7 @@ if (empty($callback)) { 'content' => $title . $body, 'sidebar' => $sidebar ); - $body = elgg_view_layout('one_column_with_sidebar', $params); + $body = elgg_view_layout('one_sidebar', $params); echo elgg_view_page($title_wording, $body); } else { header("Content-type: text/html; charset=UTF-8"); diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php index 71eef330e..e42bc6e01 100644 --- a/mod/riverdashboard/start.php +++ b/mod/riverdashboard/start.php @@ -205,7 +205,6 @@ $posted_max = 0) { " ORDER BY e.last_action desc LIMIT {$offset}, {$limit}"; // Get data - //return get_data($sql); return get_data($sql, 'elgg_row_to_elgg_river_item'); } @@ -348,6 +347,25 @@ $posted_max = 0, $pagination = true) { * @return string|false Depending on success */ function riverdashboard_view_river_item($item) { + + if (!$item || !$item->getView() || !elgg_view_exists($item->getView())) { + return ''; + } + + $subject = $item->getSubjectEntity(); + $object = $item->getObjectEntity(); + if (!$subject || !$object) { + // subject is disabled or subject/object deleted + return ''; + } + + $vars = array( + 'pict' => elgg_view('core/river/image', array('item' => $item)), + 'body' => elgg_view('riverdashboard/river/body', array('item' => $item)), + 'class' => 'elgg-river-item', + ); + return elgg_view('layout/objects/media', $vars); +/* if (isset($item->view)) { $object = get_entity($item->object_guid); $subject = get_entity($item->subject_guid); @@ -367,4 +385,6 @@ function riverdashboard_view_river_item($item) { )); } return false; + * + */ } diff --git a/mod/riverdashboard/views/default/riverdashboard/css.php b/mod/riverdashboard/views/default/riverdashboard/css.php index f4870d116..29d0d6bb8 100644 --- a/mod/riverdashboard/views/default/riverdashboard/css.php +++ b/mod/riverdashboard/views/default/riverdashboard/css.php @@ -29,14 +29,14 @@ } /* RIVER ENTRY */ -.river-item { +.elgg-river-item { border-bottom:1px solid #cccccc; padding:7px 0 7px 0; } -.river-item p { +.elgg-river-item p { margin:0; } -.river-item .entity-subtext { +.elgg-river-item .entity-subtext { display: block; line-height: 1.4em; } @@ -120,26 +120,26 @@ margin-left: 7px; } /* hidden list of users that liked item */ -.river-item .elgg-likes-user { +.elgg-likes-user { border-bottom:1px solid white; padding:3px; } -.river-item .elgg-likes-user .entity-listing-icon { +.elgg-likes-user .entity-listing-icon { margin:3px 0 4px 2px; } -.river-item .elgg-likes-user .entity-listing-info { +.elgg-likes-user .entity-listing-info { width:635px; } #profile-content .river-item .elgg-likes-user .entity-listing-info { /* when likes is displayed on profile page activity stream */ width:600px; } -.river-item .elgg-likes-user .entity-metadata { +.elgg-likes-user .entity-metadata { margin-top:3px; } -.river-item p.elgg-likes-owner { +p.elgg-likes-owner { padding-top:0; } -.river-item a.river-more-comments { +a.river-more-comments { display:block; float:right; padding:1px 7px 1px 7px; @@ -154,14 +154,14 @@ -webkit-border-top-left-radius:4px; -webkit-border-top-right-radius:4px; } -.river-item a.river-more-comments.off { +a.river-more-comments.off { background-color: white; } -.river-item .river-comment-owner-icon { +.river-comment-owner-icon { float:left; margin:3px 8px 4px 2px; } -.river-item .river-comment-contents { +.river-comment-contents { margin-left:34px; } a.river-more-comments { diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php index 09b1113d8..9286d33fe 100644 --- a/mod/riverdashboard/views/default/riverdashboard/js.php +++ b/mod/riverdashboard/views/default/riverdashboard/js.php @@ -1,7 +1,7 @@