group_space.php 20 KB

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