|
|
|
@ -5,7 +5,7 @@ |
|
|
|
|
|
|
|
|
|
Copyright (c) 2009 Dokeos SPRL |
|
|
|
|
Copyright (c) 2009 Julio Montoya Armas <gugli100@gmail.com> |
|
|
|
|
Copyright (c) Facultad de Matematicas, UADY (M<EFBFBD>xico) |
|
|
|
|
Copyright (c) Facultad de Matematicas, UADY (México) |
|
|
|
|
Copyright (c) Evie, Free University of Brussels (Belgium) |
|
|
|
|
Copyright (c) 2009 Isaac Flores Paz <isaac.flores@dokeos.com> |
|
|
|
|
|
|
|
|
@ -72,44 +72,52 @@ function deselect_all(formita) |
|
|
|
|
*/ |
|
|
|
|
$nameTools = get_lang('Messages'); |
|
|
|
|
$request=api_is_xml_http_request(); |
|
|
|
|
/***********************************************/ |
|
|
|
|
$info_reply=array(); |
|
|
|
|
$info_delete=array(); |
|
|
|
|
/***********************************************/ |
|
|
|
|
$info_reply=explode(',',$_GET['form_reply']); |
|
|
|
|
$count_reply=count($info_reply); |
|
|
|
|
/***********************************************/ |
|
|
|
|
$info_delete=explode(',',$_GET['form_delete']); |
|
|
|
|
$count_delete=(count($info_delete)-1); |
|
|
|
|
/***********************************************/ |
|
|
|
|
if ( isset($info_reply[4])) { |
|
|
|
|
$title = $info_reply[0]; |
|
|
|
|
$content = $info_reply[1]; |
|
|
|
|
$user_reply= $info_reply[2]; |
|
|
|
|
if (isset($info_reply[2]) && $info_reply[2]>0) { |
|
|
|
|
MessageManager::send_message($user_reply, $title, $content); |
|
|
|
|
MessageManager::display_success_message($user_reply); |
|
|
|
|
exit; |
|
|
|
|
} elseif($info_reply[2]==0) { |
|
|
|
|
$message_box=get_lang('ErrorSendingMessage'). |
|
|
|
|
if (isset($_GET['form_reply']) || isset($_GET['form_delete'])) { |
|
|
|
|
/***********************************************/ |
|
|
|
|
$info_reply=array(); |
|
|
|
|
$info_delete=array(); |
|
|
|
|
/***********************************************/ |
|
|
|
|
if ( isset($_GET['form_reply']) ) { |
|
|
|
|
$info_reply=explode(',',$_GET['form_reply']); |
|
|
|
|
$count_reply=count($info_reply); |
|
|
|
|
$button_sent=urldecode($info_reply[4]); |
|
|
|
|
} |
|
|
|
|
/***********************************************/ |
|
|
|
|
if ( isset($_GET['form_delete']) ) { |
|
|
|
|
$info_delete=explode(',',$_GET['form_delete']); |
|
|
|
|
$count_delete=(count($info_delete)-1); |
|
|
|
|
} |
|
|
|
|
/***********************************************/ |
|
|
|
|
|
|
|
|
|
if ( isset($button_sent) ) { |
|
|
|
|
$title = urldecode($info_reply[0]); |
|
|
|
|
$content = urldecode($info_reply[1]); |
|
|
|
|
$user_reply= $info_reply[2]; |
|
|
|
|
if ( isset($user_reply) && $user_reply>0 && strlen($info_reply[0]) >0) { |
|
|
|
|
MessageManager::send_message($user_reply, $title, $content); |
|
|
|
|
MessageManager::display_success_message($user_reply); |
|
|
|
|
exit; |
|
|
|
|
} elseif ( ($info_reply[2]==0) || strlen($info_reply[0])==0) { |
|
|
|
|
$message_box=get_lang('ErrorSendingMessage'). |
|
|
|
|
' |
|
|
|
|
<br /><a href="../social/index.php#remote-tab-2">'. |
|
|
|
|
<br /><a href="../social/index.php?#remote-tab-2">'. |
|
|
|
|
get_lang('BackToInbox'). |
|
|
|
|
'</a>'; |
|
|
|
|
Display::display_error_message($message_box,false); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
} elseif ( trim($info_delete[0])=='delete' ) { |
|
|
|
|
for ($i=1;$i<=$count_delete;$i++) { |
|
|
|
|
MessageManager::delete_message_by_user_receiver(api_get_user_id(), $info_delete[$i]); |
|
|
|
|
} |
|
|
|
|
$message_box=get_lang('SelectedMessagesDeleted'). |
|
|
|
|
Display::display_error_message($message_box,false); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
} elseif (trim($info_delete[0])=='delete' ) { |
|
|
|
|
for ($i=1;$i<=$count_delete;$i++) { |
|
|
|
|
MessageManager::delete_message_by_user_receiver(api_get_user_id(), $info_delete[$i]); |
|
|
|
|
} |
|
|
|
|
$message_box=get_lang('SelectedMessagesDeleted'). |
|
|
|
|
' |
|
|
|
|
<br /><a href="../social/index.php#remote-tab-2">'. |
|
|
|
|
<br /><a href="../social/index.php?#remote-tab-2">'. |
|
|
|
|
get_lang('BackToInbox'). |
|
|
|
|
'</a>'; |
|
|
|
|
Display::display_normal_message($message_box,false); |
|
|
|
|
exit; |
|
|
|
|
Display::display_normal_message($message_box,false); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($request===false) { |
|
|
|
|