aboutsummaryrefslogtreecommitdiff
path: root/mod/messages/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/messages/views')
-rw-r--r--mod/messages/views/default/messages/css.php234
-rw-r--r--mod/messages/views/default/messages/forms/message.php94
-rw-r--r--mod/messages/views/default/messages/forms/reply.php53
-rw-r--r--mod/messages/views/default/messages/forms/view.php15
-rw-r--r--mod/messages/views/default/messages/menu.php26
-rw-r--r--mod/messages/views/default/messages/messages.php165
-rw-r--r--mod/messages/views/default/messages/topbar.php38
-rw-r--r--mod/messages/views/default/messages/view.php150
-rw-r--r--mod/messages/views/default/object/messages.php0
-rw-r--r--mod/messages/views/default/widgets/messages/edit.php0
-rw-r--r--mod/messages/views/default/widgets/messages/view.php13
11 files changed, 788 insertions, 0 deletions
diff --git a/mod/messages/views/default/messages/css.php b/mod/messages/views/default/messages/css.php
new file mode 100644
index 000000000..6a8a6ed30
--- /dev/null
+++ b/mod/messages/views/default/messages/css.php
@@ -0,0 +1,234 @@
+<?php
+
+ /**
+ * Elgg Messages CSS extender
+ *
+ * @package ElggMessages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+?>
+
+/*-------------------------------
+MESSAGING PLUGIN
+-------------------------------*/
+#messages {
+ margin:0 10px 0 10px;
+}
+.actiontitle {
+ font-weight: bold;
+ font-size: 110%;
+ margin: 0 0 10px 0;
+}
+#messages .pagination {
+ margin:5px 0 5px 0;
+}
+#messages input[type="checkbox"] {
+ margin:0;
+ padding:0;
+ border:none;
+}
+.messages_buttonbank {
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ background:white;
+ margin:5px 10px;
+ padding:5px;
+ text-align: right;
+}
+.messages_buttonbank input {
+ margin:0 0 0 10px;
+}
+.messages_buttonbank input[type="button"] {
+ font: 12px/100% Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ color: #4690D6;
+ background:#dddddd;
+ border: 1px solid #999999;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ width: auto;
+ height: 25px;
+ padding: 2px 6px 2px 6px;
+ margin:0 0 0 10px;
+ cursor: pointer;
+}
+.messages_buttonbank input[type="button"]:hover {
+ background: #0054a7;
+ border: 1px solid #0054a7;
+ color:white;
+}
+
+#messages td {
+ text-align: left;
+ vertical-align:middle;
+ padding: 5px;
+}
+#messages .message_sent {
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ margin-bottom: 5px;
+ background: white;
+ border:1px solid #cccccc;
+}
+#messages .message_notread {
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ margin-bottom: 5px;
+ background: #F7DAD8;
+ border:1px solid #ff6c7c;
+}
+#messages .message_read {
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ margin-bottom: 5px;
+ background: white;
+ border:1px solid #cccccc;
+}
+#messages .message_notread td {
+
+}
+#messages .message_read td {
+
+}
+
+#messages .delete_msg a {
+ display:block;
+ cursor: pointer;
+ width:14px;
+ height:14px;
+ margin:0;
+ background: url("<?php echo $vars['url']; ?>_graphics/icon_customise_remove.png") no-repeat right 0;
+ text-indent: -9000px;
+ float:right;
+}
+#messages .delete_msg a:hover {
+ background-position: right -16px;
+}
+/* IE6 */
+* html #messages .delete_msg a { background-position: right 4px; }
+* html #messages .delete_msg a:hover { background-position: right 4px; }
+
+#messages .usericon,
+#messages .groupicon {
+ float: left;
+ margin: 0 15px 0 0;
+}
+
+#messages .msgsender {
+ color:#666666;
+ line-height: 1em;
+ margin:0;
+ padding:0;
+ float:left;
+}
+#messages .msgsender small {
+ color:#AAAAAA;
+}
+
+
+#messages .msgsubject {
+ font-size: 120%;
+ line-height: 100%;
+}
+
+.msgsubject {
+ font-weight:bold;
+}
+
+.messages_single_icon {
+ float: left;
+ width:110px;
+}
+
+.messages_single_icon .usericon,
+.messages_single_icon .groupicon {
+ float: left;
+ margin: 0 10px 10px 0;
+}
+
+/* view and reply to message view */
+.message_body {
+ margin-left: 120px;
+}
+.message_body .messagebody {
+ padding:0;
+ margin:10px 0 10px 0;
+ font-size: 120%;
+ border-bottom:1px solid #cccccc;
+}
+
+/* drop down message reply form */
+#message_reply_form { display:none; }
+
+.new_messages_count {
+ color:#666666;
+}
+/* tinyMCE container */
+#message_reply_editor #message_tbl {
+ width:680px !important;
+}
+/* IE6 */
+* html #message_reply_editor #message_tbl { width:676px !important;}
+
+#messages_return {
+ margin:4px 0 4px 10px;
+}
+#messages_return p {
+ margin:0;
+}
+.messages_single {
+ background: white;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ margin:0 10px 10px 10px;
+ padding:10px;
+}
+/* when displaying original msg in reply view */
+.previous_message {
+ background:#dedede;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ padding:10px;
+ margin:0 0 20px 0;
+}
+.previous_message p {
+ padding:0;
+ margin:0 0 5px 0;
+ font-size: 100%;
+}
+
+
+
+
+#notificationstable td.sitetogglefield {
+ width:50px;
+ text-align: center;
+ vertical-align: middle;
+}
+#notificationstable td.sitetogglefield input {
+ margin-right:36px;
+ margin-top:5px;
+}
+#notificationstable td.sitetogglefield a {
+ width:46px;
+ height:24px;
+ cursor: pointer;
+ display: block;
+ outline: none;
+}
+#notificationstable td.sitetogglefield a.sitetoggleOff {
+ background: url(<?php echo $vars['url']; ?>mod/messages/graphics/icon_notifications_site.gif) no-repeat right 2px;
+}
+#notificationstable td.sitetogglefield a.sitetoggleOn {
+ background: url(<?php echo $vars['url']; ?>mod/messages/graphics/icon_notifications_site.gif) no-repeat right -36px;
+}
+
+
+
+
+
+
diff --git a/mod/messages/views/default/messages/forms/message.php b/mod/messages/views/default/messages/forms/message.php
new file mode 100644
index 000000000..3a926b0d3
--- /dev/null
+++ b/mod/messages/views/default/messages/forms/message.php
@@ -0,0 +1,94 @@
+<?php
+
+ /**
+ * Elgg send a message page
+ *
+ *
+ * @package ElggMessages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ * @uses $vars['friends'] This is an array of a user's friends and is used to populate the list of
+ * people the user can message
+ *
+ */
+
+ //grab the user id to send a message to. This will only happen if a user clicks on the 'send a message'
+ //link on a user's profile or hover-over menu
+ $send_to = get_input('send_to');
+ if ($send_to === "")
+ $send_to = $_SESSION['msg_to'];
+
+ $msg_title = $_SESSION['msg_title'];
+ $msg_content = $_SESSION['msg_contents'];
+
+ // clear sticky form cache in case user browses away from page and comes back
+ unset($_SESSION['msg_to']);
+ unset($_SESSION['msg_title']);
+ unset($_SESSION['msg_contents']);
+
+
+
+?>
+ <div class="contentWrapper">
+ <form action="<?php echo $vars['url']; ?>action/messages/send" method="post" name="messageForm">
+
+ <?php
+ // security tokens.
+ echo elgg_view('input/securitytoken');
+
+ //check to see if the message recipient has already been selected
+ if($send_to){
+
+ //get the user object
+ $user = get_user($send_to);
+
+ //draw it
+ echo "<label>" . elgg_echo("messages:to") . ":</label><div class=\"messages_single_icon\">" . elgg_view("profile/icon",array('entity' => $user, 'size' => 'tiny')) . $user->username;
+ echo "</div><br class=\"clearfloat\" />";
+ //set the hidden input field to the recipients guid
+ echo "<input type=\"hidden\" name=\"send_to\" value=\"{$send_to}\" />";
+
+
+ }else{
+
+ ?>
+
+ <p><label><?php echo elgg_echo("messages:to"); ?>: </label>
+ <select name='send_to'>
+ <?php
+ //make the first option blank
+ echo "<option value=''></option>";
+ foreach($vars['friends'] as $friend){
+
+ //populate the send to box with a user's friends
+ echo "<option value='{$friend->guid}'>" . $friend->name . "</option>";
+
+ }
+
+ ?>
+ </select></p>
+
+ <?php
+
+ }//end send_to if statement
+
+ ?>
+
+ <p><label><?php echo elgg_echo("messages:title"); ?>: <br /><input type='text' name='title' value='<?php echo $msg_title; ?>' class="input-text" /></label></p>
+ <p class="longtext_editarea"><label><?php echo elgg_echo("messages:message"); ?>: <br />
+ <?php
+
+ echo elgg_view("input/longtext", array(
+ "internalname" => "message",
+ "value" => $msg_content,
+ ));
+
+ ?>
+ </label></p>
+ <p><input type="submit" class="submit_button" value="<?php echo elgg_echo("messages:fly"); ?>" /></p>
+
+ </form>
+ </div>
diff --git a/mod/messages/views/default/messages/forms/reply.php b/mod/messages/views/default/messages/forms/reply.php
new file mode 100644
index 000000000..7b949ec36
--- /dev/null
+++ b/mod/messages/views/default/messages/forms/reply.php
@@ -0,0 +1,53 @@
+<?php
+
+ /**
+ * Elgg reply to a message form
+ *
+ * @package ElggMessages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] This is the message being replied to
+ *
+ */
+
+ // fix for RE: RE: RE: that builds on replies
+ $reply_title = $vars['entity']->title;
+ if (strncmp($reply_title, "RE:", 3) != 0) {
+ $reply_title = "RE: " . $reply_title;
+ }
+exit;
+ $reply_title = str_replace("'", "\\'", $reply_title);
+?>
+
+<form action="<?php echo $vars['url']; ?>action/messages/send" method="post" name="messageForm">
+
+ <!-- populate the title space with the orginal message title, inserting re: before it -->
+ <p><label><?php echo elgg_echo("messages:title"); ?>: <br /><input type='text' name='title' class="input-text" value='<?php echo $reply_title; ?>' /></label></p>
+ <p><label><?php echo elgg_echo("messages:message"); ?>: <br /><textarea name='message' value='' class="input-textarea" /></textarea></label></p>
+
+ <p>
+ <?php
+ echo elgg_view('input/securitytoken');
+ //pass across the guid of the message being replied to
+ echo "<input type='hidden' name='reply' value='" . $vars['entity']->getGUID() . "' />";
+ //pass along the owner of the message being replied to
+ echo "<input type='hidden' name='send_to' value='BAAA" . $vars['entity']->fromId . "' />";
+
+ ?>
+ <input type="submit" class="submit_button" value="<?php echo elgg_echo("messages:fly"); ?>" />
+ </p>
+
+</form>
+
+ <?php
+ //display the message you are replying to
+ if (isset($vars['entity'])) {
+
+ echo "<h3>" . elgg_echo("messages:replying") . "</h3>";
+ echo $vars['entity']->description;
+
+ }
+ ?>
diff --git a/mod/messages/views/default/messages/forms/view.php b/mod/messages/views/default/messages/forms/view.php
new file mode 100644
index 000000000..adcd3a589
--- /dev/null
+++ b/mod/messages/views/default/messages/forms/view.php
@@ -0,0 +1,15 @@
+<?php
+
+ $body = elgg_view("messages/view",$vars);
+
+ $body .= '<div class="messages_buttonbank">';
+ $body .= '<input type="hidden" name="type" value="'.$vars['page_view'].'" />';
+ $body .= '<input type="hidden" name="offset" value="'.$vars['offset'].'" />';
+ $body .= '<input type="submit" name="submit" value="'.elgg_echo('delete').'" /> ';
+ $body .= '<input type="submit" name="submit" value="'.elgg_echo('messages:markread').'" /> ';
+ $body .= '<input type="button" onclick="javascript:$(\'input[type=checkbox]\').click();" value="'.elgg_echo('messages:toggle').'" />';
+ $body .= '</div>';
+
+ echo elgg_view('input/form',array('body' => $body, 'action' => $vars['url'] . 'action/messages/delete', 'method' => 'post'));
+
+?> \ No newline at end of file
diff --git a/mod/messages/views/default/messages/menu.php b/mod/messages/views/default/messages/menu.php
new file mode 100644
index 000000000..9f8da1fb1
--- /dev/null
+++ b/mod/messages/views/default/messages/menu.php
@@ -0,0 +1,26 @@
+<?php
+
+ /**
+ * Elgg hoverover extender for messages
+ *
+ * @package ElggMessages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+ //need to be logged in to send a message
+ if (isloggedin()) {
+
+?>
+
+ <p class="user_menu_messages">
+ <a href="<?php echo $vars['url']; ?>mod/messages/send.php?send_to=<?php echo $vars['entity']->guid; ?>"><?php echo elgg_echo("messages:sendmessage"); ?></a>
+ </p>
+
+<?php
+
+ }
+
+?> \ No newline at end of file
diff --git a/mod/messages/views/default/messages/messages.php b/mod/messages/views/default/messages/messages.php
new file mode 100644
index 000000000..cdc6e4483
--- /dev/null
+++ b/mod/messages/views/default/messages/messages.php
@@ -0,0 +1,165 @@
+<?php
+
+ /**
+ * Elgg messages individual view
+ *
+ * @package ElggMessages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ *
+ * @uses $vars['entity'] Optionally, the message to view
+ * @uses get_input('type') If the user accesses the message from their sentbox, this variable is passed
+ * and used to make sure the correct icon and name is displayed
+ */
+ // set some variables to use below
+ if(get_input("type") == "sent"){
+
+ // send back to the users sentbox
+ $url = $vars['url'] . "mod/messages/sent.php";
+
+ //this is used on the delete link so we know which type of message it is
+ $type = "sent";
+
+ } else {
+
+ //send back to the users inbox
+ $url = $vars['url'] . "pg/messages/" . $vars['user']->username;
+
+ //this is used on the delete link so we know which type of message it is
+ $type = "inbox";
+
+ }
+
+ // fix for RE: RE: RE: that builds on replies
+ $reply_title = $vars['entity']->title;
+ if (strncmp($reply_title, "RE:", 3) != 0) {
+ $reply_title = "RE: " . $reply_title;
+ }
+
+ if (isloggedin())
+ if (isset($vars['entity'])) {
+ if ($vars['entity']->toId == $vars['user']->guid
+ || $vars['entity']->owner_guid == $vars['user']->guid) {
+
+?>
+ <!-- get the correct return url -->
+ <div id="messages_return"><!-- start of messages_return div -->
+ <p><a href="<?php echo $url; ?>">&laquo; <?php echo elgg_echo('messages:back'); ?></a></p>
+ </div><!-- end of messages_return div -->
+
+ <div class="messages_single"><!-- start of the message div -->
+
+ <div class="messages_single_icon"><!-- start of the message_user_icon div -->
+ <!-- get the user icon, name and date -->
+ <?php
+ // we need a different user icon and name depending on whether the user is reading the message
+ // from their inbox or sentbox. If it is the inbox, then the icon and name will be the person who sent
+ // the message. If it is the sentbox, the icon and name will be the user the message was sent to
+ if ($type == "sent") {
+ //get an instance of the user who the message has been sent to so we can access the name and icon
+ $user_object = get_entity($vars['entity']->toId);
+ echo " " . elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny'));
+ echo "<br class=\"clearfloat\" /><p>".elgg_echo('messages:to').": <b>" . $user_object->name . "</b><br />";
+ } else {
+ echo " " . elgg_view("profile/icon",array('entity' => get_entity($vars['entity']->fromId), 'size' => 'tiny'));
+ echo "<br class=\"clearfloat\" /><p>".elgg_echo('messages:from').": <b>" . get_entity($vars['entity']->fromId)->name . "</b><br />";
+ }
+ ?>
+ <!-- get the time the message was sent -->
+ <small><?php echo friendly_time($vars['entity']->time_created); ?></small>
+ </p>
+ </div><!-- end of the message_user_icon div -->
+
+ <div class="message_body"><!-- start of div message_body -->
+
+ <?php
+ //if the message is a reply, display the message the reply was for
+ //I need to figure out how to get the description out using -> (anyone?)
+ if($main_message = $vars['entity']->getEntitiesFromRelationship("reply")){
+
+ if($type == "sent"){
+ echo "<div class='previous_message'><h3>".elgg_echo('messages:original').":</h3><p>";
+ }else{
+ echo "<div class='previous_message'><h3>".elgg_echo('messages:yours').":</h3><p>";
+ }
+
+ echo $main_message[0][description] . "</p></div>";
+
+ }
+ ?>
+
+ <!-- display the title -->
+ <div class="actiontitle">
+ <h3><?php echo $vars['entity']->title; ?></h3>
+ </div>
+
+ <!-- display the message -->
+ <div class="messagebody">
+ <p><?php echo elgg_view('output/longtext',array('value' => $vars['entity']->description)); ?></p>
+ </div>
+
+ <!-- display the edit options, reply and delete -->
+ <div class="message_options"><!-- start of the message_options div -->
+
+ <script type="text/javascript">
+ $(document).ready(function () {
+ // click function to toggle reply panel
+ $('a.message_reply').click(function () {
+ $('div#message_reply_form').slideToggle("medium");
+ return false;
+ });
+ });
+ </script>
+
+
+ <p><?php if($type != "sent")echo "<a href=\"javascript:void(0);\" class='message_reply'>".elgg_echo('messages:answer')."</a> &nbsp; "; ?> <?php echo elgg_view("output/confirmlink", array(
+ 'href' => $vars['url'] . "action/messages/delete?message_id=" . $vars['entity']->getGUID() . "&type={$type}&submit=" . elgg_echo('delete'),
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ )); ?>
+ </p>
+ </div><!-- end of the message_options div -->
+
+ </div><!-- end of div message_body -->
+
+ <!-- display the reply form -->
+ <div id="message_reply_form">
+ <form action="<?php echo $vars['url']; ?>action/messages/send" method="post" name="messageForm">
+ <!-- populate the title space with the orginal message title, inserting re: before it -->
+ <p><label><?php echo elgg_echo("messages:title"); ?>: <br /><input type='text' name='title' class="input-text" value="<?php echo htmlentities($reply_title); ?>" /></label></p>
+ <p class="longtext_editarea"><label><?php echo elgg_echo("messages:message"); ?>:</label></p>
+ <div id="message_reply_editor">
+ <?php
+
+ echo elgg_view("input/longtext", array(
+ "internalname" => "message",
+ "value" => '',
+ ));
+
+ ?></div>
+
+ <p>
+ <?php
+ // security tokens required.
+ echo elgg_view('input/securitytoken');
+
+ //pass across the guid of the message being replied to
+ echo "<input type='hidden' name='reply' value='" . $vars['entity']->getGUID() . "' />";
+ //pass along the owner of the message being replied to
+ echo "<input type='hidden' name='send_to' value='" . $vars['entity']->fromId . "' />";
+
+ ?>
+ <input type="submit" class="submit_button" value="<?php echo elgg_echo("messages:fly"); ?>" />
+ </p>
+ </form>
+ </div><!-- end of div reply_form -->
+
+ </div><!-- end of the message div -->
+
+<?php
+ }
+ }
+?>
diff --git a/mod/messages/views/default/messages/topbar.php b/mod/messages/views/default/messages/topbar.php
new file mode 100644
index 000000000..179167561
--- /dev/null
+++ b/mod/messages/views/default/messages/topbar.php
@@ -0,0 +1,38 @@
+<?php
+
+ /**
+ * Elgg messages topbar extender
+ *
+ * @package ElggMessages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+ //need to be logged in to send a message
+ gatekeeper();
+
+ //get unread messages
+ $num_messages = count_unread_messages();
+ if($num_messages){
+ $num = $num_messages;
+ } else {
+ $num = 0;
+ }
+
+ if($num == 0){
+
+?>
+
+ <a href="<?php echo $vars['url']; ?>pg/messages/<?php echo $_SESSION['user']->username; ?>" class="privatemessages" >&nbsp;</a>
+
+<?php
+ }else{
+?>
+
+ <a href="<?php echo $vars['url']; ?>pg/messages/<?php echo $_SESSION['user']->username; ?>" class="privatemessages_new" >[<?php echo $num; ?>]</a>
+
+<?php
+ }
+?> \ No newline at end of file
diff --git a/mod/messages/views/default/messages/view.php b/mod/messages/views/default/messages/view.php
new file mode 100644
index 000000000..501be8bb3
--- /dev/null
+++ b/mod/messages/views/default/messages/view.php
@@ -0,0 +1,150 @@
+<?php
+
+ /**
+ * Elgg messages view page
+ *
+ * @package ElggMessages
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ * @uses $vars['entity'] An array of messages to view
+ * @uses $vars['page_view'] This is the page the messages are being accessed from; inbox or sentbox
+ *
+ */
+
+ $limit = $vars['limit']; if (empty($limit)) $limit = 10;
+ $offset = $vars['offset']; if (!isset($offset)) $offset = 0;
+
+ // If there are any messages to view, view them
+ if (isloggedin())
+ if (is_array($vars['entity']) && sizeof($vars['entity']) > 0) {
+
+?>
+ <div id="messages" /><!-- start the main messages wrapper div -->
+
+<?php
+
+ // get the correct display for the inbox view
+ if($vars['page_view'] == "inbox") {
+
+ $counter = 0;
+
+ foreach($vars['entity'] as $message) {
+ if ($message->owner_guid == $vars['user']->guid
+ || $message->toId == $vars['user']->guid) {
+
+ //make sure to only display the messages that have not been 'deleted' (1 = deleted)
+ if($message->hiddenFrom != 1){
+
+ // check to see if the message has been read, if so, get the correct background color
+ if($message->readYet == 1){
+ echo "<div class=\"message_read\" />";
+ }else{
+ echo "<div class=\"message_notread\" />";
+ }
+
+ //set the table
+ echo "<table width=\"100%\" cellspacing='0'><tr>";
+ //get the icon of the user who owns the message
+ $from = get_entity($message->fromId);
+ echo "<td width='200px'>" . elgg_view("profile/icon",array('entity' => $from, 'size' => 'tiny')) . "<div class='msgsender'><b>" . $from->name . "</b><br /><small>" . friendly_time($message->time_created) . "</small></div></td>";
+ //display the message title
+ echo "<td><div class='msgsubject'>";
+ echo "<input type=\"checkbox\" name=\"message_id[]\" value=\"{$message->guid}\" /> ";
+ echo "<a href=\"{$message->getURL()}\">" . $message->title . "</a></div></td>";
+ //display the link to 'delete'
+
+ echo "<td width='70px'>";
+ echo "<div class='delete_msg'>" . elgg_view("output/confirmlink", array(
+ 'href' => $vars['url'] . "action/messages/delete?message_id=" . $message->getGUID() . "&type=inbox&submit=" . urlencode(elgg_echo('delete')),
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ )) . "</div>";
+
+ echo "</td></tr></table>";
+ echo "</div>"; // close the message background div
+
+ }//end of hiddenFrom if statement
+ } // end of user check
+
+ $counter++;
+ if ($counter == $limit) break;
+
+ }//end of for each loop
+
+ }//end of inbox if statement
+
+ // get the correct display for the sentbox view
+ if($vars['page_view'] == "sent") {
+
+ $counter = 0;
+
+ foreach($vars['entity'] as $message) {
+
+ //make sure to only display the messages that have not been 'deleted' (1 = deleted)
+ if($message->hiddenTo != 1){
+
+ //get the correct user entity
+ $user = get_entity($message->toId);
+ echo "<div class=\"message_sent\" />";
+ echo "<table width=\"100%\" cellspacing='0'><tr>";
+
+ //get the icon for the user the message was sent to
+ echo "<tr><td width='200px'>" . elgg_view("profile/icon",array('entity' => $user, 'size' => 'tiny')) . "<div class='msgsender'><b>" . $user->name . "</b><br /><small>" . friendly_time($message->time_created) . "</small></div></td>";
+ //display the message title
+ echo "<td><div class='msgsubject'>";
+ echo "<input type=\"checkbox\" name=\"message_id[]\" value=\"{$message->guid}\" /> ";
+ echo "<a href=\"{$message->getURL()}?type=sent\">" . $message->title . "</a></div></td>";
+ //display the link to 'delete'
+
+ echo "<td width='70px'>";
+ echo "<div class='delete_msg'>" . elgg_view("output/confirmlink", array(
+ 'href' => $vars['url'] . "action/messages/delete?message_id=" . $message->getGUID() . "&type=sent&submit=" . urlencode(elgg_echo('delete')),
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ )) . "</div>";
+ echo "</td></tr></table></div>";
+
+ }//close hiddeTo if statement
+
+ $counter++;
+ if ($counter == $limit) break;
+
+ }//close foreach
+
+ }//close page_view sent if statement
+
+ $baseurl = $_SERVER['REQUEST_URI'];
+ $nav = '';
+
+ if (sizeof($vars['entity']) > $limit) {
+ $newoffset = $offset + $limit;
+ $nexturl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset));
+
+ $nav .= '<a class="pagination_previous" href="'.$nexturl.'">&laquo; ' . elgg_echo('previous') . '</a> ';
+ }
+
+ if ($offset > 0) {
+ $newoffset = $offset - $limit;
+ if ($newoffset < 0) $newoffset = 0;
+
+ $prevurl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset));
+
+ $nav .= '<a class="pagination_next" href="'.$prevurl.'">' . elgg_echo('next') . ' &raquo;</a> ';
+ }
+
+
+ if (!empty($nav)) {
+ echo '<div class="pagination"><p>'.$nav.'</p><div class="clearfloat"></div></div>';
+ }
+
+ echo "</div>"; // close the main messages wrapper div
+
+ } else {
+
+ echo "<div class=\"contentWrapper\"><p class='messages_nomessage_message'>" . elgg_echo("messages:nomessages") . "</p></div>";
+
+ }//end of the first if statement
+?>
diff --git a/mod/messages/views/default/object/messages.php b/mod/messages/views/default/object/messages.php
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/mod/messages/views/default/object/messages.php
diff --git a/mod/messages/views/default/widgets/messages/edit.php b/mod/messages/views/default/widgets/messages/edit.php
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/mod/messages/views/default/widgets/messages/edit.php
diff --git a/mod/messages/views/default/widgets/messages/view.php b/mod/messages/views/default/widgets/messages/view.php
new file mode 100644
index 000000000..e4d138562
--- /dev/null
+++ b/mod/messages/views/default/widgets/messages/view.php
@@ -0,0 +1,13 @@
+
+ <?php
+
+ $num_messages = count_unread_messages();
+
+ if($num_messages == 0)
+ echo "<h3 class=\"new_messages_count\">You have no new messages.</h3>";
+ else {
+ echo "<h3 class=\"new_messages_count\">" . $num_messages . " new message(s).</h3>";
+ echo "<a href=\"" . $vars['url'] . "pg/messages/" . $_SESSION['user']->username ."\">check them out</a>";
+ }
+
+ ?>