[svn r18278] minor-cleaned the social Tool - (partial FS#3383)

skala
Isaac Flores 16 years ago
parent 01802cba5c
commit d9f1a0ee74
  1. 34
      main/social/message.php
  2. 165
      main/social/select_friend.php
  3. 13
      main/social/select_friend_response.php
  4. 110
      main/social/social_friend.php

@ -1,10 +1,27 @@
<?php
/*
* Created on 25/01/2009
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2008 Dokeos Latinoamerica SAC
Copyright (c) 2006 Dokeos SPRL
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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, 108 rue du Corbeau, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
$language_file = array('registration','messages');
require ('../inc/global.inc.php');
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
@ -13,7 +30,9 @@ $this_section = SECTION_MYPROFILE;
$_SESSION['this_section']=$this_section;
?>
<div id="id" class="actions">
Bienvenido a la herramienta mensajes...desde aqui usted puede comunicarse con todos los usuarios en linea
<?php
echo get_lang('WelcomeMessageTool');
?>
</div>
<?php
if (api_get_setting('allow_message_tool')=='true') {
@ -37,5 +56,4 @@ Bienvenido a la herramienta mensajes...desde aqui usted puede comunicarse con to
echo '</div>';
}
?>
?>

@ -1,165 +0,0 @@
<?php
$language_file = array('registration','messages');
$cidReset = true;
require '../inc/global.inc.php';
include_once (api_get_path(LIBRARY_PATH).'image.lib.php');
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
$this_section = SECTION_MYPROFILE;
$_SESSION['this_section']=$this_section;
api_block_anonymous_users();
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] ='<script type="text/javascript">
$(document).ready(function (){
cont=0;
list_button=new Array();
$("input").bind("click", function() {
name_button=$(this).attr("id");
name_div_id="id_"+name_button.substring(13,14);
alert( $(this).attr("id")+ "--------"+ name_div_id );
});
/*$("#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("Cargando..."); },
type: "POST",
url: "../auth/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();
$("#id_hidden_code").attr("value", code_option);
$("#id_text_name").attr("value", name_option);
$("#id_div_search").html("");
cont++;
});
},
});
}); */
});
</script>';
Display :: display_header(get_lang('MyFriends'));
?>
<?php
$list_get_invitation=array();
$list_get_path_web=array();
$user_id=api_get_user_id();
$list_get_invitation=UserFriend::get_list_invitation_of_friends_by_user_id($user_id);
$list_get_path_web=UserFriend::get_list_web_path_user_invitation_by_user_id($user_id);
$number_loop=count($list_get_invitation);
/*var_dump($list_get_invitation);
var_dump($list_get_path_web);*/
for ($i=0;$i<$number_loop;$i++) {
?>
<div id="<?php echo 'id_'.$list_get_invitation[$i]['user_sender_id'] ?>">
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="20" valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0" bgcolor="#9DACBF">
<tr>
<td width="600" height="20" valign="top"><div align="left">Dokeos -
Solicitud de Amigos </div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="135" valign="top"><table width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="600" height="135" valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="110" valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td width="100" height="110" valign="top"><table width="100%"
border="0" cellpadding="0" cellspacing="0" bgcolor="#C8D5E4">
<tr>
<td width="100" height="110" valign="top">
<img src="<?php echo $list_get_path_web[$i]['dir']."/".$list_get_path_web[$i]['file']; ?>" width="90" height="100" style="margin-left:5px ;margin-rigth:5px;margin-top:5px;margin-bottom:5px;" /></td>
</tr>
</table></td>
<td width="500" valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="500" height="22" valign="top"><table
width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="500" height="22" valign="top">
<?php
$user_id=$list_get_invitation[$i]['user_sender_id'];
$user_info=api_get_user_info($user_id);
echo $user_info['firstName'].' '.$user_info['lastName'];
?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="5" valign="top"><table width="100%"
border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="500" height="5"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" valign="top"><table width="100%"
border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="500" height="22" valign="top"><?php
$title=$list_get_invitation[$i]['title'];
$content=$list_get_invitation[$i]['content'];
echo $title.' '.$content;
?> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="61" valign="top"><?php
$date=$list_get_invitation[$i]['send_date'];
echo 'Fecha de envio : '.$date;
?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="25" valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0" bgcolor="#9DACBF">
<tr>
<td width="600" height="25" valign="top"><div align="right">
<input type="submit" name="btn_accepted" id="<?php echo "btn_accepted_".$user_id ?>" value="Aceptar" />
<input type="submit" name="btn_denied" id="<?php echo "btn_deniedst_".$user_id ?>" value="Denegar" />
</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div>
<br/>
<?php
}
?>
<?php
Display :: display_footer();
?>

@ -10,7 +10,7 @@ $_SESSION['this_section']=$this_section;
api_block_anonymous_users();
?>
<div class="actions">
Desde aqui puede ver sus invitaciones
<?php echo get_lang('ShowMessageInvitation'); ?>
</div>
<div id="id_response" align="center"></div>
<?php
@ -21,7 +21,7 @@ $list_get_invitation=UserFriend::get_list_invitation_of_friends_by_user_id($user
$list_get_path_web=UserFriend::get_list_web_path_user_invitation_by_user_id($user_id);
$number_loop=count($list_get_invitation);
if ($number_loop==0) {
echo Display::display_normal_message('No tiene invitaciones actualmente');
echo Display::display_normal_message(get_lang('NoHaveInvitation'));
}
for ($i=0;$i<$number_loop;$i++) {
@ -32,8 +32,7 @@ for ($i=0;$i<$number_loop;$i++) {
<td width="600" height="20" valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0" bgcolor="#9DACBF">
<tr>
<td width="600" height="20" valign="top"><div align="left">Dokeos -
Solicitud de Amigos </div></td>
<td width="600" height="20" valign="top"><div align="left"><?php echo get_lang('RequestFriend'); ?></div></td>
</tr>
</table></td>
</tr>
@ -95,7 +94,7 @@ border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="61" valign="top"><?php
$date=$list_get_invitation[$i]['send_date'];
echo 'Fecha de envio : '.$date;
echo get_lang('DateSent').' : '.$date;
?></td>
</tr>
</table></td>
@ -107,8 +106,8 @@ border="0" cellpadding="0" cellspacing="0">
cellpadding="0" cellspacing="0" bgcolor="#9DACBF">
<tr>
<td width="600" height="25" valign="top"><div align="right">
<input type="submit" name="btn_accepted" id="<?php echo "btn_accepted_".$user_id ?>" value="Aceptar" onclick="javascript:register_friend(this)" />
<input type="submit" name="btn_denied" id="<?php echo "btn_deniedst_".$user_id ?>" value="Denegar" onclick="javascript:denied_friend(this)" />
<input type="submit" name="btn_accepted" id="<?php echo "btn_accepted_".$user_id ?>" value="<?php echo get_lang('Accept'); ?>" onclick="javascript:register_friend(this)" />
<input type="submit" name="btn_denied" id="<?php echo "btn_deniedst_".$user_id ?>" value="<?php echo get_lang('Deny'); ?>" onclick="javascript:denied_friend(this)" />
</div></td>
</tr>
</table></td>

@ -1,110 +0,0 @@
<?php
/*
==============================================================================
INIT SECTION
==============================================================================
*/
// name of the language file that needs to be included
$language_file = 'registration';
$cidReset = true;
require ('../inc/global.inc.php');
$this_section = SECTION_MYPROFILE;
$_SESSION['this_section']=$this_section;
api_block_anonymous_users();
$htmlHeadXtra[] = '<script type="text/javascript">
function confirmation(name)
{
if (confirm("'.get_lang('AreYouSureToDelete').' " + name + " ?"))
{return true;}
else
{return false;}
}
function show_image(image,width,height) {
width = parseInt(width) + 20;
height = parseInt(height) + 20;
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
</script>';
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
$htmlHeadXtra[] ='<script type="text/javascript">
$(document).ready(function(){
$("input").bind("click", function() {
id_button=$(this).attr("id");
if (id_button=="tab1" || id_button=="tab2" || id_button=="tab3" || id_button=="tab4") {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#div_response_tab").html("Cargando..."); },
type: "POST",
url: "../auth/load_content_tab.php",
data: "option_tab="+id_button,
success: function(datos) {
// $("div#"+name_div_id).hide();
$("#div_response_tab").html(datos);
///////////////////////////////////////////////////////////////////////////////
$("input").bind("click", function() {
name_button=$(this).attr("id");
name_div_id="id_"+name_button.substring(13,14);
user_id=name_div_id.split("_");
user_friend_id=user_id[1];
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_response").html("Cargando..."); },
type: "POST",
url: "../auth/register_friend.php",
data: "friend_id="+user_friend_id,
success: function(datos) {
$("div#"+name_div_id).hide();
$("#id_response").html(datos);
},
});
});
////////////////////////////////////////////////////////////////////////////////////////////////////////
},
});
}
});
});
</script>';
/*if (api_get_setting('allow_message_tool')=='true') {
$htmlHeadXtra[] ='<script type="text/javascript">
$(document).ready(function(){
$(".message-content .message-delete").click(function(){
$(this).parents(".message-content").animate({ opacity: "hide" }, "slow");
$(".message-view").animate({ opacity: "show" }, "slow");
});
});
</script>';
}*/
Display :: display_header(get_lang('ModifyProfile'));
?>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" height="20" valign="top"><div><input class="tab-table" type="button" class="button" name="tab1" id="tab1" value="Invitaciones" /></div></td>
<td width="10%" height="20" valign="top"><div><input class="tab-table" type="button" class="button" name="tab2" id="tab2" value="Amigos" /></div></td>
<td width="10%" height="20" valign="top"><div><input class="tab-table" type="button" class="button" name="tab3" id="tab3" value="Grupos" /></div></td>
<td width="70%" height="20" valign="top"><div><input class="tab-table" type="button" class="button" name="tab4" id="tab4" value="Datos Personales" /></div></td>
</tr>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" height="95%">
<tr>
<td width="100%" height="20" valign="top"><div id="div_response_tab"></div></td>
</tr>
</table>
<?php
Display :: display_footer();
?>
Loading…
Cancel
Save