Skip to content

Commit

Permalink
Only show user image if is not anonymous.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Feb 25, 2015
1 parent 37fa195 commit 497bf58
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions main/inc/lib/userportal.lib.php
Expand Up @@ -166,8 +166,10 @@ function display_anonymous_right_menu() {
echo self::return_notice();
}

function return_teacher_link() {
function return_teacher_link()
{
$html = '';
$show_menu = false;
if (!empty($this->user_id)) {
// tabs that are deactivated are added here

Expand Down Expand Up @@ -803,16 +805,37 @@ function return_reservation_block() {
return $html;
}

function return_user_image_block() {
$img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true);
$img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 50, USER_IMAGE_SIZE_MEDIUM, ' width="90" height="90" ');
$profile_content = null;
if (api_get_setting('allow_social_tool') == 'true') {
$profile_content .='<a style="text-align:center" href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' ></a>';
} else {
$profile_content .='<a style="text-align:center" href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].'></a>';
/**
* @return null|string
*/
public function return_user_image_block()
{
$html = null;
if (!api_is_anonymous()) {
$img_array = UserManager::get_user_picture_path_by_id(
api_get_user_id(),
'web', true, true
);
$img_array = UserManager::get_picture_user(
api_get_user_id(),
$img_array['file'],
50,
USER_IMAGE_SIZE_MEDIUM,
' width="90" height="90" '
);
$profile_content = null;
if (api_get_setting('allow_social_tool') == 'true') {
$profile_content .= '<a style="text-align:center" href="' . api_get_path(WEB_PATH) . 'main/social/home.php"><img src="' . $img_array['file'] . '" ' . $img_array['style'] . ' ></a>';
} else {
$profile_content .= '<a style="text-align:center" href="' . api_get_path(WEB_PATH) . 'main/auth/profile.php"><img title="' . get_lang('EditProfile') . '" src="' . $img_array['file'] . '" ' . $img_array['style'] . '></a>';
}
$html = self::show_right_block(
null,
$profile_content,
'user_image_block',
array('style' => 'text-align:center;')
);
}
$html = self::show_right_block(null, $profile_content, 'user_image_block', array('style' => 'text-align:center;'));
return $html;
}

Expand Down

0 comments on commit 497bf58

Please sign in to comment.