group_space.php 21 KB

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