From 60a2720895ade561d7d0b40381fbcb9c0876a52a Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 21 Jan 2009 20:50:57 +0100 Subject: [PATCH] [svn r17903] Adding/fixing the message tool FS#3503 --- main/messages/functions.inc.php | 215 -------------------------------- main/messages/images/newmsg.gif | Bin 1476 -> 0 bytes main/messages/inbox.php | 59 +++++---- main/messages/index.php | 78 +++++------- main/messages/new_message.php | 99 +++++++-------- main/messages/notify.php | 24 ++-- main/messages/view_message.php | 128 +++++++++---------- 7 files changed, 186 insertions(+), 417 deletions(-) delete mode 100755 main/messages/functions.inc.php delete mode 100755 main/messages/images/newmsg.gif diff --git a/main/messages/functions.inc.php b/main/messages/functions.inc.php deleted file mode 100755 index d35ba8ef4d..0000000000 --- a/main/messages/functions.inc.php +++ /dev/null @@ -1,215 +0,0 @@ -". - get_lang('MessageSentTo'). - " ". - GetFullUserName($uid). - "". - "
". - get_lang('BackToInbox'). - ""; - Display::display_confirmation_message($success, false); -} - -/** -* @todo this function seems no longer user -* but is still mentioned in comments, what can be the use? -*/ -function validate_text($texto) -{ - $MAX_SIZE = 60; /*Tama� m�imo de caracteres por l�ea*/ - $i=0; - $lines = array(); /*Arreglo que contendr�las l�eas del texto*/ - $token = strtok($texto, "\n"); - while($token) - { - $lines[$i]= $token; - $token = strtok("\n"); - $i++; - } - $modificado= ""; - for($i=0; $i$MAX_SIZE + 1) - { - $modificado2= substr($lines[$i], 0, $MAX_SIZE); - for($j=$MAX_SIZE; $j", ">", $modificado); // �em - - - return $modificado; -} - -/** -* Displays the wysiwyg html editor. -*/ -function display_html_editor_area($name,$resp) -{ - api_disp_html_area($name, 'Type your message here.', '', '100%'); -} - -/** -* Get the new messages for the current user from the database. -*/ -function get_new_messages() -{ - if (!api_get_user_id()) - { - return false; - } - $i=0; - $query = "SELECT * FROM `".MESSAGES_DATABASE."` WHERE id_receiver=".api_get_user_id()." AND status=1;"; - $result = api_sql_query($query,__FILE__,__LINE__); - $i = mysql_num_rows($result); - return $i; -} - -/** -* Get the list of user_ids of users who are online. -*/ -function users_connected_by_id() -{ - global $_configuration, $_user; - $MINUTE=30; - $user_connect = WhoIsOnline($_user['user_id'],$_configuration['statistics_database'],$MINUTE); - for ($i=0; $i".GetFullUserName($result[1]).""; - $message[2] = ''.$result[2].''; - $message[3] = $result[3]; //date stays the same - $message[4] = ''.get_lang('; - $message_list[] = $message; - $i++; - } - return $message_list; -} - -/** -* Displays the inbox of a user, listing all messages. -* In the process of moving towards sortable table. -*/ -function inbox_display() -{ - //delete messages if delete action was chosen - if (isset ($_POST['action'])) - { - switch ($_POST['action']) - { - case 'delete' : - $number_of_selected_messages = count($_POST['id']); - foreach ($_POST['id'] as $index => $message_id) - { - $query = "DELETE FROM ".MESSAGES_DATABASE." WHERE id_receiver=".api_get_user_id()." AND id='".mysql_real_escape_string($message_id)."'"; - api_sql_query($query,__FILE__,__LINE__); - } - Display :: display_normal_message(get_lang('SelectedMessagesDeleted')); - break; - } - } - - // display sortable table with messages of the current user - $table = new SortableTable('messages', 'get_number_of_messages', 'get_message_data', 1); - $table->set_header(0, '', false); - $table->set_header(1, get_lang('From')); - $table->set_header(2, get_lang('Title')); - $table->set_header(3, get_lang('Date')); - $table->set_header(4, get_lang("ReplyToMessage"), false); - $table->set_form_actions(array ('delete' => get_lang('DeleteSelectedMessages'))); - $table->display(); -} -?> \ No newline at end of file diff --git a/main/messages/images/newmsg.gif b/main/messages/images/newmsg.gif deleted file mode 100755 index 8202e66779e9a0da695e859d78c3545c9a1af7af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1476 zcmV;#1v~mjNk%w1VITk?0Qdg@Ib7L3Vcb}4vs-bqWqP_vYu#3J-%N1fQFGu{c;Q}t z;$eKvWp% zdz$gKKLEBt0JuZ|yGsDSQ2?)DAB$f@g=bWTYFd?POqy(1j&x?1cWs`2ZMb(sqWKv4lmOtH0PK+i?w$bgj{y9L0P&sx|C9jxoB-vc0pX?%;;8`a zqX6!x0P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755 --- a/main/messages/inbox.php +++ b/main/messages/inbox.php @@ -1,24 +1,25 @@ Copyright (c) Facultad de Matematicas, UADY (México) - Copyright (c) Evie, Free University of Brussels (Belgium) - + Copyright (c) Evie, Free University of Brussels (Belgium) + For a full list of contributors, see "credits.txt". The full license can be read in "license.txt". - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + See the GNU General Public License for more details. - - Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium - Mail: info@dokeos.com + + Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium + Mail: info@dokeos.com ============================================================================== */ /* @@ -27,11 +28,17 @@ ============================================================================== */ // name of the language file that needs to be included -$language_file= "messages"; +$language_file= 'messages'; $cidReset=true; -include('../../main/inc/global.inc.php'); -include('./functions.inc.php'); +include_once ('../inc/global.inc.php'); +require_once (api_get_path(LIBRARY_PATH).'message.lib.php'); api_block_anonymous_users(); + +if (api_get_setting('allow_message_tool')!='true'){ + api_not_allowed(); +} + + $htmlHeadXtra[]='