From 5d464a56eb70c1f08bf090a7c6acdd971095b4cc Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Tue, 29 Dec 2009 15:06:12 -0500 Subject: [PATCH] Adding styles for group messages in social network - partial CT#446 --- main/css/blue_lagoon/default.css | 28 ++++++- main/inc/lib/group_portal_manager.lib.php | 2 +- main/inc/lib/message.lib.php | 90 ++++++++++++----------- main/inc/lib/social.lib.php | 20 +---- main/messages/new_message.php | 3 +- main/messages/view_message.php | 25 ++++++- main/social/group_invitation.php | 10 ++- main/social/group_members.php | 7 +- main/social/groups.php | 72 ++++++++++++------ 9 files changed, 165 insertions(+), 92 deletions(-) diff --git a/main/css/blue_lagoon/default.css b/main/css/blue_lagoon/default.css index 0da0836c70..d2bf58975f 100755 --- a/main/css/blue_lagoon/default.css +++ b/main/css/blue_lagoon/default.css @@ -2767,6 +2767,20 @@ a.unread { padding-right:20px; } +#contentPostReply{ + width:600px; + margin-left:60px; +} + +.contentPostReplybg{ + width:560px; + height:auto; + padding-left:20px; + padding-right:20px; + background-image:url(../../img/content-post-reply02.jpg); + background-repeat:repeat-y; +} + #div_content_table { width:660px; background-image:url(../../img/content-post-group2.jpg); @@ -2779,7 +2793,7 @@ a.unread { width:700px; height:auto; overflow:hidden; - margin-top:20px; + margin-bottom:20px; } .message-item { @@ -3033,12 +3047,13 @@ a.unread { .invitation_profile_grid_item { border:1px dotted #CCCCCC; float:left; - height:90px; + height:110px; margin:5px; padding:5px; width:100px; } .invitation_profile_grid_element_0 { width:100px; float:left; text-align:center; margin-bottom:5px;} +.invitation_profile_grid_element_0 img {width:50px;height:50px;border:3px solid #E6E6E6;} .invitation_profile_grid_element_2 { width:100px; float:left; text-align:center;} .invitation_profile_grid_element_3 { width:100px; float:left; text-align:center;} @@ -3064,8 +3079,9 @@ a.unread { /*LIST MEMBERS*/ .list_members_grid_container { width:100%;} -.list_members_grid_item { width:100px; height: 125px; border:1px dotted #ccc; float:left; padding:5px; margin:8px;} +.list_members_grid_item { width:105px; height: 150px; border:1px dotted #ccc; float:left; padding:5px; margin:8px;} .list_members_grid_element_0 { width:100px; float:left; text-align:center; margin-bottom:5px;} +.list_members_grid_element_0 img {width:50px;height:50px;border:3px solid #E6E6E6;} .list_members_grid_element_2 { width:100px; float:left; text-align:center; margin-bottom:5px;} .list_members_grid_element_3 { width:100px; float:left; text-align:center; margin-bottom:5px;} .list_members_grid_element_5 { width:100%; text-align:center;} @@ -3225,6 +3241,12 @@ a.unread { overflow:hidden; } +#boxmyGroupMessages { + height:auto; + overflow:hidden; + width:700px; +} + #boxmyGroupsLeft{ width:350px; float:left; diff --git a/main/inc/lib/group_portal_manager.lib.php b/main/inc/lib/group_portal_manager.lib.php index 0d7b5091df..d4a265fb3c 100755 --- a/main/inc/lib/group_portal_manager.lib.php +++ b/main/inc/lib/group_portal_manager.lib.php @@ -865,7 +865,7 @@ class GroupPortalManager $group_info = GroupPortalManager::get_group_data($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_'); + $big_image = GroupPortalManager::get_picture_group($group_id, $group_info['picture_uri'],'','big_'); $tags = GroupPortalManager::get_group_tags($group_id, true); $members = GroupPortalManager::get_users_by_group($group_id); $groups_by_user = GroupPortalManager::get_groups_by_user($user_id, 0); diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php index 3c3b0047a5..6eea81854a 100755 --- a/main/inc/lib/message.lib.php +++ b/main/inc/lib/message.lib.php @@ -168,12 +168,11 @@ class MessageManager if ($_GET['f']=='social') { $link = '&f=social'; } - - + $message[2] = ''.GetFullUserName(($result[1])).'';; $message[3] = ''.$result[2].''; - $message[5] = ''.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).''. - '  '.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''; + $message[5] = ''.Display::return_icon('message_reply.png',get_lang('ReplyToMessage')).''. + '  '.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''; } $message[4] = ($result[3]); //date stays the same foreach($message as $key => $value) { @@ -614,7 +613,7 @@ class MessageManager $message[2] = ''.GetFullUserName($result[4]).''; $message[3] = ''.$result[2].''; - $message[5] = ''.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''; + $message[5] = ''.Display::return_icon('message_delete.png',get_lang('DeleteMessage')).''; } $message[4] = $result[3]; //date stays the same foreach($message as $key => $value) { @@ -860,13 +859,14 @@ class MessageManager $total_topics = count($topics); $topics_per_page = 5; $pager = self::get_pager_for_message_group($group_id,$page,$total_topics,$topics_per_page); - $html .= '
- -
 '.$pager['details'].''.$pager['links'].'
'; + // topics and items $parents = array_keys(self::get_messages_by_parent(0,$group_id,$page,$topics_per_page)); - $html .= '
'; + $html .= '
'; + $html .= '
+ +
 '.$pager['details'].''.$pager['links'].'
'; foreach ($topics as $index => $topic) { if (!in_array($index,$parents)) continue; @@ -876,40 +876,38 @@ class MessageManager $user_sender_info = UserManager::get_user_info_by_id($topic['user_sender_id']); $files_attachments = self::get_links_message_attachment_files($topic['id']); $name = api_get_person_name($user_sender_info['firstname'], $user_sender_info['lastname']); - $html .= '
'; - $html .= ' - '.((isset($_GET['div_id']) && $_GET['div_id'] == 'content_'.$topic['id'])?Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align: middle')): - Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align: middle'))).' - '.$topic['title'].''; - //$html .= '('.get_lang('PostIn').' '.date_to_str_ago($topic['send_date']).($topic['send_date']!=$topic['update_date']?' - '.get_lang('LastUpdate').' '.date_to_str_ago($topic['send_date']):'').')'; - $html .= ''; - if ($topic['send_date']!=$topic['update_date']) { - if (!empty($topic['update_date']) && $topic['update_date'] != '0000-00-00 00:00:00' ) { - $html .= ' '.get_lang('LastUpdate').' '.date_to_str_ago($topic['update_date']).''; - } - } else { - $html .= ' '.get_lang('Created').' '.date_to_str_ago($topic['send_date']).''; - } - - - $html .= '
'; + $html .= '
'; + $html .= '
'.Display::return_icon('content-post-group1.jpg').'
'; + $html .= '
'; + $html .= ' + '.((isset($_GET['div_id']) && $_GET['div_id'] == 'content_'.$topic['id'])?Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align: middle')): + Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align: middle'))).' + '.$topic['title'].''; + $html .= ''; + + if ($topic['send_date']!=$topic['update_date']) { + if (!empty($topic['update_date']) && $topic['update_date'] != '0000-00-00 00:00:00' ) { + $html .= ' ('.get_lang('LastUpdate').' '.date_to_str_ago($topic['update_date']).')'; + } + } else { + $html .= ' ('.get_lang('Created').' '.date_to_str_ago($topic['send_date']).')'; + } + + $html .= '
'; $html .= ''; - $html.= '
'; + $html.= '
'; $html.= ''; - //$html.= '
'.$topic['title'].' 
'; + $html.= '
'; $html.= '
'.get_lang('From').' '.$name.' 
'; - $html.= '
'.$topic['content'].'
'; - //$html.= '
'.get_lang('PostIn').' '.date_to_str_ago($topic['send_date']).'
'; + $html.= '
'.$topic['content'].'
'; $html.= '
'.(!empty($files_attachments)?implode(' | ',$files_attachments):'').'
'; - $html.= '
'; + $html.= '
'; // items if (is_array($topic['items'])) { @@ -932,7 +930,12 @@ class MessageManager $user_sender_info = UserManager::get_user_info_by_id($item['user_sender_id']); $files_attachments = self::get_links_message_attachment_files($item['id']); $name = api_get_person_name($user_sender_info['firstname'], $user_sender_info['lastname']); - $html.= '
'; + + + //$html.= '
'; + $html.= '
'; + $html .= '
'.Display::return_icon('content-post-reply01.jpg').'
'; + $html .= '
'; $html.= ''; + $html.= '
'.(!empty($files_attachments)?implode(' | ',$files_attachments):'').'
'; + $html.= '
'; + $html.= '
'; } + /* // pager items $html .= '
  '.$pager_items['links'].'
'; + */ } + $html .= '
'; $html .= '
'; $html .= '
'; } $html .= '
'; + /* // pager $html .= '
- +
  '.$pager['links'].'
'; + */ } return $html; } diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index 7fc8aa899c..9c29823ff3 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -674,7 +674,7 @@ class SocialManager extends UserManager { if ($show == 'messages') { echo ''; } @@ -695,23 +695,9 @@ class SocialManager extends UserManager {
'; if ($show == 'group_messages' && !empty($group_id)) { - echo GroupPortalManager::show_group_column_information($group_id, api_get_user_id()); - - } - /* - echo ' - '; - */ - echo '
'; - - + } + echo '
'; } diff --git a/main/messages/new_message.php b/main/messages/new_message.php index 97ea7d48ff..69801259e9 100755 --- a/main/messages/new_message.php +++ b/main/messages/new_message.php @@ -157,8 +157,9 @@ function manage_form ($default, $select_from_user_list = null) { $group_id = intval($_REQUEST['group_id']); $message_id = intval($_GET['message_id']); + $param_f = isset($_GET['f'])?Security::remove_XSS($_GET['f']):''; - $form = new FormValidator('compose_message',null,null,null,array('enctype'=>'multipart/form-data')); + $form = new FormValidator('compose_message',null,api_get_self().'?f='.$param_f,null,array('enctype'=>'multipart/form-data')); if (empty($group_id)) { if (isset($select_from_user_list)) { $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')); diff --git a/main/messages/view_message.php b/main/messages/view_message.php index c898e06464..be4f61a8e6 100755 --- a/main/messages/view_message.php +++ b/main/messages/view_message.php @@ -31,10 +31,23 @@ if ($_REQUEST['f']=='social') { $interbreadcrumb[]= array ('url' => '#','name' => get_lang('View')); Display::display_header(''); -if ($_GET['f']=='social') { +if ($_GET['f']=='social') { + $user_online_list = WhoIsOnline(api_get_setting('time_limit_whosonline')); + $user_online_count = count($user_online_list); + echo '
'; + echo ' + +
'.strtoupper(get_lang('Menu')).'
 '.Display::return_icon('whoisonline.png','',array('hspace'=>'6')).''.get_lang('FriendsOnline').' '.$user_online_count.'
'; + /* + echo ''; + echo '
'.Display::return_icon('whoisonline.png','',array('hspace'=>'6')).''.$who_is_on_line.'
'; + */ + echo '
'; + /* echo '
'; echo get_lang('Messages'); echo '
'; + */ $social_parameter = '?f=social'; } else { if (api_get_setting('extended_profile') == 'true') { @@ -53,8 +66,10 @@ if ($_GET['f']=='social') { } echo '
'; + $id_content_right = ''; //LEFT COLUMN if (api_get_setting('allow_social_tool') != 'true') { + $id_content_right = 'inbox'; echo '
'; echo '
    '; echo '
  • '.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').''.'
  • '; @@ -64,10 +79,14 @@ echo '
    '; echo '
    '; } else { require_once api_get_path(LIBRARY_PATH).'social.lib.php'; - SocialManager::show_social_menu('messages'); + $id_content_right = 'socialContentRigth'; + echo '
    '; + //this include the social menu div + SocialManager::show_social_menu('messages'); + echo '
    '; } - echo '
    '; + echo '
    '; //MAIN CONTENT if (empty($_GET['id'])) { diff --git a/main/social/group_invitation.php b/main/social/group_invitation.php index ce4d6baab2..f093c0ec70 100755 --- a/main/social/group_invitation.php +++ b/main/social/group_invitation.php @@ -488,9 +488,15 @@ unset($sessionUsersList); 0) { - echo get_lang('UsersAlreadyInvited'); + + foreach ($members as &$member) { + $image_path = UserManager::get_user_picture_path_by_id($member['user_id'], 'web', false, true); + $picture = UserManager::get_picture_user($member['user_id'], $image_path['file'],80); + $member['image'] = ''; + } + echo ''.get_lang('UsersAlreadyInvited').''; Display::display_sortable_grid('invitation_profile', array(), $members, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, false, true,true)); } diff --git a/main/social/group_members.php b/main/social/group_members.php index 1d4124ba6d..d6a50900b8 100755 --- a/main/social/group_members.php +++ b/main/social/group_members.php @@ -102,7 +102,7 @@ if (! empty($show_message)){ Display :: display_normal_message($show_message); } -$users = GroupPortalManager::get_users_by_group($group_id, true, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000); +$users = GroupPortalManager::get_users_by_group($group_id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000); $new_member_list = array(); echo '
    '; @@ -133,6 +133,11 @@ echo '
    '; } break; } + + $image_path = UserManager::get_user_picture_path_by_id($user['user_id'], 'web', false, true); + $picture = UserManager::get_picture_user($user['user_id'], $image_path['file'],80); + $user['image'] = ''; + $new_member_list[] = $user; } if (count($new_member_list) > 0) { diff --git a/main/social/groups.php b/main/social/groups.php index 7cc937b38f..d2c28d621d 100755 --- a/main/social/groups.php +++ b/main/social/groups.php @@ -149,22 +149,19 @@ echo '
    '; echo '
    '; - echo '
    '; //this include the social menu div if ($group_id != 0 ) { SocialManager::show_social_menu('group_messages',$group_id); } else { SocialManager::show_social_menu('groups'); - } - + } echo '
    '; echo '
    '; - - -if ($group_id != 0 ) { +if ($group_id != 0 ) { + $group_info = GroupPortalManager::get_group_data($group_id); //Loading group information if (isset($_GET['status']) && $_GET['status']=='sent') { Display::display_confirmation_message(get_lang('MessageHasBeenSent'), false); @@ -182,8 +179,7 @@ if ($group_id != 0 ) { if (isset($_GET['action']) && $_GET['action']=='join') { // we add a user only if is a open group $user_join = intval($_GET['u']); - if (api_get_user_id() == $user_join && !empty($group_id)) { - $group_info = GroupPortalManager::get_group_data($group_id); + if (api_get_user_id() == $user_join && !empty($group_id)) { if ($group_info['visibility'] == GROUP_PERMISSION_OPEN) { GroupPortalManager::add_user_to_group($user_join, $group_id); } else { @@ -195,22 +191,55 @@ if ($group_id != 0 ) { //-- Shows left column //echo GroupPortalManager::show_group_column_information($group_id, api_get_user_id()); //--- - - //-- Show message groups - echo '
    '; - echo '
    '; - if (GroupPortalManager::is_group_member($group_id)) { - $content = MessageManager::display_messages_for_group($group_id); - if (!empty($content)) { - echo $content; + + // details about the current group + echo '
    '; + echo '
    '; + $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_'); + if (basename($picture['file']) != 'unknown_group.png') { + echo '

    '; } else { - echo get_lang('YouShouldCreateATopic'); + echo '

    '; + } + echo '
    '; + echo '
    '; + //Group's title + echo '

    '.$group_info['name'].'

    '; + //Group's description + echo '
    '.$group_info['description'].'
    '; + echo ''; + //Privacy + echo '
    '; + echo get_lang('Privacy').' : '; + if ($group_info['visibility']== GROUP_PERMISSION_OPEN) { + echo get_lang('ThisIsAnOpenGroup'); + } elseif ($group_info['visibility']== GROUP_PERMISSION_CLOSED) { + echo get_lang('ThisIsACloseGroup'); } + echo '
    '; + //Group's tags + if (!empty($tags)) { + echo '
    '.get_lang('Tags').' : '.$tags.'
    '; + } + echo '
    '; + echo '
    '; + echo '
    '; + + //-- Show message groups + echo '
    '; + echo '

    '.get_lang('Topics').'

    '; + if (GroupPortalManager::is_group_member($group_id)) { + $content = MessageManager::display_messages_for_group($group_id); + if (!empty($content)) { + echo $content; } else { - echo get_lang('YouShouldJoinTheGroup'); + echo get_lang('YouShouldCreateATopic'); } - echo '
    '; // end layout messages - echo '
    '; // end layout right + } else { + echo get_lang('YouShouldJoinTheGroup'); + } + echo '
    '; // end layout messages } else { @@ -329,8 +358,7 @@ if ($group_id != 0 ) { echo '
    '.strtoupper(get_lang('MyGroups')).'
    '; if (count($grid_my_groups) > 0) { Display::display_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); - } - + } if (count($grid_newest_groups) > 0) { echo '
    '.strtoupper(get_lang('Newest')).'
    '; Display::display_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));