diff options
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"); ?>: |