Changeset 155
- Timestamp:
- 12/14/07 20:40:30 (1 year ago)
- Files:
-
- messages/trunk/CHANGELOG.txt (modified) (1 diff)
- messages/trunk/CONTRIBUTORS.txt (modified) (1 diff)
- messages/trunk/README.txt (modified) (1 diff)
- messages/trunk/default_template.php (modified) (1 diff)
- messages/trunk/languages/fi (added)
- messages/trunk/languages/fi/LC_MESSAGES (added)
- messages/trunk/languages/fi/LC_MESSAGES/elgg.mo (added)
- messages/trunk/languages/fi/LC_MESSAGES/fi.po (added)
- messages/trunk/lib/messages_config.php (modified) (1 diff)
- messages/trunk/lib/messages_new.php (modified) (1 diff)
- messages/trunk/lib/messages_sidebar_link.php (modified) (2 diffs)
- messages/trunk/messages_actions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
messages/trunk/CHANGELOG.txt
r152 r155 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 5 Version 0.2.1 2 6 Translations to nl (Thanks to Daniel Dubbeldam) messages/trunk/CONTRIBUTORS.txt
r152 r155 9 9 Daniel Dubbeldam 10 10 Translations to nl 11 Pasi Havia (http://www.elgg.org/encore) 12 Translations to fi 13 Some 0.9 compatibility bug fixes messages/trunk/README.txt
r152 r155 18 18 If you want to change this behavior you must change the value of MESSAGES_SIDEBAR_NO_MEMBER_LINK 19 19 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 in 24 the 'messages/lib/messages_config.php' file. messages/trunk/default_template.php
r153 r155 6 6 * @copyright Corporación Somos Más - 2007 7 7 */ 8 global $template;9 global $template_definition;10 8 9 // Add CSS 11 10 templates_add_context('css', 'mod/messages/css.css', true, true); 12 11 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 ); 12 // Add page templates 27 13 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"); 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"); 58 17 59 18 ?> messages/trunk/lib/messages_config.php
r152 r155 8 8 * @copyright Corporación Somos Más - 2007 9 9 */ 10 10 11 /** 11 * Configure if the sidebar link display ifavailable for no member communities12 * Configure if the sidebar link display would be available for no member communities 12 13 * Type: boolean 13 14 */ 14 define("MESSAGES_SIDEBAR_NO_MEMBER_LINK",false); 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); 15 22 ?> messages/trunk/lib/messages_new.php
r152 r155 28 28 $friend = get_record("users", "ident", $friend->friend); 29 29 if ($friend) { 30 $to_param[$friend->ident] = $friend->name; 31 if ($friend->user_type == "community") { 32 $to_param[$friend->ident] .= " " . __gettext("(Community)"); 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; 33 35 } 34 36 } messages/trunk/lib/messages_sidebar_link.php
r152 r155 1 1 <?php 2 3 4 2 /* 5 3 * This script shows the 'Send Message' link in the sidebar 6 4 * 7 * @uses $CFG 5 * @uses $CFG,$USER 8 6 * 9 7 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> … … 20 18 if (isloggedin() && $page_owner != $_SESSION['userid'] && $page_owner != -1) { 21 19 $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 20 if (!MESSAGES_SIDEBAR_NO_MEMBER_LINK 23 21 && user_type($page_owner) == "community" 24 22 && count_records_sql($community_membership_query, array ($USER->ident,$page_owner)) == 0) { 25 23 $messages_link = ''; 24 } 25 else if(!MESSAGES_COMMUNITY_MESSAGES && user_type($page_owner) == "community" ){ 26 $messages_link = ''; 26 27 } 27 28 $run_result .= $messages_link; messages/trunk/messages_actions.php
r152 r155 37 37 38 38 require_once (dirname(dirname(__FILE__)) . "/../includes.php"); 39 require_once (dirname(__FILE__) . "/lib/messages_config.php"); 39 40 40 41 /** … … 103 104 $recipients = array (); 104 105 $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 105 113 if ($recipient->user_type == "community") { 106 114 $members = get_records_sql('SELECT u.*, f.ident AS friendident FROM ' . $CFG->prefix . 'friends f ' . 107 115 'JOIN ' . $CFG->prefix . 'users u ON u.ident = f.owner ' . 108 'WHERE f.friend = ? AND u.user_type = ?', array ( 109 $to, 110 'person' 111 )); 116 'WHERE f.friend = ? AND u.user_type = ?', array ($to,'person')); 112 117 113 118 foreach ($members as $key => $infoMember) {
