diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php
index 7230b96ec0..bc7c713ee4 100755
--- a/main/inc/lib/social.lib.php
+++ b/main/inc/lib/social.lib.php
@@ -884,16 +884,14 @@ class SocialManager extends UserManager
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT * FROM $user_table WHERE user_id = ".$safe_user_id;
$result = Database::query($sql);
+ $html = null;
if (Database::num_rows($result) == 1) {
$user_object = Database::fetch_object($result);
$alt = GetFullUserName($user_id).($_SESSION['_uid'] == $user_id ? ' ('.get_lang('Me').')' : '');
-
$status = get_status_from_code($user_object->status);
-
$interbreadcrumb[] = array('url' => 'whoisonline.php', 'name' => get_lang('UsersOnLineList'));
- Display::display_header($alt, null, $alt);
- echo '
';
+ $html .= '
';
-
+ $html .= '
';
if (api_get_setting('show_email_addresses') == 'true') {
- echo Display::encrypted_mailto_link($user_object->email, $user_object->email).'
';
+ $html .= Display::encrypted_mailto_link($user_object->email, $user_object->email).'
';
}
if ($user_object->competences) {
- echo Display::page_subheader(get_lang('MyCompetences'));
- echo ''.$user_object->competences.'
';
+ $html .= Display::page_subheader(get_lang('MyCompetences'));
+ $html .= ''.$user_object->competences.'
';
}
if ($user_object->diplomas) {
- echo Display::page_subheader(get_lang('MyDiplomas'));
- echo ''.$user_object->diplomas.'
';
+ $html .= Display::page_subheader(get_lang('MyDiplomas'));
+ $html .= ''.$user_object->diplomas.'
';
}
if ($user_object->teach) {
- echo Display::page_subheader(get_lang('MyTeach'));
- echo ''.$user_object->teach.'
';
+ $html .= Display::page_subheader(get_lang('MyTeach'));
+ $html .= ''.$user_object->teach.'
';
}
SocialManager::display_productions($user_object->user_id);
if ($user_object->openarea) {
- echo Display::page_subheader(get_lang('MyPersonalOpenArea'));
- echo ''.$user_object->openarea.'
';
+ $html .= Display::page_subheader(get_lang('MyPersonalOpenArea'));
+ $html .= ''.$user_object->openarea.'
';
}
} else {
- Display::display_header(get_lang('UsersOnLineList'));
- echo '';
- echo get_lang('UsersOnLineList');
- echo '
';
+ $html .= '';
+ $html .= get_lang('UsersOnLineList');
+ $html .= '
';
}
+
+ return $html;
}
/**
- * Display productions in whoisonline
+ * Display productions in who is online
* @param int $user_id User id
*/
public static function display_productions($user_id)
@@ -960,6 +958,7 @@ class SocialManager extends UserManager
$sysdir = $sysdir_array['dir'];
$webdir_array = UserManager::get_user_picture_path_by_id($user_id, 'web', true);
$webdir = $webdir_array['dir'];
+
if (!is_dir($sysdir)) {
mkdir($sysdir, api_get_permissions_for_new_directories(), true);
}
@@ -988,6 +987,11 @@ class SocialManager extends UserManager
}
}
+ /**
+ * @param string $content
+ * @param string $span_count
+ * @return string
+ */
public static function social_wrapper_div($content, $span_count)
{
$span_count = intval($span_count);
diff --git a/whoisonline.php b/whoisonline.php
index dd1a7bbeaa..4d6f4a0038 100755
--- a/whoisonline.php
+++ b/whoisonline.php
@@ -142,7 +142,7 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
header("Location: ".api_get_path(WEB_CODE_PATH)."social/profile.php?u=".intval($_GET['id']));
exit;
} else {
- SocialManager::display_individual_user($_GET['id']);
+ $social_right_content .= SocialManager::display_individual_user($_GET['id']);
}
}
} else {
@@ -164,4 +164,4 @@ if (api_get_setting('allow_social_tool') == 'true' && !api_is_anonymous()) {
$tpl->assign('header', get_lang('UsersOnLineList'));
$tpl->assign('content', $content);
$tpl->display_one_col_template();
-}
\ No newline at end of file
+}