diff options
Diffstat (limited to 'mod/messages/views/default/forms')
-rw-r--r-- | mod/messages/views/default/forms/messages/process.php | 43 | ||||
-rw-r--r-- | mod/messages/views/default/forms/messages/reply.php | 43 | ||||
-rw-r--r-- | mod/messages/views/default/forms/messages/send.php | 54 |
3 files changed, 140 insertions, 0 deletions
diff --git a/mod/messages/views/default/forms/messages/process.php b/mod/messages/views/default/forms/messages/process.php new file mode 100644 index 000000000..cb30792e9 --- /dev/null +++ b/mod/messages/views/default/forms/messages/process.php @@ -0,0 +1,43 @@ +<?php +/** + * Messages folder view (inbox, sent) + * + * Provides form body for mass deleting messages + * + * @uses $vars['list'] List of messages + * + */ + +$messages = $vars['list']; +if (!$messages) { + echo elgg_echo('messages:nomessages'); + return true; +} + +echo '<div class="messages-container">'; +echo $messages; +echo '</div>'; + +echo '<div class="elgg-foot messages-buttonbank">'; + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('delete'), + 'name' => 'delete', + 'class' => 'elgg-button-delete elgg-requires-confirmation', + 'title' => elgg_echo('deleteconfirm:plural'), +)); + +if ($vars['folder'] == "inbox") { + echo elgg_view('input/submit', array( + 'value' => elgg_echo('messages:markread'), + 'name' => 'read', + )); +} + +echo elgg_view('input/button', array( + 'value' => elgg_echo('messages:toggle'), + 'class' => 'elgg-button elgg-button-cancel', + 'id' => 'messages-toggle', +)); + +echo '</div>'; diff --git a/mod/messages/views/default/forms/messages/reply.php b/mod/messages/views/default/forms/messages/reply.php new file mode 100644 index 000000000..a0a01afce --- /dev/null +++ b/mod/messages/views/default/forms/messages/reply.php @@ -0,0 +1,43 @@ +<?php +/** + * Reply form + * + * @uses $vars['message'] + */ + +// fix for RE: RE: RE: that builds on replies +$reply_title = $vars['message']->title; +if (strncmp($reply_title, "RE:", 3) != 0) { + $reply_title = "RE: " . $reply_title; +} + +echo elgg_view('input/hidden', array( + 'name' => 'recipient_guid', + 'value' => $vars['message']->fromId, +)); +echo elgg_view('input/hidden', array( + 'name' => 'reply', + 'value' => $vars['message']->guid, +)); + +?> + +<div> + <label><?php echo elgg_echo("messages:title"); ?>: <br /></label> + <?php echo elgg_view('input/text', array( + 'name' => 'subject', + 'value' => $reply_title, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo("messages:message"); ?>:</label> + <?php echo elgg_view("input/longtext", array( + 'name' => 'body', + 'value' => '', + )); + ?> +</div> +<div class="elgg-foot"> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('messages:send'))); ?> +</div> diff --git a/mod/messages/views/default/forms/messages/send.php b/mod/messages/views/default/forms/messages/send.php new file mode 100644 index 000000000..5b7e7830e --- /dev/null +++ b/mod/messages/views/default/forms/messages/send.php @@ -0,0 +1,54 @@ +<?php +/** + * Compose message form + * + * @package ElggMessages + * @uses $vars['friends'] + */ + +$recipient_guid = elgg_extract('recipient_guid', $vars, 0); +$subject = elgg_extract('subject', $vars, ''); +$body = elgg_extract('body', $vars, ''); + +$recipients_options = array(); +foreach ($vars['friends'] as $friend) { + $recipients_options[$friend->guid] = $friend->name; +} + +if (!array_key_exists($recipient_guid, $recipients_options)) { + $recipient = get_entity($recipient_guid); + if (elgg_instanceof($recipient, 'user')) { + $recipients_options[$recipient_guid] = $recipient->name; + } +} + +$recipient_drop_down = elgg_view('input/dropdown', array( + 'name' => 'recipient_guid', + 'value' => $recipient_guid, + 'options_values' => $recipients_options, +)); + +?> +<div> + <label><?php echo elgg_echo("messages:to"); ?>: </label> + <?php echo $recipient_drop_down; ?> +</div> +<div> + <label><?php echo elgg_echo("messages:title"); ?>: <br /></label> + <?php echo elgg_view('input/text', array( + 'name' => 'subject', + 'value' => $subject, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo("messages:message"); ?>:</label> + <?php echo elgg_view("input/longtext", array( + 'name' => 'body', + 'value' => $body, + )); + ?> +</div> +<div class="elgg-foot"> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('messages:send'))); ?> +</div> |