Changeset 102
- Timestamp:
- 05/03/07 13:28:27 (2 years ago)
- Files:
-
- messages/CHANGELOG.txt (modified) (1 diff)
- messages/compose.php (modified) (1 diff)
- messages/css.css (modified) (1 diff)
- messages/default_template.php (modified) (1 diff)
- messages/index.php (modified) (1 diff)
- messages/languages (added)
- messages/languages/es_CO (added)
- messages/languages/es_CO/LC_MESSAGES (added)
- messages/languages/es_CO/LC_MESSAGES/elgg.mo (added)
- messages/languages/es_CO/LC_MESSAGES/es_CO.po (added)
- messages/lib (added)
- messages/lib.php (modified) (4 diffs)
- messages/lib/messages_init.php (added)
- messages/lib/messages_message_detailedview.php (added)
- messages/lib/messages_message_view.php (added)
- messages/lib/messages_new.php (added)
- messages/lib/messages_view.php (added)
- messages/main.php (deleted)
- messages/messages_actions.php (modified) (1 diff)
- messages/messages_init.php (deleted)
- messages/messages_message_detailedview.php (deleted)
- messages/messages_message_view.php (deleted)
- messages/messages_new.php (deleted)
- messages/messages_view.php (deleted)
- messages/strings.txt (deleted)
- messages/templates (added)
- messages/templates/messages_detailed_message.html (added)
- messages/templates/messages_message.html (added)
- messages/templates/messages_messages.html (added)
- messages/view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
messages/CHANGELOG.txt
r93 r102 1 Version 0.1.4 2 Added the messages counter in the toolbar string 3 Code refactor 4 Spanish translation 1 5 Version 0.1.3 2 6 Fix a problem with the css messages/compose.php
r80 r102 6 6 */ 7 7 require_once (dirname(dirname(__FILE__)) . "/../includes.php"); 8 require_once (dirname(__FILE__) . "/main.php");9 8 10 9 run("profile:init"); messages/css.css
r93 r102 3 3 4 4 #messages_table th{ 5 color: #6D929B;6 border-right: 1px solid #CCCCCC;7 border-left: 1px solid #CCCCCC;8 text-align: center;9 padding: 6px 6px 6px 12px;10 background: #EFEFEF;5 color: #6D929B; 6 border-right: 1px solid #CCCCCC; 7 border-left: 1px solid #CCCCCC; 8 text-align: center; 9 padding: 6px 6px 6px 12px; 10 background: #EFEFEF; 11 11 } 12 12 #messages_table td{ 13 background: #fff;14 padding: 2px 2px 2px 10px;15 font-weight: bold;16 border-right: 1px solid #CCCCCC;17 border-left: 1px solid #CCCCCC;13 background: #fff; 14 padding: 2px 2px 2px 10px; 15 font-weight: bold; 16 border-bottom: 1px solid #CCCCCC; 17 border-left: 1px solid #CCCCCC; 18 18 } 19 19 #messages_table td.message_read{ 20 background: #F5FAFA;21 padding: 2px 2px 2px 10px;22 font-weight: normal;20 background: #F5FAFA; 21 padding: 2px 2px 2px 10px; 22 font-weight: normal; 23 23 } 24 24 #detailed_message h3{ 25 color: #000;25 color: #000; 26 26 } messages/default_template.php
r93 r102 9 9 global $template_definition; 10 10 11 $postedby = __gettext("Sent by");12 $date = __gettext("Date");13 $subject = __gettext("Subject");14 15 $action = __gettext("Action:");16 $actionMsg = __gettext("Select an action");17 $returnConfirm = __gettext("Are you sure you want to permanently delete this message(s)?");18 19 11 $template['css'] .= file_get_contents($CFG->dirroot . "mod/messages/css.css"); 20 12 21 13 // Registering template definitions 22 $template_definition[] = array ( 23 'id' => 'plug_messages', 24 'name' => __gettext("Message List" 25 ), 'description' => __gettext("A template for the message list"), 'glossary' => array ( 26 '{{messages}}' => __gettext("The list of messages themselves" 27 ), '{{paging}}' => __gettext("The list of page links when there are lots of messages"), '{{from_to}}' => __gettext("From | To Label for the message list"))); 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 ); 28 27 29 $template_definition[] = array (30 'id' => 'plug_message',31 'name' => __gettext("Message"32 ), 'description' => __gettext("A template for each message"), 'glossary' => array (33 '{{date}}' => __gettext("The time and date of the message"34 ), '{{title}}' => __gettext("Message title"), '{{from_username}}' => __gettext("The username from the sender"), '{{from_name}}' => __gettext("The full name from the sender"), '{{from_icon}}' => __gettext("The icon from the sender"), '{{msg_style}}' => __gettext("The message status style (read|unread)")));35 28 36 $template_definition[] = array ( 37 'id' => 'plug_detailedmessage', 38 'name' => __gettext("Message" 39 ), 'description' => __gettext("A template for each message"), 'glossary' => array ( 40 '{{date}}' => __gettext("The time and date of the message" 41 ), '{{title}}' => __gettext("Message title"), '{{from_username}}' => __gettext("The username from the sender"), '{{from_name}}' => __gettext("The full name from the sender"), '{{from_icon}}' => __gettext("The icon from the sender"), '{{body}}' => __gettext("The message body text"), '{{links}}' => __gettext("Links related with the message (delete|reply)"))); 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 ); 42 40 43 $template['plug_messages'] =<<< END 44 <div id="messages"><!-- start comments div --> 45 <form method="post" name="message_form" action="{{action_form}}" onsubmit="return submitForm();"> 46 <input type="hidden" name="sent" value="{{sent}}"> 47 <h2>{{title}}</h2> 48 <table id="messages_table" cellspacing="0" width="100%"> 49 <tr> 50 <th colspan="3" style="text-align:left"> 51 $action 52 <select name="message_action_type" id="message_action_type" onchange="submitMessagesAction(this,message_form,'$returnConfirm')"> 53 <option value="-1">$actionMsg</option> 54 {{action_options}} 55 </select> 56 </th> 57 <th>{{paging}}</th> 58 </tr> 59 <tr> 60 <th width="2%"> </th> 61 <th width="23%">{{from_to}}</th> 62 <th width="50%">$subject</th> 63 <th width="35%">$date</th> 64 </tr> 65 {{messages}} 66 <tr> 67 <th colspan="3"> </th> 68 <th>{{paging}}</th> 69 </tr> 70 </table> 71 </form> 72 </div><!-- end comments div --> 73 END; 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 ); 74 53 75 $template['plug_message'] =<<< END76 <tr>77 <td {{msg_style}} >{{mark}}</td>78 <td {{msg_style}} valign="middle">{{from_icon}} {{from_name}}</td>79 <td {{msg_style}}>{{title}}</td>80 <td {{msg_style}}>{{date}}</td>81 </tr>82 END;83 54 84 $template['plug_detailedmessage'] =<<< END 85 <div id="detailed_message"><!-- Holds all aspects of a blog post --> 86 <h2>{{title}}</h2> 87 <div class="user"><!-- Open class user --> 88 {{from_icon}} <small>{{from_name}}</small> 89 </div><!-- Close class user --> 90 <div class="post"><!-- Open class post --> 91 {{body}} 92 </div><!-- Close class post --> 93 <div class="info"><!-- Open class info --> 94 <p> 95 {{links}} 96 </p> 97 </div><!-- Close class info --> 98 </div><!-- Close weblog_post --> 99 <div class="clearing"></div> 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"); 100 58 101 END;102 59 ?> messages/index.php
r80 r102 6 6 */ 7 7 require_once (dirname(dirname(__FILE__)) . "/../includes.php"); 8 require_once (dirname(__FILE__) . "/main.php");9 8 10 9 run("profile:init"); messages/lib.php
r93 r102 2 2 function messages_pagesetup() { 3 3 // register links -- 4 global $profile_id,$PAGE,$CFG,$metatags,$function ;4 global $profile_id,$PAGE,$CFG,$metatags,$function,$USER; 5 5 6 6 $pgowner= $profile_id; 7 7 8 /* 9 foreach($function['display:sidebar'] as $key => $file) 10 { 11 echo "$key => $file<br>"; 12 } 13 14 */ 8 require_once $CFG->dirroot . "mod/messages/default_template.php"; 15 9 16 10 if (isloggedin() && user_info("user_type", $_SESSION['userid']) != "external") { … … 21 15 $metatags .= "<link rel=\"stylesheet\" href=\"" . $CFG->wwwroot . "mod/messages/css.css\" type=\"text/css\" media=\"screen\" />"; 22 16 17 //$messages = count_records_select('messages','to_id='.$USER->ident." AND status='unread' and from_id >= 0"); 18 $messages = count_records_select('messages','to_id='.$USER->ident." AND status='unread'"); 23 19 if (defined("context") && context == "messages" && $pgowner == $_SESSION['userid']) { 24 20 $PAGE->menu[]= array ( 25 21 'name' => 'messages', 26 'html' => '<li><a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/" class="selected">' . __gettext("Your Messages"27 ) .'</a></li>');22 'html' => '<li><a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/" class="selected">' . 23 __gettext("Your Messages") . " ($messages)".'</a></li>'); 28 24 } else { 29 25 $PAGE->menu[]= array ( 30 26 'name' => 'messages', 31 'html' => '<li><a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/">' . __gettext("Your Messages" 32 ). '</a></li>');27 'html' => '<li><a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/">' . __gettext("Your Messages") . 28 " ($messages)". '</a></li>'); 33 29 } 34 30 … … 38 34 $PAGE->menu_sub[]= array ( 39 35 'name' => 'messages:list', 40 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/">' . __gettext("View Messages" 41 ) . '</a>'); 36 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/">' . __gettext("View Messages") . '</a>'); 42 37 43 38 $PAGE->menu_sub[]= array ( 44 39 'name' => 'messages:compose', 45 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/compose">' . __gettext("Compose" 46 ) . '</a>'); 40 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/compose">' . __gettext("Compose") . '</a>'); 47 41 48 42 $PAGE->menu_sub[]= array ( 49 43 'name' => 'messages:sent', 50 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/sent">' . __gettext("Sent Messages" 51 ) . '</a>'); 44 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/sent">' . __gettext("Sent Messages") . '</a>'); 52 45 } 53 46 } … … 68 61 } 69 62 } 63 64 // Functions to perform initializacion 65 66 $function['messages:init'][] = $CFG->dirroot . "mod/messages/lib/messages_init.php"; 67 68 // Compose / Delete messages 69 $function['messages:new'][] = $CFG->dirroot . "mod/messages/lib/messages_new.php"; 70 $function['messages:new:body'][] = $CFG->dirroot . "units/tinymce/tinymce_js.php"; 71 72 // View a message 73 $function['messages:view'][] = $CFG->dirroot . "mod/messages/lib/messages_view.php"; 74 $function['messages:message:view'][] = $CFG->dirroot . "mod/messages/lib/messages_message_view.php"; 75 $function['messages:detailedview'][] = $CFG->dirroot . "mod/messages/lib/messages_message_detailedview.php"; 76 70 77 // Inits the display field module param for the 'select' input field 71 78 // I know, I know this is a big cannon to kill a fly, but I want to use the display_input_field function :P messages/messages_actions.php
r93 r102 37 37 38 38 require_once (dirname(dirname(__FILE__)) . "/../includes.php"); 39 require_once (dirname(__FILE__) . "/main.php");40 39 41 40 /** messages/view.php
r80 r102 7 7 */ 8 8 require_once (dirname(dirname(__FILE__)) ."/../includes.php"); 9 require_once (dirname(__FILE__) . "/main.php");10 9 11 10 run("profile:init");
