[svn r19531] UI improvements to the Message/Social tool see FS#3909

skala
Julio Montoya 17 years ago
parent 8984028cf8
commit cb956a3cf6
  1. 17
      main/messages/send_message.php
  2. 109
      main/messages/send_message_to_userfriend.inc.php
  3. 13
      main/social/profile.php
  4. 86
      whoisonline.php

@ -36,28 +36,22 @@ $content_message=$_POST['txt_content'];
$subject_message=$_POST['txt_subject'];
$user_info=array();
$user_info=api_get_user_info($user_id);
?>
<?php
if ($panel_id==2) {
?>
<td height="20"><?php //echo mb_convert_encoding(get_lang('Info'),'UTF-8',$charset).' :'; ?></td>
<td height="20"><?php //echo mb_convert_encoding(get_lang('SocialUserInformationAttach'),'UTF-8',$charset); ?></td>
<td height="20"><?php echo mb_convert_encoding(get_lang('WriteToMessage'),'UTF-8',$charset); ?> :<br/><textarea id="txt_area_invite" rows="3" cols="25"></textarea></td>
<td height="20"><?php echo mb_convert_encoding(get_lang('WriteAMessage'),'UTF-8',$charset); ?> :<br/><textarea id="txt_area_invite" rows="3" cols="25"></textarea></td>
<td height="20"><input type="button" value="<?php echo mb_convert_encoding(get_lang('SendInviteMessage'),'UTF-8',$charset); ?>" onclick="action_database_panel('4','<?php echo $user_id;?>')" /></td>
<?php
}
?>
<?php
if ($panel_id==1) {
?>
<td height="20"><?php echo mb_convert_encoding(get_lang('To'),'UTF-8',$charset); ?> &nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;<?php echo mb_convert_encoding($user_info['firstName'],'UTF-8',$charset); ?></td>
<td height="20"><?php echo mb_convert_encoding(get_lang('subject'),'UTF-8',$charset); ?> :<br/><input id="txt_subject_id" type="text" style="width:200px;"></td>
<td height="20"><?php echo mb_convert_encoding(get_lang('To'),'UTF-8',$charset); ?> &nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;<?php echo mb_convert_encoding($user_info['firstName'].' '.$user_info['lastName'],'UTF-8',$charset); ?></td>
<td height="20"><?php echo mb_convert_encoding(get_lang('Subject'),'UTF-8',$charset); ?> :<br/><input id="txt_subject_id" type="text" style="width:200px;"></td>
<td height="20"><?php echo mb_convert_encoding(get_lang('Message'),'UTF-8',$charset); ?> :<br/><textarea id="txt_area_invite" rows="3" cols="25"></textarea></td>
<td height="20"><input type="button" value="<?php echo mb_convert_encoding(get_lang('NewMessage'),'UTF-8',$charset); ?>" onclick="hide_display_message()" />&nbsp;&nbsp;&nbsp; <input type="button" value="<?php echo get_lang('SendMessage'); ?>" onclick="action_database_panel('5','<?php echo $user_id;?>')" /></td>
<?php
}
?>
<?php
if ($panel_id==3) {
?>
<dl>
@ -66,9 +60,8 @@ if ($panel_id==3) {
</dl>
<?php
// <dd><a href="main/social/index.php#remote-tab-5"> echo mb_convert_encoding(get_lang('SocialSeeContacts'),'UTF-8',$charset);</a></dd>
}
?>
<?php
}
if ($panel_id==4) {
if ($subject_message=='clear') {
$subject_message=null;

@ -31,94 +31,73 @@ include_once(api_get_path(LIBRARY_PATH).'/usermanager.lib.php');
include_once(api_get_path(LIBRARY_PATH).'/message.lib.php');
include_once(api_get_path(LIBRARY_PATH).'/social.lib.php');
api_block_anonymous_users();
if (api_get_setting('allow_message_tool')<>'true' && api_get_setting('allow_social_tool')<>'true'){
api_not_allowed();
}
?>
<?php
if ( isset($_REQUEST['user_friend']) ) {
$info_user_friend=array();
$info_path_friend=array();
$userfriend_id=Security::remove_XSS($_REQUEST['user_friend']);
$panel=Security::remove_XSS($_REQUEST['view_panel']);
$info_user_friend=api_get_user_info($userfriend_id);
$info_path_friend=UserManager::get_user_picture_path_by_id($userfriend_id,'web',false,true);
}
if ( isset($_REQUEST['user_friend']) ) {
$info_user_friend=array();
$info_path_friend=array();
$userfriend_id=Security::remove_XSS($_REQUEST['user_friend']);
// panel=1 send message
// panel=2 send invitation
$panel=Security::remove_XSS($_REQUEST['view_panel']);
$info_user_friend=api_get_user_info($userfriend_id);
$info_path_friend=UserManager::get_user_picture_path_by_id($userfriend_id,'web',false,true);
}
?>
<table width="600" border="0" height="220">
<tr height="20">
<td><div class="message-top-title">
<table width="600" border="0" height="20">
<td width="450"><?php echo mb_convert_encoding(get_lang('SocialNetwork'),'UTF-8',$charset);?></td>
<?php
if (!isset($_REQUEST['view'])) {
?>
<td width="150"><a href="javascript:void(0)" onclick="change_panel('3','<?php echo $userfriend_id; ?>')" ><?php echo Display::return_icon('folder_up.gif',mb_convert_encoding(get_lang('SeeMoreOptions'),'UTF-8',$charset)).'&nbsp;&nbsp;'.mb_convert_encoding(get_lang('SeeMoreOptions'),'UTF-8',$charset);?></a></td>
<?php
}
?>
</table>
</div></td>
</tr>
<tr height="180">
<td>
<td>
<div class="message-content-body-left">
<img class="message-image-info" src="<?php echo $info_path_friend['dir'].$info_path_friend['file']; ?>"/>
<dl>
<dd><?php echo mb_convert_encoding(get_lang('FirstName'),'UTF-8',$charset).' : '.mb_convert_encoding($info_user_friend['firstName'],'UTF-8',$charset); ?></dd>
<dd><?php echo mb_convert_encoding(get_lang('LastName'),'UTF-8',$charset).' : '.mb_convert_encoding($info_user_friend['lastName'],'UTF-8',$charset); ?></dd>
</dl>
<?php
if ($panel != 1) {
echo '<br /><center>'.mb_convert_encoding($info_user_friend['firstName'].' '.$info_user_friend['lastName'],'UTF-8',$charset).'</center>';
}
?>
</div>
<div class="message-conten-body-right">
<div id="id_content_panel_init"><!--init content changed -->
<div id="id_content_panel_init">
<dl>
<?php
if (!isset($_REQUEST['view'])) {
?>
<dd><a href="javascript:void(0)" onclick="change_panel('2','<?php echo $userfriend_id; ?>')"><?php echo mb_convert_encoding(get_lang('SendInviteMessage'),'UTF-8',$charset);?></a></dd>
<?php
}
?>
<?php
if (api_get_setting('allow_message_tool')=='true') {
if (isset($_REQUEST['view_panel'])) {
?>
<?php
$user_info=api_get_user_info($userfriend_id);
echo mb_convert_encoding(get_lang('To'),'UTF-8',$charset); ?> &nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;<?php echo mb_convert_encoding($user_info['firstName'],'UTF-8',$charset); ?>
<br/><?php echo mb_convert_encoding(get_lang('subject'),'UTF-8',$charset); ?> :<br/><input id="txt_subject_id" type="text" style="width:200px;">
<br/><?php echo mb_convert_encoding(get_lang('Message'),'UTF-8',$charset); ?> :<br/><textarea id="txt_area_invite" rows="3" cols="25"></textarea>
<input type="button" value="<?php echo mb_convert_encoding(get_lang('NewMessage'),'UTF-8',$charset); ?>" onclick="hide_display_message()" />&nbsp;&nbsp;&nbsp;
<input type="button" value="<?php echo get_lang('SendMessage'); ?>" onclick="action_database_panel('5','<?php echo $userfriend_id;?>')" />
/*if ($panel == 1) {
<dd><a href="javascript:void(0)" onclick="change_panel('2','<?php echo $userfriend_id; ?>')"><?php echo mb_convert_encoding(get_lang('SendInviteMessage'),'UTF-8',$charset);?></a></dd>' .
}
<input type="button" value="<?php echo mb_convert_encoding(get_lang('NewMessage'),'UTF-8',$charset); ?>" onclick="hide_display_message()" />&nbsp;&nbsp;&nbsp;
**/
if (api_get_setting('allow_message_tool')=='true') {
if ($panel == 1) {
$user_info=api_get_user_info($userfriend_id);
echo mb_convert_encoding(get_lang('To'),'UTF-8',$charset); ?> :&nbsp;&nbsp;&nbsp;&nbsp;<?php echo mb_convert_encoding($user_info['firstName'].' '.$user_info['lastName'],'UTF-8',$charset); ?>
<br/>
<br/><?php echo mb_convert_encoding(get_lang('Subject'),'UTF-8',$charset); ?> :<br/><input id="txt_subject_id" type="text" style="width:300px;"><br/>
<br/><?php echo mb_convert_encoding(get_lang('Message'),'UTF-8',$charset); ?> :<br/><textarea id="txt_area_invite" rows="4" cols="41"></textarea>
<br /><br />
<input type="button" value="<?php echo get_lang('SendMessage'); ?>" onclick="action_database_panel('5','<?php echo $userfriend_id;?>')" />
<?php
} else {
?>
<dd><a href="javascript:void(0)" onclick="change_panel('1','<?php echo $userfriend_id; ?>')"><?php echo mb_convert_encoding(get_lang('SendMessage'),'UTF-8',$charset);?></a></dd>
} else {
echo mb_convert_encoding(get_lang('AddPersonalMessage'),'UTF-8',$charset); ?> :<br/><br/>
<textarea id="txt_area_invite" rows="5" cols="41"></textarea><br /><br />
<input type="button" value="<?php echo mb_convert_encoding(get_lang('SocialAddToFriends'),'UTF-8',$charset); ?>" onclick="action_database_panel('4','<?php echo $userfriend_id;?>')" />
<?php
}
?>
<?php
}
?>
<?php
if (!isset($_REQUEST['view'])) {
//<dd><a href="main/social/index.php#remote-tab-5"> echo get_lang('SocialSeeContacts'); </a></dd>
?>
<?php
}
?>
</dl>
</div><!-- end content changed-->
</dl>
</div>
</td>
</tr>
</div>
<tr height="22">
<td>
<div id="display_response_id" style="position:relative"></div>
<div class="message-bottom-title">&nbsp;</div></td>
</tr>
<div id="display_response_id" style="position:relative"></div>
<div class="message-bottom-title">&nbsp;</div>
</td>
</tr>
</table>

@ -517,7 +517,7 @@ echo '<div id="social-profile-wrapper">';
if ($k==0) $margin_top = 0;
$friend_html.='<a href="profile.php?u='.$list_friends_id[$j].'&amp;'.$link_shared.'">';
$friend_html.='<img src="'.$list_friends_dir[$j]."/".$list_friends_file[$j].'" width="90px" height="110px" style="margin-left:3px;margin-right:3px;margin-top:'.$margin_top.'px;margin-bottom:3px;" id="imgfriend_'.$list_friends_id[$j].'" title="'.$name_user.'" />';
$friend_html.= '<br />'.$my_user_info['firstName'].'<br />'.$my_user_info['lastName'];
$friend_html.= '<br /><div style="margin-left:10px">'.$my_user_info['firstName'].'<br />'.$my_user_info['lastName'].'</div>';
$friend_html.= '</a>';
$friend_html.= '</div>&nbsp;';
}
@ -585,6 +585,7 @@ echo '<div id="social-profile-wrapper">';
foreach ($course_list_code as $course) {
$file_list.= UserManager::get_user_upload_files_by_course($user_id,$course['code']);
}
if (!empty($file_list)) {
echo '<div class="clear"></div><br />';
echo '<div class="actions-profile">';
@ -600,8 +601,9 @@ echo '<div id="social-profile-wrapper">';
//-- Competences
if (!empty($user_info['competences']) || !empty($user_info['diplomas']) || !empty($user_info['openarea']) || !empty($user_info['teach']) ) {
echo '<div class="actions-profile">';
echo get_lang('MoreInfo');
echo '<div class="clear"></div>';
echo '<div class="actions-profile">';
echo get_lang('MoreInformation');
echo '</div>';
}
$cut_size = 220;
@ -652,10 +654,9 @@ echo '<div id="social-profile-container">';
echo Display::return_icon('email.gif');
echo '&nbsp;&nbsp;<a href="../social/index.php#remote-tab-2">'.get_lang('MyInbox').'</a><br />';
echo Display::return_icon('edit.gif');
echo '&nbsp;&nbsp;<a href="../auth/profile.php?show=1">'.get_lang('EditInformation').'</a>';
echo '&nbsp;&nbsp;<a href="../auth/profile.php?show=1">'.get_lang('EditInformation').'</a>';
} else {
echo '&nbsp;&nbsp;<a href="../messages/send_message_to_userfriend.inc.php?height=365&width=610&user_friend='.$user_id.'&view=profile&view_panel=true" class="thickbox" title="'.get_lang('SendMessage').'">'.Display::return_icon('message_new.png').'&nbsp;&nbsp;'.get_lang('SendMessage').'</a><br />';
echo '&nbsp;&nbsp;<a href="../messages/send_message_to_userfriend.inc.php?height=365&width=610&user_friend='.$user_id.'&view=profile&view_panel=1" class="thickbox" title="'.get_lang('SendMessage').'">'.Display::return_icon('message_new.png').'&nbsp;&nbsp;'.get_lang('SendAMessage').'</a><br />';
//echo '&nbsp;&nbsp;<a href="#">'.get_lang('SendMessage').'</a>';
}
echo '<br /><br />';

@ -1,4 +1,4 @@
<?php // $Id: whoisonline.php 19389 2009-03-27 21:14:44Z juliomontoya $
<?php // $Id: whoisonline.php 19531 2009-04-03 17:24:14Z juliomontoya $
/*
==============================================================================
Dokeos - elearning and course management software
@ -19,10 +19,6 @@
Contact: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
* @todo use the correct api_get_path instead of $clarolineRepositoryWeb
*/
/**
==============================================================================
@ -121,7 +117,7 @@ if ($_GET['chatid'] != '') {
$time = time();
$time = date("Y-m-d H:i:s", $time);
$chatid = addslashes($_GET['chatid']);
$sql="update $track_user_table set chatcall_user_id = '".mysql_real_escape_string($_user['user_id'])."', chatcall_date = '".mysql_real_escape_string($time)."', chatcall_text = '' where (user_id = ".mysql_real_escape_string($chatid).")";
$sql="update $track_user_table set chatcall_user_id = '".Database::escape_string($_user['user_id'])."', chatcall_date = '".Database::escape_string($time)."', chatcall_text = '' where (user_id = ".Database::escape_string($chatid).")";
$result=api_sql_query($sql,__FILE__,__LINE__);
//redirect caller to chat
@ -144,16 +140,18 @@ function display_user_list($user_list, $_plugins)
$extra_params['cidReq'] = Database::escape_string($_GET['cidReq']);
$course_url = '&amp;cidReq='.Security::remove_XSS($_GET['cidReq']);
}
foreach($user_list as $user) {
foreach ($user_list as $user) {
$uid=$user[0];
$user_info = api_get_user_info($uid);
$table_row = array();
$url = '?id='.$uid.$course_url;
$image_array=UserManager::get_user_picture_path_by_id($uid,'web',false,true);
$table_row[] = '<a href="'.$url.'"><img src="'.$image_array['dir'].$image_array['file'].'" border="1" height="110"></a>';
$table_row[] = '<a href="'.$url.'">'.$user_info['firstName'].'</a>';
$table_row[] = '<a href="'.$url.'">'.$user_info['lastName'].'</a>';
//reduce image
$table_row[] = '<a href="'.$url.'"><img src="'.$image_array['dir'].$image_array['file'].'" border="1" width="130"></a>';
$table_row[] = '<a href="'.$url.'">'.$user_info['firstName'].' '.$user_info['lastName'].'</a>';
//$table_row[] = '<a href="'.$url.'">'.$user_info['lastName'].'</a>';
if (api_get_setting('show_email_addresses') == 'true') {
$table_row[] = Display::encrypted_mailto_link($user_info['mail']);
@ -163,31 +161,25 @@ function display_user_list($user_list, $_plugins)
if ($user_info['user_id'] != api_get_user_id() && !api_is_anonymous($user_info['user_id'])) {
$user_relation=UserFriend::get_relation_between_contacts(api_get_user_id(),$user_info['user_id']);
if ($user_relation==0 || $user_relation==6) {
$table_row[] = '<a href="main/messages/send_message_to_userfriend.inc.php?height=365&width=610&user_friend='.$user_info['user_id'].'" class="thickbox" title="'.get_lang('SearchContacts').'"><img src="main/img/addd.gif"></a>';
$table_row[] = '<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=2&height=365&width=610&user_friend='.$user_info['user_id'].'" class="thickbox" title="'.get_lang('SocialAddToFriends').'">'.get_lang('SocialAddToFriends').'</a><br />
<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=1&height=365&width=610&user_friend='.$user_info['user_id'].'" class="thickbox" title="'.get_lang('SendAMessage').'">'.get_lang('SendAMessage').'</a>';
} else {
$table_row[] = '<img src="main/img/add_na.gif">';
}
$table_row[] = '<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=1&height=365&width=610&user_friend='.$user_info['user_id'].'" class="thickbox" title="'.get_lang('SendAMessage').'">'.get_lang('SendAMessage').'</a>';
}
}
}
//this feature is deprecated
/*
if ( api_get_setting('allow_message_tool')=='true' && isset($_SESSION['_user']) ) {
$table_row[] = '<a href="' . api_get_path(WEB_PLUGIN_PATH).'messages/new_message.php?send_to_user=' . $uid. '"><img src="./main/img/forum.gif" alt="'.get_lang("ComposeMessage").'" align="middle"></img></a>';
}
*/
$table_data[] = $table_row;
}
$table_header[] = array(get_lang('UserPicture'),false,'width="80"');
$table_header[] = array(get_lang('FirstName'),true);
$table_header[] = array(get_lang('LastName'),true);
$table_header[] = array(get_lang('Name'),false);
//$table_header[] = array(get_lang('LastName'),true);
if (api_get_setting('show_email_addresses') == 'true') {
$table_header[] = array(get_lang('Email'),true);
}
$user_anonymous=api_get_anonymous_id();
if (api_get_setting('allow_social_tool')=='true' && api_get_user_id()<>$user_anonymous && api_get_user_id()<>0) {
$table_header[] = array(get_lang('Friends'),false,'width="100"');
$table_header[] = array(get_lang('Friends'),false,'width="130"');
}
/*this feature is deprecated
if ( api_get_setting('allow_message_tool')=='true' && isset($_SESSION['_user'])) {
@ -265,13 +257,11 @@ function display_individual_user($user_id)
}
echo $status.'<br />';
echo '</div>';
if ($user_object->competences)
{
if ($user_object->competences) {
echo '<dt><strong>'.get_lang('MyCompetences').'</strong></dt>';
echo '<dd>'.$user_object->competences.'</dd>';
}
if ($user_object->diplomas)
{
if ($user_object->diplomas) {
echo '<dt><strong>'.get_lang('MyDiplomas').'</strong></dt>';
echo '<dd>'.$user_object->diplomas.'</dd>';
}
@ -297,41 +287,34 @@ function display_individual_user($user_id)
* @todo use the correct api_get_path instead of $clarolineRepositoryWeb
*/
function display_productions($user_id)
{
global $clarolineRepositoryWeb, $disabled_output;
{
$sysdir_array = UserManager::get_user_picture_path_by_id($user_id,'system');
$sysdir = $sysdir_array['dir'].$user_id.'/';
$webdir_array = UserManager::get_user_picture_path_by_id($user_id,'web');
$webdir = $webdir_array['dir'].$user_id.'/';
if( !is_dir($sysdir))
{
if( !is_dir($sysdir)) {
mkpath($sysdir);
}
$handle = opendir($sysdir);
$productions = array();
while ($file = readdir($handle))
{
if ($file == '.' || $file == '..' || $file == '.htaccess')
{
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..' || $file == '.htaccess') {
continue; // Skip current and parent directories
}
$productions[] = $file;
}
if(count($productions) > 0)
{
if(count($productions) > 0) {
echo '<dt><strong>'.get_lang('Productions').'</strong></dt>';
echo '<dd><ul>';
foreach($productions as $index => $file)
{
foreach($productions as $index => $file) {
// Only display direct file links to avoid browsing an empty directory
if(is_file($sysdir.$file) && $file != $webdir_array['file']){
echo '<li><a href="'.$webdir.urlencode($file).'" target=_blank>'.$file.'</a></li>';
}
// Real productions are under a subdirectory by the User's id
if(is_dir($sysdir.$file)){
if(is_dir($sysdir.$file)) {
$subs = scandir($sysdir.$file);
foreach($subs as $my => $sub)
{
foreach($subs as $my => $sub) {
if(substr($sub,0,1) != '.' && is_file($sysdir.$file.'/'.$sub))
{
echo '<li><a href="'.$webdir.urlencode($file).'/'.urlencode($sub).'" target=_blank>'.$sub.'</a></li>';
@ -344,14 +327,10 @@ function display_productions($user_id)
}
// This if statement prevents users accessing the who's online feature when it has been disabled.
if ((api_get_setting('showonline','world') == 'true' AND !$_user['user_id']) OR ((api_get_setting('showonline','users') == 'true' OR api_get_setting('showonline','course') == 'true') AND $_user['user_id']))
{
if(isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0)
{
if ((api_get_setting('showonline','world') == 'true' AND !$_user['user_id']) OR ((api_get_setting('showonline','users') == 'true' OR api_get_setting('showonline','course') == 'true') AND $_user['user_id'])) {
if(isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) {
$user_list = Who_is_online_in_this_course($_user['user_id'],api_get_setting('time_limit_whosonline'),$_GET['cidReq']);
}
else
{
} else {
$user_list = WhoIsOnline($_user['user_id'],$_configuration['statistics_database'],api_get_setting('time_limit_whosonline'));
}
@ -362,12 +341,9 @@ if ((api_get_setting('showonline','world') == 'true' AND !$_user['user_id']) OR
Display::display_header(get_lang('UsersOnLineList'));
api_display_tool_title(get_lang('UsersOnLineList'));
echo '<b>'.get_lang('TotalOnLine').' : '.$total.'</b>';
if ($_GET['id']=='')
{
if ($_GET['id']=='') {
echo '<p><a href="javascript:window.location.reload()">'.get_lang('Refresh').'</a></p>';
}
else
{
} else {
if(0) // if ($_user['user_id'] && $_GET["id"] != $_user['user_id'])
{
echo '<a href="'.api_get_self().'?chatid='.Security::remove_XSS($_GET['id']).'">'.get_lang('SendChatRequest').'</a>';

Loading…
Cancel
Save