aboutsummaryrefslogtreecommitdiff
path: root/mod/messages/send.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/messages/send.php')
-rw-r--r--mod/messages/send.php44
1 files changed, 15 insertions, 29 deletions
diff --git a/mod/messages/send.php b/mod/messages/send.php
index 3e1baa496..1f31e9e02 100644
--- a/mod/messages/send.php
+++ b/mod/messages/send.php
@@ -1,42 +1,28 @@
<?php
/**
-* Elgg send a message page
+* Compose a message
*
* @package ElggMessages
*/
-// Load Elgg engine
-require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
-// If we're not logged in, forward to the front page
gatekeeper();
-// Get the current page's owner
-$page_owner = elgg_get_page_owner();
-if ($page_owner === false || is_null($page_owner)) {
- $page_owner = get_loggedin_user();
- set_page_owner($page_owner->getGUID());
-}
-
-// Get the users friends; this is used in the drop down to select who to send the message to
-$user = get_loggedin_user();
-$friends = $user->getFriends('', 9999);
+$page_owner = get_loggedin_user();
+set_page_owner($page_owner->getGUID());
-// Set the page title
-$area2 = elgg_view_title(elgg_echo("messages:sendmessage"));
+$title = elgg_echo('messages:add');
-// Get the send form
-$area2 .= elgg_view("messages/forms/send",array('friends' => $friends));
+elgg_push_breadcrumb($title);
-// Sidebar menu options
-$area3 = elgg_view("messages/menu_options");
+$params = messages_prepare_form_vars(get_input('send_to'));
+$params['friends'] = $page_owner->getFriends();
+$content = elgg_view_form('messages/send', array(), $params);
-// Format
-$params = array(
- 'content' => $area2,
- 'sidebar' => $area3
-);
-$body = elgg_view_layout("one_column_with_sidebar", $params);
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => '',
+ 'buttons' => '',
+));
-// Draw page
-echo elgg_view_page(elgg_echo('messages:send', array($page_owner->name)), $body); \ No newline at end of file
+echo elgg_view_page($title, $body);