From 02a52af62e1579ad174b1160071b82ec11ee31e3 Mon Sep 17 00:00:00 2001 From: brettp Date: Sat, 19 Feb 2011 19:31:34 +0000 Subject: Refs #2916. More cleanup of the messageboard widget. git-svn-id: http://code.elgg.org/elgg/trunk@8344 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/annotation/messageboard.php | 11 ++++ mod/messageboard/views/default/messageboard/js.php | 31 ++++++++++- .../default/messageboard/messageboard_content.php | 61 ---------------------- .../views/default/widgets/messageboard/content.php | 28 +++++++--- .../views/default/widgets/messageboard/edit.php | 4 +- 5 files changed, 62 insertions(+), 73 deletions(-) create mode 100644 mod/messageboard/views/default/annotation/messageboard.php delete mode 100644 mod/messageboard/views/default/messageboard/messageboard_content.php (limited to 'mod/messageboard/views/default') diff --git a/mod/messageboard/views/default/annotation/messageboard.php b/mod/messageboard/views/default/annotation/messageboard.php new file mode 100644 index 000000000..fa4b43ff3 --- /dev/null +++ b/mod/messageboard/views/default/annotation/messageboard.php @@ -0,0 +1,11 @@ + - -
- - -
- get_entity($vars['annotation']->owner_guid), 'size' => 'tiny')); - ?> -
- - -

- owner_guid)->name . " " . elgg_view_friendly_time($vars['annotation']->time_created); ?> -

- - -
parse_urls($vars['annotation']->value))); ?>
-
- - canEdit()) { - - - echo "
" . elgg_view("output/confirmlink",array( - 'href' => "action/messageboard/delete?annotation_id=" . $vars['annotation']->id, - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm'), - )) . "
"; - - } //end of can edit if statement - ?> - owner_guid != elgg_get_logged_in_user_guid()) { - - //get the message owner - $msg_owner = get_entity($vars['annotation']->owner_guid); - //create the url to their messageboard - $user_mb = "pg/messageboard/" . $msg_owner->username; - - echo "".elgg_echo('messageboard:replyon')." " . $msg_owner->name . "'s " . elgg_echo('messageboard:messageboard') . " | "; - - echo "" . elgg_echo('messageboard:history') . ""; - } - ?> - -
-
-
diff --git a/mod/messageboard/views/default/widgets/messageboard/content.php b/mod/messageboard/views/default/widgets/messageboard/content.php index 5f0cc8676..7ec3e5d4e 100644 --- a/mod/messageboard/views/default/widgets/messageboard/content.php +++ b/mod/messageboard/views/default/widgets/messageboard/content.php @@ -6,7 +6,7 @@ * @package ElggMessageBoard */ -$user = elgg_get_page_owner_entity(); +$owner = elgg_get_page_owner_entity(); $num_display = 5; if (isset($vars['entity']->num_display)) { @@ -14,12 +14,26 @@ if (isset($vars['entity']->num_display)) { } if (elgg_is_logged_in()) { - echo elgg_view_form('messageboard/add', array('class' => 'elgg-messageboard')); + echo elgg_view_form('messageboard/add', array('name' => 'elgg-messageboard')); } -//this for the first time the page loads, grab the latest messages. -$contents = $user->getAnnotations('messageboard', $num_display, 0, 'desc'); +$options = array( + 'annotations_name' => 'messageboard', + 'guid' => $owner->getGUID(), + 'limit' => $num_display, + 'pagination' => false, + 'reverse_order_by' => true +); -if ($contents) { - echo elgg_view('messageboard/messageboard', array('annotation' => $contents)); -} \ No newline at end of file +echo elgg_list_annotations($options); + +if ($owner instanceof ElggGroup) { + $url = "pg/messageboard/group/$owner->guid/owner"; +} else { + $url = "pg/messageboard/owner/$owner->username"; +} + +echo elgg_view('output/url', array( + 'href' => $url, + 'text' => elgg_echo('messageboard:viewall') +)); \ No newline at end of file diff --git a/mod/messageboard/views/default/widgets/messageboard/edit.php b/mod/messageboard/views/default/widgets/messageboard/edit.php index 470d49060..2157da6c4 100644 --- a/mod/messageboard/views/default/widgets/messageboard/edit.php +++ b/mod/messageboard/views/default/widgets/messageboard/edit.php @@ -1,18 +1,16 @@ num_display)) { $num_display = $vars['entity']->num_display; } - ?>

: -- cgit v1.2.3