|
|
|
|
@ -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.' |
|
|
|
|
</a> |
|
|
|
|
</li>'; |
|
|
|
|
if ($settingExtendedProfileEnabled == true) { |
|
|
|
|
|
|
|
|
|
$active = $show === 'portfolio' ? 'active' : null; |
|
|
|
|
$links .= ' |
|
|
|
|
<li class="portfolio-icon '.$active.'"> |
|
|
|
|
<a href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$user_id.'&p=1"> |
|
|
|
|
'.$portfolio.' '.get_lang('Portfolio').' |
|
|
|
|
</a> |
|
|
|
|
</li>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Invitations |
|
|
|
|
$active = $show === 'invitations' ? 'active' : null; |
|
|
|
|
@ -1112,6 +1124,15 @@ class SocialManager extends UserManager |
|
|
|
|
'.$messagesIcon.' '.get_lang('Messages').$count_unread_message.' |
|
|
|
|
</a> |
|
|
|
|
</li>'; |
|
|
|
|
if ($settingExtendedProfileEnabled == true) { |
|
|
|
|
$active = $show === 'portfolio' ? 'active' : null; |
|
|
|
|
$links .= ' |
|
|
|
|
<li class="portfolio-icon '.$active.'"> |
|
|
|
|
<a href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$user_id.'&p=1"> |
|
|
|
|
'.$portfolio.' '.get_lang('Portfolio').' |
|
|
|
|
</a> |
|
|
|
|
</li>'; |
|
|
|
|
} |
|
|
|
|
$active = $show === 'invitations' ? 'active' : null; |
|
|
|
|
$links .= ' |
|
|
|
|
<li class="invitations-icon'.$active.'"> |
|
|
|
|
@ -1204,7 +1225,15 @@ class SocialManager extends UserManager |
|
|
|
|
'data-title' => $sendMessageText, |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
$links .= '</li>'; |
|
|
|
|
if($settingExtendedProfileEnabled == true) { |
|
|
|
|
$active = $show === 'portfolio' ? 'active' : null; |
|
|
|
|
$links .= ' |
|
|
|
|
<li class="portfolio-icon '.$active.'"> |
|
|
|
|
<a href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$user_id.'&p=1"> |
|
|
|
|
'.$portfolio.' '.get_lang('Portfolio').' |
|
|
|
|
</a> |
|
|
|
|
</li>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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 .= '<div><h3>'.get_lang('MoreInformation').'</h3></div>'; |
|
|
|
|
// MY PERSONAL OPEN AREA |
|
|
|
|
if (!empty($user_info['openarea'])) { |
|
|
|
|
$more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>'; |
|
|
|
|
$more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>'; |
|
|
|
|
$more_info .= '<br />'; |
|
|
|
|
} |
|
|
|
|
// MY COMPETENCES |
|
|
|
|
if (!empty($user_info['competences'])) { |
|
|
|
|
$more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>'; |
|
|
|
|
$more_info .= '<div class="social-profile-extended">'.$user_info['competences'].'</div>'; |
|
|
|
|
$more_info .= '<br />'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($user_info['diplomas'])) { |
|
|
|
|
$more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>'; |
|
|
|
|
$more_info .= '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>'; |
|
|
|
|
$more_info .= '<br />'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// MY PRODUCTIONS |
|
|
|
|
$product_content = ''; |
|
|
|
|
if (!empty($production_list)) { |
|
|
|
|
$more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyProductions').'</strong></div>'; |
|
|
|
|
$more_info .= '<div class="social-profile-extended">'.$production_list.'</div>'; |
|
|
|
|
$more_info .= '<br />'; |
|
|
|
|
}else{ |
|
|
|
|
$more_info = "Nada aqui"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// WHAT I AM ABLE TO TEACH |
|
|
|
|
if (!empty($user_info['teach'])) { |
|
|
|
|
$more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>'; |
|
|
|
|
$more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>'; |
|
|
|
|
$more_info .= '<br />'; |
|
|
|
|
} |
|
|
|
|
//$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('<div class="form-group">'); |
|
|
|
|
$form->addHtml('<div class="col-sm-6">'); |
|
|
|
|
$form->addFile('picture', get_lang('UploadFile'), ['custom' => true]); |
|
|
|
|
$form->addHtml('</div>'); |
|
|
|
|
$form->addHtml('<div class="col-sm-6 "><div class="pull-right">'); |
|
|
|
|
$form->addButtonSend( |
|
|
|
|
get_lang('Post'), |
|
|
|
|
'wall_post_button', |
|
|
|
|
false, |
|
|
|
|
[ |
|
|
|
|
'cols-size' => [1, 10, 1], |
|
|
|
|
'custom' => true, |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
$form->addHtml('</div></div>'); |
|
|
|
|
$form->addHtml('</div>'); |
|
|
|
|
$form->addHidden('url_content', ''); |
|
|
|
|
return Display::panel($more_info, get_lang('Portfolio')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param int $userId |
|
|
|
|
* @param int $start |
|
|
|
|
|