[svn r18511] logic changes - allow show,the message tool in tabs - (partial FS#3651)

skala
Isaac Flores 16 years ago
parent 8bbd29103b
commit 52a28b7d46
  1. 4
      main/auth/profile.php
  2. 22
      main/inc/lib/message.lib.php
  3. 49
      main/messages/inbox.php
  4. 76
      main/messages/message.class.php
  5. 64
      main/messages/new_message.php
  6. 24
      main/messages/outbox.php
  7. 19
      main/messages/view_message.php
  8. 187
      main/social/index.php

@ -1,4 +1,4 @@
<?php // $Id: profile.php 18508 2009-02-15 04:37:02Z ivantcholakov $
<?php // $Id: profile.php 18511 2009-02-16 02:22:11Z iflorespaz $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -18,7 +18,7 @@ $language_file = array('registration','messages');
$cidReset = true;
require ('../inc/global.inc.php');
if (!isset($_GET['show'])) {
if (api_get_setting('allow_social_tool')=='true') {
if (api_get_setting('allow_social_tool')=='true' || api_get_setting('allow_message_tool')=='true') {
header('Location:../social/index.php');
exit;
}

@ -78,16 +78,15 @@ function inbox_display() {
if ($request===true) {
$title= utf8_encode(get_lang('Title'));
$action=utf8_encode(get_lang('Actions'));
$param=true;
} else {
$title= get_lang('Title');
$action=get_lang('Actions');
$param=true;
$action=get_lang('Actions');
}
$table->set_header(1, get_lang('From'),$param);
$table->set_header(2,$title,$param);
$table->set_header(3, get_lang('Date'),$param);
$table->set_header(4,$action,$param);
$table->set_header(1, get_lang('From'),false);
$table->set_header(2,$title,false);
$table->set_header(3, get_lang('Date'),false);
$table->set_header(4,$action,false);
echo '<div id="div_content_table_data">';
if ($request===true) {
echo '<form name="form_send" id="form_send" action="" method="post">';
echo '<input type="hidden" name="action" value="delete" />';
@ -102,6 +101,7 @@ function inbox_display() {
$table->set_form_actions(array ('delete' => get_lang('DeleteSelectedMessages')));
$table->display();
}
echo '</div>';
}
function get_number_of_messages_mask() {
return MessageManager::get_number_of_messages();
@ -168,10 +168,11 @@ if ($request===true) {
$action=get_lang('Actions');
}
$table->set_header(0, '', false);
$table->set_header(1, get_lang('From'));
$table->set_header(2, $title);
$table->set_header(3, get_lang('Date'));
$table->set_header(1, get_lang('From'),false);
$table->set_header(2, $title,false);
$table->set_header(3, get_lang('Date'),false);
$table->set_header(4,$action, false);
echo '<div id="div_content_table_data_sent">';
if ($request===true) {
echo '<form name="form_send_out" id="form_send_out" action="" method="post">';
echo '<input type="hidden" name="action" value="delete" />';
@ -186,6 +187,7 @@ $table->set_header(4,$action, false);
$table->set_form_actions(array ('delete' => get_lang('DeleteSelectedMessages')));
$table->display();
}
echo '</div>';
}
function get_number_of_messages_send_mask() {
return MessageManager::get_number_of_messages_sent();

@ -71,6 +71,46 @@ 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 ( trim($info_reply[4])=='Enviar' ) {
$title = utf8_decode($info_reply[0]);
$content = utf8_decode($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('ErrorMessageSend').
'&nbsp
<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').
'&nbsp
<br><a href="../social/index.php#remote-tab-2">'.
get_lang('BackToInbox').
'</a>';
Display::display_normal_message($message_box,false);
exit;
}
if ($request===false) {
$interbreadcrumb[]= array (
'url' => '#',
@ -89,14 +129,13 @@ if ($request===false) {
} else {
$link_ref="../messages/new_message.php?rs=1";
}
api_display_tool_title(get_lang('Inbox'));
$table_message = Database::get_main_table(TABLE_MESSAGE);
echo '<div id="div_content_messages">&nbsp;&nbsp;';
api_display_tool_title(utf8_encode(get_lang('Inbox')));
echo '<div class=actions>';
echo '<a href="'.$link_ref.'">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>';
echo '<a onclick="compose_and_show_message(\'show\',\'1\')" href="javascript:void(0)">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>';
echo '</div>';
echo '</div>';
if (!isset($_GET['del_msg'])) {
inbox_display();
} else {

@ -60,7 +60,7 @@ class MessageManager {
GetFullUserName($uid).
"</b>".
"<br><a href=\"".
"inbox.php\">".
"../social/index.php$redirect\">".
get_lang('BackToInbox').
"</a>";
}
@ -147,14 +147,14 @@ class MessageManager {
}
if ($request===true) {
$message[1] = utf8_encode(GetFullUserName(($result[1])));
$message[2] = '<a href="../messages/view_message.php?rs=1&amp;id='.$result[0].'">'.utf8_encode($result[2]).'</a>';
$message[4] = '<a href="../messages/new_message.php?rs=1&amp;re_id='.$result[0].'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).'</a>'.
'&nbsp;&nbsp;<a href="../messages/inbox.php?rs=1&amp;action=deleteone&id='.$result[0].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;">'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
$message[2] = '<a onclick="get_action_url_and_show_messages(1,'.$result[0].')" href="javascript:void(0)">'.utf8_encode($result[2]).'</a>';
$message[4] = '<a onclick="reply_to_messages(\'show\','.$result[0].',\'\')" href="javascript:void(0)">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).'</a>'.
'&nbsp;&nbsp;<a onclick="delete_one_message('.$result[0].')" href="#../messages/inbox.php?rs=1&amp;action=deleteone&id='.$result[0].'" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
} else {
$message[1] = GetFullUserName(($result[1]));
$message[2] = '<a href="view_message.php?id='.$result[0].'">'.$result[2].'</a>';
$message[4] = '<a href="new_message.php?re_id='.$result[0].'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).'</a>'.
'&nbsp;&nbsp;<a href="inbox.php?action=deleteone&id='.$result[0].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;">'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
'&nbsp;&nbsp;<a delete_one_message('.$result[0].') href="#inbox.php?action=deleteone&id='.$result[0].'">'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
}
$message[3] = ($result[3]); //date stays the same
$message_list[] = $message;
@ -264,12 +264,11 @@ class MessageManager {
}
if ($request===true) {
$message[1] = utf8_encode(GetFullUserName($result[1]));
$message[2] = '<a href="../messages/view_message.php?rs=1&amp;id_send='.$result[0].'">'.utf8_encode($result[2]).'</a>';
$message[4] = '<a href="../messages/new_message.php?rs=1&amp;re_id='.$result[0].'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).'</a>'.
'&nbsp;&nbsp;<a href="../messages/outbox.php?rs=1&amp;action=deleteone&id='.$result[0].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;">'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
$message[2] = '<a onclick="show_sent_message('.$result[0].')" href="javascript:void(0)">'.utf8_encode($result[2]).'</a>';
$message[4] = '&nbsp;&nbsp;<a onclick="delete_one_message_outbox('.$result[0].')" href="javascript:void(0)" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
} else {
$message[1] = GetFullUserName($result[1]);
$message[2] = '<a href="../messages/view_message.php?id_send='.$result[0].'">'.$result[2].'</a>';
$message[2] = '<a onclick="show_sent_message ('.$result[0].')" href="#../messages/view_message.php?id_send='.$result[0].'">'.$result[2].'</a>';
$message[4] = '<a href="new_message.php?re_id='.$result[0].'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).'</a>'.
'&nbsp;&nbsp;<a href="outbox.php?action=deleteone&id='.$result[0].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;">'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).'</a>';
}
@ -313,11 +312,60 @@ class MessageManager {
if ($row[1]==$user_con[$i])
$band=1;
if ($band==1 && !isset($_GET['id_send'])) {
$reply = '<a href="new_message.php?re_id='.$_GET['id'].'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).get_lang('ReplyToMessage').'</a>';
$reply = '<a onclick="reply_to_messages(\'show\','.$_GET['id'].',\'\')" href="javascript:void(0)">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).get_lang('ReplyToMessage').'</a>';
}
echo '<div class=actions>';
echo '<a onclick="close_div_show(\'div_content_messages\')" href="javascript:void(0)">'.Display::return_icon('folder_up.gif',get_lang('BackToInbox')).get_lang('BackToInbox').'</a>';
echo $reply;
echo '<a href="'.$path.'?action=deleteone&id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;">'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''.get_lang('Delete').'</a>';
echo '<a onclick="delete_one_message('.$row[0].')" href="#'.$path.'?action=deleteone&id='.$row[0].'" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''.get_lang('Delete').'</a>';
echo '</div><br />';
echo '
<table class="message_view_table" >
<TR>
<TD width=10>&nbsp; </TD>
<TD vAlign=top width="100%">
<TABLE>
<TR>
<TD width="100%">
<TR> <h1>'.utf8_encode($row[5]).'</h1></TR>
</TD>
<TR>
<TD>'.utf8_encode(get_lang('From')).'&nbsp;<b>'.GetFullUserName($row[1]).'</b> '.utf8_encode(strtolower(get_lang('To'))).'&nbsp; <b>'.utf8_encode(GetFullUserName($row[2])).'</b> </TD>
</TR>
<TR>
<TD >'.get_lang('Date').'&nbsp; '.$row[4].'</TD>
</TR>
</TR>
</TABLE>
<br />
<TABLE height=209 width="100%" bgColor=#ffffff>
<TBODY>
<TR>
<TD vAlign=top>'.utf8_encode($row[6]).'</TD>
</TR>
</TBODY>
</TABLE>
<DIV class=HT style="PADDING-BOTTOM: 5px"> </DIV></TD>
<TD width=10>&nbsp;</TD>
</TR>
</TABLE>';
}
public static function show_message_box_sent () {
$table_message = Database::get_main_table(TABLE_MESSAGE);
$query = "SELECT * FROM $table_message WHERE user_sender_id=".api_get_user_id()." AND id=".$_GET['id_send']." AND msg_status=4;";
$result = api_sql_query($query,__FILE__,__LINE__);
$path='outbox.php';
$row = Database::fetch_array($result);
$user_con = self::users_connected_by_id();
$band=0;
$reply='';
for ($i=0;$i<count($user_con);$i++)
if ($row[1]==$user_con[$i])
$band=1;
echo '<div class=actions>';
echo '<a onclick="close_and_open_outbox()" href="javascript:void(0)">'.Display::return_icon('folder_up.gif',get_lang('BackToOutbox')).get_lang('BackToOutbox').'</a>';
echo '<a onclick="delete_one_message_outbox('.$row[0].')" href="javascript:void(0)" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''.get_lang('Delete').'</a>';
echo '</div><br />';
echo '
<table class="message_view_table" >
@ -327,10 +375,10 @@ class MessageManager {
<TABLE>
<TR>
<TD width="100%">
<TR> <h1>'.$row[5].'</h1></TR>
<TR> <h1>'.utf8_encode($row[5]).'</h1></TR>
</TD>
<TR>
<TD>'.get_lang('From').'&nbsp;<b>'.GetFullUserName($row[1]).'</b> '.strtolower(get_lang('To')).'&nbsp; <b>'.GetFullUserName($row[2]).'</b> </TD>
<TD>'.utf8_encode(get_lang('From')).'&nbsp;<b>'.GetFullUserName($row[1]).'</b> '.utf8_encode(strtolower(get_lang('To'))).'&nbsp; <b>'.utf8_encode(GetFullUserName($row[2])).'</b> </TD>
</TR>
<TR>
<TD >'.get_lang('Date').'&nbsp; '.$row[4].'</TD>
@ -341,7 +389,7 @@ class MessageManager {
<TABLE height=209 width="100%" bgColor=#ffffff>
<TBODY>
<TR>
<TD vAlign=top>'.$row[6].'</TD>
<TD vAlign=top>'.utf8_encode($row[6]).'</TD>
</TR>
</TBODY>
</TABLE>

@ -1,4 +1,4 @@
<?php // $Id: new_message.php 18499 2009-02-13 20:57:29Z herodoto $
<?php // $Id: new_message.php 18511 2009-02-16 02:22:11Z iflorespaz $
/*
==============================================================================
Dokeos - elearning and course management software
@ -99,10 +99,9 @@ $(document).ready(function (){
});
</script>';
$nameTools = get_lang('ComposeMessage');
$fck_attribute['Width'] = "100%";
$fck_attribute['Height'] = "150";
$fck_attribute['ToolbarSet'] = "Messages";
$fck_attribute['Width'] = "95%";
$fck_attribute['ToolbarSet'] = "Profil";
/*
==============================================================================
FUNCTIONS
@ -114,7 +113,8 @@ $fck_attribute['ToolbarSet'] = "Messages";
*/
function show_compose_to_any ($user_id) {
$online_user_list = MessageManager::get_online_user_list($user_id);
$default['user_list'] = $user_id;
$default['user_list'] = 0;
$online_user_list=null;
manage_form($default, $online_user_list);
}
@ -129,37 +129,46 @@ function show_compose_reply_to_message ($message_id, $receiver_id) {
die();
}
echo get_lang('To').':&nbsp;<strong>'. GetFullUserName($row[1]).'</strong>';
$default['title'] =get_lang('EnterTitle');
$default['title'] =utf8_encode(get_lang('EnterTitle'));
$default['user_list'] = $row[1];
manage_form($default);
}
function show_compose_to_user ($receiver_id) {
echo get_lang('To').':&nbsp;<strong>'. GetFullUserName($receiver_id).'</strong>';
$default['title'] = get_lang('EnterTitle');
$default['title'] = utf8_encode(get_lang('EnterTitle'));
$default['user_list'] = $receiver_id;
manage_form($default);
}
function manage_form ($default, $select_from_user_list = null) {
$table_message = Database::get_main_table(TABLE_MESSAGE);
$form = new FormValidator('compose_message');
$request=api_is_xml_http_request();
if ($request===true) {
$form = new FormValidator('compose_message','post','index.php?sendform=true#remote-tab-2');
} else {
$form = new FormValidator('compose_message');
}
if (isset($select_from_user_list)) {
$form->add_textfield('id_text_name',get_lang('SendMessageTo'),true,array('size' => 40,'id'=>'id_text_name'));
$form->add_textfield('id_text_name',get_lang('SendMessageTo'),true,array('size' => 40,'id'=>'id_text_name','onclick'=>'send_request_and_search()'));
$form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html','<div id="id_div_search" class="message-search">&nbsp;</div>');
$form->addElement('hidden','user_list','',array('id'=>'user_list'));
//$form->addElement('select','user_list',get_lang('SendMessageTo'),$select_from_user_list);
$form->addElement('hidden','user_list',0,array('id'=>'user_list'));
} else {
//$form->addElement('hidden','user_list');
$form->addElement('hidden','user_list','',array('id'=>'user_list'));
if ($default['user_list']==0) {
$form->add_textfield('id_text_name',get_lang('SendMessageTo'),true,array('size' => 40,'id'=>'id_text_name','onclick'=>'send_request_and_search()'));
$form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html','<div id="id_div_search" class="message-search">&nbsp;</div>');
}
$form->addElement('hidden','user_list',0,array('id'=>'user_list'));
}
$form->add_textfield('title', get_lang('Title'));
$form->add_textfield('title', utf8_encode(get_lang('Title')));
$form->add_html_editor('content', '',false,false);
if (isset($_GET['re_id'])) {
$form->addElement('hidden','re_id',$_GET['re_id']);
}
$form->addElement('submit', 'compose', get_lang('Send'));
$form->setDefaults($default);
if ($form->validate()) {
$values = $form->exportValues();
$receiver_user_id = $values['user_list'];
@ -198,8 +207,15 @@ if (isset($_GET['rs'])) {
'url' => '#',
'name' => get_lang('ComposeMessage')
);
Display::display_header('');
$request=api_is_xml_http_request();
if ($request===false) {
Display::display_header('');
}
api_display_tool_title($nameTools);
echo '<div class=actions>';
echo '<a onclick="close_div_show(\'div_content_messages\')" href="javascript:void(0)">'.Display::return_icon('folder_up.gif',get_lang('BackToInbox')).get_lang('BackToInbox').'</a>';
echo '</div>';
if (!isset($_POST['compose'])) {
if(isset($_GET['re_id'])) {
$message_id = $_GET['re_id'];
@ -216,14 +232,14 @@ if (!isset($_POST['compose'])) {
}
if (isset($_GET['re_id'])) {
$default['title'] = $_POST['title'];
$default['content'] = $_POST['content'];
$default['user_list'] = $_POST['user_list'];
$default['title'] = utf8_encode($_POST['title']);
$default['content'] = utf8_encode($_POST['content']);
//$default['user_list'] = $_POST['user_list'];
manage_form($default);
} else {
if ($restrict) {
$default['title'] = $_POST['title'];
$default['id_text_name'] = $_POST['id_text_name'];
$default['title'] = utf8_encode($_POST['title']);
$default['id_text_name'] = utf8_encode($_POST['id_text_name']);
$default['user_list'] = $_POST['user_list'];
manage_form($default);
} else {
@ -236,5 +252,7 @@ if (!isset($_POST['compose'])) {
FOOTER
==============================================================================
*/
Display::display_footer();
if ($request===false) {
Display::display_footer();
}
?>

@ -88,14 +88,32 @@ if ($request===false) {
);
Display::display_header('');
}
api_display_tool_title(get_lang('Outbox'));
/**************************************************************/
$info_delete_outbox=array();
$info_delete_outbox=explode(',',$_GET['form_delete_outbox']);
$count_delete_outbox=(count($info_delete_outbox)-1);
/**************************************************************/
if( trim($info_delete_outbox[0])=='delete' ) {
for ($i=1;$i<=$count_delete_outbox;$i++) {
MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]);
}
$message_box=get_lang('SelectedMessagesDeleted').
'&nbsp
<br><a href="../social/index.php#remote-tab-3">'.
get_lang('BackToOutbox').
'</a>';
Display::display_normal_message($message_box,false);
exit;
}
/**************************************************************/
$table_message = Database::get_main_table(TABLE_MESSAGE);
echo '<div id="div_content_messages_sent">&nbsp;&nbsp;';
api_display_tool_title(utf8_encode(get_lang('Outbox')));
echo '<div class=actions>';
$language_variable=($request===true) ? utf8_encode(get_lang('MessageOutboxComment')) : get_lang('MessageOutboxComment');
echo $language_variable;
echo '</div>';
echo '</div>';
$user_sender_id=api_get_user_id();
if ($_REQUEST['action']=='delete') {
$delete_list_id=array();

@ -1,4 +1,4 @@
<?php // $Id: view_message.php 18385 2009-02-09 21:56:23Z iflorespaz $
<?php // $Id: view_message.php 18511 2009-02-16 02:22:11Z iflorespaz $
/*
==============================================================================
Dokeos - elearning and course management software
@ -76,13 +76,22 @@ if (isset($_GET['id_send']) || isset($_GET['id'])) {
HEADER
==============================================================================
*/
Display::display_header('');
api_display_tool_title(get_lang('ReadMessage'));
MessageManager::show_message_box();
$request=api_is_xml_http_request();
if ($request===false) {
Display::display_header('');
}
api_display_tool_title(utf8_encode(get_lang('ReadMessage')));
if (isset($_GET['id_send'])) {
MessageManager::show_message_box_sent();
} else {
MessageManager::show_message_box();
}
/*
==============================================================================
FOOTER
==============================================================================
*/
Display::display_footer();
if ($request===false) {
Display::display_footer();
}
?>

@ -21,7 +21,7 @@ function register_friend(element_input) {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_response").html("Cargando..."); },
$("#id_response").html("'.get_lang('Loading').'"); },
type: "POST",
url: "../social/register_friend.php",
data: "friend_id="+user_friend_id,
@ -168,7 +168,7 @@ function unselectall_cheks() {
function submit_form (path_submit) {
if (path_submit=="inbox") {
if (count_checkbox("inbox") > 0) {
document.getElementById(\'form_send\').action="../messages/inbox.php";
document.getElementById(\'form_send\').action="../social/index.php?inbox=true#remote-tab-2";
if (confirm("'.get_lang('ConfirmYourChoice').'")) {
$("#form_send").submit();
}
@ -178,7 +178,7 @@ function submit_form (path_submit) {
} else {
if (count_checkbox("outbox") > 0) {
document.getElementById(\'form_send_out\').action="../messages/outbox.php";
document.getElementById(\'form_send_out\').action="../social/index.php?outbox=true#remote-tab-3";
if (confirm("'.get_lang('ConfirmYourChoice').'")) {
$("#form_send_out").submit();
}
@ -208,6 +208,155 @@ function count_checkbox(status_type) {
return cont;
}
}
function get_action_url_and_show_messages (name_rs,name_id) {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_response").html("'.get_lang('Loading').'"); },
type: "GET",
url: "../messages/view_message.php",
data: "rs="+name_rs+"&id="+name_id,
success: function(datos) {
$("div#div_content_messages").html(datos);
$("div#div_content_table_data").html(" ");
}
});
}
function close_div_show (my_div) {
$("div#"+my_div).html("");
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_response").html("'.get_lang('Loading').'"); },
type: "POST",
url: "../messages/inbox.php",
data:"",
success: function(datos) {
$("div#div_content_table_data").html(datos);
}
});
}
function reply_to_messages (my_action,name_rs,name_id) {
if(my_action=="show") {
$("div#div_content_messages").html("");
$("div#div_content_table_data").html("");
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_response").html("'.get_lang('Loading').'"); },
type: "GET",
url: "../messages/new_message.php",
data:"re_id="+name_rs+"&id="+name_id,
success: function(datos) {
$("div#div_content_messages").html(datos);
}
});
}
}
function compose_and_show_message (my_action,name_rs) {
if(my_action=="show") {
$("div#div_content_messages").html("");
$("div#div_content_table_data").html("");
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_response").html("'.get_lang('Loading').'"); },
type: "GET",
url: "../messages/new_message.php",
data:"rs="+name_rs,
success: function(datos) {
$("div#div_content_messages").html(datos);
}
});
}
}
function send_request_and_search() {
cont=0;
$("#id_text_name").bind("keyup", function(){
name=$("#id_text_name").get(0).value;
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
/*$("#id_div_search").html("Searching...");*/ },
type: "POST",
url: "../social/select_options.php",
data: "search="+name,
success: function(datos){
$("#id_div_search").html(datos)
$("#id_search_name").bind("click", function(){
name_option=$("select#id_search_name option:selected").text();
code_option=$("select#id_search_name option:selected").val();
$("#user_list").attr("value", code_option);
$("#id_text_name").attr("value", name_option);
$("#id_div_search").html("");
cont++;
});
}
});
});
}
function delete_one_message (num_id) {
$("div#div_content_messages").html("");
$("div#div_content_table_data").html("");
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
/*$("#id_div_search").html("Searching...");*/ },
type: "GET",
url: "../messages/inbox.php",
data: "action="+"deleteone"+"&id="+num_id,
success: function(datos){
$("#div_content_table_data").html(datos)
}
});
}
function show_sent_message (id_sent) {
$("div#div_content_messages_sent").html("");
$("div#div_content_table_data_sent").html("");
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
/*$("#id_div_search").html("Searching...");*/ },
type: "GET",
url: "../messages/view_message.php",
data: "rs="+"1"+"&id_send="+id_sent,
success: function(datos){
$("#div_content_table_data_sent").html(datos)
}
});
}
function close_and_open_outbox() {
$("div#div_content_messages_sent").html("");
$("div#div_content_table_data_sent").html("");
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_response").html("'.get_lang('Loading').'"); },
type: "POST",
url: "../messages/outbox.php",
data:"",
success: function(datos) {
$("div#div_content_table_data_sent").html(datos);
}
});
}
function delete_one_message_outbox (num_id) {
$("div#div_content_messages_sent").html("");
$("div#div_content_table_data_sent").html("");
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
/*$("#id_div_search").html("Searching...");*/ },
type: "GET",
url: "../messages/outbox.php",
data: "action="+"deleteone"+"&id="+num_id,
success: function(datos){
$("#div_content_table_data_sent").html(datos)
}
});
}
</script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="../inc/lib/javascript/jquery.tabs.css" type="text/css" media="print, projection, screen">';
$htmlHeadXtra[] = '
@ -240,6 +389,7 @@ code {
font-family: "Courier New", Courier, monospace;
}
</style>';
/*onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;"*/
$_SESSION['social_exist']=true;
$_SESSION['social_dest'] = 'index.php';
$interbreadcrumb[]= array (
@ -251,6 +401,33 @@ $interbreadcrumb[]= array (
'name' => get_lang('SocialNetwork')
);
Display :: display_header('');
if (isset($_GET['sendform'])) {
$form_reply=array();
$params_url='?'.$_SERVER['argv'][0];
$form_reply[]=utf8_encode($_POST['title']);
$form_reply[]=utf8_encode($_POST['content']);
$form_reply[]=$_POST['user_list'];
$form_reply[]=$_POST['re_id'];
$form_reply[]=$_POST['compose'];
$form_info=implode(',',$form_reply);
$form_send_data_message="?form_reply=$form_info";
} elseif (isset($_GET['inbox'])) {
$form_delete=array();
$form_delete[]=$_POST['action'];
for ($i=0;$i<count($_POST['id']);$i++) {
$form_delete[]=$_POST['id'][$i];
}
$form_info=implode(',',$form_delete);
$form_send_data_message="?form_delete=$form_info";
} elseif (isset($_GET['outbox'])) {
$form_delete_outbox=array();
$form_delete_outbox[]=$_POST['action'];
for ($i=0;$i<count($_POST['out']);$i++) {
$form_delete_outbox[]=$_POST['out'][$i];
}
$form_info_outbox=implode(',',$form_delete_outbox);
$form_send_data_message="?form_delete_outbox=$form_info_outbox";
}
?>
<div id="container-9">
<ul>
@ -258,8 +435,8 @@ Display :: display_header('');
<?php
if (api_get_setting('allow_message_tool')=='true') {
?>
<li><a href="../messages/inbox.php"><span><?php echo get_lang('Inbox'); ?></span></a></li>
<li><a href="../messages/outbox.php"><span><?php echo get_lang('Outbox'); ?></span></a></li>
<li><a href="../messages/inbox.php<?php echo $form_send_data_message; ?>"><span><?php echo get_lang('Inbox'); ?></span></a></li>
<li><a href="../messages/outbox.php<?php echo $form_send_data_message; ?>"><span><?php echo get_lang('Outbox'); ?></span></a></li>
<?php }
if (api_get_setting('allow_social_tool')=='true') {
?>

Loading…
Cancel
Save