From 5260a05075a15e1a0a02fa1f261fe38370498ff2 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 1 Mar 2011 01:29:43 +0000 Subject: cleaned up the messageboard plugin further git-svn-id: http://code.elgg.org/elgg/trunk@8516 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/messageboard/languages/en.php | 9 ++---- .../views/default/annotation/messageboard.php | 2 +- .../views/default/forms/messageboard/add.php | 10 +++--- .../views/default/messageboard/messageboard.php | 30 ------------------ .../default/river/object/messageboard/create.php | 24 ++++++++++++--- .../views/default/widgets/messageboard/content.php | 11 ++----- .../views/default/widgets/messageboard/edit.php | 36 +++++++++------------- 7 files changed, 44 insertions(+), 78 deletions(-) delete mode 100644 mod/messageboard/views/default/messageboard/messageboard.php (limited to 'mod/messageboard') diff --git a/mod/messageboard/languages/en.php b/mod/messageboard/languages/en.php index 2ae6f3a49..d8ccbdeee 100644 --- a/mod/messageboard/languages/en.php +++ b/mod/messageboard/languages/en.php @@ -25,12 +25,9 @@ $english = array( /** * Message board widget river - **/ - - 'messageboard:river:annotate' => "%s has had a new comment posted on their message board.", - 'messageboard:river:create' => "%s added the message board widget.", - 'messageboard:river:update' => "%s updated their message board widget.", - 'messageboard:river:added' => "%s posted on", + */ + 'messageboard:river:added' => "posted on", + 'messageboard:river:user' => "%s's", 'messageboard:river:messageboard' => "message board", diff --git a/mod/messageboard/views/default/annotation/messageboard.php b/mod/messageboard/views/default/annotation/messageboard.php index fa4b43ff3..595cc6db4 100644 --- a/mod/messageboard/views/default/annotation/messageboard.php +++ b/mod/messageboard/views/default/annotation/messageboard.php @@ -8,4 +8,4 @@ $vars['delete_action'] = 'action/messageboard/delete'; -echo elgg_view('annotation/generic_comment', $vars); \ No newline at end of file +echo elgg_view('annotation/default', $vars); \ No newline at end of file diff --git a/mod/messageboard/views/default/forms/messageboard/add.php b/mod/messageboard/views/default/forms/messageboard/add.php index 4698abf28..2bca4e1dc 100644 --- a/mod/messageboard/views/default/forms/messageboard/add.php +++ b/mod/messageboard/views/default/forms/messageboard/add.php @@ -1,21 +1,19 @@ 'message_content' )); -$owner_input = elgg_view('input/hidden', array( +echo elgg_view('input/hidden', array( 'name' => 'owner_guid', 'value' => elgg_get_page_owner_guid() )); -$submit = elgg_view('input/submit', array( +echo elgg_view('input/submit', array( 'value' => elgg_echo('post') )); - -echo $textarea . $owner_input . $submit; \ No newline at end of file diff --git a/mod/messageboard/views/default/messageboard/messageboard.php b/mod/messageboard/views/default/messageboard/messageboard.php deleted file mode 100644 index f78451c84..000000000 --- a/mod/messageboard/views/default/messageboard/messageboard.php +++ /dev/null @@ -1,30 +0,0 @@ - 0) { - - //start the div which will wrap all the message board contents - echo "
"; - - //loop through all annotations and display - foreach($vars['annotation'] as $content) { - - echo elgg_view("messageboard/messageboard_content", array('annotation' => $content)); - - } - - //close the wrapper div - echo "
"; - -} else { - - echo "
" . elgg_echo("messageboard:none") . "
"; - -} diff --git a/mod/messageboard/views/default/river/object/messageboard/create.php b/mod/messageboard/views/default/river/object/messageboard/create.php index 3bdf595d1..0268930bf 100644 --- a/mod/messageboard/views/default/river/object/messageboard/create.php +++ b/mod/messageboard/views/default/river/object/messageboard/create.php @@ -1,10 +1,24 @@ subject_guid); -$performed_on = get_entity($vars['item']->object_guid); +$performed_by = $vars['item']->getSubjectEntity(); +$performed_on = $vars['item']->getObjectEntity(); -$url = "getURL()}\">{$performed_by->name}"; -$string = elgg_echo("messageboard:river:added", array($url)) . " getURL()}\">" . $performed_on->name . "'s " . elgg_echo("messageboard:river:messageboard"); +$comment = $vars['item']->getAnnotation(); +$link = elgg_view('output/url', array( + 'href' => $performed_on->getURL(), + 'text' => elgg_echo('messageboard:river:user', array($performed_on->name)), +)); -echo $string; +echo elgg_echo("messageboard:river:added"); +echo " $link "; +echo elgg_echo("messageboard:river:messageboard"); + +if ($comment) { + echo '
'; + echo elgg_get_excerpt($comment->value); + echo '
'; +} diff --git a/mod/messageboard/views/default/widgets/messageboard/content.php b/mod/messageboard/views/default/widgets/messageboard/content.php index 7ec3e5d4e..04dbb00d2 100644 --- a/mod/messageboard/views/default/widgets/messageboard/content.php +++ b/mod/messageboard/views/default/widgets/messageboard/content.php @@ -2,16 +2,11 @@ /** * Elgg messageboard widget view * - * - * @package ElggMessageBoard */ $owner = elgg_get_page_owner_entity(); -$num_display = 5; -if (isset($vars['entity']->num_display)) { - $num_display = $vars['entity']->num_display; -} +$num_display = $vars['entity']->num_display; if (elgg_is_logged_in()) { echo elgg_view_form('messageboard/add', array('name' => 'elgg-messageboard')); @@ -22,7 +17,7 @@ $options = array( 'guid' => $owner->getGUID(), 'limit' => $num_display, 'pagination' => false, - 'reverse_order_by' => true + 'reverse_order_by' => true, ); echo elgg_list_annotations($options); @@ -35,5 +30,5 @@ if ($owner instanceof ElggGroup) { echo elgg_view('output/url', array( 'href' => $url, - 'text' => elgg_echo('messageboard:viewall') + '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 2157da6c4..74848f832 100644 --- a/mod/messageboard/views/default/widgets/messageboard/edit.php +++ b/mod/messageboard/views/default/widgets/messageboard/edit.php @@ -1,30 +1,22 @@ num_display)) { - $num_display = $vars['entity']->num_display; +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 5; } -?> -

- : - -

\ No newline at end of file +
+ : + +
-- cgit v1.2.3