';
$social_right_content .= $results;
}
$grid_groups = array();
if (is_array($groups) && count($groups)>0) {
$social_right_content .= '
';
$social_right_content .= Display::page_subheader(get_lang('Groups'));
foreach($groups as $group) {
$group['name'] = Security::remove_XSS($group['name'], STUDENT, true);
$$group['description'] = Security::remove_XSS($group['description'], STUDENT, true);
$id = $group['id'];
$url_open = '
';
$url_close = '';
$name = Text::cut($group['name'],25,true);
$count_users_group = count($usergroup->get_all_users_by_group($id));
if ($count_users_group == 1 ) {
$count_users_group = $count_users_group.' '.get_lang('Member');
} else {
$count_users_group = $count_users_group.' '.get_lang('Members');
}
$picture = $usergroup->get_picture_group($group['id'], $group['picture'],80);
$tags = $usergroup->get_group_tags($group['id']);
$group['picture'] = '
';
$item_0 = Display::div($group['picture'], array('class'=>'box_description_group_image'));
$members = Display::span($count_users_group, array('class'=>'box_description_group_member'));
$item_1 = Display::div(Display::tag('h3', $url_open.$name.$url_close).$members, array('class'=>'box_description_group_title'));
$item_2 = '';
$item_3 = '';
if ($group['description'] != '') {
$item_3 = '
'.Text::cut($group['description'],100,true).'
';
} else {
$item_2 = '
';
$item_3 = '
';
}
$item_4 = '
'.$tags.'
';
$item_5 = '
'.$url_open.get_lang('SeeMore').$url_close.'
';
$grid_item_2 = $item_0.$item_1.$item_2.$item_3.$item_4.$item_5;
$grid_groups[]= array('',$grid_item_2);
}
}
$visibility = array(true,true,true,true,true);
$social_right_content .= Display::return_sortable_grid('mygroups', array(), $grid_groups, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false, $visibility);
}
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);