group_space.php 21 KB

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