diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-19 19:31:34 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-19 19:31:34 +0000 |
commit | 02a52af62e1579ad174b1160071b82ec11ee31e3 (patch) | |
tree | cd14f5338df64b69dffb03499ce7222f93c9f988 /mod/messageboard/views/default/widgets | |
parent | 93cf8041ef996eae3912116cee572f7ff26efc92 (diff) | |
download | elgg-02a52af62e1579ad174b1160071b82ec11ee31e3.tar.gz elgg-02a52af62e1579ad174b1160071b82ec11ee31e3.tar.bz2 |
Refs #2916. More cleanup of the messageboard widget.
git-svn-id: http://code.elgg.org/elgg/trunk@8344 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/messageboard/views/default/widgets')
-rw-r--r-- | mod/messageboard/views/default/widgets/messageboard/content.php | 28 | ||||
-rw-r--r-- | mod/messageboard/views/default/widgets/messageboard/edit.php | 4 |
2 files changed, 22 insertions, 10 deletions
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 @@ <?php - /** * Elgg message board widget edit view * * @package ElggMessageBoard */ -// default value $num_display = 5; + if (isset($vars['entity']->num_display)) { $num_display = $vars['entity']->num_display; } - ?> <p> <?php echo elgg_echo("messageboard:num_display"); ?>: |