- Timestamp:
- 05/30/08 16:59:14 (6 months ago)
- Files:
-
- messages/trunk/CHANGELOG.txt (modified) (1 diff)
- messages/trunk/CONTRIBUTORS.txt (modified) (1 diff)
- messages/trunk/README.txt (modified) (2 diffs)
- messages/trunk/default_template.php (modified) (1 diff)
- messages/trunk/index.php (modified) (1 diff)
- messages/trunk/languages/es_CO/LC_MESSAGES/elgg.mo (modified) (previous)
- messages/trunk/languages/es_CO/LC_MESSAGES/es_CO.po (modified) (5 diffs)
- messages/trunk/lib.php (modified) (5 diffs)
- messages/trunk/lib/messages_config.php (modified) (1 diff)
- messages/trunk/lib/messages_init.php (modified) (2 diffs)
- messages/trunk/lib/messages_message_detailedview.php (modified) (3 diffs)
- messages/trunk/lib/messages_new.php (modified) (1 diff)
- messages/trunk/lib/messages_sidebar_link.php (modified) (3 diffs)
- messages/trunk/lib/messages_view.php (modified) (3 diffs)
- messages/trunk/messages_actions.php (modified) (3 diffs)
- messages/trunk/plugin.info (modified) (1 diff)
- messages/trunk/templates/messages_detailed_message.html (modified) (2 diffs)
- messages/trunk/templates/messages_message.html (modified) (1 diff)
- messages/trunk/templates/messages_messages.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
messages/trunk/CHANGELOG.txt
r155 r312 1 Version 0.2.3 2 Translations to fi (Thanks to Pasi Havia) 3 Fixes for work with the 0.9 series (not backward compatibility) 4 Added a property for allow/disallow community messages 1 Version 0.3 2 - Refactor for extract the send messages functionality to the 3 messages_send_message function to allow other plugins use it for 4 send messages 5 - Adjustments for use the new Java Script management procedure 6 Version 0.2.2.1 7 Bug fix: You can view other users messages using the message id. 8 Thanks to Federica Oradini (http://eduspaces.net/federicao/) for report it 9 Version 0.2.2 10 Little navigation improvements 11 Interface polishing 5 12 Version 0.2.1 6 13 Translations to nl (Thanks to Daniel Dubbeldam) messages/trunk/CONTRIBUTORS.txt
r155 r312 9 9 Daniel Dubbeldam 10 10 Translations to nl 11 Pasi Havia (http://www.elgg.org/encore)12 Translations to fi13 Some 0.9 compatibility bug fixesmessages/trunk/README.txt
r155 r312 1 ------------------------------------------------------------------------------------------------------- 2 NOTE: 3 If your are using Elgg (<=0.9.2) or a svn checkout previous to the changeset 1595 4 you need to apply the patch provided with the ticket #359 (http://classic.elgg.org/trac/ticket/359) 5 6 ------------------------------------------------------------------------------------------------------- 7 1 8 Add the following lines to the .htacess file: 2 9 … … 18 25 If you want to change this behavior you must change the value of MESSAGES_SIDEBAR_NO_MEMBER_LINK 19 26 in the 'messages/lib/messages_config.php' file. 20 21 By default the plugin enable send messages for communities.22 23 If you want to change this behavior you must change the value of MESSAGES_COMMUNITY_MESSAGES in24 the 'messages/lib/messages_config.php' file.messages/trunk/default_template.php
r155 r312 6 6 * @copyright Corporación Somos Más - 2007 7 7 */ 8 global $template; 9 global $template_definition; 8 10 9 // Add CSS 10 templates_add_context('css', 'mod/messages/css.css', true, true); 11 $template['css'] .= file_get_contents($CFG->dirroot . "mod/messages/css.css"); 11 12 12 // Add page templates 13 // Registering template definitions 14 $template_definition[] = array ('id' => 'plug_messages', 15 'name' => __gettext("Message List"), 16 'description' => __gettext("A template for the message list"), 17 'glossary' => array ('{{messages}}' => __gettext("The list of messages themselves"), 18 '{{paging}}' => __gettext("The list of page links when there are lots of messages"), 19 '{{from_to}}' => __gettext("From | To Label for the message list"), 20 'action' => "", 21 'date' => '', 22 'subject' => '', 23 'actionMsg' => '', 24 'returnConfirm' => '' 25 ) 26 ); 13 27 14 templates_add_context('plug_messages',"mod/messages/templates/messages_messages.html"); 15 templates_add_context('plug_message',"mod/messages/templates/messages_message.html"); 16 templates_add_context('plug_detailedmessage',"mod/messages/templates/messages_detailed_message.html"); 28 29 $template_definition[] = array ('id' => 'plug_message', 30 'name' => __gettext("Message"), 31 'description' => __gettext("A template for each message"), 32 'glossary' => array ('{{date}}' => __gettext("The time and date of the message"), 33 '{{title}}' => __gettext("Message title"), 34 '{{from_username}}' => __gettext("The username from the sender"), 35 '{{from_name}}' => __gettext("The full name from the sender"), 36 '{{from_icon}}' => __gettext("The icon from the sender"), 37 '{{msg_style}}' => __gettext("The message status style (read|unread)") 38 ) 39 ); 40 41 $template_definition[] = array ('id' => 'plug_detailedmessage', 42 'name' => __gettext("Message"), 43 'description' => __gettext("A template for each message"), 44 'glossary' => array ('{{date}}' => __gettext("The time and date of the message"), 45 '{{title}}' => __gettext("Message title"), 46 '{{from_username}}' => __gettext("The username from the sender"), 47 '{{from_name}}' => __gettext("The full name from the sender"), 48 '{{from_icon}}' => __gettext("The icon from the sender"), 49 '{{body}}' => __gettext("The message body text"), 50 '{{links}}' => __gettext("Links related with the message (delete|reply)") 51 ) 52 ); 53 54 55 $template['plug_messages'] = file_get_contents(dirname(__FILE__)."/templates/messages_messages.html"); 56 $template['plug_message'] = file_get_contents(dirname(__FILE__)."/templates/messages_message.html"); 57 $template['plug_detailedmessage'] = file_get_contents(dirname(__FILE__)."/templates/messages_detailed_message.html"); 17 58 18 59 ?> messages/trunk/index.php
r152 r312 11 11 12 12 define("context", "messages"); 13 13 14 templates_page_setup(); 15 templates_js_setup("messages"); 14 16 15 17 $title = run("profile:display:name") . " :: " . __gettext("Messages"); messages/trunk/languages/es_CO/LC_MESSAGES/es_CO.po
r103 r312 1 # SOME DESCRIPTIVE TITLE. 2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 1 # Copyright (C) Corporacin Somos ms 2007 3 2 # This file is distributed under the same license as the PACKAGE package. 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.3 # Nicols Martn <nicolas@somosmas.org>, 2007. 5 4 # 6 5 msgid "" … … 9 8 "POT-Creation-Date: 2007-01-06 02:52+0000\n" 10 9 "PO-Revision-Date: 2007-02-17 16:14+0000\n" 11 "Last-Translator: Nicol ás MartÃn <nicolas@somosmas.org>\n"10 "Last-Translator: Nicols Martn nicolas@somosmas.org>\n" 12 11 "Language-Team: Spanish (O2O) <nicolas@somosmas.org>\n" 13 12 "MIME-Version: 1.0\n" … … 106 105 #: lib.php:26 107 106 msgid "Your Messages" 108 msgstr "M is Mensajes"107 msgstr "Mensajes" 109 108 110 109 #: lib.php:40 … … 114 113 #: lib.php:45 115 114 msgid "Compose" 116 msgstr " Componer"115 msgstr "Redactar" 117 116 118 117 #: lib.php:50 … … 231 230 msgid "Send Message" 232 231 msgstr "Enviar mensaje" 232 233 #: lib/messages_new.php:69: 234 msgid "Send" 235 msgstr "Enviar" 236 237 #: lib/messages_message_detailedview.php:59: 238 msgid "Previous" 239 msgstr "Anterior" 240 241 #: lib/messages_init.php:22: 242 msgid "You must be logged in to send a message to another user!." 243 msgstr "Para enviar mensajes a usuarios del sitio debes ingresar primero!" 244 245 #: lib/messages_init.php:23: 246 msgid "If you are not registered in this site yet, please fill the following form." 247 msgstr "Si no te has registrado aún, puedes hacerlo llenando el siguiente formulario." 248 messages/trunk/lib.php
r152 r312 10 10 11 11 if (isloggedin() && user_info("user_type", $_SESSION['userid']) != "external") { 12 // Add the JavaScript functions13 // Lose the trailing slash14 $url= substr($CFG->wwwroot, 0, -1);15 $metatags .= "<script language=\"javascript\" type=\"text/javascript\" src=\"$url/mod/messages/messages.js\"></script>";16 12 $metatags .= "<link rel=\"stylesheet\" href=\"" . $CFG->wwwroot . "mod/messages/css.css\" type=\"text/css\" media=\"screen\" />"; 17 13 … … 21 17 'name' => 'messages', 22 18 'html' => '<li><a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/" class="selected">' . 23 __gettext("Your Messages") . " ($messages)".'</a></li>');19 __gettext("Your Messages") . " ($messages)".'</a></li>'); 24 20 } else { 25 21 $PAGE->menu[]= array ( … … 79 75 $function['users:infobox:menu:text'][] = $CFG->dirroot ."/mod/messages/lib/messages_sidebar_link.php"; 80 76 81 77 templates_add_js_context("messages","mod/messages/messages.js"); 78 82 79 // Inits the display field module param for the 'select' input field 83 80 // I know, I know this is a big cannon to kill a fly, but I want to use the display_input_field function :P … … 88 85 $CFG->display_field_module["as_select"]= "messages"; 89 86 } 87 90 88 } 91 89 … … 132 130 } 133 131 132 function messages_send_message($from,$recipients,$title,$message,$sent_user_msg=false){ 133 global $CFG,$messages; 134 135 $recipients = (!is_array($recipients))?array($recipients):$recipients; 136 137 $msgs = 0; 138 $msg = new StdClass; 139 $msg->from_id = trim($from); 140 $msg->title = trim($title); 141 $msg->posted = time(); 142 143 foreach ($recipients as $rcpt) { 144 $msg->to_id = trim($rcpt); 145 $message_ = str_replace("{{USER}}",user_info("name",$rcpt),$message); 146 $msg->body = trim($message_); 147 $insert_id = insert_record('messages', $msg); 148 if ($insert_id != -1) { 149 $msgs++; 150 } 151 // Send the email confirmation if configured 152 // Don't use the weblog plug-in hook because it inserts data in the messages table too 153 $notifications = user_flag_get("emailnotifications", $msg->to_id); 154 if ($notifications) { 155 $email_from = new StdClass; 156 $email_from->email = $CFG->noreplyaddress; 157 $email_from->name = $CFG->sitename; 158 159 if(!$sent_user_msg){ 160 $email_message = sprintf(__gettext("You have received a message from %s."), user_info("name", $msg->from_id)); 161 $email_message .= "\n\n"; 162 $email_message .= sprintf(__gettext("To reply, click here: %s"), $CFG->wwwroot . user_info("username", $msg->to_id) . "/messages/"); 163 $email_message = wordwrap($email_message); 164 } 165 else{ 166 $email_message = wordwrap($message); 167 } 168 if ($email_to = get_record_sql("select * from " . $CFG->prefix . "users where ident = " . $msg->to_id)) { 169 if (!email_to_user($email_to, $email_from, $msg->title, $email_message . "\n\n\n" . __gettext("You cannot reply to this message by email."))) { 170 $messages[] = __gettext("Failed to send email. An unknown error occurred."); 171 } 172 } 173 } 174 } 175 return $msgs; 176 } 177 134 178 ?> messages/trunk/lib/messages_config.php
r155 r312 8 8 * @copyright Corporación Somos Más - 2007 9 9 */ 10 11 10 /** 12 * Configure if the sidebar link display would beavailable for no member communities11 * Configure if the sidebar link display if available for no member communities 13 12 * Type: boolean 14 13 */ 15 define("MESSAGES_SIDEBAR_NO_MEMBER_LINK",true); 16 17 /** 18 * Configure if you want to enable to send messages to communities 19 * Type: boolean 20 */ 21 define("MESSAGES_COMMUNITY_MESSAGES",true); 14 define("MESSAGES_SIDEBAR_NO_MEMBER_LINK",false); 22 15 ?> messages/trunk/lib/messages_init.php
r152 r312 1 1 <?php 2 2 3 /* 3 4 * This script initialize the enviroment for the private messages plug-in. … … 10 11 global $USER, $messages; 11 12 if ($profile_name = optional_param('profile_name')) { 12 if ($profile_id = user_info_username('ident', $profile_name)) {13 $page_owner = $profile_id;14 }13 if ($profile_id = user_info_username('ident', $profile_name)) { 14 $page_owner = $profile_id; 15 } 15 16 } 16 17 17 18 if (empty ($profile_id)) { 18 $profile_id = optional_param("profile_id", optional_param("profileid", $_SESSION['userid'], PARAM_INT), PARAM_INT);19 $profile_id = optional_param("profile_id", optional_param("profileid", $_SESSION['userid'], PARAM_INT), PARAM_INT); 19 20 } 20 21 21 22 if (!logged_on) { 22 header("Location: " . url); 23 exit; 23 $messages[] = __gettext("You must be logged in to send a message to another user!."); 24 $messages[] = __gettext("If you are not registered in this site yet, please fill the following form."); 25 $_SESSION['messages'] = $messages; 26 header("Location: " . url . "/login/index.php"); 27 exit; 24 28 } 25 29 if ($profile_id != $USER->ident || !logged_on) { 26 $messages[] = __gettext("You may view only your own messages"); 27 $redirect_url = url . user_info('username', $USER->ident) . "/messages/"; 28 $_SESSION['messages'] = $messages; 29 header("Location: " . $redirect_url); 30 exit; 30 $messages[] = __gettext("You may view only your own messages"); 31 $redirect_url = url . user_info('username', $USER->ident) . "/messages/"; 32 $_SESSION['messages'] = $messages; 33 header("Location: " . $redirect_url); 34 exit; 35 } 36 37 $message = optional_param('message'); 38 if (isset ($message)) { 39 $msg = get_record('messages', 'ident', $message); 40 $sent = optional_param('sent'); 41 42 $authorid = ($sent == 0) ? $msg->to_id : $msg->from_id; 43 error_log($authorid); 44 error_log($USER->ident); 45 46 if ($authorid != $USER->ident || !logged_on) { 47 $messages[] = __gettext("You may view only your own messages"); 48 $redirect_url = url . user_info('username', $USER->ident) . "/messages/"; 49 $_SESSION['messages'] = $messages; 50 header("Location: " . $redirect_url); 51 exit; 52 } 31 53 } 32 54 ?> messages/trunk/lib/messages_message_detailedview.php
r152 r312 30 30 $author->ident= -1; 31 31 } 32 $author->icon= '<a href="' . url . $author->username . '/">' .user_icon_html($author->ident )."</a>";32 $author->icon= '<a href="' . url . $author->username . '/">' .user_icon_html($author->ident,60)."</a>"; 33 33 34 34 $date= strftime("%d %b %Y, %H:%M", $msg->posted); … … 46 46 $links .= ' <a href="' . $CFG->wwwroot . 'mod/messages/messages_actions.php?action=delete&sent=' . $sent . '&msg_id=' . $msg->ident . '" onclick="return confirm(\'' . $returnConfirm . '\')">' . $Delete . '</a> |'; 47 47 48 // Obtaining the previous and next messages for put the links here for easy navigation 49 $msgs_ids = $_SESSION['messages_ids'.$sent]; 50 51 for($ii=0; $ii < count($msgs_ids); $ii++){ 52 if($msgs_ids[$ii] == $msg->ident){ 53 $previous = ($ii>0)? $msgs_ids[$ii-1] : -1; 54 $next = (($ii + 1) < count($msgs_ids))? $msgs_ids[$ii+1] : -1; 55 } 56 } 57 58 if($previous!=-1){ 59 $msg_nav= '<a href="' . url . $_SESSION['username'] . '/messages/view/' . $previous . "/$sent\">" . __gettext("Previous") . "</a>"; 60 } 61 $msg_nav.=" | "; 62 if($next!=-1){ 63 $msg_nav.= '<a href="' . url . $_SESSION['username'] . '/messages/view/' . $next . "/$sent\">" . __gettext("Next") . "</a>"; 64 } 65 48 66 // Updated the message to the read status 49 67 if ($msg->status == "unread" && $msg->to_id == $profile_id) { … … 60 78 'from_icon' => $author->icon, 61 79 'body' => $body, 62 'links' => $links 80 'links' => $links, 81 'msg_nav' => $msg_nav 63 82 )); 64 83 } messages/trunk/lib/messages_new.php
r244 r312 28 28 $friend = get_record("users", "ident", $friend->friend); 29 29 if ($friend) { 30 if ($friend->user_type == "community" && MESSAGES_COMMUNITY_MESSAGES) { 31 $to_param[$friend->ident] = $friend->name." " . __gettext("(Community)"); 32 } 33 else if($friend->user_type != "community"){ 34 $to_param[$friend->ident] = $friend->name; 30 $to_param[$friend->ident] = $friend->name; 31 if ($friend->user_type == "community") { 32 $to_param[$friend->ident] .= " " . __gettext("(Community)"); 35 33 } 36 34 } messages/trunk/lib/messages_sidebar_link.php
r307 r312 1 1 <?php 2 3 2 4 /* 3 5 * This script shows the 'Send Message' link in the sidebar 4 6 * 5 * @uses $CFG ,$USER7 * @uses $CFG 6 8 * 7 9 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> … … 10 12 11 13 global $CFG, $USER; 12 $ owner = page_owner();14 $page_owner = page_owner(); 13 15 14 16 $community_membership_query = 'SELECT COUNT(u.ident) FROM ' . $CFG->prefix . 'friends f'; … … 16 18 $community_membership_query .= ' WHERE f.owner = ? AND f.friend = ?'; 17 19 18 if (isloggedin() && $ owner != $_SESSION['userid'] && $owner != -1) {19 $messages_link = '<ul><li><a href="' . $CFG->wwwroot . "mod/messages/compose.php?action=compose&to=$ owner" . '">' . __gettext("Send Message") . '</a></li></ul>';20 if (!MESSAGES_SIDEBAR_NO_MEMBER_LINK 21 && user_type($ owner) == "community"22 && count_records_sql($community_membership_query, array ($USER->ident,$ owner)) == 0) {20 if (isloggedin() && $page_owner != $_SESSION['userid'] && $page_owner != -1) { 21 $messages_link = '<ul><li><a href="' . $CFG->wwwroot . "mod/messages/compose.php?action=compose&to=$page_owner" . '">' . __gettext("Send Message") . '</a></li></ul>'; 22 if (!MESSAGES_SIDEBAR_NO_MEMBER_LINK 23 && user_type($page_owner) == "community" 24 && count_records_sql($community_membership_query, array ($USER->ident,$page_owner)) == 0) { 23 25 $messages_link = ''; 24 }25 else if(!MESSAGES_COMMUNITY_MESSAGES && user_type($owner) == "community" ){26 $messages_link = '';27 26 } 28 27 $run_result .= $messages_link; messages/trunk/lib/messages_view.php
r152 r312 51 51 } 52 52 53 //$posts = get_records_select('messages', "$where_sent AND from_id != -1 ", null, 'posted DESC', '*', $msg_offset, $msgs_per_page);54 //$numberofposts = count_records_select('messages', "$where_sent AND from_id != -1 ");55 53 56 $posts = get_records_select('messages', "$where_sent", null, 'posted DESC', '*', $msg_offset, $msgs_per_page); 54 $posts = get_records_select('messages', "$where_sent", null, 'posted DESC,ident ASC', '*', $msg_offset, $msgs_per_page); 55 $msgs_ids = get_records_sql("SELECT ident FROM {$CFG->prefix}messages WHERE $where_sent ORDER BY posted DESC, ident ASC"); 56 if(!empty($msgs_ids)){ 57 $_SESSION['messages_ids'.$sent] = array_keys($msgs_ids); 58 } 57 59 $numberofposts = count_records_select('messages', "$where_sent"); 58 60 … … 70 72 $next = __gettext("Next"); 71 73 72 if ($numberofposts - ($msg_offset + $msgs_per_page) > 0) {73 $display_msg_offset = $msg_offset + $msgs_per_page;74 $pagging .=<<< END75 76 <a href="{$CFG->wwwroot}{$msg_name}/messages/{$filterlink}msg_offset/{$display_msg_offset}">$next >></a>77 78 END;79 }80 74 if ($msg_offset > 0) { 81 75 $display_msg_offset = $msg_offset - $msgs_per_page; … … 85 79 $pagging .=<<< END 86 80 87 <a href="{$CFG->wwwroot}{$msg_name}/messages/{$filterlink}msg_offset/{$display_msg_offset}"><<$back</a>81 <a href="{$CFG->wwwroot}{$msg_name}/messages/{$filterlink}msg_offset/{$display_msg_offset}"><small><<</small> $back</a> 88 82 89 83 END; 90 84 } 91 85 86 if ($numberofposts - ($msg_offset + $msgs_per_page) > 0) { 87 $display_msg_offset = $msg_offset + $msgs_per_page; 88 $pagging .=<<< END 89 90 <a href="{$CFG->wwwroot}{$msg_name}/messages/{$filterlink}msg_offset/{$display_msg_offset}">$next <small>>></small></a> 91 92 END; 93 } 92 94 } 93 95 messages/trunk/messages_actions.php
r155 r312 34 34 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 35 35 * @copyright Corporación Somos Más - 2007 36 */36 */ 37 37 38 38 require_once (dirname(dirname(__FILE__)) . "/../includes.php"); 39 require_once (dirname(__FILE__) . "/lib/messages_config.php");40 39 41 40 /** … … 96 95 if ($from != -1 && $to != -1) { 97 96 if (trim($body) != "" && trim($subject) != "") { 98 $msg = new StdClass;99 $msg->from_id = trim($from);100 $msg->title = trim($subject);101 $msg->body = trim($body);102 $msg->posted = time();103 104 97 $recipients = array (); 105 98 $recipient = get_record("users", "ident", $to); 106 107 if($recipient->user_type == "community" && !MESSAGES_COMMUNITY_MESSAGES){108 $messages[] = __gettext("The administrator doesn't allow send community messages");109 define('redirect_url', $redirect_url);110 break;111 }112 113 99 if ($recipient->user_type == "community") { 114 100 $members = get_records_sql('SELECT u.*, f.ident AS friendident FROM ' . $CFG->prefix . 'friends f ' . 115 101 'JOIN ' . $CFG->prefix . 'users u ON u.ident = f.owner ' . 116 102 'WHERE f.friend = ? AND u.user_type = ?', array ($to,'person')); 117 118 103 foreach ($members as $key => $infoMember) { 119 104 $recipients[] = $key; 120 105 } 106 $subject = "[" . $recipient->name . "] " .$subject; 121 107 } else { 122 108 $recipients[] = $to; 123 109 } 124 110 125 $msgs = 0; 126 foreach ($recipients as $rcpt) { 127 $msg->to_id = trim($rcpt); 128 $msg->title = $subject; 129 if ($recipient->user_type == "community") { 130 $msg->title = "[" . $recipient->name . "] " . $subject; 131 } 132 $insert_id = insert_record('messages', $msg); 133 if ($insert_id != -1) { 134 $msgs++; 135 } 136 // Send the email confirmation if configured 137 // Don't use the weblog plug-in hook because it inserts data in the messages table too 138 $notifications = user_flag_get("emailnotifications", $msg->to_id); 139 if ($notifications) { 140 $email_from = new StdClass; 141 $email_from->email = $CFG->noreplyaddress; 142 $email_from->name = $CFG->sitename; 143 $email_message = sprintf(__gettext("You have received a message from %s."), user_info("name", $msg->from_id)); 144 $email_message .= "\n\n"; 145 $email_message .= sprintf(__gettext("To reply, click here: %s"), $CFG->wwwroot . user_info("username", $msg->to_id) . "/messages/"); 146 $email_message = wordwrap($email_message); 147 148 if ($email_to = get_record_sql("select * from " . $CFG->prefix . "users where ident = " . $msg->to_id)) { 149 if (!email_to_user($email_to, $email_from, $msg->title, $email_message . "\n\n\n" . __gettext("You cannot reply to this message by email."))) { 150 $messages[] = __gettext("Failed to send email. An unknown error occurred."); 151 } 152 } 153 } 154 } 155 111 $msgs = messages_send_message($from,$recipients,$subject,$body); 112 156 113 if ($msgs == count($recipients)) { 157 114 $messages[] = __gettext("Your message was sent"); … … 176 133 switch ($action_type) { 177 134 case "read"; 178 if ($msg->status == "unread") {179 $msg->status = "read";180 update_record('messages', $msg);181 }182 break;135 if ($msg->status == "unread") { 136 $msg->status = "read"; 137 update_record('messages', $msg); 138 } 139 break; 183 140 case "unread"; 184 if ($msg->status == "read") {185 $msg->status = "unread";186 update_record('messages', $msg);187 }188 break;141 if ($msg->status == "read") { 142 $msg->status = "unread"; 143 update_record('messages', $msg); 144 } 145 break; 189 146 case "delete"; 190 deleteMessage($option, $USER->ident,$sent);191 break;147 deleteMessage($option, $USER->ident,$sent); 148 break; 192 149 } 193 150 } messages/trunk/plugin.info
r223 r312 1 1 Maintainer: Diego Andrés RamÃrez Aragón <diego@somosmas.org> 2 2 Title: Messages plugin 3 Version: 0. 2.33 Version: 0.3 4 4 Package: messages 5 5 Distribution-URL: http://elgg.org/mod/plugins/plugin.php?id=18 messages/trunk/templates/messages_detailed_message.html
r152 r312 2 2 <h2>{{title}}</h2> 3 3 <div class="user"><!-- Open class user --> 4 {{from_icon}} <small>{{from_name}}</small> 4 {{from_icon}}<br/>{{from_name}} 5 5 </div><!-- Close class user --> 6 6 <div class="post"><!-- Open class post --> … … 9 9 <div class="info"><!-- Open class info --> 10 10 <p> 11 {{links}} 11 <span style="float:right;padding-right:10px">{{msg_nav}}</span> 12 {{links}} 12 13 </p> 13 14 </div><!-- Close class info --> messages/trunk/templates/messages_message.html
r152 r312 2 2 <td {{msg_style}} style="text-align:center;padding-left:2px;padding-right:2px">{{index}}</td> 3 3 <td {{msg_style}} style="text-align:center;padding-left:2px;padding-right:2px">{{mark}}</td> 4 <td {{msg_style}} valign="middle">{{from_icon}} {{from_name}}</td>5 <td {{msg_style}}> {{title}}</td>6 <td {{msg_style}}> {{date}}</td>4 <td {{msg_style}} align="center" valign="middle">{{from_icon}}<br/><small>{{from_name}}</small></td> 5 <td {{msg_style}}><p>{{title}}</p></td> 6 <td {{msg_style}}><p>{{date}}</p></td> 7 7 </tr> messages/trunk/templates/messages_messages.html
r152 r312 2 2 <form method="post" name="message_form" action="{{action_form}}" onsubmit="return submitForm();"> 3 3 <input type="hidden" name="sent" value="{{sent}}"> 4 <h 2>{{title}}</h2>4 <h3>{{title}}</h3> 5 5 <table id="messages_table" cellspacing="0" width="100%"> 6 6 <tr> 7 7 <th colspan="4" style="text-align:left"> 8 {{action}} 8 <p>{{action}} 9 9 <select name="message_action_type" id="message_action_type" onchange="submitMessagesAction(this,message_form,'{{returnConfirm}}')"> 10 10 <option value="-1">{{actionMsg}}</option> 11 11 {{action_options}} 12 </select>12 </select></p> 13 13 </th> 14 14 <th> </th> … … 16 16 <tr> 17 17 <th width="4%" colspan="2"> </th> 18 <th width="23%"> {{from_to}}</th>19 <th width="50%"> {{subject}}</th>20 <th width="33%"> {{date}}</th>18 <th width="23%"><p>{{from_to}}</p></th> 19 <th width="50%"><p>{{subject}}</p></th> 20 <th width="33%"><p>{{date}}</p></th> 21 21 </tr> 22 22 {{messages}} 23 23 <tr> 24 <th colspan="4" style="text-align:left"> {{paging}}</th>24 <th colspan="4" style="text-align:left"><p>{{paging}}</p></th> 25 25 <th> </th> 26 26 </tr>
