group_space.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This script shows the group space for one specific group, possibly displaying
  5. * a list of users in the group, subscribe or unsubscribe option, tutors...
  6. *
  7. * @package chamilo.group
  8. * @todo Display error message if no group ID specified
  9. */
  10. // Name of the language file that needs to be included
  11. $language_file = 'group';
  12. require_once '../inc/global.inc.php';
  13. $current_course_tool = TOOL_GROUP;
  14. // Notice for unauthorized people.
  15. api_protect_course_script(true);
  16. /* Libraries & config files */
  17. require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
  18. require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php';
  19. /* MAIN CODE */
  20. $group_id = api_get_group_id();
  21. $user_id = api_get_user_id();
  22. $current_group = GroupManager :: get_group_properties($group_id);
  23. if (empty($current_group)) {
  24. api_not_allowed(true);
  25. }
  26. $this_section = SECTION_COURSES;
  27. $nameTools = get_lang('GroupSpace');
  28. $interbreadcrumb[] = array ('url' => 'group.php', 'name' => get_lang('Groups'));
  29. /* Ensure all private groups // Juan Carlos Raña Trabado */
  30. $forums_of_groups = get_forums_of_group($current_group['id']);
  31. $forum_state_public = 0;
  32. if (is_array($forums_of_groups)) {
  33. foreach ($forums_of_groups as $key => $value) {
  34. if ($value['forum_group_public_private'] == 'public') {
  35. $forum_state_public = 1;
  36. }
  37. }
  38. }
  39. if ($current_group['doc_state'] != 1 &&
  40. $current_group['calendar_state'] != 1 &&
  41. $current_group['work_state'] != 1 &&
  42. $current_group['announcements_state'] != 1 &&
  43. $current_group['wiki_state'] != 1 &&
  44. $current_group['chat_state'] != 1 &&
  45. $forum_state_public != 1
  46. ) {
  47. if (!api_is_allowed_to_edit(null,true) &&
  48. !GroupManager::is_user_in_group($user_id, $group_id)) {
  49. api_not_allowed($print_headers);
  50. }
  51. }
  52. /* Header */
  53. Display::display_header($nameTools.' '.Security::remove_XSS($current_group['name']), 'Group');
  54. /* Introduction section (editable by course admin) */
  55. Display::display_introduction_section(TOOL_GROUP);
  56. /* Actions and Action links */
  57. /*
  58. * User wants to register in this group
  59. */
  60. if (!empty($_GET['selfReg']) &&
  61. GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])
  62. ) {
  63. GroupManager :: subscribe_users($user_id, $current_group['id']);
  64. Display :: display_normal_message(get_lang('GroupNowMember'));
  65. }
  66. /*
  67. * User wants to unregister from this group
  68. */
  69. if (!empty($_GET['selfUnReg']) &&
  70. GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])
  71. ) {
  72. GroupManager :: unsubscribe_users($user_id, $current_group['id']);
  73. Display::display_normal_message(get_lang('StudentDeletesHimself'));
  74. }
  75. echo '<div class="actions">';
  76. echo '<a href="group.php">'.
  77. Display::return_icon('back.png',get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).
  78. '</a>';
  79. /*
  80. * Register to group
  81. */
  82. $subscribe_group = '';
  83. if (GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])) {
  84. $subscribe_group = '<a class="btn" href="'.api_get_self().'?selfReg=1&group_id='.$current_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."'".')) return false;">'.
  85. get_lang("RegIntoGroup").'</a>';
  86. }
  87. /*
  88. * Unregister from group
  89. */
  90. $unsubscribe_group = '';
  91. if (GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])) {
  92. $unsubscribe_group = '<a class="btn" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."'".')) return false;">'.
  93. get_lang("StudentUnsubscribe").'</a>';
  94. }
  95. echo '&nbsp;</div>';
  96. if (isset($_GET['action'])) {
  97. switch ($_GET['action']) {
  98. case 'show_msg':
  99. Display::display_normal_message(Security::remove_XSS($_GET['msg']));
  100. break;
  101. }
  102. }
  103. /* Main Display Area */
  104. $course_code = api_get_course_id();
  105. $is_course_member = CourseManager::is_user_subscribed_in_real_or_linked_course(
  106. api_get_user_id(),
  107. $course_code
  108. );
  109. // Edit the group.
  110. $edit_url = '';
  111. if (api_is_allowed_to_edit(false, true) or
  112. GroupManager::is_tutor_of_group(api_get_user_id(), api_get_group_id())
  113. ) {
  114. $my_origin = isset($origin) ? $origin : '';
  115. $edit_url = '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?cidReq='.api_get_course_id().'&origin='.$my_origin.'&gidReq='.api_get_group_id().'">'.
  116. Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>';
  117. }
  118. echo Display::page_header(
  119. Security::remove_XSS($current_group['name']).' '.$edit_url.' '.$subscribe_group.' '.$unsubscribe_group
  120. );
  121. if (!empty($current_group['description'])) {
  122. echo '<p>'.Security::remove_XSS($current_group['description']).'</p>';
  123. }
  124. /*
  125. * Group Tools
  126. */
  127. // If the user is subscribed to the group or the user is a tutor of the group then
  128. if (api_is_allowed_to_edit(false, true) OR
  129. GroupManager::is_user_in_group(api_get_user_id(), $current_group['id'])
  130. ) {
  131. $actions_array = array();
  132. // Link to the forum of this group
  133. $forums_of_groups = get_forums_of_group($current_group['id']);
  134. if (is_array($forums_of_groups)) {
  135. if ($current_group['forum_state'] != GroupManager::TOOL_NOT_AVAILABLE ) {
  136. foreach ($forums_of_groups as $key => $value) {
  137. //*!empty($user_subscribe_to_current_group) && */
  138. if ($value['forum_group_public_private'] == 'public' ||
  139. ($value['forum_group_public_private'] == 'private') ||
  140. !empty($user_is_tutor) ||
  141. api_is_allowed_to_edit(false, true)
  142. ) {
  143. $actions_array[] = array(
  144. 'url' => '../forum/viewforum.php?forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&origin=group',
  145. 'content' => Display::return_icon('forum.png', get_lang('Forum').': '.$value['forum_title'] , array(), 32)
  146. );
  147. }
  148. }
  149. }
  150. }
  151. if ($current_group['doc_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  152. // Link to the documents area of this group
  153. $actions_array[] = array(
  154. 'url' => '../document/document.php?'.api_get_cidreq(),
  155. 'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), array(), 32)
  156. );
  157. }
  158. if ($current_group['calendar_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  159. $groupFilter = null;
  160. if (!empty($group_id)) {
  161. $groupFilter = "&type=course&user_id=GROUP:$group_id";
  162. }
  163. // Link to a group-specific part of agenda
  164. $actions_array[] = array(
  165. 'url' => '../calendar/agenda_js.php?'.api_get_cidreq().$groupFilter,
  166. 'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), array(), 32)
  167. );
  168. }
  169. if ($current_group['work_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  170. // Link to the works area of this group
  171. $actions_array[] = array(
  172. 'url' => '../work/work.php?'.api_get_cidreq(),
  173. 'content' => Display::return_icon('work.png', get_lang('GroupWork'), array(), 32)
  174. );
  175. }
  176. if ($current_group['announcements_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  177. // Link to a group-specific part of announcements
  178. $actions_array[] = array(
  179. 'url' => '../announcements/announcements.php?'.api_get_cidreq(),
  180. 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), array(), 32)
  181. );
  182. }
  183. if ($current_group['wiki_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  184. // Link to the wiki area of this group
  185. $actions_array[] = array(
  186. 'url' => '../wiki/index.php?'.api_get_cidreq().'&action=show&title=index&session_id='.api_get_session_id().'&group_id='.$current_group['id'],
  187. 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), array(), 32)
  188. );
  189. }
  190. if ($current_group['chat_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  191. // Link to the chat area of this group
  192. if (api_get_course_setting('allow_open_chat_window')) {
  193. $actions_array[] = array(
  194. 'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id']."','window_chat_group_".$_SESSION['_cid']."_".$_SESSION['_gid']."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"",
  195. 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
  196. );
  197. } else {
  198. $actions_array[] = array(
  199. 'url' => "../chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id'],
  200. 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
  201. );
  202. }
  203. }
  204. if (!empty($actions_array)) {
  205. echo Display::actions($actions_array);
  206. }
  207. } else {
  208. $actions_array = array();
  209. // Link to the forum of this group
  210. $forums_of_groups = get_forums_of_group($current_group['id']);
  211. if (is_array($forums_of_groups)) {
  212. if ( $current_group['forum_state'] == GroupManager::TOOL_PUBLIC ) {
  213. foreach ($forums_of_groups as $key => $value) {
  214. if ($value['forum_group_public_private'] == 'public' ) {
  215. $actions_array[] = array(
  216. 'url' => '../forum/viewforum.php?cidReq='.api_get_course_id().'&forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&origin=group',
  217. 'content' => Display::return_icon('forum.png', get_lang('GroupForum'), array(), ICON_SIZE_MEDIUM)
  218. );
  219. }
  220. }
  221. }
  222. }
  223. if ($current_group['doc_state'] == GroupManager::TOOL_PUBLIC) {
  224. // Link to the documents area of this group
  225. $actions_array[] = array(
  226. 'url' => '../document/document.php?'.api_get_cidreq().'&origin='.$origin,
  227. 'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), array(), ICON_SIZE_MEDIUM)
  228. );
  229. }
  230. if ($current_group['calendar_state'] == GroupManager::TOOL_PUBLIC) {
  231. // Link to a group-specific part of agenda
  232. $actions_array[] = array(
  233. 'url' => '../calendar/agenda.php?'.api_get_cidreq(),
  234. 'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), array(), ICON_SIZE_MEDIUM)
  235. );
  236. }
  237. if ($current_group['work_state'] == GroupManager::TOOL_PUBLIC) {
  238. // Link to the works area of this group
  239. $actions_array[] = array(
  240. 'url' => '../work/work.php?'.api_get_cidreq(),
  241. 'content' => Display::return_icon('work.png', get_lang('GroupWork'), array(), ICON_SIZE_MEDIUM)
  242. );
  243. }
  244. if ($current_group['announcements_state'] == GroupManager::TOOL_PUBLIC) {
  245. // Link to a group-specific part of announcements
  246. $actions_array[] = array(
  247. 'url' => '../announcements/announcements.php?'.api_get_cidreq(),
  248. 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), array(), ICON_SIZE_MEDIUM)
  249. );
  250. }
  251. if ($current_group['wiki_state'] == GroupManager::TOOL_PUBLIC) {
  252. // Link to the wiki area of this group
  253. $actions_array[] = array(
  254. 'url' => '../wiki/index.php?'.api_get_cidreq().'&action=show&title=index&session_id='.api_get_session_id().'&group_id='.$current_group['id'],
  255. 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), array(), 32)
  256. );
  257. }
  258. if ($current_group['chat_state'] == GroupManager::TOOL_PUBLIC ) {
  259. // Link to the chat area of this group
  260. if (api_get_course_setting('allow_open_chat_window')) {
  261. $actions_array[] = array(
  262. 'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id']."','window_chat_group_".$_SESSION['_cid']."_".$_SESSION['_gid']."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"",
  263. 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
  264. );
  265. } else {
  266. $actions_array[] = array(
  267. 'url' => "../chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id'],
  268. 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
  269. );
  270. }
  271. }
  272. if (!empty($actions_array)) {
  273. echo Display::actions($actions_array);
  274. }
  275. }
  276. /*
  277. * List all the tutors of the current group
  278. */
  279. $tutors = GroupManager::get_subscribed_tutors($current_group['id']);
  280. $tutor_info = '';
  281. if (count($tutors) == 0) {
  282. $tutor_info = get_lang('GroupNoneMasc');
  283. } else {
  284. isset($origin) ? $my_origin = $origin:$my_origin='';
  285. $tutor_info .= '<ul class="thumbnails">';
  286. foreach ($tutors as $index => $tutor) {
  287. $tab_user_info = api_get_user_info($tutor['user_id']);
  288. $username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES);
  289. $image_path = UserManager::get_user_picture_path_by_id($tutor['user_id'], 'web', false, true);
  290. $image_repository = $image_path['dir'];
  291. $existing_image = $image_path['file'];
  292. $completeName = api_get_person_name($tutor['firstname'], $tutor['lastname']);
  293. $photo = '<img src="'.$image_repository.$existing_image.'" alt="'.$completeName.'" width="32" height="32" title="'.$completeName.'" />';
  294. $tutor_info .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'user/userInfo.php?origin='.$my_origin.'&uInfo='.$tutor['user_id'].'">'.
  295. $photo.'&nbsp;'.$completeName.'</a></li>';
  296. }
  297. $tutor_info .= '</ul>';
  298. }
  299. echo Display::page_subheader(get_lang('GroupTutors'));
  300. if (!empty($tutor_info)) {
  301. echo $tutor_info;
  302. }
  303. echo '<br />';
  304. /*
  305. * List all the members of the current group
  306. */
  307. echo Display::page_subheader(get_lang('GroupMembers'));
  308. $table = new SortableTable('group_users', 'get_number_of_group_users', 'get_group_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 2 : 1);
  309. $my_cidreq = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
  310. $my_origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
  311. $my_gidreq = isset($_GET['gidReq']) ? Security::remove_XSS($_GET['gidReq']) : '';
  312. $parameters = array('cidReq' => $my_cidreq, 'origin'=> $my_origin, 'gidReq' => $my_gidreq);
  313. $table->set_additional_parameters($parameters);
  314. $table->set_header(0, '');
  315. if (api_is_western_name_order()) {
  316. $table->set_header(1, get_lang('FirstName'));
  317. $table->set_header(2, get_lang('LastName'));
  318. } else {
  319. $table->set_header(1, get_lang('LastName'));
  320. $table->set_header(2, get_lang('FirstName'));
  321. }
  322. if (api_get_setting('show_email_addresses') == 'true') {
  323. $table->set_header(3, get_lang('Email'));
  324. $table->set_column_filter(3, 'email_filter');
  325. } else {
  326. if (api_is_allowed_to_edit() == 'true') {
  327. $table->set_header(3, get_lang('Email'));
  328. $table->set_column_filter(3, 'email_filter');
  329. }
  330. }
  331. //the order of these calls is important
  332. $table->set_column_filter(1, 'user_name_filter');
  333. $table->set_column_filter(2, 'user_name_filter');
  334. $table->set_column_filter(0, 'user_icon_filter');
  335. $table->display();
  336. /**
  337. * Get the number of subscribed users to the group
  338. *
  339. * @return integer
  340. *
  341. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  342. * @version April 2008
  343. */
  344. function get_number_of_group_users()
  345. {
  346. global $current_group;
  347. $course_id = api_get_course_int_id();
  348. // Database table definition
  349. $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
  350. // Query
  351. $sql = "SELECT count(id) AS number_of_users
  352. FROM ".$table_group_user."
  353. WHERE c_id = $course_id AND group_id='".Database::escape_string($current_group['id'])."'";
  354. $result = Database::query($sql);
  355. $return = Database::fetch_array($result,'ASSOC');
  356. return $return['number_of_users'];
  357. }
  358. /**
  359. * Get the details of the users in a group
  360. *
  361. * @param integer $from starting row
  362. * @param integer $number_of_items number of items to be displayed
  363. * @param integer $column sorting colum
  364. * @param integer $direction sorting direction
  365. * @return array
  366. *
  367. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  368. * @version April 2008
  369. */
  370. function get_group_user_data($from, $number_of_items, $column, $direction)
  371. {
  372. global $current_group;
  373. // Database table definition
  374. $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
  375. $table_user = Database :: get_main_table(TABLE_MAIN_USER);
  376. $course_id = api_get_course_int_id();
  377. // Query
  378. if (api_get_setting('show_email_addresses') == 'true') {
  379. $sql = "SELECT user.user_id AS col0,
  380. ".(api_is_western_name_order() ?
  381. "user.firstname AS col1,
  382. user.lastname AS col2,"
  383. :
  384. "user.lastname AS col1,
  385. user.firstname AS col2,"
  386. )."
  387. user.email AS col3
  388. FROM ".$table_user." user, ".$table_group_user." group_rel_user
  389. WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id
  390. AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
  391. $sql .= " ORDER BY col$column $direction ";
  392. $sql .= " LIMIT $from,$number_of_items";
  393. } else {
  394. if (api_is_allowed_to_edit()) {
  395. $sql = "SELECT DISTINCT
  396. u.user_id AS col0,
  397. ".(api_is_western_name_order() ?
  398. "u.firstname AS col1,
  399. u.lastname AS col2,"
  400. :
  401. "u.lastname AS col1,
  402. u.firstname AS col2,"
  403. )."
  404. u.email AS col3
  405. FROM ".$table_user." u INNER JOIN ".$table_group_user." gu ON (gu.user_id = u.user_id) AND gu.c_id = $course_id
  406. WHERE gu.group_id = '".Database::escape_string($current_group['id'])."'";
  407. $sql .= " ORDER BY col$column $direction ";
  408. $sql .= " LIMIT $from,$number_of_items";
  409. } else {
  410. $sql = "SELECT DISTINCT
  411. user.user_id AS col0,
  412. ". (api_is_western_name_order() ?
  413. "user.firstname AS col1,
  414. user.lastname AS col2 "
  415. :
  416. "user.lastname AS col1,
  417. user.firstname AS col2 "
  418. )."
  419. FROM ".$table_user." user, ".$table_group_user." group_rel_user
  420. WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id
  421. AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
  422. $sql .= " ORDER BY col$column $direction ";
  423. $sql .= " LIMIT $from,$number_of_items";
  424. }
  425. }
  426. $return = array();
  427. $result = Database::query($sql);
  428. while ($row = Database::fetch_row($result)) {
  429. $return[] = $row;
  430. }
  431. return $return;
  432. }
  433. /**
  434. * Returns a mailto-link
  435. * @param string $email An email-address
  436. * @return string HTML-code with a mailto-link
  437. */
  438. function email_filter($email)
  439. {
  440. return Display :: encrypted_mailto_link($email, $email);
  441. }
  442. /**
  443. * Display a user icon that links to the user page
  444. *
  445. * @param integer $user_id the id of the user
  446. * @return html code
  447. *
  448. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  449. * @version April 2008
  450. */
  451. function user_icon_filter($user_id)
  452. {
  453. global $origin;
  454. $userinfo = api_get_user_info($user_id);
  455. $image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
  456. $image_repository = $image_path['dir'];
  457. $existing_image = $image_path['file'];
  458. $photo = '<center><img src="'.$image_repository.$existing_image.'" alt="'.$userinfo['complete_name'].'" width="22" height="22" title="'.$userinfo['complete_name'].'" /></center>';
  459. return '<a href="../user/userInfo.php?origin='.$origin.'&uInfo='.$user_id.'">'.$photo;
  460. }
  461. /**
  462. * Return user profile link around the given user name.
  463. *
  464. * The parameters use a trick of the sorteable table, where the first param is
  465. * the original value of the column
  466. * @param string User name (value of the column at the time of calling)
  467. * @param string URL parameters
  468. * @param array Row of the "sortable table" as it is at the time of function call - we extract the user ID from there
  469. * @return string HTML link
  470. */
  471. function user_name_filter($name, $url_params, $row)
  472. {
  473. $tab_user_info = api_get_user_info($row[0]);
  474. $username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES);
  475. return '<a href="../user/userInfo.php?uInfo='.$row[0].'&'.$url_params.'" title="'.$username.'">'.$name.'</a>';
  476. }
  477. // Footer
  478. $orig = isset($origin) ? $origin : '';
  479. if ($orig != 'learnpath') {
  480. Display::display_footer();
  481. }