diff --git a/index.php b/index.php index 93093b00cb..3351d13074 100644 --- a/index.php +++ b/index.php @@ -140,6 +140,7 @@ $controller->set_login_form(); //@todo move this inside the IndexManager if (!api_is_anonymous()) { $controller->tpl->assign('profile_block', $controller->return_profile_block()); + $controller->tpl->assign('user_image_block', $controller->return_user_image_block()); if (api_is_platform_admin()) { $controller->tpl->assign('course_block', $controller->return_course_block()); diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index da97a684f6..ef298df28c 100644 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -623,17 +623,17 @@ class IndexManager { /** * @todo use the template system */ - function show_right_block($title, $content, $id = null) { - $id_label = null; - if (!empty($id)) { - $id_label = " id = $id "; + function show_right_block($title, $content, $id = null, $params = null) { + if (!empty($id)) { + $params['id'] = $id; } - $html= '
'; + $html.= $content; + $html = Display::div($html, $params); return $html; } @@ -706,15 +706,9 @@ class IndexManager { } return $html; } - - function return_profile_block() { - $html = ''; - $user_id = api_get_user_id(); - - if (empty($user_id)) { - return; - } - + + function return_user_image_block() { + //Always show the user image $img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true); $no_image = false; @@ -723,15 +717,26 @@ class IndexManager { } $img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 50, USER_IMAGE_SIZE_MEDIUM, ' width="90" height="90" '); - $profile_content .= '