Fix misalignment issue in whoisonline when showing more users - refs #6888

1.9.x
Yannick Warnier 12 years ago
parent 202bb478bd
commit 6f7f0130b7
  1. 2
      main/inc/ajax/online.ajax.php
  2. 9
      main/inc/lib/social.lib.php

@ -24,7 +24,7 @@ switch($action) {
$user_list = who_is_online($page_rows, $images_to_show); $user_list = who_is_online($page_rows, $images_to_show);
} }
if (!empty($user_list)) { if (!empty($user_list)) {
echo SocialManager::display_user_list($user_list); echo SocialManager::display_user_list($user_list, false);
exit; exit;
} }
} }

@ -795,10 +795,11 @@ class SocialManager extends UserManager
/** /**
* Displays a sortable table with the list of online users. * Displays a sortable table with the list of online users.
* @param array $user_list The list of users to be shown * @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 * @return string HTML block or null if and ID was defined
* @assert (null) === false * @assert (null) === false
*/ */
public static function display_user_list($user_list) public static function display_user_list($user_list, $wrap = true)
{ {
$html = null; $html = null;
if (isset($_GET['id']) or count($user_list) < 1) { if (isset($_GET['id']) or count($user_list) < 1) {
@ -818,6 +819,7 @@ class SocialManager extends UserManager
$course_url = '&amp;cidReq='.Security::remove_XSS($_GET['cidReq']); $course_url = '&amp;cidReq='.Security::remove_XSS($_GET['cidReq']);
} }
if ($wrap) {
if ($add_row) { if ($add_row) {
$html .='<div class="row">'; $html .='<div class="row">';
} }
@ -825,6 +827,7 @@ class SocialManager extends UserManager
$html .= '<div class="span'.$column_size.'">'; $html .= '<div class="span'.$column_size.'">';
$html .= '<ul id="online_grid_container" class="thumbnails">'; $html .= '<ul id="online_grid_container" class="thumbnails">';
}
foreach ($user_list as $uid) { foreach ($user_list as $uid) {
$user_info = api_get_user_info($uid); $user_info = api_get_user_info($uid);
@ -857,11 +860,13 @@ class SocialManager extends UserManager
} }
$counter = $_SESSION['who_is_online_counter']; $counter = $_SESSION['who_is_online_counter'];
if ($wrap) {
$html .= '</ul></div>'; $html .= '</ul></div>';
}
if (count($user_list) >= 9) { if (count($user_list) >= 9) {
$html .= '<div class="span'.$column_size.'"><a class="btn btn-large" id="link_load_more_items" data_link="'.$counter.'" >'.get_lang('More').'</a></div>'; $html .= '<div class="span'.$column_size.'"><a class="btn btn-large" id="link_load_more_items" data_link="'.$counter.'" >'.get_lang('More').'</a></div>';
} }
if ($add_row) { if ($wrap && $add_row) {
$html .= '</div>'; $html .= '</div>';
} }
return $html; return $html;

Loading…
Cancel
Save