From 6f7f0130b7e5e87c488ae2c46528c1150a67174f Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 25 Dec 2013 14:44:54 -0500 Subject: [PATCH] Fix misalignment issue in whoisonline when showing more users - refs #6888 --- main/inc/ajax/online.ajax.php | 2 +- main/inc/lib/social.lib.php | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/main/inc/ajax/online.ajax.php b/main/inc/ajax/online.ajax.php index aad28a8097..9c110bf1c9 100644 --- a/main/inc/ajax/online.ajax.php +++ b/main/inc/ajax/online.ajax.php @@ -24,7 +24,7 @@ switch($action) { $user_list = who_is_online($page_rows, $images_to_show); } if (!empty($user_list)) { - echo SocialManager::display_user_list($user_list); + echo SocialManager::display_user_list($user_list, false); exit; } } diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index 84731b8f38..2951008f57 100644 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -795,10 +795,11 @@ class SocialManager extends UserManager /** * Displays a sortable table with the list of online users. * @param array $user_list The list of users to be shown + * @param bool $wrap Whether we want the function to wrap the spans list in a div or not * @return string HTML block or null if and ID was defined * @assert (null) === false */ - public static function display_user_list($user_list) + public static function display_user_list($user_list, $wrap = true) { $html = null; if (isset($_GET['id']) or count($user_list) < 1) { @@ -818,13 +819,15 @@ class SocialManager extends UserManager $course_url = '&cidReq='.Security::remove_XSS($_GET['cidReq']); } - if ($add_row) { - $html .='
'; - } + if ($wrap) { + if ($add_row) { + $html .='
'; + } - $html .= '
'; + $html .= '
'; - $html .= '
    '; + $html .= '
      '; + } foreach ($user_list as $uid) { $user_info = api_get_user_info($uid); @@ -857,11 +860,13 @@ class SocialManager extends UserManager } $counter = $_SESSION['who_is_online_counter']; - $html .= '
'; + if ($wrap) { + $html .= '
'; + } if (count($user_list) >= 9) { $html .= ''; } - if ($add_row) { + if ($wrap && $add_row) { $html .= '
'; } return $html;