diff --git a/main/css/base.css b/main/css/base.css index 543a9ad680..2a17bc715c 100755 --- a/main/css/base.css +++ b/main/css/base.css @@ -5673,6 +5673,124 @@ i.size-32.icon-new-work{ { display: inline-block; } +.social-group .list-group-newest .items .group-info{ + width: auto; +} +.social-group .items{ + border-bottom: 1px dotted #B1DDE0; + padding-bottom: 5px; + margin-bottom: 5px; +} +.social-group .group-name a{ + font-size: 14px; + font-weight: bold; + color: #4D4D4D; +} +.social-group .count-username{ + font-size: 12px; + color: #4D4D4D; +} +.social-group .description p{ + color: #4D4D4D; + padding-top: 10px; + padding-bottom: 0px; + font-size: 11px; +} +.social-post .mediaPost{ + padding-top:10px; + padding-bottom: 5px; + margin-bottom: 5px; +} +.social-post .sub-mediapost{ + padding-left: 20px; + margin-left: 20px; +} +.top-mediapost .user-image img, +.sub-mediapost .user-image img +{ + width: 50px; + height: 50px; + max-width: 50px; + max-height: 50px; +} +.top-mediapost .user-image, +.sub-mediapost .user-image +{ + vertical-align: top; +} +.top-mediapost .user-image .avatar-thumb, +.sub-mediapost .user-image .avatar-thumb{ + padding: 5px; + border: 1px solid #dddddd; + margin-bottom: 5px; + margin-right: 5px; +} +.top-mediapost .user-data .username a, +.sub-mediapost .user-data .username a{ + font-size: 14px; + font-weight: bold; + color: #4D4D4D; +} +.top-mediapost .user-data .time, +.sub-mediapost .user-data .time +{ + color: #9197a3; +} +.top-mediapost .msg-content .img-post .thumbnail, +.sub-mediapost .msg-content .img-post .thumbnail{ + border: 1px solid #BCE8F1; +} +.top-mediapost .msg-content p, +.sub-mediapost .rep-post .msg-content p{ + border-top:1px solid #BCE8F1; + padding-top: 5px; + padding-bottom: 5px; + margin-top: 5px; + margin-bottom: 5px; + line-height: 18px; + padding-left: 10px; + padding-right: 10px; +} +.top-mediapost .user-data .username a:hover, +.sub-mediapost .user-data .username a:hover{ + text-decoration: underline; +} +.top-mediapost .user-image, .top-mediapost .user-data, +.sub-mediapost .rep-post .user-image, .sub-mediapost .rep-post .user-data{ + display: inline-block; +} + +.deleted-mgs a{ + float: right; + font-size: 18px; + font-weight: bold; + text-shadow: 0 1px 0 #fff; + opacity: 0.2; + filter: alpha(opacity=20); + color: #000000; +} + +.social-rss .title-rss{ + margin-bottom: 5px; + margin-top: 5px; + font-size: 14px; +} +.social-rss .rss-items{ + padding-top: 10px; + padding-bottom: 5px; + margin-bottom: 5px; +} +.social-rss .rss-items .rss-title a{ + color: #4D4D4D; +} +.social-rss .rss-items .rss-title a:hover{ + text-decoration: underline; +} +.social-rss .rss-items .rss-content p{ + line-height: 18px; + font-size: 12px; + color: #666; +} /* deleted bootstrap 3 update */ .panel { @@ -5682,6 +5800,7 @@ i.size-32.icon-new-work{ border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); box-shadow: 0 1px 1px rgba(0, 0, 0, .05); + clear: both; } .panel-body { padding: 15px; diff --git a/main/img/icons/22/social_rss.png b/main/img/icons/22/social_rss.png new file mode 100644 index 0000000000..ed19af0ab3 Binary files /dev/null and b/main/img/icons/22/social_rss.png differ diff --git a/main/inc/ajax/social.ajax.php b/main/inc/ajax/social.ajax.php index 7d173668a5..7a18af019c 100755 --- a/main/inc/ajax/social.ajax.php +++ b/main/inc/ajax/social.ajax.php @@ -196,7 +196,7 @@ switch ($action) { for($i = 0; $i < count($array); $i++) { $post = $array[$i]['html']; $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $array[$i]['id']); - $html .= '
'.$post.$comment.'
'; + $html .= '
'.$post.$comment.'
'; } $html .= Display::div( Display::url( diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index b8b111b49e..766b8c3853 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -420,17 +420,18 @@ class SocialManager extends UserManager if (!empty($rss->items)) { $icon_rss = ''; if (!empty($feed)) { - $icon_rss = Display::url(Display::return_icon('rss.png', '', array(), 32), Security::remove_XSS($feed['rssfeeds']), array('target' => '_blank')); + $icon_rss = Display::url(Display::return_icon('social_rss.png', '', array(), 22), Security::remove_XSS($feed['rssfeeds']), array('target' => '_blank')); } - $res .= '

'.$rss->channel['title'].''.$icon_rss.'

'; - $res .= '
'; + + $res .= '

'.$icon_rss.' '.$rss->channel['title'].'

'; + $res .= '
'; foreach ($rss->items as $item) { if ($limit >= 0 and $i > $limit) { break; } - $res .= '

'.$item['title'].'

'; - $res .= ''; - $res .= '
'; + $res .= '

'.$item['title'].'

'; + $res .= '
'.api_get_local_time($item['date_timestamp']).'
'; + $res .= '

'.$item['description'].'

'; $i++; } $res .= '
'; @@ -762,8 +763,9 @@ class SocialManager extends UserManager } if ($show == 'shared_profile') { - $html .= '
'; if ($show_full_profile && $user_id == intval(api_get_user_id())) { $personal_course_list = UserManager::get_personal_session_course_list($user_id); @@ -1285,8 +1287,7 @@ class SocialManager extends UserManager $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL, $idMessage, $start, $limit, $offset); - $formattedList = '
'; + $formattedList = '
'; $users = array(); // The messages are ordered by date descendant, for comments we need ascendant @@ -1303,50 +1304,38 @@ class SocialManager extends UserManager : $users[$userIdLoop]['lastname'] . ' ' . $users[$userIdLoop]['firstname']; $url = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userIdLoop; $media = ''; - $media .= '
'; - $media .= '
'; - $media .= '
'; - $media .= '' - . ' ' - . ''; - $media .= '
'; - $media .= '
'; - $media .= '
'; - $media .= '

' - . ''.$nameComplete.'

'; - $media .= '
'; - $media .= '
'; - $media .= '
'; - $media .= ''.$date.''; - $media .= '
'; - $media .= '
'; - $media .= '
'; - $media .= '
'; + $media .= '
'; if ($isOwnWall) { - $media .= '
'; - $media .= ''; + $media .= '
'; + $media .= ''.get_lang('x').''; $media .= '
'; } - $media .= '
'; - $media .= ''.Security::remove_XSS($message['content']).''; + $media .= '
'; + $media .= ''.$users[$userIdLoop]['complete_name'].''; $media .= '
'; - $media .= '
'; // end media + $media .= '
'; + $media .= ''; + $media .= '
'.$date.'
'; + $media .= '
'; + $media .= '
'; + $media .= '

'.Security::remove_XSS($message['content']).'

'; + $media .= '
'; + $formattedList .= $media; } $formattedList .= '
'; - $formattedList .= '
'; + $formattedList .= '
'; $formattedList .= '
-
+ '" name="social_wall_new_msg" rows="1" style="width:80%;" > + value="'.get_lang('Post').'" class="pull-right btn" />
'; $formattedList .= '
'; return $formattedList; @@ -1442,40 +1431,29 @@ class SocialManager extends UserManager $htmlDelete = ''; if ($isOwnWall) { - $htmlDelete .= ''.get_lang('SocialMessageDelete').''; + $htmlDelete .= ''.get_lang('x').''; } $html = ''; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= ''.''.$nameCompleteAuthor.''; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '

'; - $html .= ''.$nameCompleteAuthor.''.$htmlReceiver.'

'; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= ''.$date.''; - $html .= '
'; - $html .= '
'; - $html .= '
'; - $html .= '
'; + $html .= '
'; if ($isOwnWall) { - $html .= '
'; + $html .= '
'; $html .= $htmlDelete; $html .= '
'; } - $html .= '
'; + $html .= '
'; + $html .= ''.''.$nameCompleteAuthor.''; + $html .= '
'; + $html .= '
'; + $html .= '
'.$nameCompleteAuthor.''.$htmlReceiver.'
'; + $html .= '
'.$date.'
'; + $html .= '
'; + $html .= '
'; + $html .= '
'; $html .= $wallImage; $html .= '
'; - $html .= '
'; - $html .= ''. - Security::remove_XSS(self::readContentWithOpenGraph($message['content'])).''; + $html .= '

'. Security::remove_XSS(self::readContentWithOpenGraph($message['content'])).'

'; $html .= '
'; $html .= '
'; // end mediaPost diff --git a/main/social/home.php b/main/social/home.php index 43d59b50e1..8a3ad7e35e 100755 --- a/main/social/home.php +++ b/main/social/home.php @@ -3,6 +3,7 @@ /** * @package chamilo.social * @author Julio Montoya + * @autor Alex Aragon CSS Design and Template */ /** * Initialization @@ -118,17 +119,18 @@ $social_avatar_block .= '
'; $social_avatar_block .= '
'; +//Block Menu $social_menu_block = SocialManager::show_social_menu('home'); //Search box $social_search_block = ''; -//Skill +//BLock Social Skill if (api_get_setting('allow_skills_tool') == 'true') { $social_skill_block = ''; + //Group box by age @@ -201,7 +209,6 @@ $results = GroupPortalManager::get_groups_by_age(1, false); $groups_newest = array(); - if (!empty($results)) { foreach ($results as $result) { $id = $result['id']; @@ -227,21 +234,17 @@ if (!empty($results)) { ); $result['picture_uri'] = ''; - $group_actions = ''; - $group_info= '

' . cut($result['description'], 120, true) . "

"; $groups_newest[] = array( Display::url( $result['picture_uri'], $group_url ),$result['name'],$group_info.$group_actions - ); - } } - +//Top popular $results = GroupPortalManager::get_groups_by_popularity(1, false); $groups_pop = array(); @@ -260,28 +263,24 @@ foreach ($results as $result) { } else { $result['count'] = $result['count'] . ' ' . get_lang('Members'); } - $result['name'] = Display::url( - api_ucwords(cut($result['name'], 40, true)), - $group_url - ) . Display::span( - '
' . $result['count'], - array('class' => 'box_description_group_member') - ); + $result['name'] = '
'.Display::url( + api_ucwords(cut($result['name'], 40, true)),$group_url) + .'
'.Display::return_icon('user.png','','',ICON_SIZE_TINY).$result['count'].'
'; + $picture = GroupPortalManager::get_picture_group( $id, $result['picture_uri'], 80 ); - $result['picture_uri'] = ''; - $group_actions = ''; + $result['picture_uri'] = ''; + $group_actions = ''; + $group_info= '

' . cut($result['description'], 120, true) . "

"; $groups_pop[] = array( Display::url($result['picture_uri'], $group_url), - $result['name'], - cut($result['description'], 120, true) . $group_actions + $result['name'],$group_info. $group_actions ); } + $list=count($groups_newest); if ($list > 0) { @@ -296,10 +295,20 @@ if ($list > 0) { } $social_group_block.= "
"; } - -if (count($groups_pop) > 0) { +$list=count($groups_pop); +if ($list > 0) { + $social_group_block .= '
'; $social_group_block .= '
' . get_lang('Popular') . '
'; - $social_group_block .= Display::return_sortable_grid( + + for($i = 0;$i < $list; $i++){ + $social_group_block.='
'; + $social_group_block.='
' . $groups_pop[$i][0] . '
'; + $social_group_block.='
' . $groups_pop[$i][1]; + $social_group_block.= $groups_pop[$i][2] . '
'; + $social_group_block.="
"; + } + + /*$social_group_block .= Display::return_sortable_grid( 'home_group', array(), $groups_pop, @@ -307,9 +316,9 @@ if (count($groups_pop) > 0) { array(), false, array(true, true, true, true, true) - ); + );*/ } -$social_group_block .= '
'; +$social_group_block .= '
'; $tpl = new Template(get_lang('SocialNetwork')); $tpl->assign('social_avatar_block', $social_avatar_block); diff --git a/main/social/profile.php b/main/social/profile.php index 713b5734f6..11cde65c90 100755 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -366,8 +366,43 @@ if (is_array($personal_course_list)) { //to avoid repeted courses $course_list_code = array_unique_dimensional($course_list_code); } +//Block Avatar Social +$social_avatar_block = ''; + +//Social Block Menu $social_menu_block = SocialManager::show_social_menu('shared_profile', null, $user_id, $show_full_profile); //Setting some session info @@ -385,6 +420,7 @@ foreach ($sessionList as $session) { $friend_html = listMyFriends($user_id, $link_shared ,$show_full_profile); $social_left_content = ''; +/* $personal_info = null; if (!empty($user_info['firstname']) || !empty($user_info['lastname'])) { $personal_info .= '

'.api_get_person_name($user_info['firstname'], $user_info['lastname']).'

'; @@ -423,11 +459,24 @@ if ($show_full_profile) { } $personal_info .= ''; } +*/ +//Social Block Wall $wallSocialAddPost = wallSocialAddPost(); -$social_right_content = SocialManager::social_wrapper_div($wallSocialAddPost, 5); +$social_wall_block = $wallSocialAddPost; + +//Social Post Wall +$post_wall = wallSocialPost($my_user_id,$friendId) ; +$social_post_wall_block = ''; -$social_right_content .= wallSocialPost($my_user_id, $friendId); $socialAutoExtendLink = Display::url( get_lang('SeeMore'), $socialAjaxUrl . '?u='. $my_user_id . '&a=listWallMessage&start=10&length=5', @@ -436,22 +485,23 @@ $socialAutoExtendLink = Display::url( ) ); -$socialRightInformation = SocialManager::social_wrapper_div($personal_info, 4); +/* $socialRightInformation = SocialManager::social_wrapper_div($personal_info, 4); */ //$social_right_content .= SocialManager::social_wrapper_div($wallSocial, 5); if ($show_full_profile) { - // Extra information + // Block Extra information $t_uf = Database :: get_main_table(TABLE_MAIN_USER_FIELD); $t_ufo = Database :: get_main_table(TABLE_MAIN_USER_FIELD_OPTIONS); $extra_user_data = UserManager::get_extra_user_data($user_id); $extra_information = ''; if (is_array($extra_user_data) && count($extra_user_data)>0 ) { - $extra_information .= '

'.get_lang('ExtraInformation').'

'; - $extra_information .=''; //social-profile-info } - // if there are information to show + + //If there are information to show Block Extra Information + if (!empty($extra_information_value)) { - $socialRightInformation .= SocialManager::social_wrapper_div($extra_information, 4); + $social_extra_info_block .= $extra_information; } // MY GROUPS $results = GroupPortalManager::get_groups_by_user($my_user_id, 0); $grid_my_groups = array(); $max_numbers_of_group = 4; + if (is_array($results) && count($results) > 0) { $i = 1; foreach ($results as $result) { @@ -586,6 +639,7 @@ if ($show_full_profile) { } } + if (count($grid_my_groups) > 0) { $my_groups = ''; $count_groups = 0; @@ -594,7 +648,8 @@ if ($show_full_profile) { } else { $count_groups = count($results); } - $my_groups .= '

'.get_lang('MyGroups').' ('.$count_groups.')

'; + $my_groups .= '
'; + $my_groups .= '
'.get_lang('MyGroups').' ('.$count_groups.')
'; if ($i > $max_numbers_of_group) { if (api_get_user_id() == $user_id) { @@ -609,34 +664,29 @@ if ($show_full_profile) { .'
'; } } - /* - Display::display_sortable_grid( - 'shared_profile_mygroups', - array(), - $grid_my_groups, - array('hide_navigation'=>true, 'per_page' => 2), - $query_vars, - false, - array(true, true, true,false) - ); - */ + $total = count($grid_my_groups); $i = 1; foreach($grid_my_groups as $group) { + $my_groups .= '
'; $my_groups .= $group[0]; + $my_groups .= '
'; if ($i < $total) { $my_groups .= ', '; } $i++; } - $socialRightInformation .= SocialManager::social_wrapper_div($my_groups, 4); + $my_groups .= '
'; + //Block My Groups + $social_group_info_block .= $my_groups; } $my_courses = null; // COURSES LIST if ( is_array($list) ) { - $my_courses .= '

'.api_ucfirst(get_lang('MyCourses')).'

'; - $my_courses .= ''; + + //Block Social Course + + $social_course_block .= $my_courses; } + //Block Social Sessions + + $sessions = '
'; + $sessions .= '
'.api_ucfirst(get_lang('MySessions')).'
'; + $sessions .= '
'.$htmlSessionList.'
'; + $sessions .= '
'; + $social_session_block .= $sessions; - $sessions = '

'.api_ucfirst(get_lang('MySessions')).'

'; - $sessions .= ""; - $socialRightInformation .= SocialManager::social_wrapper_div($sessions, 4); + // Block Social User Feeds - // user feeds $user_feeds = SocialManager::get_user_feeds($user_id); + if (!empty($user_feeds)) { - $rss = '

'.get_lang('RSSFeeds').'

'; - $rss .= ''; - $socialRightInformation .= SocialManager::social_wrapper_div($rss, 4); + $rss = ''; + $social_rss_block .= $rss; + + } + + //BLock Social Skill + if (api_get_setting('allow_skills_tool') == 'true') { + $social_skill_block = ''; } + //--Productions $production_list = UserManager::build_production_list($user_id); @@ -782,10 +911,17 @@ $social_right_content .= MessageManager::generate_invitation_form('send_invitati $tpl = new Template(get_lang('Social')); $tpl->assign('social_avatar_block', $social_avatar_block); $tpl->assign('social_menu_block', $social_menu_block); -$tpl->assign('social_right_content', $social_right_content); +$tpl->assign('social_wall_block', $social_wall_block); +$tpl->assign('social_post_wall_block', $social_post_wall_block); +$tpl->assign('social_extra_info_block', $social_extra_info_block); +$tpl->assign('social_course_block', $social_course_block); +$tpl->assign('social_group_info_block', $social_group_info_block); +$tpl->assign('social_rss_block', $social_rss_block); +$tpl->assign('social_skill_block', $social_skill_block); +$tpl->assign('social_session_block', $social_session_block); $tpl->assign('socialRightInformation', $socialRightInformation); $tpl->assign('socialAutoExtendLink', $socialAutoExtendLink); -$social_layout = $tpl->get_template('social/home.tpl'); +$social_layout = $tpl->get_template('social/profile.tpl'); $tpl->display($social_layout); /* @@ -853,16 +989,18 @@ function listMyFriends($user_id, $link_shared, $show_full_profile) function wallSocialAddPost() { - $html = ''; - $html .= '

' . get_lang('SocialWall') . '

'; + $html = ''; return $html; } @@ -876,7 +1014,7 @@ function wallSocialPost($userId, $friendId) $post = $array[$i]['html']; $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $array[$i]['id']); - $html .= SocialManager::social_wrapper_div($post.$comment, 5); + $html .= $post.$comment; } return $html; diff --git a/main/template/default/social/home.tpl b/main/template/default/social/home.tpl index 792bd484af..b6dd19b23a 100644 --- a/main/template/default/social/home.tpl +++ b/main/template/default/social/home.tpl @@ -19,7 +19,6 @@
-
{% endblock %} \ No newline at end of file diff --git a/main/template/default/social/profile.tpl b/main/template/default/social/profile.tpl new file mode 100644 index 0000000000..f03cf2290b --- /dev/null +++ b/main/template/default/social/profile.tpl @@ -0,0 +1,36 @@ +{% extends template ~ "/layout/layout_1_col.tpl" %} + +{% block content %} +
+
+ {{ social_avatar_block }} + {{ social_extra_info_block }} + +
+
+ {{ social_wall_block }} + {{ social_post_wall_block }} + {{ socialAutoExtendLink }} + + + + +
+
+ + {{ social_skill_block }} + {{ social_group_info_block }} + {{ social_course_block }} + {{ social_session_block }} + {{ social_rss_block }} + {{ socialRightInformation}} + +
+
+{% endblock %} \ No newline at end of file