From 4ae064871ba9dca9f03e095671db48815632d070 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 12 May 2010 23:31:00 +0000 Subject: merging messageboard cleanup from 1.7 branch [5908],[5909],[5917] git-svn-id: http://code.elgg.org/elgg/trunk@6019 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/messageboard/css.php | 4 - .../views/default/messageboard/forms/add.php | 49 +++--- .../default/messageboard/group_messageboard.php | 96 ------------ .../views/default/messageboard/messageboard.php | 67 ++++----- .../default/messageboard/messageboard_content.php | 110 +++++++------- .../default/river/object/messageboard/create.php | 14 +- .../views/default/widgets/messageboard/edit.php | 52 ++++--- .../views/default/widgets/messageboard/view.php | 165 ++++++++++----------- 8 files changed, 224 insertions(+), 333 deletions(-) delete mode 100644 mod/messageboard/views/default/messageboard/group_messageboard.php (limited to 'mod/messageboard/views/default') diff --git a/mod/messageboard/views/default/messageboard/css.php b/mod/messageboard/views/default/messageboard/css.php index 0bf150bc2..2dd25a364 100644 --- a/mod/messageboard/views/default/messageboard/css.php +++ b/mod/messageboard/views/default/messageboard/css.php @@ -89,7 +89,3 @@ p.message_item_timestamp { background-position: 0 -16px; } - - - - diff --git a/mod/messageboard/views/default/messageboard/forms/add.php b/mod/messageboard/views/default/messageboard/forms/add.php index 91337fdc9..f835e8af0 100644 --- a/mod/messageboard/views/default/messageboard/forms/add.php +++ b/mod/messageboard/views/default/messageboard/forms/add.php @@ -1,32 +1,29 @@ - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - +/** + * Elgg Message board add form + * + * @package ElggMessageBoard + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + ?>
-
- - -
- - - - - - + + + +
+ + + + + + + + - - - - - -
+
diff --git a/mod/messageboard/views/default/messageboard/group_messageboard.php b/mod/messageboard/views/default/messageboard/group_messageboard.php deleted file mode 100644 index 8662d45ac..000000000 --- a/mod/messageboard/views/default/messageboard/group_messageboard.php +++ /dev/null @@ -1,96 +0,0 @@ - - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - - // get the groups passed over here - - //get the full page owner entity - $entity = $vars['entity']; - - $num_display = 10; - -?> - - -
- -

- -guid, $_SESSION['guid'])){ -?> - - - - - - - - - - - - - - -
- -
- - -
- - - -
- - - getAnnotations('messageboard', $num_display, 0, 'desc'); - - //as long as there is some content to display, display it - if (!empty($contents)) { - - echo elgg_view('messageboard/messageboard',array('annotation' => $contents)); - - } else { - - //put the required div on the page for the first message - echo "
"; - - } - - ?> diff --git a/mod/messageboard/views/default/messageboard/messageboard.php b/mod/messageboard/views/default/messageboard/messageboard.php index bb563d7fb..92c880593 100644 --- a/mod/messageboard/views/default/messageboard/messageboard.php +++ b/mod/messageboard/views/default/messageboard/messageboard.php @@ -1,37 +1,34 @@ - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - - - // If there is any content to view, view it - if (is_array($vars['annotation']) && sizeof($vars['annotation']) > 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") . "
"; - - } - - -?> \ No newline at end of file +/** + * Elgg Message board display page + * + * @package ElggMessageBoard + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + + +// If there is any content to view, view it +if (is_array($vars['annotation']) && sizeof($vars['annotation']) > 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/messageboard/messageboard_content.php b/mod/messageboard/views/default/messageboard/messageboard_content.php index 86240e910..41a308892 100644 --- a/mod/messageboard/views/default/messageboard/messageboard_content.php +++ b/mod/messageboard/views/default/messageboard/messageboard_content.php @@ -1,65 +1,65 @@ - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - +/** + * Elgg Message board individual item display view + * + * @package ElggMessageBoard + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + ?>
- - -
- get_entity($vars['annotation']->owner_guid), 'size' => 'tiny')); - ?> -
- - -

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

- + + +
+ get_entity($vars['annotation']->owner_guid), 'size' => 'tiny')); + ?> +
+ + +

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

+
parse_urls($vars['annotation']->value))); ?>
- - canEdit()) { - - - echo "
" . elgg_view("output/confirmlink",array( - 'href' => $vars['url'] . "action/messageboard/delete?annotation_id=" . $vars['annotation']->id, - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm'), - )) . "
"; - - } //end of can edit if statement - ?> -owner_guid != get_loggedin_userid()){ - - //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') . ""; - } -?> - -
+ + canEdit()) { + + + echo "
" . elgg_view("output/confirmlink",array( + 'href' => $vars['url'] . "action/messageboard/delete?annotation_id=" . $vars['annotation']->id, + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + )) . "
"; + + } //end of can edit if statement + ?> + owner_guid != get_loggedin_userid()) { + + //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/river/object/messageboard/create.php b/mod/messageboard/views/default/river/object/messageboard/create.php index 9f65122d0..88bbd56aa 100644 --- a/mod/messageboard/views/default/river/object/messageboard/create.php +++ b/mod/messageboard/views/default/river/object/messageboard/create.php @@ -1,12 +1,10 @@ subject_guid); // $statement->getSubject(); - $performed_on = get_entity($vars['item']->object_guid); +$performed_by = get_entity($vars['item']->subject_guid); +$performed_on = get_entity($vars['item']->object_guid); - $url = "getURL()}\">{$performed_by->name}"; - $string = sprintf(elgg_echo("messageboard:river:added"),$url) . " getURL()}\">" . $performed_on->name . "'s " . elgg_echo("messageboard:river:messageboard"); - - - echo $string; +$url = "getURL()}\">{$performed_by->name}"; +$string = sprintf(elgg_echo("messageboard:river:added"),$url) . " getURL()}\">" . $performed_on->name . "'s " . elgg_echo("messageboard:river:messageboard"); -?> \ No newline at end of file + +echo $string; diff --git a/mod/messageboard/views/default/widgets/messageboard/edit.php b/mod/messageboard/views/default/widgets/messageboard/edit.php index cf0741a36..4e3bb19bf 100644 --- a/mod/messageboard/views/default/widgets/messageboard/edit.php +++ b/mod/messageboard/views/default/widgets/messageboard/edit.php @@ -1,28 +1,36 @@ - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ +/** + * Elgg message board widget edit view + * + * @package ElggMessageBoard + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + +// default value +$num_display = 5; +if (isset($vars['entity']->num_display)) { + $num_display = $vars['entity']->num_display; +} + ?>

- : - + : +

\ No newline at end of file diff --git a/mod/messageboard/views/default/widgets/messageboard/view.php b/mod/messageboard/views/default/widgets/messageboard/view.php index 9a0d8e251..c05d6b618 100644 --- a/mod/messageboard/views/default/widgets/messageboard/view.php +++ b/mod/messageboard/views/default/widgets/messageboard/view.php @@ -1,93 +1,84 @@ - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - - // a couple of required variables - - //get the full page owner entity - $entity = get_entity(page_owner()); - - //the number of message to display - $num_display = $vars['entity']->num_display; - - //if no num set, set to one - if(!$num_display) - $num_display = 5; - -//Just the loggedin user can send messages -if(isloggedin()){ +/** + * Elgg messageboard widget view + * + * + * @package ElggMessageBoard + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + +//get the full page owner entity +$user = get_entity(page_owner()); + +//the number of message to display +$num_display = 5; +if (isset($vars['entity']->num_display)) { + $num_display = $vars['entity']->num_display; +} + +//Just the loggedin user can post messages +if (isloggedin()) { ?> - - -
- - - - - - - - - - - - - - -
- -
- - -
- -
-_graphics/ajax_loader.gif" />'); + $('#loader').html(' TRUE)); ?>'); + + //load the results back into the message board contents and remove the loading gif + //remember that the actual div being populated is determined on views/default/messageboard/messageboard.php + $("#messageboard_wrapper").load("mod/messageboard/ajax_endpoint/load.php", {messageboard_content:$("[name=message_content]").val(), pageOwner:$("[name=pageOwner]").val(), numToDisplay:}, function(){ + $('#loader').empty(); // remove the loading gif + $('[name=message_content]').val(''); // clear the input textarea + }); //end + + }); // end of the main click function + + }); //end of the document .ready function + + +
+ + + + + + + + + + + +
+ +
+ + +
+ +
+ + getAnnotations('messageboard', $num_display, 0, 'desc'); - - //as long as there is some content to display, display it - if (!empty($contents)) { - - echo elgg_view('messageboard/messageboard',array('annotation' => $contents)); - - } else { - - //put the required div on the page for the first message - echo "
"; - - } - -?> \ No newline at end of file + +//this for the first time the page loads, grab the latest messages. +$contents = $user->getAnnotations('messageboard', $num_display, 0, 'desc'); + +//as long as there is some content to display, display it +if (!empty($contents)) { + + echo elgg_view('messageboard/messageboard',array('annotation' => $contents)); + +} else { + + //put the required div on the page for the first message + echo "
"; + +} -- cgit v1.2.3