skala
Julio Montoya 16 years ago
commit 7d0439db53
  1. 25
      dokeos_license.txt
  2. 122
      main/css/blue_lagoon/default.css
  3. 6
      main/inc/lib/group_portal_manager.lib.php
  4. 3
      main/inc/lib/magpierss/rss_fetch.inc
  5. 114
      main/inc/lib/message.lib.php
  6. 233
      main/inc/lib/social.lib.php
  7. 72
      main/messages/inbox.php
  8. 179
      main/messages/new_message.php
  9. 102
      main/messages/outbox.php
  10. 76
      main/messages/view_message.php
  11. 8
      main/social/group_invitation.php
  12. 41
      main/social/groups.php
  13. 47
      main/social/message_for_group_form.inc.php
  14. 17
      main/social/profile.php
  15. 1
      main/social/register_friend.php
  16. 2
      main/social/search.php
  17. 7
      main/tracking/courseLog.php
  18. 233
      whoisonline.php

@ -1,25 +0,0 @@
===============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2009 Dokeos SPRL
Copyright (c) 2009 Dokeos Latinoamérica SAC
Copyright (c) 2003-2007 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) 2003-2008 Vrije Universiteit Brussel (VUB)
Copyright (c) 2004-2008 Hoogeschool Gent (HoGent)
For a full list of contributors detaining copyrights over parts of
the Dokeos software, see "documentation/credits.html".
The full license can be read in "documentation/license.html".
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, Rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
===============================================================================
This license is referenced throughout the code using the following header line:
/* For licensing terms, see /dokeos_license.txt */

@ -2207,7 +2207,7 @@ div.comments {
margin-right:-100px;
}
.message-title {
/* color:#ff0000;*/
color:#ff0000;
font-size:12px;
}
.message-body {
@ -2624,7 +2624,7 @@ input.arrowl {
/* UI improvements */
/* UI improvements for 1.8.6.2 this should be move to the chamilo theme and reproduce in all CSS*/
* {
@ -2672,4 +2672,120 @@ a.read {
a.unread {
}
}
#inbox-wrapper {width:100%;}
#inbox {width:90%;float:left;}
#inbox-menu ul {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
margin:0;
padding:0;
width:10%;
float:left;
}
#message-reply-link {
float:right;
}
.social-plugin-item {
float:left;
width:50%;
background-color:#ccc;
margin: 0px;
}
#social-plugins {
float:left;
background-color:#f00;
width:100%;
margin: 0px;
padding:2px;
}
.groups_grid_item {
width:80px;
float:left;
margin:5px;
}
.groups_grid_container {
}
.message-item {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
-moz-border-radius-bottomleft:8px;
-moz-border-radius-bottomright:8px;
-moz-border-radius-topleft:8px;
-moz-border-radius-topright:8px;
background:#eee none repeat scroll 0 0;
margin:0 0 5px;
padding:10px;
}
.message-topic {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
-moz-border-radius-bottomleft:8px;
-moz-border-radius-bottomright:8px;
-moz-border-radius-topleft:8px;
-moz-border-radius-topright:8px;
background:#ccc none repeat scroll 0 0;
margin:0 0 5px;
padding:10px;
}
.message-group-title-topic {
font-size:180%;
margin:5px 0px 5px 0px;
}
.message-group-title {
font-size:120%;
}
.message-group-author {
margin:5px 0px 5px 0px;
}
.message-group-content {
line-height:150%
}
.view-message-content {
line-height:150%;
font-size:110%;
}
.actions {
background:#efefef;
border:1px solid #ccc;
padding:2px;
margin-bottom: 5px;
vertical-align:middle;
}
.actions-title {
background:#efefef;
border:1px solid #ccc;
padding:4px;
margin-bottom: 5px;
font-size:14px;
font-weight:bolder;
vertical-align:middle;
}

@ -186,7 +186,7 @@ class GroupPortalManager
$table = Database :: get_main_table(TABLE_MAIN_GROUP);
$group_id = intval($group_id);
$user_condition = '';
$sql = "SELECT name, description, picture_uri, visibility FROM $table WHERE id = $group_id ";
$sql = "SELECT name, description, picture_uri, url, visibility FROM $table WHERE id = $group_id ";
$res = Database::query($sql, __FILE__, __LINE__);
$item = array();
if (Database::num_rows($res)>0) {
@ -384,7 +384,7 @@ class GroupPortalManager
$where_relation_condition = "AND gu.relation_type IN ($relation_type) ";
}
$sql="SELECT picture_uri, u.user_id, u.firstname, u.lastname, relation_type FROM $tbl_user u
$sql="SELECT picture_uri as image, u.user_id, u.firstname, u.lastname, relation_type FROM $tbl_user u
INNER JOIN $table_group_rel_user gu
ON (gu.user_id = u.user_id) WHERE gu.group_id= $group_id $where_relation_condition ORDER BY relation_type, firstname LIMIT $limit";
@ -392,7 +392,7 @@ class GroupPortalManager
$array = array();
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) {
$picture = UserManager::get_picture_user($row['user_id'], $row['picture_uri'],$image_conf['height'],$image_conf['size']);
$picture = UserManager::get_picture_user($row['user_id'], $row['picture_uri'],$image_conf['height'],$image_conf['size']);
$row['image'] = '<img src="'.$picture['file'].'" '.$picture['style'].' />';
}
$array[$row['user_id']] = $row;

@ -213,7 +213,8 @@ function fetch_rss ($url) {
}
// else we totally failed
error( $errormsg );
//hide the error
//error( $errormsg );
return false;

@ -30,9 +30,6 @@ define('MESSAGE_STATUS_INVITATION_DENIED', '7');
class MessageManager
{
function MessageManager() {
}
public static function get_online_user_list($current_user_id) {
$min=30;
global $_configuration;
@ -544,32 +541,32 @@ class MessageManager
/**
* display message box in the inbox
* @param int the message id
* @return string html with the message content
*/
public static function show_message_box() {
global $charset;
public static function show_message_box($message_id) {
$table_message = Database::get_main_table(TABLE_MESSAGE);
$tbl_message_attach = Database::get_main_table(TABLE_MESSAGE_ATTACHMENT);
$message_id = '';
if (isset($_GET['id_send']) && is_numeric($_GET['id_send'])) {
/* if (isset($_GET['id_send']) && is_numeric($_GET['id_send'])) {
// when I get here ? by Julio Montoya
$query = "SELECT * FROM $table_message WHERE user_sender_id=".api_get_user_id()." AND id=".intval(Database::escape_string($_GET['id_send']))." AND msg_status=4;";
$result = Database::query($query,__FILE__,__LINE__);
$path='outbox.php';
$message_id = intval($_GET['id_send']);
} else {
if (is_numeric($_GET['id'])) {
$message_id = intval($_GET['id']);
$query = "UPDATE $table_message SET msg_status = '".MESSAGE_STATUS_NEW."' WHERE user_receiver_id=".api_get_user_id()." AND id='".$message_id."';";
$result = Database::query($query,__FILE__,__LINE__);
$query = "SELECT * FROM $table_message WHERE msg_status<>4 AND user_receiver_id=".api_get_user_id()." AND id='".$message_id."';";
$result = Database::query($query,__FILE__,__LINE__);
}
} else {*/
$message_id = intval($message_id);
if (is_numeric($message_id) && !empty($message_id)) {
$query = "UPDATE $table_message SET msg_status = '".MESSAGE_STATUS_NEW."' WHERE user_receiver_id=".api_get_user_id()." AND id='".$message_id."';";
$result = Database::query($query,__FILE__,__LINE__);
$query = "SELECT * FROM $table_message WHERE msg_status<>4 AND user_receiver_id=".api_get_user_id()." AND id='".$message_id."';";
$result = Database::query($query,__FILE__,__LINE__);
}
$path='inbox.php';
}
//}
$row = Database::fetch_array($result);
@ -591,7 +588,7 @@ class MessageManager
<TABLE>
<TR>
<TD width="100%">
<TR> <h1>'.str_replace("\\","",$row[5]).'</h1></TR>
<h1>'.str_replace("\\","",$row[5]).'</h1>
</TD>
<TR>';
if (api_get_setting('allow_social_tool') == 'true') {
@ -617,13 +614,20 @@ class MessageManager
<TABLE height=209 width="100%" bgColor=#ffffff>
<TBODY>
<TR>
<TD vAlign=top>'.str_replace("\\","",$row[6]).'</TD>
<TD vAlign=top class="view-message-content">'.str_replace("\\","",$row[6]).'</TD>
</TR>
</TBODY>
</TABLE>
<div id="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>
<DIV class=HT style="PADDING-BOTTOM: 5px"> </DIV></TD>
<TD width=10>&nbsp;</TD>
<DIV class=HT style="PADDING-BOTTOM: 5px">';
$message_content .= '<a href="new_message.php?re_id='.$message_id.'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).get_lang('ReplyToMessage').'</a> &nbsp';
$message_content .= '<a href="inbox.php?action=deleteone&id='.$message_id.'" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''.get_lang('DeleteMessage').'</a>&nbsp';
$message_content .='</DIV></TD>
<TD width=10></TD>
</TR>
</TABLE>';
return $message_content;
@ -712,9 +716,8 @@ class MessageManager
}
/**
* display messages for group with nested view
* Displays messages of a group with nested view
* @param int group id
* @return void
*/
public static function display_messages_for_group($group_id) {
@ -723,34 +726,43 @@ class MessageManager
$rows = self::calculate_children($rows);
$group_info = GroupPortalManager::get_group_data($group_id);
$count=0;
foreach ($rows as $message) {
$indent = $message['indent_cnt']*'20';
$user_sender_info = UserManager::get_user_info_by_id($message['user_sender_id']);
if (!empty($message['parent_id'])) {
$message_parent_info = self::get_message_by_id($message['parent_id']);
$user_parent_info = UserManager::get_user_info_by_id($message_parent_info['user_sender_id']);
$name_user_parent = api_get_person_name($user_parent_info['firstname'], $user_parent_info['lastname']);
}
// get file attachments by message id
$files_attachments = self::get_links_message_attachment_files($message['id']);
$name=api_get_person_name($user_sender_info['firstname'], $user_sender_info['lastname']);
echo "<div style=\"margin-left: ".$indent."px;padding:5px;border:1pt dotted black\">";
echo '<div id="message-title">'.$message['title'].'&nbsp;(&nbsp;'.$message['send_date'].'&nbsp;)&nbsp;</div>';
echo '<div id="message-author">'.get_lang('From').'&nbsp;'.$name.'&nbsp;'.get_lang('ToGroup').'&nbsp;'.(!empty($message['parent_id'])?$name_user_parent:$group_info['name']).'</div>';
echo '<div id="message-content">'.$message['content'].'</div>';
echo '<div id="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
echo '<div id="actions">';
if (!isset($message['children'])) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=365&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$message['id'].'" class="thickbox" title="'.api_xml_http_response_encode(get_lang('Reply')).'">'.Display :: return_icon('forumthread_new.gif', api_xml_http_response_encode(get_lang('Reply'))).'&nbsp;'.api_xml_http_response_encode(get_lang('Reply')).'</a>';
//echo '<a href="/main/messages/new_message.php?group_id='.$group_id.'&message_id='.$message['id'].'">'.Display::return_icon('forumthread_new.gif',api_xml_http_response_encode(get_lang('Reply'))).'&nbsp;'.api_xml_http_response_encode(get_lang('Reply')).'</a>';
if (is_array($rows) && count($rows)> 0) {
foreach ($rows as $message) {
$indent = $message['indent_cnt']*'20';
$user_sender_info = UserManager::get_user_info_by_id($message['user_sender_id']);
if (!empty($message['parent_id'])) {
$message_parent_info = self::get_message_by_id($message['parent_id']);
$user_parent_info = UserManager::get_user_info_by_id($message_parent_info['user_sender_id']);
$name_user_parent = api_get_person_name($user_parent_info['firstname'], $user_parent_info['lastname']);
$message_item = 'message-item';
$message_title_item = 'message-group-title';
} else {
$message_item = 'message-topic';
$message_title_item = 'message-group-title-topic';
}
// get file attachments by message id
$files_attachments = self::get_links_message_attachment_files($message['id']);
$name = api_get_person_name($user_sender_info['firstname'], $user_sender_info['lastname']);
echo '<div class="'.$message_item.'" id="message-item-'.$count.'" style="margin-left: '.$indent.'px;">';
//if (!isset($message['children'])) {
echo '<div id="message-reply-link"><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$message['id'].'" class="thickbox" title="'.api_xml_http_response_encode(get_lang('Reply')).'">'.Display :: return_icon('forumthread_new.gif', api_xml_http_response_encode(get_lang('Reply'))).'&nbsp;'.api_xml_http_response_encode(get_lang('Reply')).'</a></div>';
//echo '<a href="/main/messages/new_message.php?group_id='.$group_id.'&message_id='.$message['id'].'">'.Display::return_icon('forumthread_new.gif',api_xml_http_response_encode(get_lang('Reply'))).'&nbsp;'.api_xml_http_response_encode(get_lang('Reply')).'</a>';
//}
echo '<div class="'.$message_title_item.'">'.$message['title'].'&nbsp;(&nbsp;'.date_to_str_ago($message['send_date']).'&nbsp;)&nbsp;</div>';
echo '<div class="message-group-author">'.get_lang('From').'&nbsp;<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$message['user_sender_id'].'">'.$name.'&nbsp;</a></div>';
echo '<div class="message-group-content">'.$message['content'].'</div>';
echo '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
echo '</div>';
$count++;
}
echo '</div>';
echo '</div>';
$count++;
}
}

@ -20,6 +20,11 @@ define('SOCIALGOODFRIEND','4');
define('SOCIALENEMY', '5');
define('SOCIALDELETED', '6');
//PLUGIN PLACES
define('SOCIAL_LEFT_PLUGIN', '1');
define('SOCIAL_CENTER_PLUGIN', '2');
define('SOCIAL_RIGHT_PLUGIN', '3');
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
@ -46,18 +51,23 @@ class SocialManager extends UserManager {
$sql = 'SELECT COUNT(*) as count FROM ' . $tbl_my_friend . ' WHERE friend_user_id=' .$friend_id.' AND user_id='.$my_user_id;
$result = Database::query($sql, __FILE__, __LINE__);
$row = Database :: fetch_array($result, 'ASSOC');
error_log('1'.$row['count']);
if ($row['count'] == 0) {
$current_date=date('Y-m-d H:i:s');
$sql_i = 'INSERT INTO ' . $tbl_my_friend . '(friend_user_id,user_id,relation_type,last_edit)values(' . $friend_id . ','.$my_user_id.','.$relation_type.',"'.$current_date.'");';
error_log($sql_i);
Database::query($sql_i, __FILE__, __LINE__);
} else {
$sql = 'SELECT COUNT(*) as count FROM ' . $tbl_my_friend . ' WHERE friend_user_id=' . $friend_id . ' AND user_id='.$my_user_id;
$result = Database::query($sql, __FILE__, __LINE__);
$row = Database :: fetch_array($result, 'ASSOC');
error_log($row['count']);
if ($row['count'] == 1) {
$sql_i = 'UPDATE ' . $tbl_my_friend . ' SET relation_type='.$relation_type.' WHERE friend_user_id=' . $friend_id.' AND user_id='.$my_user_id;
error_log($sql_i);
Database::query($sql_i, __FILE__, __LINE__);
}
}
@ -658,4 +668,227 @@ class SocialManager extends UserManager {
*/
echo '</div>';
}
/**
* Displays a sortable table with the list of online users.
* @param array $user_list
*/
function display_user_list($user_list, $_plugins) {
global $charset;
if ($_GET['id'] == '') {
$extra_params = array();
$course_url = '';
if (strlen($_GET['cidReq']) > 0) {
$extra_params['cidReq'] = Security::remove_XSS($_GET['cidReq']);
$course_url = '&amp;cidReq='.Security::remove_XSS($_GET['cidReq']);
}
foreach ($user_list as $user) {
$uid = $user[0];
$user_info = api_get_user_info($uid);
$table_row = array();
if (api_get_setting('allow_social_tool')=='true') {
$url = api_get_path(WEB_PATH).'main/social/profile.php?u='.$uid.$course_url;
} else {
$url = '?id='.$uid.$course_url;
}
$image_array = UserManager::get_user_picture_path_by_id($uid, 'system', false, true);
$friends_profile = SocialManager::get_picture_user($uid, $image_array['file'], 92, 'medium_', ' width="90" height="90" ');
// reduce image
$name = api_get_person_name($user_info['firstName'], $user_info['lastName']);
$table_row[] = '<a href="'.$url.'"><img title = "'.$name.'" alt="'.$name.'" src="'.$friends_profile['file'].'" '.$friends_profile['style'].' border="1"></a>';
$table_row[] = '<a href="'.$url.'" style="font-size:10px;">'.api_get_person_name($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']);
}
$user_anonymous = api_get_anonymous_id();
$table_data[] = $table_row;
}
$table_header[] = array(get_lang('UserPicture'), false, 'width="90"');
///$table_header[] = array(get_lang('Name'), true);
//$table_header[] = array(get_lang('LastName'), true);
if (api_get_setting('show_email_addresses') == 'true') {
$table_header[] = array(get_lang('Email'), true);
}
Display::display_sortable_table($table_header, $table_data, array(), array('per_page' => 30), $extra_params,array(),'grid');
}
}
/**
* Displays the information of an individual user
* @param int $user_id
*/
function display_individual_user($user_id) {
global $interbreadcrumb;
$safe_user_id = Database::escape_string($user_id);
// to prevent a hacking attempt: http://www.dokeos.com/forum/viewtopic.php?t=5363
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT * FROM $user_table WHERE user_id='".$safe_user_id."'";
$result = Database::query($sql, __FILE__, __LINE__);
if (Database::num_rows($result) == 1) {
$user_object = Database::fetch_object($result);
$name = GetFullUserName($user_id).($_SESSION['_uid'] == $user_id ? '&nbsp;<strong>('.get_lang('Me').')</strong>' : '' );
$alt = GetFullUserName($user_id).($_SESSION['_uid'] == $user_id ? '&nbsp;('.get_lang('Me').')' : '');
$status = ($user_object->status == COURSEMANAGER ? get_lang('Teacher') : get_lang('Student'));
$interbreadcrumb[] = array('url' => 'whoisonline.php', 'name' => get_lang('UsersOnLineList'));
Display::display_header($alt);
echo '<div class="actions-title">';
echo $alt;
echo '</div><br />';
echo '<div style="text-align: center">';
if (strlen(trim($user_object->picture_uri)) > 0) {
$sysdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'system');
$sysdir = $sysdir_array['dir'];
$webdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'web');
$webdir = $webdir_array['dir'];
$fullurl = $webdir.$user_object->picture_uri;
$system_image_path = $sysdir.$user_object->picture_uri;
list($width, $height, $type, $attr) = @getimagesize($system_image_path);
$resizing = (($height > 200) ? 'height="200"' : '');
$height += 30;
$width += 30;
$window_name = 'window'.uniqid('');
// get the path,width and height from original picture
$big_image = $webdir.'big_'.$user_object->picture_uri;
$big_image_size = api_getimagesize($big_image);
$big_image_width = $big_image_size[0];
$big_image_height = $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
echo '<input type="image" src="'.$fullurl.'" alt="'.$alt.'" onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/><br />';
} else {
echo Display::return_icon('unknown.jpg', get_lang('Unknown'));
echo '<br />';
}
echo '<br />'.$status.'<br />';
global $user_anonymous;
if (api_get_setting('allow_social_tool') == 'true' && api_get_user_id() <> $user_anonymous && api_get_user_id() <> 0) {
echo '<br />';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$safe_user_id.'">'.get_lang('ViewSharedProfile').'</a>';
echo '<br />';
$user_anonymous = api_get_anonymous_id();
if ($safe_user_id != api_get_user_id() && !api_is_anonymous($safe_user_id)) {
$user_relation = SocialManager::get_relation_between_contacts(api_get_user_id(), $safe_user_id);
if ($user_relation == 0 || $user_relation == 6) {
echo '<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=2&height=300&width=610&user_friend='.$safe_user_id.'" class="thickbox" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('add_multiple_users.gif', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a><br />
<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=1&height=310&width=610&user_friend='.$safe_user_id.'" class="thickbox" title="'.get_lang('SendAMessage').'">'.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).'&nbsp;'.get_lang('SendAMessage').'</a>';
} else {
echo '<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=1&height=310&width=610&user_friend='.$safe_user_id.'" class="thickbox" title="'.get_lang('SendAMessage').'">'.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).'&nbsp;'.get_lang('SendAMessage').'</a>';
}
}
}
if (api_get_setting('show_email_addresses') == 'true') {
echo Display::encrypted_mailto_link($user_object->email,$user_object->email).'<br />';
}
echo '</div>';
if ($user_object->competences) {
echo '<dt><div class="actions-message"><strong>'.get_lang('MyCompetences').'</strong></div></dt>';
echo '<dd>'.$user_object->competences.'</dd>';
}
if ($user_object->diplomas) {
echo '<dt><div class="actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div></dt>';
echo '<dd>'.$user_object->diplomas.'</dd>';
}
if ($user_object->teach) {
echo '<dt><div class="actions-message"><strong>'.get_lang('MyTeach').'</strong></div></dt>';
echo '<dd>'.$user_object->teach.'</dd>';;
}
display_productions($user_object->user_id);
if ($user_object->openarea) {
echo '<dt><div class="actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div></dt>';
echo '<dd>'.$user_object->openarea.'</dd>';
}
}
else
{
Display::display_header(get_lang('UsersOnLineList'));
echo '<div class="actions-title">';
echo get_lang('UsersOnLineList');
echo '</div>';
}
}
/**
* Display productions in whoisonline
* @param int $user_id User id
* @todo use the correct api_get_path instead of $clarolineRepositoryWeb
*/
function display_productions($user_id) {
$sysdir_array = UserManager::get_user_picture_path_by_id($user_id, 'system', true);
$sysdir = $sysdir_array['dir'].$user_id.'/';
$webdir_array = UserManager::get_user_picture_path_by_id($user_id, 'web', true);
$webdir = $webdir_array['dir'].$user_id.'/';
if (!is_dir($sysdir)) {
mkpath($sysdir);
}
/*
$handle = opendir($sysdir);
$productions = array();
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..' || $file == '.htaccess') {
continue; // Skip current and parent directories
}
if (preg_match('/('.$user_id.'|[0-9a-f]{13}|saved)_.+\.(png|jpg|jpeg|gif)$/i', $file)) {
// User's photos should not be listed as productions.
continue;
}
$productions[] = $file;
}
*/
$productions = UserManager::get_user_productions($user_id);
if (count($productions) > 0) {
echo '<dt><strong>'.get_lang('Productions').'</strong></dt>';
echo '<dd><ul>';
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)) {
$subs = scandir($sysdir.$file);
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>';
}
}
}
}
echo '</ul></dd>';
}
}
public static function get_plugins($place = SOCIAL_CENTER_PLUGIN) {
$content = '';
switch ($place) {
case SOCIAL_CENTER_PLUGIN:
$social_plugins = array(1, 2);
if (is_array($social_plugins) && count($social_plugins)>0) {
$content.= '<div id="social-plugins">';
foreach($social_plugins as $plugin ) {
$content.= '<div class="social-plugin-item">';
$content.= $plugin;
$content.= '</div>';
}
$content.= '</div>';
}
break;
case SOCIAL_LEFT_PLUGIN:
break;
case SOCIAL_RIGHT_PLUGIN:
break;
}
return $content;
}
}

@ -126,6 +126,7 @@ if ($_GET['f']=='social') {
}
Display::display_header('');
$social_parameter = '';
if ($_GET['f']=='social') {
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
@ -133,35 +134,76 @@ if ($_GET['f']=='social') {
echo '<div class="actions-title">';
echo get_lang('Messages');
echo '</div>';
$social_parameter = '?f=social';
} else {
//comes from normal profile
/*
echo '<div class=actions>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',api_xml_http_response_encode(get_lang('Inbox'))).api_xml_http_response_encode(get_lang('Inbox')).'</a>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).'</a>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',api_xml_http_response_encode(get_lang('Outbox'))).api_xml_http_response_encode(get_lang('Outbox')).'</a>';
echo '</div>';
}
echo '</div>'; */
echo '<div class="actions">';
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
}
if (api_get_setting('allow_message_tool') == 'true') {
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
}
$show = isset($_GET['show']) ? '&amp;show='.Security::remove_XSS($_GET['show']) : '';
//echo '<span style="float:right; padding-top:7px;">';
if (isset($_GET['type']) && $_GET['type'] == 'extended') {
echo '<a href="profile.php?type=reduced'.$show.'">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
} else {
echo '<a href="profile.php?type=extended'.$show.'">'.Display::return_icon('edit.gif', get_lang('EditExtendProfile')).'&nbsp;'.get_lang('EditExtendProfile').'</a>';
}
//echo '</span>';
if (!isset($_GET['del_msg'])) {
inbox_display();
} else {
$num_msg = intval($_POST['total']);
for ($i=0;$i<$num_msg;$i++) {
if($_POST[$i]) {
//the user_id was necesarry to delete a message??
MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_POST['_'.$i]);
echo '</div>';
}
echo '<div id="inbox-wrapper">';
//LEFT CONTENT
echo '<div id="inbox-menu">';
echo '<ul>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$social_parameter.'">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$social_parameter.'">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php'.$social_parameter.'">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
echo '</ul>';
echo '</div>';
echo '<div id="inbox">';
//MAIN CONTENT
if (!isset($_GET['del_msg'])) {
inbox_display();
} else {
$num_msg = intval($_POST['total']);
for ($i=0;$i<$num_msg;$i++) {
if($_POST[$i]) {
//the user_id was necesarry to delete a message??
MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_POST['_'.$i]);
}
}
inbox_display();
}
inbox_display();
}
echo '</div>';
echo '</div>';
/*
==============================================================================
FOOTER
==============================================================================
*/
if ($request===false) {
Display::display_footer();
}
Display::display_footer();
?>

@ -14,7 +14,7 @@
==============================================================================
*/
// name of the language file that needs to be included
$language_file= 'messages';
$language_file= array('messages','userInfo');
$cidReset=true;
require_once '../inc/global.inc.php';
@ -29,7 +29,6 @@ require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
$request=api_is_xml_http_request();
$nameTools = api_xml_http_response_encode(get_lang('Messages'));
/*
-----------------------------------------------------------
@ -123,7 +122,7 @@ function show_compose_reply_to_message ($message_id, $receiver_id) {
$row = Database::fetch_array($result);
if (!isset($row[1])) {
echo api_xml_http_response_encode(get_lang('InvalidMessageId'));
echo get_lang('InvalidMessageId');
die();
}
echo api_xml_http_response_encode(get_lang('To').':&nbsp;<strong>'. GetFullUserName($row[1]).'</strong>');
@ -143,22 +142,21 @@ function show_compose_to_user ($receiver_id) {
function manage_form ($default, $select_from_user_list = null) {
global $charset;
$table_message = Database::get_main_table(TABLE_MESSAGE);
$request=api_is_xml_http_request();
$group_id = intval($_REQUEST['group_id']);
$message_id = intval($_GET['message_id']);
$form = new FormValidator('compose_message',null,null,null,array('enctype'=>'multipart/form-data'));
if (empty($group_id)) {
if (isset($select_from_user_list)) {
$form->add_textfield('id_text_name', api_xml_http_response_encode(get_lang('SendMessageTo')),true,array('size' => 40,'id'=>'id_text_name','onkeyup'=>'send_request_and_search()','autocomplete'=>'off','style'=>'padding:0px'));
$form->addRule('id_text_name', api_xml_http_response_encode(get_lang('ThisFieldIsRequired')), 'required');
$form->add_textfield('id_text_name', get_lang('SendMessageTo'),true,array('size' => 40,'id'=>'id_text_name','onkeyup'=>'send_request_and_search()','autocomplete'=>'off','style'=>'padding:0px'));
$form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html','<div id="id_div_search" style="padding:0px" class="message-select-box" >&nbsp;</div>');
$form->addElement('hidden','user_list',0,array('id'=>'user_list'));
} else {
if ($default['user_list']==0) {
$form->add_textfield('id_text_name', api_xml_http_response_encode(get_lang('SendMessageTo')),true,array('size' => 40,'id'=>'id_text_name','onkeyup'=>'send_request_and_search()','autocomplete'=>'off','style'=>'padding:0px'));
$form->addRule('id_text_name', api_xml_http_response_encode(get_lang('ThisFieldIsRequired')), 'required');
$form->add_textfield('id_text_name', get_lang('SendMessageTo'),true,array('size' => 40,'id'=>'id_text_name','onkeyup'=>'send_request_and_search()','autocomplete'=>'off','style'=>'padding:0px'));
$form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html','<div id="id_div_search" style="padding:0px" class="message-select-box" >&nbsp;</div>');
}
$form->addElement('hidden','user_list',0,array('id'=>'user_list'));
@ -186,7 +184,7 @@ function manage_form ($default, $select_from_user_list = null) {
}
$form->addElement('style_submit_button','compose',api_xml_http_response_encode(get_lang('SendMessage')),'class="save"');
$form->setRequiredNote(api_xml_http_response_encode('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>'));
$form->setRequiredNote('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>');
if (!empty($group_id) && !empty($message_id)) {
$message_info = MessageManager::get_message_by_id($message_id);
$default['title']=get_lang('Re:').api_html_entity_decode($message_info['title'],ENT_QUOTES,$charset);
@ -212,86 +210,127 @@ function manage_form ($default, $select_from_user_list = null) {
MAIN SECTION
==============================================================================
*/
if (isset($_GET['rs'])) {
$interbreadcrumb[] = array ('url' => 'inbox.php', 'name' => get_lang('Messages'));
$interbreadcrumb[]= array (
'url' => '../social/'.$_SESSION['social_dest'],
'name' => get_lang('SocialNetwork')
);
if ($_GET['f']=='social') {
$this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Profile'));
$interbreadcrumb[]= array ('url' => 'outbox.php','name' => get_lang('Inbox'));
} else {
$interbreadcrumb[] = array ('url' => 'main/auth/profile.php', 'name' => get_lang('Profile'));
$interbreadcrumb[]= array (
'url' => 'inbox.php',
'name' => get_lang('Inbox')
);
$this_section = SECTION_MYPROFILE;
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Profile'));
$interbreadcrumb[]= array ('url' => 'outbox.php','name' => get_lang('Inbox'));
}
$interbreadcrumb[]= array (
'url' => '#',
'name' => get_lang('ComposeMessage')
);
$this_section = SECTION_MYPROFILE;
Display::display_header('');
$group_id = intval($_REQUEST['group_id']);
echo '<div class=actions>';
if ($group_id != 0) {
echo '<div class=actions>';
echo '<a href="'.api_get_path(WEB_PATH).'main/social/groups.php?id='.$group_id.'">'.Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('BackToGroup')).'</a>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).'</a>';
echo '</div>';
} else {
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',api_xml_http_response_encode(get_lang('Inbox'))).api_xml_http_response_encode(get_lang('Inbox')).'</a>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).'</a>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',api_xml_http_response_encode(get_lang('Outbox'))).api_xml_http_response_encode(get_lang('Outbox')).'</a>';
}
echo '</div>';
if (!isset($_POST['compose'])) {
if(isset($_GET['re_id'])) {
$message_id = $_GET['re_id'];
$receiver_id = api_get_user_id();
show_compose_reply_to_message($message_id, $receiver_id);
} elseif(isset($_GET['send_to_user'])) {
show_compose_to_user($_GET['send_to_user']);
if ($_GET['f']=='social') {
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
SocialManager::show_social_menu();
echo '<div class="actions-title">';
echo get_lang('Messages');
echo '</div>';
$social_parameter = '?f=social';
} else {
show_compose_to_any($_user['user_id']);
}
} else {
echo '<div class=actions>';
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
}
if (api_get_setting('allow_message_tool') == 'true') {
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
}
$show = isset($_GET['show']) ? '&amp;show='.Security::remove_XSS($_GET['show']) : '';
//echo '<span style="float:right; padding-top:7px;">';
if (isset($_GET['type']) && $_GET['type'] == 'extended') {
echo '<a href="profile.php?type=reduced'.$show.'">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
} else {
echo '<a href="profile.php?type=extended'.$show.'">'.Display::return_icon('edit.gif', get_lang('EditExtendProfile')).'&nbsp;'.get_lang('EditExtendProfile').'</a>';
}
//echo '</span>';
echo '</div>';
}
$restrict = false;
if (isset($_POST['id_text_name'])) {
$restrict = $_POST['id_text_name'];
} else if (isset($_POST['group_id'])) {
$restrict = $_POST['group_id'];
}
}
if (isset($_GET['re_id'])) {
$default['title'] = api_xml_http_response_encode($_POST['title']);
$default['content'] = api_xml_http_response_encode($_POST['content']);
//$default['user_list'] = $_POST['user_list'];
manage_form($default);
} else {
if ($restrict) {
$default['title'] = api_xml_http_response_encode($_POST['title']);
if (!isset($_POST['group_id'])) {
$default['id_text_name'] = api_xml_http_response_encode($_POST['id_text_name']);
$default['user_list'] = $_POST['user_list'];
echo '<div id="inbox-wrapper">';
//LEFT COLUMN
echo '<div id="inbox-menu">';
echo '<ul>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$social_parameter.'">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$social_parameter.'">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php'.$social_parameter.'">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
echo '</ul>';
echo '</div>';
echo '<div id="inbox">';
//MAIN CONTENT
if (!isset($_POST['compose'])) {
if(isset($_GET['re_id'])) {
$message_id = $_GET['re_id'];
$receiver_id = api_get_user_id();
show_compose_reply_to_message($message_id, $receiver_id);
} elseif(isset($_GET['send_to_user'])) {
show_compose_to_user($_GET['send_to_user']);
} else {
$default['group_id'] = $_POST['group_id'];
}
manage_form($default);
show_compose_to_any($_user['user_id']);
}
} else {
Display::display_error_message(api_xml_http_response_encode(get_lang('ErrorSendingMessage')));
$restrict = false;
if (isset($_POST['id_text_name'])) {
$restrict = $_POST['id_text_name'];
} else if (isset($_POST['group_id'])) {
$restrict = $_POST['group_id'];
}
if (isset($_GET['re_id'])) {
$default['title'] = api_xml_http_response_encode($_POST['title']);
$default['content'] = api_xml_http_response_encode($_POST['content']);
//$default['user_list'] = $_POST['user_list'];
manage_form($default);
} else {
var_dump($restrict);
if ($restrict) {
$default['title'] = api_xml_http_response_encode($_POST['title']);
if (!isset($_POST['group_id'])) {
$default['id_text_name'] = api_xml_http_response_encode($_POST['id_text_name']);
$default['user_list'] = $_POST['user_list'];
} else {
$default['group_id'] = $_POST['group_id'];
}
manage_form($default);
} else {
Display::display_error_message(get_lang('ErrorSendingMessage'));
}
}
}
}
}
echo '</div>';
echo '</div>';
/*
==============================================================================
FOOTER
==============================================================================
*/
if ($request===false) {
Display::display_footer();
}
Display::display_footer();
?>

@ -6,7 +6,7 @@
==============================================================================
*/
// name of the language file that needs to be included
$language_file = array('registration','messages','userInfo','admin');
$language_file = array('registration','messages','userInfo');
$cidReset=true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
@ -69,11 +69,38 @@ if ($_GET['f']=='social') {
Display::display_header('');
echo '<div class=actions>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',api_xml_http_response_encode(get_lang('Inbox'))).api_xml_http_response_encode(get_lang('Inbox')).'</a>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).'</a>';
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',api_xml_http_response_encode(get_lang('Outbox'))).api_xml_http_response_encode(get_lang('Outbox')).'</a>';
echo '</div>';
if ($_GET['f']=='social') {
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
SocialManager::show_social_menu();
echo '<div class="actions-title">';
echo get_lang('Messages');
echo '</div>';
$social_parameter = '?f=social';
} else {
if (api_get_setting('extended_profile') == 'true') {
echo '<div class="actions">';
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
}
if (api_get_setting('allow_message_tool') == 'true') {
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
}
$show = isset($_GET['show']) ? '&amp;show='.Security::remove_XSS($_GET['show']) : '';
//echo '<span style="float:right; padding-top:7px;">';
if (isset($_GET['type']) && $_GET['type'] == 'extended') {
echo '<a href="profile.php?type=reduced'.$show.'">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
} else {
echo '<a href="profile.php?type=extended'.$show.'">'.Display::return_icon('edit.gif', get_lang('EditExtendProfile')).'&nbsp;'.get_lang('EditExtendProfile').'</a>';
}
//echo '</span>';
echo '</div>';
}
}
/**************************************************************/
$info_delete_outbox=array();
@ -96,28 +123,47 @@ if( trim($info_delete_outbox[0])=='delete' ) {
$table_message = Database::get_main_table(TABLE_MESSAGE);
$user_sender_id=api_get_user_id();
if ($_REQUEST['action']=='delete') {
$delete_list_id=array();
if (isset($_POST['out'])) {
$delete_list_id=$_POST['out'];
}
if (isset($_POST['id'])) {
$delete_list_id=$_POST['id'];
}
for ($i=0;$i<count($delete_list_id);$i++) {
MessageManager::delete_message_by_user_sender(api_get_user_id(), $delete_list_id[$i]);
}
$delete_list_id=array();
outbox_display();
} elseif ($_REQUEST['action']=='deleteone') {
$delete_list_id=array();
$id=Security::remove_XSS($_GET['id']);
MessageManager::delete_message_by_user_sender(api_get_user_id(),$id);
$delete_list_id=array();
outbox_display();
}else {
outbox_display();
}
echo '<div id="inbox-wrapper">';
//LEFT COLUMN
echo '<div id="inbox-menu">';
echo '<ul>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$social_parameter.'">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$social_parameter.'">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php'.$social_parameter.'">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
echo '</ul>';
echo '</div>';
echo '<div id="inbox">';
//MAIN CONTENT
if ($_REQUEST['action']=='delete') {
$delete_list_id=array();
if (isset($_POST['out'])) {
$delete_list_id=$_POST['out'];
}
if (isset($_POST['id'])) {
$delete_list_id=$_POST['id'];
}
for ($i=0;$i<count($delete_list_id);$i++) {
MessageManager::delete_message_by_user_sender(api_get_user_id(), $delete_list_id[$i]);
}
$delete_list_id=array();
outbox_display();
} elseif ($_REQUEST['action']=='deleteone') {
$delete_list_id=array();
$id=Security::remove_XSS($_GET['id']);
MessageManager::delete_message_by_user_sender(api_get_user_id(),$id);
$delete_list_id=array();
outbox_display();
}else {
outbox_display();
}
echo '</div>';
echo '</div>';
/*
==============================================================================
FOOTER

@ -18,23 +18,75 @@ $interbreadcrumb[]= array ('url' => '#','name' => get_lang('View'));
HEADER
==============================================================================
*/
$this_section = SECTION_MYPROFILE;
if ($_GET['f']=='social') {
$this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Profile'));
$interbreadcrumb[]= array ('url' => 'outbox.php','name' => get_lang('Inbox'));
} else {
$this_section = SECTION_MYPROFILE;
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Profile'));
$interbreadcrumb[]= array ('url' => 'outbox.php','name' => get_lang('Inbox'));
}
Display::display_header('');
if ($_GET['f']=='social') {
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
SocialManager::show_social_menu();
echo '<div class="actions-title">';
echo get_lang('Messages');
echo '</div>';
$social_parameter = '?f=social';
} else {
if (api_get_setting('extended_profile') == 'true') {
echo '<div class="actions">';
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
}
if (api_get_setting('allow_message_tool') == 'true') {
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
}
$show = isset($_GET['show']) ? '&amp;show='.Security::remove_XSS($_GET['show']) : '';
//echo '<span style="float:right; padding-top:7px;">';
if (isset($_GET['type']) && $_GET['type'] == 'extended') {
echo '<a href="profile.php?type=reduced'.$show.'">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
} else {
echo '<a href="profile.php?type=extended'.$show.'">'.Display::return_icon('edit.gif', get_lang('EditExtendProfile')).'&nbsp;'.get_lang('EditExtendProfile').'</a>';
}
//echo '</span>';
echo '</div>';
}
}
echo '<div id="inbox-wrapper">';
//LEFT COLUMN
echo '<div id="inbox-menu">';
echo '<ul>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$social_parameter.'">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$social_parameter.'">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php'.$social_parameter.'">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
echo '</ul>';
echo '</div>';
echo '<div class=actions>';
echo '<a href="inbox.php">'.Display::return_icon('folder_up.gif',get_lang('BackToInbox')).get_lang('BackToInbox').'</a>';
echo '<a href="new_message.php?re_id"'.intval($_GET['id']).'">'.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).get_lang('ReplyToMessage').'</a>';
echo '<a href="inbox.php?action=deleteone&id="'.intval($_GET['id']).'" >'.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''.get_lang('DeleteMessage').'</a>';
echo '</div><br />';
echo '<div id="inbox">';
//MAIN CONTENT
$message = MessageManager::show_message_box($_GET['id']);
if (!empty($message)) {
echo $message;
} else {
api_not_allowed();
}
echo '</div>';
$message = MessageManager::show_message_box();
if (!empty($message)) {
echo $message;
} else {
api_not_allowed();
}
echo '</div>';
/*
==============================================================================

@ -323,7 +323,7 @@ if ($add_type == 'multiple') {
?>
<div class="actions">
<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
<?php $link_add_type_unique ?>&nbsp;|&nbsp;<?php $link_add_type_multiple ?>
</div>
<?php echo '<div class="row"><div class="form_header">'.$tool_name.' ('.$session_info['name'].')</div></div><br/>'; ?>
@ -559,8 +559,10 @@ function makepost(select){
//current group members
$members = GroupPortalManager::get_users_by_group($group_id,true,array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER));
echo get_lang('UsersAlreadyInvited');
Display::display_sortable_grid('search_users', array(), $members, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, false, true));
if (is_array($members) && count($members)>0) {
echo get_lang('UsersAlreadyInvited');
Display::display_sortable_grid('search_users', array(), $members, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, false, true));
}
/*

@ -83,7 +83,6 @@ echo '</div>';
// getting group information
$group_id = intval($_GET['id']);
$group_info = GroupPortalManager::get_group_data($group_id);
if ($group_id != 0 ) {
//Loading group information
@ -112,6 +111,7 @@ if ($group_id != 0 ) {
}
}
echo GroupPortalManager::show_group_column_information($group_id);
$picture = GroupPortalManager::get_picture_group($group_id, $group_info['picture_uri'],160,'medium_');
$big_image = GroupPortalManager::get_picture_group($group_id, $group_info['picture_uri'],'','big_');
@ -139,16 +139,16 @@ if ($group_id != 0 ) {
#group_members { width:233px; height:300px; overflow-x:none; overflow-y: auto;}
.group_member_item { width:98px; height:86px; float:left; margin:5px 5px 15px 5px; }
.group_member_picture { display:block;
height:92px;
margin:0;
overflow:hidden; };
height:92px;
margin:0;
overflow:hidden; };
</style>';
echo '<div id="layout-left" style="float: left; width: 280px; height: 100%;">';
//Group's title
echo '<h1>'.$group_info['name'].'</h1>';
//image
//Group's image
echo '<div id="group_image">';
if (basename($picture['file']) != 'unknown_group.png') {
@ -159,11 +159,17 @@ overflow:hidden; };
echo '</div>';
//description
//Group's description
echo '<div id="group_description">';
echo $group_info['description'];
echo '</div>';
//Group's description
echo '<div id="group-url">';
echo $group_info['url'];
echo '</div>';
//Privacy
echo '<div id="group_privacy">';
echo get_lang('Privacy').' : ';
@ -174,20 +180,22 @@ overflow:hidden; };
}
echo '</div>';
//group tags
//Group's tags
if (!empty($tags)) {
echo '<div id="group_tags">';
echo get_lang('Tags').' : '.$tags;
echo '</div>';
}
//Compose message link
if (in_array($my_group_role, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER,GROUP_USER_PERMISSION_MODERATOR))) {
echo '<div id="actions" style="margin:10px">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'" class="thickbox" title="'.get_lang('ComposeMessage').'">'.Display :: return_icon('message_new.png', get_lang('ComposeMessage')).'&nbsp;'.get_lang('ComposeMessage').'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'" class="thickbox" title="'.get_lang('ComposeMessage').'">'.Display :: return_icon('message_new.png', get_lang('NewTopic')).'&nbsp;'.get_lang('NewTopic').'</a>';
//echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'.Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).api_xml_http_response_encode(get_lang('ComposeMessage')).'</a>';
echo '</div>';
}
//Members
echo get_lang('Members').' : ';
echo '<div id="group_members">';
foreach($users as $user) {
@ -206,7 +214,8 @@ overflow:hidden; };
}
echo '</div>';
//loading group permission
echo '<div id="group_permissions">';
switch ($my_group_role) {
case GROUP_USER_PERMISSION_READER:
@ -238,6 +247,9 @@ overflow:hidden; };
echo '</div>'; // end layout left
//-- Show message groups
echo '<div id="layout_right" style="margin-left: 282px;">';
echo '<div class="messages">';
MessageManager::display_messages_for_group($group_id);
@ -270,11 +282,18 @@ overflow:hidden; };
$id = $result['id'];
$url_open = '<a href="groups.php?id='.$id.'">';
$url_close = '</a>';
$groups[]= array($url_open.$result['picture_uri'].$url_close, $url_open.$result['name'].$url_close,$result['count']);
if ($result['count'] == 1 ) {
$result['count'] = $result['count'].' '.get_lang('Member');
} else {
$result['count'] = $result['count'].' '.get_lang('Members');
}
$groups[]= array($url_open.$result['picture_uri'].$url_close, $url_open.$result['name'].$url_close,$result['count'],$result['description']);
}
if (count($groups) > 0) {
echo '<h1>'.get_lang('Popular').'</h1>';
Display::display_sortable_grid('search_users', array(), $groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true));
Display::display_sortable_grid('search_users', array(), $groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true));
}

@ -48,36 +48,29 @@ if (!empty($group_id)) {
<input type="hidden" name="parent_id" value="<?php echo $message_id ?>" />
<table width="600" border="0" height="220">
<tr height="180">
<td align="center">
<div class="message-content-body-left">
<img class="message-image-info" src="<?php echo $info_path_friend['dir'].$info_path_friend['file']; ?>"/>
<?php
if ($panel != 1) {
echo '<br /><center>'.api_xml_http_response_encode(api_get_person_name($info_user_friend['firstName'], $info_user_friend['lastName'])).'</center>';
}
?>
</div>
<div class="message-content-body-right">
<td align="left">
<div id="id_content_panel_init">
<dl>
<?php
if (api_get_setting('allow_message_tool')=='true') {
//normal message
$user_info=api_get_user_info($userfriend_id);
echo api_xml_http_response_encode(get_lang('To')); ?> :&nbsp;&nbsp;&nbsp;&nbsp;<?php echo api_xml_http_response_encode($to_group); ?>
<br />
<br /><?php echo api_xml_http_response_encode(get_lang('Subject')); ?> :<br /><input id="txt_subject_id" name="title" type="text" style="width:300px;" value="<?php echo $title_group ?>"><br/>
<br /><?php echo api_xml_http_response_encode(get_lang('Message')); ?> :<br /><textarea id="txt_area_invite" name="content" rows="3" cols="41"></textarea><br/>
<br /><?php echo api_xml_http_response_encode(get_lang('AttachmentFiles')); ?> :<br />
<span id="filepaths"><div id="filepath_1"><input type="file" name="attach_1" size="20" /></div></span>
<div id="link-more-attach"><a href="javascript://" onclick="return add_image_form()"><?php echo get_lang('AddOneMoreFile') ?></a>&nbsp;(<?php echo get_lang('MaximunFileSizeXMB') ?>)</div>
<!--button class="save" type="button" value="<?php echo api_xml_http_response_encode(get_lang('SendMessage')); ?>" onclick="return ajaxFileUpload()"><?php echo api_xml_http_response_encode(get_lang('SendMessage')) ?></button-->
<br />
<button class="save" type="submit" value="<?php echo api_xml_http_response_encode(get_lang('SendMessage')); ?>"><?php echo api_xml_http_response_encode(get_lang('SendMessage')) ?></button>
<?php } ?>
<?php
if (api_get_setting('allow_message_tool')=='true') {
//normal message
$user_info=api_get_user_info($userfriend_id);
echo api_xml_http_response_encode(get_lang('To')); ?> :&nbsp;&nbsp;&nbsp;&nbsp;<?php echo api_xml_http_response_encode($to_group); ?>
<br />
<br /><?php echo api_xml_http_response_encode(get_lang('Subject')); ?> :<br />
<input id="txt_subject_id" name="title" type="text" style="width:300px;" value="<?php echo $title_group ?>"><br/>
<br /><?php echo api_xml_http_response_encode(get_lang('Message')); ?> :<br />
<textarea id="txt_area_invite" name="content" rows="3" cols="68"></textarea><br/>
<br /><?php echo api_xml_http_response_encode(get_lang('AttachmentFiles')); ?> :<br />
<span id="filepaths"><div id="filepath_1"><input type="file" name="attach_1" size="20" /></div></span>
<div id="link-more-attach"><a href="javascript://" onclick="return add_image_form()"><?php echo get_lang('AddOneMoreFile') ?></a>&nbsp;(<?php echo get_lang('MaximunFileSizeXMB') ?>)</div>
<!--button class="save" type="button" value="<?php echo api_xml_http_response_encode(get_lang('SendMessage')); ?>" onclick="return ajaxFileUpload()"><?php echo api_xml_http_response_encode(get_lang('SendMessage')) ?></button-->
<br />
<button class="save" type="submit" value="<?php echo api_xml_http_response_encode(get_lang('SendMessage')); ?>"><?php echo api_xml_http_response_encode(get_lang('SendMessage')) ?></button>
<?php } ?>
</dl>
</div>
</td>
</tr>
</div>

@ -436,6 +436,10 @@ echo '<div id="social-profile-wrapper">';
echo '<br />';
}
echo '</div>';
//Load right plugin's
echo SocialManager::get_plugins(SOCIAL_RIGHT_PLUGIN);
} else {
echo '<div class="clear"></div><br />';
}
@ -610,6 +614,12 @@ echo '<div id="social-profile-container">';
echo $announcement_content.'<br/>';
echo '</div>';
}
//Load left plugin
echo SocialManager::get_plugins(SOCIAL_LEFT_PLUGIN);
}
echo '</div>';
@ -698,6 +708,13 @@ echo '<div id="social-profile-container">';
echo '</div>';
}
}
//Load plugin center
echo SocialManager::get_plugins(SOCIAL_CENTER_PLUGIN);
//--------------------------
echo '</div>';
echo '</div>';
echo '</div>';

@ -28,6 +28,7 @@ if (isset($_POST['friend_id'])) {
SocialManager::register_friend($the_current_user_id,$my_current_friend,$relation_type);
SocialManager::register_friend($my_current_friend,$the_current_user_id,$relation_type);
SocialManager::invitation_accepted($my_current_friend,$the_current_user_id);
if (isset($_POST['is_my_friend'])) {

@ -12,6 +12,8 @@ require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
api_block_anonymous_users();
$this_section = SECTION_SOCIAL;
$tool_name = get_lang('Search');
$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));

@ -60,6 +60,9 @@ require api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
// starting the output buffering when we are exporting the information
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
if ($export_csv) {
if (isset($_REQUEST['id_session']) && $_REQUEST['id_session'] != 0 ) {
$_SESSION['id_session'] = intval($_REQUEST['id_session']);
}
ob_start();
}
$csv_content = array();
@ -303,13 +306,13 @@ if ($_GET['studentlist'] == 'false') {
}
echo '&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print();">'.Display::return_icon('printmgr.gif',get_lang('Print')).get_lang('Print').'</a>';
if($_GET['studentlist'] == 'false') {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&studentlist=false"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&id_session='.api_get_session_id().'&export=csv&studentlist=false"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
} elseif ($_GET['studentlist'] == '' || $_GET['studentlist'] == 'true') {
$addional_param = '';
if (isset($_GET['additional_profile_field'])) {
$addional_param ='additional_profile_field='.intval($_GET['additional_profile_field']);
}
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.'">'.Display::return_icon('csv.gif',get_lang('ExportAsCSV')).get_lang('ExportAsCSV').'</a>';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&id_session='.api_get_session_id().'&export=csv&'.$addional_param.'">'.Display::return_icon('csv.gif',get_lang('ExportAsCSV')).get_lang('ExportAsCSV').'</a>';
}
if($_GET['studentlist'] == 'true' || empty($_GET['studentlist'])) {
echo display_additional_profile_fields();

@ -1,5 +1,5 @@
<?php // $Id: whoisonline.php 21549 2009-06-21 14:02:37Z iflorespaz $
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /chamilo_license.txt */
/**
==============================================================================
@ -19,6 +19,7 @@ require_once './main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
//social tab
$this_section = SECTION_SOCIAL;
// table definitions
@ -113,204 +114,6 @@ if ($_GET['chatid'] != '') {
}
}
/**
* Displays a sortable table with the list of online users.
* @param array $user_list
*/
function display_user_list($user_list, $_plugins) {
global $charset;
if ($_GET['id'] == '') {
$extra_params = array();
$course_url = '';
if (strlen($_GET['cidReq']) > 0) {
$extra_params['cidReq'] = Security::remove_XSS($_GET['cidReq']);
$course_url = '&amp;cidReq='.Security::remove_XSS($_GET['cidReq']);
}
foreach ($user_list as $user) {
$uid = $user[0];
$user_info = api_get_user_info($uid);
$table_row = array();
if (api_get_setting('allow_social_tool')=='true') {
$url = api_get_path(WEB_PATH).'main/social/profile.php?u='.$uid.$course_url;
} else {
$url = '?id='.$uid.$course_url;
}
$image_array = UserManager::get_user_picture_path_by_id($uid, 'system', false, true);
$friends_profile = SocialManager::get_picture_user($uid, $image_array['file'], 92, 'medium_', ' width="90" height="90" ');
// reduce image
$name = api_get_person_name($user_info['firstName'], $user_info['lastName']);
$table_row[] = '<a href="'.$url.'"><img title = "'.$name.'" alt="'.$name.'" src="'.$friends_profile['file'].'" '.$friends_profile['style'].' border="1"></a>';
$table_row[] = '<a href="'.$url.'" style="font-size:10px;">'.api_get_person_name($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']);
}
$user_anonymous = api_get_anonymous_id();
$table_data[] = $table_row;
}
$table_header[] = array(get_lang('UserPicture'), false, 'width="90"');
///$table_header[] = array(get_lang('Name'), true);
//$table_header[] = array(get_lang('LastName'), true);
if (api_get_setting('show_email_addresses') == 'true') {
$table_header[] = array(get_lang('Email'), true);
}
Display::display_sortable_table($table_header, $table_data, array(), array('per_page' => 30), $extra_params,array(),'grid');
}
}
/**
* Displays the information of an individual user
* @param int $user_id
*/
function display_individual_user($user_id) {
global $interbreadcrumb;
$safe_user_id = Database::escape_string($user_id);
// to prevent a hacking attempt: http://www.dokeos.com/forum/viewtopic.php?t=5363
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT * FROM $user_table WHERE user_id='".$safe_user_id."'";
$result = Database::query($sql, __FILE__, __LINE__);
if (Database::num_rows($result) == 1) {
$user_object = Database::fetch_object($result);
$name = GetFullUserName($user_id).($_SESSION['_uid'] == $user_id ? '&nbsp;<strong>('.get_lang('Me').')</strong>' : '' );
$alt = GetFullUserName($user_id).($_SESSION['_uid'] == $user_id ? '&nbsp;('.get_lang('Me').')' : '');
$status = ($user_object->status == COURSEMANAGER ? get_lang('Teacher') : get_lang('Student'));
$interbreadcrumb[] = array('url' => 'whoisonline.php', 'name' => get_lang('UsersOnLineList'));
Display::display_header($alt);
echo '<div class="actions-title">';
echo $alt;
echo '</div><br />';
echo '<div style="text-align: center">';
if (strlen(trim($user_object->picture_uri)) > 0) {
$sysdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'system');
$sysdir = $sysdir_array['dir'];
$webdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'web');
$webdir = $webdir_array['dir'];
$fullurl = $webdir.$user_object->picture_uri;
$system_image_path = $sysdir.$user_object->picture_uri;
list($width, $height, $type, $attr) = @getimagesize($system_image_path);
$resizing = (($height > 200) ? 'height="200"' : '');
$height += 30;
$width += 30;
$window_name = 'window'.uniqid('');
// get the path,width and height from original picture
$big_image = $webdir.'big_'.$user_object->picture_uri;
$big_image_size = api_getimagesize($big_image);
$big_image_width = $big_image_size[0];
$big_image_height = $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
echo '<input type="image" src="'.$fullurl.'" alt="'.$alt.'" onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/><br />';
} else {
echo Display::return_icon('unknown.jpg', get_lang('Unknown'));
echo '<br />';
}
echo '<br />'.$status.'<br />';
global $user_anonymous;
if (api_get_setting('allow_social_tool') == 'true' && api_get_user_id() <> $user_anonymous && api_get_user_id() <> 0) {
echo '<br />';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$safe_user_id.'">'.get_lang('ViewSharedProfile').'</a>';
echo '<br />';
$user_anonymous = api_get_anonymous_id();
if ($safe_user_id != api_get_user_id() && !api_is_anonymous($safe_user_id)) {
$user_relation = SocialManager::get_relation_between_contacts(api_get_user_id(), $safe_user_id);
if ($user_relation == 0 || $user_relation == 6) {
echo '<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=2&height=300&width=610&user_friend='.$safe_user_id.'" class="thickbox" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('add_multiple_users.gif', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a><br />
<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=1&height=310&width=610&user_friend='.$safe_user_id.'" class="thickbox" title="'.get_lang('SendAMessage').'">'.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).'&nbsp;'.get_lang('SendAMessage').'</a>';
} else {
echo '<a href="main/messages/send_message_to_userfriend.inc.php?view_panel=1&height=310&width=610&user_friend='.$safe_user_id.'" class="thickbox" title="'.get_lang('SendAMessage').'">'.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).'&nbsp;'.get_lang('SendAMessage').'</a>';
}
}
}
if (api_get_setting('show_email_addresses') == 'true') {
echo Display::encrypted_mailto_link($user_object->email,$user_object->email).'<br />';
}
echo '</div>';
if ($user_object->competences) {
echo '<dt><div class="actions-message"><strong>'.get_lang('MyCompetences').'</strong></div></dt>';
echo '<dd>'.$user_object->competences.'</dd>';
}
if ($user_object->diplomas) {
echo '<dt><div class="actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div></dt>';
echo '<dd>'.$user_object->diplomas.'</dd>';
}
if ($user_object->teach) {
echo '<dt><div class="actions-message"><strong>'.get_lang('MyTeach').'</strong></div></dt>';
echo '<dd>'.$user_object->teach.'</dd>';;
}
display_productions($user_object->user_id);
if ($user_object->openarea) {
echo '<dt><div class="actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div></dt>';
echo '<dd>'.$user_object->openarea.'</dd>';
}
}
else
{
Display::display_header(get_lang('UsersOnLineList'));
echo '<div class="actions-title">';
echo get_lang('UsersOnLineList');
echo '</div>';
}
}
/**
* Display productions in whoisonline
* @param int $user_id User id
* @todo use the correct api_get_path instead of $clarolineRepositoryWeb
*/
function display_productions($user_id) {
$sysdir_array = UserManager::get_user_picture_path_by_id($user_id, 'system', true);
$sysdir = $sysdir_array['dir'].$user_id.'/';
$webdir_array = UserManager::get_user_picture_path_by_id($user_id, 'web', true);
$webdir = $webdir_array['dir'].$user_id.'/';
if (!is_dir($sysdir)) {
mkpath($sysdir);
}
/*
$handle = opendir($sysdir);
$productions = array();
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..' || $file == '.htaccess') {
continue; // Skip current and parent directories
}
if (preg_match('/('.$user_id.'|[0-9a-f]{13}|saved)_.+\.(png|jpg|jpeg|gif)$/i', $file)) {
// User's photos should not be listed as productions.
continue;
}
$productions[] = $file;
}
*/
$productions = UserManager::get_user_productions($user_id);
if (count($productions) > 0) {
echo '<dt><strong>'.get_lang('Productions').'</strong></dt>';
echo '<dd><ul>';
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)) {
$subs = scandir($sysdir.$file);
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>';
}
}
}
}
echo '</ul></dd>';
}
}
// This if statement prevents users accessing the who's online feature when it has been disabled.
if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) || ((api_get_setting('showonline', 'users') == 'true' || api_get_setting('showonline', 'course') == 'true') && $_user['user_id'])) {
@ -323,6 +126,10 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
$total = count($user_list);
if (!isset($_GET['id'])) {
Display::display_header(get_lang('UsersOnLineList'));
if (!api_is_anonymous())
echo SocialManager::show_social_menu();
echo '<div class="actions-title">';
echo get_lang('UsersOnLineList');
echo '</div>';
@ -339,15 +146,17 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
if ($user_list) {
if (!isset($_GET['id'])) {
echo UserManager::get_search_form($_GET['q']);
display_user_list($user_list, $_plugins);
if (!api_is_anonymous())
echo UserManager::get_search_form($_GET['q']);
SocialManager::display_user_list($user_list, $_plugins);
} else {
//individual user information - also displays header info
display_individual_user(Security::remove_XSS($_GET['id']));
SocialManager::display_individual_user(Security::remove_XSS($_GET['id']));
}
}
elseif (isset($_GET['id'])) {
} elseif (isset($_GET['id'])) {
Display::display_header(get_lang('UsersOnLineList'));
echo '<div class="actions-title">';
echo get_lang('UsersOnLineList');
echo '</div>';
@ -359,23 +168,9 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
$referer = empty($_GET['referer']) ? 'index.php' : api_htmlentities(strip_tags($_GET['referer']), ENT_QUOTES);
/*
if (isset($_GET['id'])) {
if ($_GET['origin'] == 'user_list') {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php" class="fake_button_back">'.get_lang('Back').'</a>';
} else {
echo '<a href="whoisonline.php" class="fake_button_back">'.get_lang('Back').'</a>';
}
} else {
echo '<a href="'.$referer.'" class="fake_button_back">'.get_lang('BackHome').'</a>';
}
*/
/*
==============================================================================
FOOTER
==============================================================================
*/
/*echo '<div align="center"><a href="http://main.svndokeos.net/main/upload/users/4/4_49aeb3bb8bba5.jpg" class="thickbox">hola</a></div>';*/
Display::display_footer();
Display::display_footer();
Loading…
Cancel
Save