aboutsummaryrefslogtreecommitdiff
path: root/mod/messageboard/actions/add.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/messageboard/actions/add.php')
-rw-r--r--mod/messageboard/actions/add.php29
1 files changed, 11 insertions, 18 deletions
diff --git a/mod/messageboard/actions/add.php b/mod/messageboard/actions/add.php
index 55bc5775a..971dd22fc 100644
--- a/mod/messageboard/actions/add.php
+++ b/mod/messageboard/actions/add.php
@@ -15,24 +15,17 @@ if ($owner && !empty($message_content)) {
if ($result) {
system_message(elgg_echo("messageboard:posted"));
- // push the newest content out if using ajax
- $is_ajax = array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
- if ($is_ajax) {
- // always return the entity with the full ul and li
- // this is parsed out as needed by js.
- // if this is the only post we need to return the entire ul
- $options = array(
- 'annotations_name' => 'messageboard',
- 'guid' => $owner->getGUID(),
- 'limit' => $num_display,
- 'pagination' => false,
- 'reverse_order_by' => true,
- 'limit' => 1
- );
-
- $output = elgg_list_annotations($options);
- echo json_encode(array('post' => $output));
- }
+ $options = array(
+ 'annotations_name' => 'messageboard',
+ 'guid' => $owner->getGUID(),
+ 'limit' => $num_display,
+ 'pagination' => false,
+ 'reverse_order_by' => true,
+ 'limit' => 1
+ );
+
+ $output = elgg_list_annotations($options);
+ echo $output;
} else {
register_error(elgg_echo("messageboard:failure"));