Social UI corrections

skala
Julio Montoya 13 years ago
parent 24b43cc9f9
commit dabbe45c7b
  1. 5
      main/css/base_chamilo.css
  2. 8
      main/inc/lib/message.lib.php
  3. 16
      main/messages/inbox.php
  4. 10
      main/messages/new_message.php
  5. 11
      main/messages/outbox.php
  6. 2
      main/messages/send_message_to_userfriend.inc.php
  7. 14
      main/messages/view_message.php
  8. 64
      main/social/friends.php
  9. 197
      main/social/invitations.php
  10. 9
      main/social/myfiles.php
  11. 20
      main/social/profile.php
  12. 88
      main/social/search.php
  13. 8
      plugin/hello_world/index.php

@ -1982,12 +1982,11 @@ a.read {
vertical-align:middle;
}
/* INVITATIONS */
.invitation_confirm {
border-top:1px solid #D8DFEA;
padding-bottom: 10px;
border-bottom: 1px solid #D8DFEA;
}
.invitation_image {
width:110px;

@ -712,8 +712,7 @@ class MessageManager
* @return string html with the message content
*/
public static function show_message_box($message_id, $source = 'inbox') {
$table_message = Database::get_main_table(TABLE_MESSAGE);
$tbl_message_attach = Database::get_main_table(TABLE_MESSAGE_ATTACHMENT);
$table_message = Database::get_main_table(TABLE_MESSAGE);
$message_id = intval($message_id);
if ($source == 'outbox') {
@ -739,8 +738,7 @@ class MessageManager
$files_attachments = self::get_links_message_attachment_files($message_id,$source);
$user_con = self::users_connected_by_id();
$band=0;
$reply='';
$band= 0;
for ($i=0;$i<count($user_con);$i++)
if ($user_sender_id == $user_con[$i])
$band=1;
@ -760,7 +758,7 @@ class MessageManager
<table>
<tr>
<td valign="top" width="100%">
<h1>'.str_replace("\\","",$title).'</h1>
'.Display::page_subheader(str_replace("\\","",$title)).'
</td>';
if (api_get_setting('allow_social_tool') == 'true') {
$message_content .='<td width="100%">'.$user_image.'</td>';

@ -107,10 +107,8 @@ if ($_GET['f']=='social') {
} else {
$this_section = SECTION_MYPROFILE;
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
//$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Inbox'));
}
//Display::display_header('');
$social_parameter = '';
if ($_GET['f']=='social' || api_get_setting('allow_social_tool') == 'true') {
@ -137,13 +135,16 @@ if (api_get_setting('allow_social_tool') == 'true') {
//Right content
if (api_get_setting('allow_social_tool') == 'true') {
$social_right_content .= '<div class="span9">';
$social_right_content .= '<div class="actions">';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?f=social">'.Display::return_icon('compose_message.png', get_lang('ComposeMessage'), array(), 32).'</a>';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php?f=social">'.Display::return_icon('outbox.png', get_lang('Outbox'), array(), 32).'</a>';
$social_right_content .= '</div>';
}
$social_right_content .= '</div>';
$social_right_content .= '<div class="span9">';
}
//MAIN CONTENT
if (!isset($_GET['del_msg'])) {
$social_right_content .= inbox_display();
} else {
@ -155,8 +156,11 @@ if (!isset($_GET['del_msg'])) {
}
}
$social_right_content .= inbox_display();
}
$social_right_content .= '</div>';
}
if (api_get_setting('allow_social_tool') == 'true') {
$social_right_content .= '</div>';
}
$tpl = new Template($tool_name);
if (api_get_setting('allow_social_tool') == 'true') {

@ -297,11 +297,15 @@ if ($group_id != 0) {
//LEFT COLUMN
if (api_get_setting('allow_social_tool') == 'true') {
$social_left_content = SocialManager::show_social_menu('messages');
$social_left_content = SocialManager::show_social_menu('messages');
$social_right_content .= '<div class="span9">';
$social_right_content .= '<div class="actions">';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'.Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>';
$social_right_content .= '</div>';
$social_right_content .= '</div>';
$social_right_content .= '<div class="span9">';
}
//MAIN CONTENT
if (!isset($_POST['compose'])) {
if(isset($_GET['re_id'])) {
@ -344,7 +348,9 @@ if (!isset($_POST['compose'])) {
}
}
}
$social_right_content .= '</div>';
if (api_get_setting('allow_social_tool') == 'true') {
$social_right_content .= '</div>';
}
$tpl = new Template(get_lang('ComposeMessage'));
if (api_get_setting('allow_social_tool') == 'true') {

@ -114,9 +114,12 @@ if (isset($_REQUEST['action'])) {
if (api_get_setting('allow_social_tool') == 'true') {
$social_left_content = SocialManager::show_social_menu('messages');
$social_right_content .= '<div class="actions">';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'.Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>';
$social_right_content .= '<div class="span9">';
$social_right_content .= '<div class="actions">';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'.Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>';
$social_right_content .= '</div>';
$social_right_content .= '</div>';
$social_right_content .= '<div class="span9">';
}
//MAIN CONTENT
if ($action == 'delete') {
@ -143,6 +146,10 @@ if ($action == 'delete') {
$social_right_content .= outbox_display();
}
if (api_get_setting('allow_social_tool') == 'true') {
$social_right_content .= '</div>';
}
$tpl = new Template(get_lang('ComposeMessage'));
if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_content', $social_left_content);

@ -32,7 +32,7 @@ if (api_get_setting('allow_message_tool')=='true') {
if ($panel == 1) {
//normal message
$user_info=api_get_user_info($userfriend_id);
echo '<div id="display_response_id" style="height:200px;">';
echo '<div id="display_response_id">';
$form = new FormValidator('add_user', null, null, null, array('class'=>'form-vertical'));
//$username = api_xml_http_response_encode(get_lang('To')).api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
$form->addElement('label', get_lang('To'), api_get_person_name($user_info['firstName'], $user_info['lastName']));

@ -40,10 +40,7 @@ if ($_GET['f']=='social') {
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
}
//echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
$social_right_content .= '</div>';
}
}
@ -58,12 +55,19 @@ if (empty($_GET['id'])) {
$show_menu = 'messages_inbox';
}
$message = '';
//LEFT COLUMN
if (api_get_setting('allow_social_tool') == 'true') {
$social_left_content = SocialManager::show_social_menu($show_menu);
$social_left_content = SocialManager::show_social_menu($show_menu);
$message .='<div class="span9">';
}
//MAIN CONTENT
$message = MessageManager::show_message_box($id_message,$source);
$message .= MessageManager::show_message_box($id_message,$source);
if (api_get_setting('allow_social_tool') == 'true') {
$message .='</div>';
}
if (!empty($message)) {
$social_right_content .= $message;

@ -85,8 +85,6 @@ function clear_form () {
$interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Friends'));
//Display :: display_header($tool_name, 'Groups');
$social_left_content = SocialManager::show_social_menu('friends');
$user_id = api_get_user_id();
@ -105,38 +103,38 @@ if (count($friends) == 0 ) {
$social_right_content = get_lang('NoFriendsInYourContactList').'<br /><br />';
$social_right_content .= '<a href="search.php">'.get_lang('TryAndFindSomeFriends').'</a>';
} else {
$social_right_content = get_lang('Search') .'&nbsp;&nbsp; : &nbsp;&nbsp;';
$social_right_content .= '<input class="social-search-image" type="text" id="id_search_image" name="id_search_image" onkeyup="search_image_social()" />';
$social_right_content = '<div class="span8">'.get_lang('Search') .'&nbsp;&nbsp; : &nbsp;&nbsp;';
$social_right_content .= '<input class="social-search-image" type="text" id="id_search_image" name="id_search_image" onkeyup="search_image_social()" /></div>';
$friend_html = '';
$number_of_images = 8;
$number_friends = count($friends);
$j=0;
$friend_html.= '<table id="friend_table" width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="" >';
for ($k=0;$k<$number_friends;$k++) {
$friend_html.='<tr><td valign="top">';
while ($j<$number_friends) {
if (isset($friends[$j])) {
$friend = $friends[$j];
$user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']);
$friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92);
$friend_html.='<div onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$friends[$j]['friend_user_id'].'>';
$friend_html.='<span><a href="profile.php?u='.$friend['friend_user_id'].'"><center><img src="'.$friends_profile['file'].'" style="height:60px;" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'" /></center></a></span>';
$friend_html.='<img onclick="delete_friend(this)" id=img_'.$friend['friend_user_id'].' src="../img/blank.gif" alt="" title="" class="image-delete" /> <center class="friend">'.$user_name.'</center></div>';
}
$j++;
}
$friend_html.='</td></tr>';
}
$friend_html.='<br/></table>';
$social_right_content .= $friend_html;
}
$social_right_content .= '</div>';
$social_right_content .= '</div>';
$social_right_content .= '</div>';
$friend_html = '';
$number_friends = count($friends);
$j=0;
$friend_html.= '<table id="friend_table" width="95%" border="0" cellpadding="0" cellspacing="0" bgcolor="" >';
for ($k=0;$k<$number_friends;$k++) {
$friend_html.='<tr><td valign="top">';
while ($j<$number_friends) {
if (isset($friends[$j])) {
$friend = $friends[$j];
$user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']);
$friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92);
$friend_html.='<div onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$friends[$j]['friend_user_id'].'>';
$friend_html.='<span><a href="profile.php?u='.$friend['friend_user_id'].'"><center><img src="'.$friends_profile['file'].'" style="height:60px;" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'" /></center></a></span>';
$friend_html.='<img onclick="delete_friend(this)" id=img_'.$friend['friend_user_id'].' src="../img/blank.gif" alt="" title="" class="image-delete" /> <center class="friend">'.$user_name.'</center></div>';
}
$j++;
}
$friend_html.='</td></tr>';
}
$friend_html.='<br/></table>';
$social_right_content .= $friend_html;
}
$social_right_content .= '</div>';
$social_right_content .= '</div>';
$social_right_content .= '</div>';
$tpl = new Template(get_lang('Social'));
$tpl->assign('social_left_content', $social_left_content);

@ -66,9 +66,6 @@ function register_friend(element_input) {
</script>';
api_block_anonymous_users();
//Display :: display_header($tool_name, 'Groups');
// easy links
if (is_array($_GET) && count($_GET)>0) {
foreach($_GET as $key => $value) {
@ -110,107 +107,105 @@ if ($total_invitations == 0 && count($_GET) <= 0) {
$social_right_content .= '<a href="search.php">'.get_lang('TryAndFindSomeFriends').'</a><br /><br />';
}
if ($number_loop != 0) {
$social_right_content .= '<h2>'.get_lang('InvitationReceived').'</h2>';
foreach ($list_get_invitation as $invitation) {
$sender_user_id = $invitation['user_sender_id'];
$social_right_content .= '<div id="id_'.$sender_user_id.'" class="invitation_confirm">';
$picture = UserManager::get_user_picture_path_by_id($sender_user_id,'web',false,true);
$friends_profile = SocialManager::get_picture_user($sender_user_id, $picture['file'], 92);
$user_info = api_get_user_info($sender_user_id);
$title = Security::remove_XSS($invitation['title'], STUDENT, true);
$content = Security::remove_XSS($invitation['content'], STUDENT, true);
$date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG);
$social_right_content .= '<table cellspacing="0" border="0">
<tbody>
<tr>
<td class="invitation_image">
<a href="profile.php?u=<?php echo $sender_user_id; ?>">
<img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' /></a>
</td>
<td class="info">
<a class="profile_link" href="profile.php?u='.$sender_user_id.'">'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</a>
<div>
'.$title.' : '.$content.'
</div>
<div>
'.get_lang('DateSend').' : '.$date.'
</div>
<div class="buttons">
<button class="save" name="btn_accepted" type="submit" id="btn_accepted_'.$sender_user_id.'" value="'.get_lang('Accept').' "onclick="javascript:register_friend(this)">
'.get_lang('Accept').'</button>
<button class="cancel" name="btn_denied" type="submit" id="btn_deniedst_'.$sender_user_id.' " value="'.get_lang('Deny').' " onclick="javascript:denied_friend(this)" >
'.get_lang('Deny').'</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>';
}
}
if (count($list_get_invitation_sent) > 0 ) {
$social_right_content .= '<h2>'.get_lang('InvitationSent').'</h2>';
foreach ($list_get_invitation_sent as $invitation) {
$sender_user_id = $invitation['user_receiver_id'];
$social_right_content .= '<div id="id_'.$sender_user_id.'" class="invitation_confirm">';
if ($number_loop != 0) {
$social_right_content .= '<div class="span8">'.Display::page_subheader(get_lang('InvitationReceived')).'</div>';
foreach ($list_get_invitation as $invitation) {
$sender_user_id = $invitation['user_sender_id'];
$social_right_content .= '<div id="id_'.$sender_user_id.'" class="invitation_confirm span8">';
$picture = UserManager::get_user_picture_path_by_id($sender_user_id,'web',false,true);
$friends_profile = SocialManager::get_picture_user($sender_user_id, $picture['file'], 92);
$user_info = api_get_user_info($sender_user_id);
$title = Security::remove_XSS($invitation['title'], STUDENT, true);
$content = Security::remove_XSS($invitation['content'], STUDENT, true);
$date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG);
$social_right_content .= '
<table cellspacing="0" border="0">
<tbody>
<tr>
<td class="invitation_image">
<a href="profile.php?u=<?php echo $sender_user_id;?>">
<img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' /></a>
</td>
<td class="info">
<a class="profile_link" href="profile.php?u='.$sender_user_id.'">'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</a>
<div>
'. $title.' : '.$content.'
</div>
<div>
'. get_lang('DateSend').' : '.$date.'
</div>
</td>
</tr>
</tbody>
</table>
</div>
';
}
}
if (count($pending_invitations) > 0) {
$social_right_content .= '<h2>'.get_lang('GroupsWaitingApproval').'</h2>';
$new_invitation = array();
foreach ($pending_invitations as $invitation) {
$picture = GroupPortalManager::get_picture_group($invitation['id'], $invitation['picture_uri'],80);
$img = '<img class="social-groups-image" src="'.$picture['file'].'" hspace="4" height="50" border="2" align="left" width="50" />';
$invitation['picture_uri'] = '<a href="groups.php?id='.$invitation['id'].'">'.$img.'</a>';
$invitation['name'] = '<a href="groups.php?id='.$invitation['id'].'">'.cut($invitation['name'],120,true).'</a>';
$invitation['join'] = '<a href="invitations.php?accept='.$invitation['id'].'">'.Display::return_icon('accept_invitation.png', get_lang('AcceptInvitation')).'&nbsp;&nbsp;'.get_lang('AcceptInvitation').'</a>';
$invitation['deny'] = '<a href="invitations.php?deny='.$invitation['id'].'">'.Display::return_icon('denied_invitation.png', get_lang('DenyInvitation')).'&nbsp;&nbsp;'.get_lang('DenyInvitation').'</a>';
$invitation['description'] = cut($invitation['description'],220,true);
$new_invitation[]=$invitation;
}
$social_right_content .= Display::display_return_grid('waiting_user', array(), $new_invitation, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false,false,true,true,true,true));
}
$social_right_content .= '</div>';
$user_info = api_get_user_info($sender_user_id);
$title = Security::remove_XSS($invitation['title'], STUDENT, true);
$content = Security::remove_XSS($invitation['content'], STUDENT, true);
$date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG);
$social_right_content .= '<table cellspacing="0" border="0">
<tbody>
<tr>
<td class="invitation_image">
<a href="profile.php?u=<?php echo $sender_user_id; ?>">
<img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' /></a>
</td>
<td class="info">
<a class="profile_link" href="profile.php?u='.$sender_user_id.'">'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</a>
<div>
'.$title.' : '.$content.'
</div>
<div>
'.get_lang('DateSend').' : '.$date.'
</div>
<div class="buttons">
<button class="save" name="btn_accepted" type="submit" id="btn_accepted_'.$sender_user_id.'" value="'.get_lang('Accept').' "onclick="javascript:register_friend(this)">
'.get_lang('Accept').'</button>
<button class="cancel" name="btn_denied" type="submit" id="btn_deniedst_'.$sender_user_id.' " value="'.get_lang('Deny').' " onclick="javascript:denied_friend(this)" >
'.get_lang('Deny').'</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>';
}
}
if (count($list_get_invitation_sent) > 0 ) {
$social_right_content .= '<div class="span8">'.Display::page_subheader(get_lang('InvitationSent')).'</div>';
foreach ($list_get_invitation_sent as $invitation) {
$sender_user_id = $invitation['user_receiver_id'];
$social_right_content .= '<div id="id_'.$sender_user_id.'" class="invitation_confirm span8">';
$picture = UserManager::get_user_picture_path_by_id($sender_user_id,'web',false,true);
$friends_profile = SocialManager::get_picture_user($sender_user_id, $picture['file'], 92);
$user_info = api_get_user_info($sender_user_id);
$title = Security::remove_XSS($invitation['title'], STUDENT, true);
$content = Security::remove_XSS($invitation['content'], STUDENT, true);
$date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG);
$social_right_content .= '
<table cellspacing="0" border="0">
<tbody>
<tr>
<td class="invitation_image">
<a href="profile.php?u=<?php echo $sender_user_id;?>">
<img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' /></a>
</td>
<td class="info">
<a class="profile_link" href="profile.php?u='.$sender_user_id.'">'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</a>
<div>
'. $title.' : '.$content.'
</div>
<div>
'. get_lang('DateSend').' : '.$date.'
</div>
</td>
</tr>
</tbody>
</table>
</div>
';
}
}
if (count($pending_invitations) > 0) {
$social_right_content .= '<h2>'.get_lang('GroupsWaitingApproval').'</h2>';
$new_invitation = array();
foreach ($pending_invitations as $invitation) {
$picture = GroupPortalManager::get_picture_group($invitation['id'], $invitation['picture_uri'],80);
$img = '<img class="social-groups-image" src="'.$picture['file'].'" hspace="4" height="50" border="2" align="left" width="50" />';
$invitation['picture_uri'] = '<a href="groups.php?id='.$invitation['id'].'">'.$img.'</a>';
$invitation['name'] = '<a href="groups.php?id='.$invitation['id'].'">'.cut($invitation['name'],120,true).'</a>';
$invitation['join'] = '<a href="invitations.php?accept='.$invitation['id'].'">'.Display::return_icon('accept_invitation.png', get_lang('AcceptInvitation')).'&nbsp;&nbsp;'.get_lang('AcceptInvitation').'</a>';
$invitation['deny'] = '<a href="invitations.php?deny='.$invitation['id'].'">'.Display::return_icon('denied_invitation.png', get_lang('DenyInvitation')).'&nbsp;&nbsp;'.get_lang('DenyInvitation').'</a>';
$invitation['description'] = cut($invitation['description'],220,true);
$new_invitation[]=$invitation;
}
$social_right_content .= Display::display_return_grid('waiting_user', array(), $new_invitation, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false,false,true,true,true,true));
}
$tpl = new Template($tool_name);
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);

@ -66,9 +66,6 @@ function register_friend(element_input) {
</script>';
//Display :: display_header($tool_name, 'Groups');
// easy links
if (is_array($_GET) && count($_GET)>0) {
foreach($_GET as $key => $value) {
@ -99,12 +96,10 @@ if (isset($_GET['cidReq'])){
$social_right_content .= '<a href="'.api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.Security::remove_XSS($_GET['cidReq']).'&amp;id_session='.Security::remove_XSS($_GET['id_session']).'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'&amp;id='.Security::remove_XSS($_GET['parent_id']).'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('Documents').' ('.get_lang('Course').')').get_lang('BackTo').' '.get_lang('Documents').' ('.get_lang('Course').')</a>';
$social_right_content .= '</div>';
}
else{
$social_right_content .= '<br />';
}
$social_right_content .= '<div class="span9">';
$social_right_content .= '<iframe name="fileManager" id="fileManager" src="'.api_get_path(WEB_PATH).'main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajaxfilemanager.php?editor=stand_alone" scrolling="no" noresize="noresize" frameborder="no" style="height:450px; width:100%; float:left"></iframe>';
$social_right_content .= '</div>';
$social_right_content .= '</div>';
$tpl = new Template(get_lang('Social'));

@ -226,7 +226,7 @@ if (is_array($personal_course_list)) {
}
$social_left_content = SocialManager::show_social_menu('shared_profile', null, $user_id, $show_full_profile);
$social_right_content = '<div class="rounded_div span4">';
$social_right_content = '<div class="well_border span4">';
if (!empty($user_info['firstname']) || !empty($user_info['lastname'])) {
$social_right_content .= '<div><h3>'.api_get_person_name($user_info['firstname'], $user_info['lastname']).'</h3></div>';
@ -340,7 +340,7 @@ $social_right_content .= '</div>'; // close div tag rounded
if ($show_full_profile) {
$social_right_content .= '<div class="rounded_div span4">';
$social_right_content .= '<div class="well_border span4">';
$list_path_normal_friends = $list_path_parents = array();
//SOCIALGOODFRIEND , USER_RELATION_TYPE_FRIEND, USER_RELATION_TYPE_PARENT
@ -457,7 +457,7 @@ if ($show_full_profile) {
}
if (count($grid_my_groups) > 0) {
$social_right_content .= '<div class="rounded_div span8" >';
$social_right_content .= '<div class="well_border span8" >';
$count_groups = 0;
if (count($results) == 1 ) {
$count_groups = count($results);
@ -488,7 +488,7 @@ if ($show_full_profile) {
// COURSES LIST
if ( is_array($list) ) {
$social_right_content .= '<div class="rounded_div span8">';
$social_right_content .= '<div class="well_border span8">';
$social_right_content .= '<div><h3>'.api_ucfirst(get_lang('MyCourses')).'</h3></div>';
$social_right_content .= '<div class="social-content-training">';
//Courses whithout sessions
@ -516,7 +516,7 @@ if ($show_full_profile) {
// user feeds
$user_feeds = SocialManager::get_user_feeds($user_id);
if (!empty($user_feeds)) {
$social_right_content .= '<div class="rounded_div span8">';
$social_right_content .= '<div class="well_border span8">';
$social_right_content .= '<div><h3>'.get_lang('RSSFeeds').'</h3></div>';
$social_right_content .= '<div class="social-content-training">'.$user_feeds.'</div>';
$social_right_content .= '</div>';
@ -546,7 +546,7 @@ if ($show_full_profile) {
//Pending invitations
if (!isset($_GET['u']) || (isset($_GET['u']) && $_GET['u']==api_get_user_id())) {
if ($count_pending_invitations > 0) {
$social_right_content .= '<div class="rounded_div span4">';
$social_right_content .= '<div class="well_border span4">';
$social_right_content .= '<div><h3>'.get_lang('PendingInvitations').'</h3></div>';
for ($i=0;$i<$count_pending_invitations;$i++) {
$user_invitation_id = $pending_invitations[$i]['user_sender_id'];
@ -561,7 +561,7 @@ if ($show_full_profile) {
$social_right_content .= '<br />';
$social_right_content .= Security::remove_XSS(cut($pending_invitations[$i]['content'], 50), STUDENT, true);
$social_right_content .= '<br />';
$social_right_content .= '<a id="btn_accepted_'.$user_invitation_id.'" onclick="register_friend(this)" href="javascript:void(0)">'.get_lang('SocialAddToFriends').'</a>';
$social_right_content .= '<a id="btn_accepted_'.$user_invitation_id.'" class="btn" onclick="register_friend(this)" href="javascript:void(0)">'.get_lang('SocialAddToFriends').'</a>';
$social_right_content .= '<div id="id_response"></div>';
$social_right_content .= '</div>';
$social_right_content .= '</div>';
@ -575,14 +575,14 @@ if ($show_full_profile) {
$production_list = UserManager::build_production_list($user_id);
$product_content = '';
if (!empty($production_list)) {
$product_content .= '<div class="rounded_div span4">';
$product_content .= '<div class="well_border span4">';
$product_content .= '<div><h3>'.get_lang('MyProductions').'</h3></div>';
$product_content .= $production_list;
$product_content .= '</div>';
}
// Images uploaded by course
if (!empty($file_list)) {
$product_content .= '<div class="rounded_div span4">';
$product_content .= '<div class="well_border span4">';
$product_content .= '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>';
$product_content .= '<div class="social-content-information">';
$product_content .= $file_list;
@ -596,7 +596,7 @@ if ($show_full_profile) {
if (!empty($user_info['competences']) || !empty($user_info['diplomas']) || !empty($user_info['openarea']) || !empty($user_info['teach']) ) {
$social_right_content .= '<div class="rounded_div span4">';
$social_right_content .= '<div class="well_border span4">';
$social_right_content .= '<div><h3>'.get_lang('MoreInformation').'</h3></div>';
$cut_size = 220;
if (!empty($user_info['competences'])) {

@ -23,51 +23,50 @@ $tool_name = get_lang('Search');
$interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));
$query_vars = array();
$query = isset($_GET['q']) ? $_GET['q'] : null;
$social_left_content = SocialManager::show_social_menu('search');
$social_right_content = UserManager::get_search_form($query);
//I'm searching something
if ($query !='') {
//get users from tags
$users = UserManager::get_all_user_tags($_GET['q'], 0, 0, 5);
$groups = GroupPortalManager::get_all_group_tags($_GET['q']);
if (empty($users) && empty($groups)) {
$social_right_content .= get_lang('SorryNoResults');
}
$results .= '<div id="online_grid_container"><div class="span9">';
if (is_array($users) && count($users)> 0) {
$results .= '<h2>'.get_lang('Users').'</h2>';
$results .= '<ul class="thumbnails">';
foreach($users as $user) {
$user_info = api_get_user_info($user['user_id'], true);
$url = api_get_path(WEB_PATH).'main/social/profile.php?u='.$user['user_id'];
if (empty($user['picture_uri'])) {
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown_180_100.jpg';
$img = '<img src="'.$picture['file'].'">';
} else {
$picture = UserManager::get_picture_user($user['user_id'], $user['picture_uri'], 80, USER_IMAGE_SIZE_ORIGINAL );
$img = '<img src="'.$picture['file'].'">';
}
if ($user_info['user_is_online']) {
$status_icon = Display::span('', array('class' => 'online_user_in_text'));
} else {
$status_icon = Display::span('', array('class' => 'offline_user_in_text'));
}
$user['tag'] = isset($user['tag']) ? $user['tag'] : null;
$user_info['complete_name'] = Display::url($status_icon.$user_info['complete_name'], $url).'<br />'.$user['tag'];
$results .= '<li class="span3"><div class="thumbnail">'.$img.'<div class="caption">'.$user_info['complete_name'].$user['tag'].'</div</div></li>';
}
$results .='</ul></div></div>';
$social_right_content .= $results;
}
$social_right_content = '<div class="span9">'.UserManager::get_search_form($query).'</div>';
//I'm searching something
if ($query !='') {
//get users from tags
$users = UserManager::get_all_user_tags($_GET['q'], 0, 0, 5);
$groups = GroupPortalManager::get_all_group_tags($_GET['q']);
if (empty($users) && empty($groups)) {
$social_right_content .= get_lang('SorryNoResults');
}
$results .= '<div id="online_grid_container"><div class="span9">';
if (is_array($users) && count($users)> 0) {
$results .= Display::page_subheader(get_lang('Users'));
$results .= '<ul class="thumbnails">';
foreach($users as $user) {
$user_info = api_get_user_info($user['user_id'], true);
$url = api_get_path(WEB_PATH).'main/social/profile.php?u='.$user['user_id'];
if (empty($user['picture_uri'])) {
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown_180_100.jpg';
$img = '<img src="'.$picture['file'].'">';
} else {
$picture = UserManager::get_picture_user($user['user_id'], $user['picture_uri'], 80, USER_IMAGE_SIZE_ORIGINAL );
$img = '<img src="'.$picture['file'].'">';
}
if ($user_info['user_is_online']) {
$status_icon = Display::span('', array('class' => 'online_user_in_text'));
} else {
$status_icon = Display::span('', array('class' => 'offline_user_in_text'));
}
$user['tag'] = isset($user['tag']) ? $user['tag'] : null;
$user_info['complete_name'] = Display::url($status_icon.$user_info['complete_name'], $url).'<br />'.$user['tag'];
$results .= '<li class="span3"><div class="thumbnail">'.$img.'<div class="caption">'.$user_info['complete_name'].$user['tag'].'</div</div></li>';
}
$results .='</ul></div></div>';
$social_right_content .= $results;
}
//Get users from tags this loop does not make sense for now ...
/*
@ -113,12 +112,12 @@ $social_right_content = UserManager::get_search_form($query);
$grid_groups = array();
if (is_array($groups) && count($groups)>0) {
$social_right_content .= '<div class="span9">';
$social_right_content .= '<h2>'.get_lang('Groups').'</h2>';
$social_right_content .= Display::page_subheader(get_lang('Groups'));
foreach($groups as $group) {
$group['name'] = Security::remove_XSS($group['name'], STUDENT, true);
$$group['description'] = Security::remove_XSS($group['description'], STUDENT, true);
$id = $group['id'];
$url_open = '<a href="groups.php?id='.$id.'">';
$url_open = '<a href="groups.php?id='.$id.'" >';
$url_close = '</a>';
$name = cut($group['name'],25,true);
$count_users_group = count(GroupPortalManager::get_all_users_by_group($id));
@ -153,8 +152,7 @@ $social_right_content = UserManager::get_search_form($query);
$visibility = array(true,true,true,true,true);
$social_right_content .= Display::return_sortable_grid('mygroups', array(), $grid_groups, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false, $visibility);
}
$social_right_content .= '</div>';
$social_right_content .= '</div>';
$tpl = new Template($tool_name);
$tpl->assign('social_left_content', $social_left_content);

@ -1,12 +1,14 @@
<?php
/**
* Controller for example date plugin
* @package chamilo.plugin.date
* @package chamilo.plugin.hello_world
*/
// See also the share_user_info plugin
echo '<div class="well">';
if (!empty($plugin_info['settings']['hello_world_show_type'])) {
echo "<h2>".$plugin_info['settings']['hello_world_show_type']."</h2>";
} else {
echo "<h2>Hello world</h2>";
}
}
echo '</div>';
Loading…
Cancel
Save