Changeset 113
- Timestamp:
- 06/11/07 05:08:57 (1 year ago)
- Files:
-
- messages/CHANGELOG.txt (modified) (1 diff)
- messages/CONTRIBUTORS.txt (added)
- messages/README.txt (modified) (1 diff)
- messages/ROADMAP.txt (added)
- messages/compose.php (modified) (1 diff)
- messages/default_template.php (modified) (1 diff)
- messages/index.php (modified) (1 diff)
- messages/languages/es (added)
- messages/languages/es/LC_MESSAGES (added)
- messages/languages/es/LC_MESSAGES/elgg.mo (added)
- messages/languages/es/LC_MESSAGES/es.po (added)
- messages/languages/pt_BR (added)
- messages/languages/pt_BR/LC_MESSAGES (added)
- messages/languages/pt_BR/LC_MESSAGES/elgg.mo (added)
- messages/languages/pt_BR/LC_MESSAGES/pt_BR.po (added)
- messages/lib.php (modified) (3 diffs)
- messages/lib/messages_config.php (added)
- messages/lib/messages_init.php (modified) (1 diff)
- messages/lib/messages_message_detailedview.php (modified) (1 diff)
- messages/lib/messages_message_view.php (modified) (1 diff)
- messages/lib/messages_new.php (modified) (1 diff)
- messages/lib/messages_sidebar_link.php (modified) (1 diff)
- messages/lib/messages_view.php (modified) (1 diff)
- messages/messages_actions.php (modified) (3 diffs)
- messages/view.php (modified) (1 diff)
- template_wrapper/CHANGELOG.txt (added)
- template_wrapper/README.txt (modified) (1 diff)
- template_wrapper/globalwrapper.php (modified) (1 diff)
- template_wrapper/languages (added)
- template_wrapper/languages/es_CO (added)
- template_wrapper/languages/es_CO/LC_MESSAGES (added)
- template_wrapper/languages/es_CO/LC_MESSAGES/elgg.po (added)
- template_wrapper/languages/es_CO/LC_MESSAGES/es_CO.po (added)
- template_wrapper/lib.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
messages/CHANGELOG.txt
r103 r113 1 Version 0.2.1 2 Translations to pt_BR (Thanks to Renato) 3 Sidebar links display improvements 4 Fixed but with the delete of system messages that didn't be read 5 Added the CONTRIBUTORS.txt file 6 Added the lib/messages_config.php for configuration options 1 7 Version 0.2 2 8 Bug fixes messages/README.txt
r93 r113 9 9 RewriteRule ^([A-Za-z0-9]+)\/messages\/compose$ mod/messages/compose.php?profile_name=$1 10 10 RewriteRule ^([A-Za-z0-9]+)\/messages\/view\/([0-9]+)\/([0-1])$ mod/messages/view.php?profile_name=$1&message=$2&sent=$3 11 12 Configuration Options 13 ===================== 14 15 By default the plugin disables the 'Send Message' sidebar link for communities where 16 you are not member. 17 18 If you want to change this behavior you must change the value of MESSAGES_SIDEBAR_NO_MEMBER_LINK 19 in the 'messages/lib/messages_config.php' file. messages/compose.php
r102 r113 2 2 /* 3 3 * This script initialize the enviroment for create a new message 4 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>5 * @copyright Corporaci ón Somos Más - 20074 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 5 * @copyright Corporación Somos Más - 2007 6 6 */ 7 7 require_once (dirname(dirname(__FILE__)) . "/../includes.php"); messages/default_template.php
r102 r113 3 3 * This script configure the templates used for the private messages plug-in 4 4 * 5 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>6 * @copyright Corporaci ón Somos Más - 20075 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 6 * @copyright Corporación Somos Más - 2007 7 7 */ 8 8 global $template; messages/index.php
r102 r113 2 2 /* 3 3 * This script initialize the enviroment for show the message list 4 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>5 * @copyright Corporaci ón Somos Más - 20074 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 5 * @copyright Corporación Somos Más - 2007 6 6 */ 7 7 require_once (dirname(dirname(__FILE__)) . "/../includes.php"); messages/lib.php
r103 r113 6 6 $pgowner= $profile_id; 7 7 8 require_once $CFG->dirroot . "mod/messages/lib/messages_config.php"; 8 9 require_once $CFG->dirroot . "mod/messages/default_template.php"; 9 10 … … 15 16 $metatags .= "<link rel=\"stylesheet\" href=\"" . $CFG->wwwroot . "mod/messages/css.css\" type=\"text/css\" media=\"screen\" />"; 16 17 17 //$messages = count_records_select('messages','to_id='.$USER->ident." AND status='unread' and from_id >= 0");18 18 $messages = count_records_select('messages','to_id='.$USER->ident." AND status='unread'"); 19 19 if (defined("context") && context == "messages" && $pgowner == $_SESSION['userid']) { … … 88 88 $CFG->display_field_module["as_select"]= "messages"; 89 89 } 90 91 $CFG->templates->variables_substitute['contact'] = 'messages_contact_user';92 93 90 } 94 91 messages/lib/messages_init.php
r102 r113 3 3 * This script initialize the enviroment for the private messages plug-in. 4 4 * It checks if the user is logged and if he is trying to access another Inbox 5 * 6 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>7 * @copyright Corporaci ón Somos Más - 20075 * 6 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 7 * @copyright Corporación Somos Más - 2007 8 8 */ 9 9 messages/lib/messages_message_detailedview.php
r103 r113 10 10 * @uses $CFG 11 11 * 12 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>13 * @copyright Corporaci ón Somos Más - 200712 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 13 * @copyright Corporación Somos Más - 2007 14 14 */ 15 15 if (isset ($parameter)) { messages/lib/messages_message_view.php
r103 r113 10 10 * @uses $CFG 11 11 * 12 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>13 * @copyright Corporaci ón Somos Más - 200712 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 13 * @copyright Corporación Somos Más - 2007 14 14 */ 15 15 messages/lib/messages_new.php
r103 r113 11 11 * @uses $CFG 12 12 * 13 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>14 * @copyright Corporaci ón Somos Más - 200713 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 14 * @copyright Corporación Somos Más - 2007 15 15 */ 16 16 messages/lib/messages_sidebar_link.php
r103 r113 1 1 <?php 2 global $CFG; 3 $page_owner = page_owner(); 4 if(isloggedin() && $page_owner != $_SESSION['userid']) { 5 $run_result.= '<a href="'.$CFG->wwwroot."mod/messages/compose.php?action=compose&to=$page_owner".'">'.__gettext("Send Message").'</a>'; 6 } else { 7 $run_result.= ''; 8 } 2 3 4 /* 5 * This script shows the 'Send Message' link in the sidebar 6 * 7 * @uses $CFG 8 * 9 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 10 * @copyright Corporación Somos Más - 2007 11 */ 12 13 global $CFG, $USER; 14 $page_owner = page_owner(); 15 16 $community_membership_query = 'SELECT COUNT(u.ident) FROM ' . $CFG->prefix . 'friends f'; 17 $community_membership_query .= ' LEFT JOIN ' . $CFG->prefix . 'users u ON u.ident = f.friend'; 18 $community_membership_query .= ' WHERE f.owner = ? AND f.friend = ?'; 19 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) { 25 $messages_link = ''; 26 } 27 $run_result .= $messages_link; 28 } else { 29 $run_result .= ''; 30 } 9 31 ?> messages/lib/messages_view.php
r103 r113 10 10 * @uses $db 11 11 * 12 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>13 * @copyright Corporaci ón Somos Más - 200712 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 13 * @copyright Corporación Somos Más - 2007 14 14 */ 15 15 messages/messages_actions.php
r103 r113 32 32 * @uses $messages 33 33 * 34 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>35 * @copyright Corporaci ón Somos Más - 200734 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 35 * @copyright Corporación Somos Más - 2007 36 36 */ 37 37 … … 47 47 global $messages; 48 48 if ($msg_info = get_record('messages', 'ident', $msg)) { 49 error_log("borrando $msg, $user, $sent");50 49 if($sent){ 51 50 $msg_info->hidden_from = '1'; … … 54 53 $msg_info->hidden_to = '1'; 55 54 } 55 $msg_info->status = "read"; 56 56 update_record('messages', $msg_info); 57 57 if ($msg_info->hidden_from && $msg_info->hidden_to) { messages/view.php
r102 r113 3 3 * This script initialize the enviroment for view a message 4 4 * @param int $message The msg Id 5 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>6 * @copyright Corporaci ón Somos Más - 20075 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 6 * @copyright Corporación Somos Más - 2007 7 7 */ 8 8 require_once (dirname(dirname(__FILE__)) ."/../includes.php"); template_wrapper/README.txt
r99 r113 15 15 ============== 16 16 17 T he use of the 'template_wrapper' its straightforward.17 To use the 'template_wrapper' you must to follow the following steps: 18 18 19 - First at all you need to specify the default_template_wrapper for your wrapped 20 pages. That its doing by the 'set_default_wrapper' function. 19 - If you will be 'wrap' many pages you should configure an template wrapper for it. 20 To do that you must to specify the default template wrapper through 21 the 'set_default_wrapper' function in the 'template_wrapper_init' at 'template_wrapper/lib.php'. 21 22 For example: 22 23 set_default_wrapper($CFG->dirroot."mod/template/templates/Default_Template/searchtemplate"); 23 24 24 - Then you can add a template_wrapper for each page that you want to have an special 25 layout. 25 - Add a template_wrapper for each page that you want to have an special layout. 26 Add it in the 'template_wrapper_init' at 'template_wrapper/lib.php' 27 If you configure a default template wrapper an you want to use it you could ommit the third argument. 26 28 For example: 27 add_template_wrapper("register",$CFG->dirroot."mod/invite/register.php" ,$CFG->dirroot."mod/template/templates/Default_Template/logintemplate");29 add_template_wrapper("register",$CFG->dirroot."mod/invite/register.php"); 28 30 add_template_wrapper("join",$CFG->dirroot."mod/invite/join.php",$CFG->dirroot."mod/template/templates/Default_Template/logintemplate"); 29 add_template_wrapper("forgottenpassword",$CFG->dirroot."mod/invite/forgotten_password.php",$CFG->dirroot."mod/template/templates/Default_Template/logintemplate");30 add_template_wrapper("newpassword",$CFG->dirroot."mod/invite/new_password.php",$CFG->dirroot."mod/template/templates/Default_Template/logintemplate");31 31 32 - Finally you must to configure in your .htaccess file the redirection 32 - Finally you must to configure in your .htaccess file the redirection. 33 Note: the 'page' parameter ist the SAME name that you configure through 34 the 'add_template_wrapper' function. 33 35 For example: 34 36 ReWriteRule ^register$ mod/template_wrapper/globalwrapper.php?page=register 35 ReWriteRule ^invite\/join\/([A-Za-z0-9]+)$ mod/template_wrapper/globalwrapper.php?page=join&invitecode=$1 36 RewriteRule ^forgottenpassword$ mod/template_wrapper/globalwrapper.php?page=forgottenpassword 37 RewriteRule ^newpassword\/([A-Za-z0-9]+)$ mod/template_wrapper/globalwrapper.php?page=newpassword&passwordcode=$1 37 ReWriteRule ^invite\/join\/([A-Za-z0-9]+)$ mod/template_wrapper/globalwrapper.php?page=join&invitecode=$1 38 38 39 Note that in some cases to make it work you need to change some elgg code for generate 40 the links or form actions in the redirect form that you are configuring. 41 39 Notes: 40 - Personaly, I suggest to add your wrapper templates with your Elgg theme. 41 - Note that in some cases to make it work you need to change some elgg code for generate 42 the links or form actions in the redirect form that you are configuring. template_wrapper/globalwrapper.php
r99 r113 5 5 * Created on Apr 19, 2007 6 6 * 7 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>8 * @copyright Corporaci ón Somos más - 20077 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 8 * @copyright Corporación Somos más - 2007 9 9 */ 10 10 require_once(dirname(dirname(__FILE__))."/../includes.php"); 11 11 global $default_template_wrapper; 12 12 global $template_wrapper; 13 global $template; 13 14 14 15 $page = optional_param("page"); template_wrapper/lib.php
r99 r113 5 5 * Created on Apr 23, 2007 6 6 * 7 * @author Diego Andr és Ramírez Aragón <diego@somosmas.org>8 * @copyright Corporaci ón Somos más - 20077 * @author Diego Andrés RamÃrez Aragón <diego@somosmas.org> 8 * @copyright Corporación Somos más - 2007 9 9 */ 10 10 global $template_wrapper; … … 15 15 16 16 function template_wrapper_pagesetup(){ 17 } 18 19 function template_wrapper_init(){ 20 // Setup the default template_wrapper. It is usefull if you will share a wrapped template 21 // for many pages 22 //set_default_wrapper($CFG->dirroot."mod/template/templates/Default_Template/searchtemplate"); 23 // Add a template wrapper using the default wrapper 24 //add_template_wrapper("register",$CFG->dirroot."mod/invite/register.php"); 25 // Add a template wrapper using a specific template for it 26 //add_template_wrapper("join",$CFG->dirroot."mod/invite/join.php",$CFG->dirroot."mod/template/templates/Default_Template/logintemplate"); 17 27 } 18 28
