Minor - moving to another div the user picture using wells

skala
Julio Montoya 13 years ago
parent 66b4f43611
commit 04698fe011
  1. 1
      index.php
  2. 37
      main/inc/lib/userportal.lib.php
  3. 3
      main/template/default/layout/layout_2_col.tpl
  4. 1
      user_portal.php

@ -140,6 +140,7 @@ $controller->set_login_form();
//@todo move this inside the IndexManager //@todo move this inside the IndexManager
if (!api_is_anonymous()) { if (!api_is_anonymous()) {
$controller->tpl->assign('profile_block', $controller->return_profile_block()); $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()) { if (api_is_platform_admin()) {
$controller->tpl->assign('course_block', $controller->return_course_block()); $controller->tpl->assign('course_block', $controller->return_course_block());

@ -623,17 +623,17 @@ class IndexManager {
/** /**
* @todo use the template system * @todo use the template system
*/ */
function show_right_block($title, $content, $id = null) { function show_right_block($title, $content, $id = null, $params = null) {
$id_label = null;
if (!empty($id)) { if (!empty($id)) {
$id_label = " id = $id "; $params['id'] = $id;
} }
$html= '<div '.$id_label.' class="well sidebar-nav">'; $params['class'] = 'well sidebar-nav';
$html = null;
if (!empty($title)) { if (!empty($title)) {
$html.= '<h4>'.$title.'</h4>'; $html.= '<h4>'.$title.'</h4>';
} }
$html.= $content; $html.= $content;
$html.= '</div>'; $html = Display::div($html, $params);
return $html; return $html;
} }
@ -707,13 +707,7 @@ class IndexManager {
return $html; return $html;
} }
function return_profile_block() { function return_user_image_block() {
$html = '';
$user_id = api_get_user_id();
if (empty($user_id)) {
return;
}
//Always show the user image //Always show the user image
$img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true); $img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true);
@ -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" '); $img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 50, USER_IMAGE_SIZE_MEDIUM, ' width="90" height="90" ');
$profile_content .= '<ul class="menulist">';
if (api_get_setting('allow_social_tool') == 'true') { if (api_get_setting('allow_social_tool') == 'true') {
if (!$no_image) { if (!$no_image) {
$profile_content .='<li><a class="thumbnail" href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' ></a></li>'; $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 { } else {
$profile_content .='<li><a class="thumbnail" href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].'></a></li>'; $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;'));
return $html;
}
function return_profile_block() {
$html = '';
$user_id = api_get_user_id();
if (empty($user_id)) {
return;
}
$profile_content .= '<ul class="menulist">';
// @todo Add a platform setting to add the user image. // @todo Add a platform setting to add the user image.
if (api_get_setting('allow_message_tool') == 'true') { if (api_get_setting('allow_message_tool') == 'true') {

@ -67,6 +67,9 @@
{% endif %} {% endif %}
{# User picture #} {# User picture #}
{{ user_image_block }}
{# User Profile links #}
{{ profile_block }} {{ profile_block }}
{# Course block - admin #} {# Course block - admin #}

@ -177,6 +177,7 @@ if(!empty($some_activex) || !empty($some_plugins)){
} }
$controller->tpl->assign('profile_block', $controller->return_profile_block()); $controller->tpl->assign('profile_block', $controller->return_profile_block());
$controller->tpl->assign('user_image_block', $controller->return_user_image_block());
$controller->tpl->assign('course_block', $controller->return_course_block()); $controller->tpl->assign('course_block', $controller->return_course_block());
$controller->tpl->assign('navigation_course_links', $controller->return_navigation_links()); $controller->tpl->assign('navigation_course_links', $controller->return_navigation_links());
$controller->tpl->assign('reservation_block', $controller->return_reservation_block()); $controller->tpl->assign('reservation_block', $controller->return_reservation_block());

Loading…
Cancel
Save