diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index a728182c16..7f7b6b0499 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -10490,3 +10490,7 @@ ul.dropdown-menu.inner > li > a { top:-5px; left: -2px; } + +.production-no-padding > .files-production > ul { + padding-left: 0px; +} \ No newline at end of file diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index 39fa12a0b2..b419fbe6a8 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -916,6 +916,7 @@ class SocialManager extends UserManager ) { $user_id = (int) $user_id; $group_id = (int) $group_id; + $settingExtendedProfileEnabled = api_get_setting('extended_profile'); if (empty($user_id)) { $user_id = api_get_user_id(); @@ -960,6 +961,7 @@ class SocialManager extends UserManager $portfolioIcon = Display::return_icon('wiki_task.png', get_lang('Portfolio')); $personalDataIcon = Display::return_icon('database.png', get_lang('PersonalDataReport')); $messageSocialIcon = Display::return_icon('promoted_message.png', get_lang('PromotedMessages')); + $portfolio = Display::return_icon('vcard.png', get_lang('Portfolio ')); $forumCourseId = api_get_configuration_value('global_forums_course_id'); $groupUrl = api_get_path(WEB_CODE_PATH).'social/groups.php'; @@ -991,6 +993,16 @@ class SocialManager extends UserManager '.$messagesIcon.' '.get_lang('Messages').$count_unread_message.' '; + if ($settingExtendedProfileEnabled == true) { + + $active = $show === 'portfolio' ? 'active' : null; + $links .= ' +
  • + + '.$portfolio.' '.get_lang('Portfolio').' + +
  • '; + } // Invitations $active = $show === 'invitations' ? 'active' : null; @@ -1112,6 +1124,15 @@ class SocialManager extends UserManager '.$messagesIcon.' '.get_lang('Messages').$count_unread_message.' '; + if ($settingExtendedProfileEnabled == true) { + $active = $show === 'portfolio' ? 'active' : null; + $links .= ' +
  • + + '.$portfolio.' '.get_lang('Portfolio').' + +
  • '; + } $active = $show === 'invitations' ? 'active' : null; $links .= '
  • @@ -1204,7 +1225,15 @@ class SocialManager extends UserManager 'data-title' => $sendMessageText, ] ); - $links .= '
  • '; + if($settingExtendedProfileEnabled == true) { + $active = $show === 'portfolio' ? 'active' : null; + $links .= ' +
  • + + '.$portfolio.' '.get_lang('Portfolio').' + +
  • '; + } if (api_get_configuration_value('allow_portfolio_tool')) { $links .= ' @@ -2414,6 +2443,119 @@ class SocialManager extends UserManager return $html; } + /** + * Show middle section for Portfolio extended. + * Must be active on main/admin/settings.php?category=User into extended_profile + * + * @param string $urlForm + * + * @return string + */ + public static function getWallFormPortfolio($urlForm) + { + $userId = (int) isset($_GET['u']) ? $_GET['u'] : ''; + $userId = ($userId!=0) ? $userId : api_get_user_id(); + $user_info = api_get_user_info($userId); + $portfolioName = ' '.$userId; + $friend = true; + if($userId != api_get_user_id()){ + $portfolioName = $user_info['complete_name']; + $friend = self::get_relation_between_contacts(api_get_user_id(), $userId); + } + if ($friend == 0) { + /* if has not relation, get current user */ + $userId = api_get_user_id(); + $user_info = api_get_user_info($userId); + } + // Images uploaded by course + $more_info = ''; + + // Productions + $production_list = UserManager::build_production_list($userId); + + $form = new FormValidator( + 'social_wall_main', + 'post', + $urlForm.$userId, + null, + ['enctype' => 'multipart/form-data'], + FormValidator::LAYOUT_HORIZONTAL + ); + + $socialWallPlaceholder = isset($_GET['u']) ? get_lang('SocialWallWriteNewPostToFriend') : get_lang( + 'SocialWallWhatAreYouThinkingAbout' + ); + + if (!empty($user_info['competences']) || !empty($user_info['diplomas']) + || !empty($user_info['openarea']) || !empty($user_info['teach'])) { + // $more_info .= '

    '.get_lang('MoreInformation').'

    '; + // MY PERSONAL OPEN AREA + if (!empty($user_info['openarea'])) { + $more_info .= '
    '.get_lang('MyPersonalOpenArea').'
    '; + $more_info .= '
    '.$user_info['openarea'].'
    '; + $more_info .= '
    '; + } + // MY COMPETENCES + if (!empty($user_info['competences'])) { + $more_info .= '
    '.get_lang('MyCompetences').'
    '; + $more_info .= '
    '.$user_info['competences'].'
    '; + $more_info .= '
    '; + } + + if (!empty($user_info['diplomas'])) { + $more_info .= '
    '.get_lang('MyDiplomas').'
    '; + $more_info .= '
    '.$user_info['diplomas'].'
    '; + $more_info .= '
    '; + } + + // MY PRODUCTIONS + $product_content = ''; + if (!empty($production_list)) { + $more_info .= '
    '.get_lang('MyProductions').'
    '; + $more_info .= '
    '.$production_list.'
    '; + $more_info .= '
    '; + }else{ + $more_info = "Nada aqui"; + } + + // WHAT I AM ABLE TO TEACH + if (!empty($user_info['teach'])) { + $more_info .= '
    '.get_lang('MyTeach').'
    '; + $more_info .= '
    '.$user_info['teach'].'
    '; + $more_info .= '
    '; + } + //$socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4); + } + + $form->addTextarea( + 'social_wall_new_msg_main', + null, + [ + 'placeholder' => $socialWallPlaceholder, + 'cols-size' => [1, 12, 1], + 'aria-label' => $socialWallPlaceholder, + ] + ); + $form->addHtml('
    '); + $form->addHtml('
    '); + $form->addFile('picture', get_lang('UploadFile'), ['custom' => true]); + $form->addHtml('
    '); + $form->addHtml('
    '); + $form->addButtonSend( + get_lang('Post'), + 'wall_post_button', + false, + [ + 'cols-size' => [1, 10, 1], + 'custom' => true, + ] + ); + $form->addHtml('
    '); + $form->addHtml('
    '); + $form->addHidden('url_content', ''); + return Display::panel($more_info, get_lang('Portfolio')); + } + /** * @param int $userId * @param int $start diff --git a/main/social/profile.php b/main/social/profile.php index cca3f90ab0..9c4ba21480 100755 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -20,7 +20,8 @@ if (api_get_setting('allow_social_tool') !== 'true') { header('Location: '.$url); exit; } - +$portfolioRequest = (isset($_GET['p']))?true:false; +$productionString = ''; $bossId = isset($_REQUEST['sup']) ? (int) $_REQUEST['sup'] : 0; $user_id = api_get_user_id(); @@ -141,6 +142,7 @@ $sessionList = []; // My friends $friend_html = SocialManager::listMyFriendsBlock($user_id, $link_shared); $addPostForm = SocialManager::getWallForm(api_get_self()); +$addPostFormPortfolio = SocialManager::getWallFormPortfolio(api_get_self()); $posts = SocialManager::getWallMessagesByUser($friendId); $socialAutoExtendLink = SocialManager::getAutoExtendLink($user_id, $countPost); @@ -150,6 +152,7 @@ $htmlHeadXtra[] = SocialManager::getScriptToGetOpenGraph(); $socialRightInformation = ''; $listInvitations = ''; +$more_info = ''; if ($show_full_profile) { $social_group_info_block = SocialManager::getGroupBlock($friendId); @@ -223,13 +226,18 @@ if ($show_full_profile) { } } + // MY PRODUCTIONS // Productions $production_list = UserManager::build_production_list($user_id); $product_content = ''; if (!empty($production_list)) { $product_content .= '

    '.get_lang('MyProductions').'

    '; $product_content .= $production_list; - $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4); + // $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4); + $more_info_1 = '
    '.get_lang('MyProductions').'
    '; + $more_info_1 .= '
    '.$production_list.'
    '; + $more_info_1 .= '
    '; + $productionString .= $more_info_1; } $images_uploaded = null; @@ -238,8 +246,14 @@ if ($show_full_profile) { if (!empty($user_info['competences']) || !empty($user_info['diplomas']) || !empty($user_info['openarea']) || !empty($user_info['teach'])) { $more_info .= '

    '.get_lang('MoreInformation').'

    '; - if (!empty($user_info['competences'])) { + // MY PERSONAL OPEN AREA + if (!empty($user_info['openarea'])) { + $more_info .= '
    '.get_lang('MyPersonalOpenArea').'
    '; + $more_info .= '
    '.$user_info['openarea'].'
    '; $more_info .= '
    '; + } + // MY COMPETENCES + if (!empty($user_info['competences'])) { $more_info .= '
    '.get_lang('MyCompetences').'
    '; $more_info .= '
    '.$user_info['competences'].'
    '; $more_info .= '
    '; @@ -249,11 +263,10 @@ if ($show_full_profile) { $more_info .= '
    '.$user_info['diplomas'].'
    '; $more_info .= '
    '; } - if (!empty($user_info['openarea'])) { - $more_info .= '
    '.get_lang('MyPersonalOpenArea').'
    '; - $more_info .= '
    '.$user_info['openarea'].'
    '; - $more_info .= '
    '; - } + // MY PRODUCTIONS + $more_info .= $productionString; + + // WHAT I AM ABLE TO TEACH if (!empty($user_info['teach'])) { $more_info .= '
    '.get_lang('MyTeach').'
    '; $more_info .= '
    '.$user_info['teach'].'
    '; @@ -275,7 +288,11 @@ SocialManager::setSocialUserBlock( $tpl->assign('social_friend_block', $friend_html); $tpl->assign('social_menu_block', $menu); -$tpl->assign('add_post_form', $addPostForm); +if($portfolioRequest == true && api_get_setting('extended_profile') == true){ + $tpl->assign('add_post_form', $addPostFormPortfolio); +}else{ + $tpl->assign('add_post_form', $addPostForm); +} $tpl->assign('posts', $posts); $tpl->assign('social_course_block', $social_course_block); $tpl->assign('social_group_info_block', $social_group_info_block);