group_space.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  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);
  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('GroupSpace');
  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('GroupNowMember'), 'normal'));
  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('StudentDeletesHimself'), '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('BackToGroupList'),
  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("ConfirmYourChoice"), ENT_QUOTES))."'".')) return false;">'.
  76. get_lang("RegIntoGroup").'</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("ConfirmYourChoice"), ENT_QUOTES))."'".')) return false;">'.
  84. get_lang("StudentUnsubscribe").'</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(api_get_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('EditGroup'), '', 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. /*
  102. * Group Tools
  103. */
  104. // If the user is subscribed to the group or the user is a tutor of the group then
  105. if (api_is_allowed_to_edit(false, true) ||
  106. GroupManager::is_user_in_group(api_get_user_id(), $current_group)
  107. ) {
  108. $actions_array = [];
  109. // Link to the forum of this group
  110. $forums_of_groups = get_forums_of_group($current_group);
  111. if (is_array($forums_of_groups)) {
  112. if ($current_group['forum_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  113. foreach ($forums_of_groups as $key => $value) {
  114. if ($value['forum_group_public_private'] == 'public' ||
  115. ($value['forum_group_public_private'] == 'private') ||
  116. !empty($user_is_tutor) ||
  117. api_is_allowed_to_edit(false, true)
  118. ) {
  119. $actions_array[] = [
  120. 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.$value['forum_id'].'&'.api_get_cidreq().'&origin=group',
  121. 'content' => Display::return_icon(
  122. 'forum.png',
  123. get_lang('Forum').': '.$value['forum_title'],
  124. [],
  125. 32
  126. ),
  127. ];
  128. }
  129. }
  130. }
  131. }
  132. if ($current_group['doc_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  133. // Link to the documents area of this group
  134. $actions_array[] = [
  135. 'url' => api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq(),
  136. 'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), [], 32),
  137. ];
  138. }
  139. if ($current_group['calendar_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  140. $groupFilter = '';
  141. if (!empty($group_id)) {
  142. $groupFilter = "&type=course&user_id=GROUP:$group_id";
  143. }
  144. // Link to a group-specific part of agenda
  145. $actions_array[] = [
  146. 'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?'.api_get_cidreq().$groupFilter,
  147. 'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), [], 32),
  148. ];
  149. }
  150. if ($current_group['work_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  151. // Link to the works area of this group
  152. $actions_array[] = [
  153. 'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(),
  154. 'content' => Display::return_icon('work.png', get_lang('GroupWork'), [], 32),
  155. ];
  156. }
  157. if ($current_group['announcements_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  158. // Link to a group-specific part of announcements
  159. $actions_array[] = [
  160. 'url' => api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(),
  161. 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), [], 32),
  162. ];
  163. }
  164. if ($current_group['wiki_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  165. // Link to the wiki area of this group
  166. $actions_array[] = [
  167. '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'],
  168. 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), [], 32),
  169. ];
  170. }
  171. if ($current_group['chat_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
  172. // Link to the chat area of this group
  173. if (api_get_course_setting('allow_open_chat_window')) {
  174. $actions_array[] = [
  175. 'url' => "javascript: void(0);",
  176. 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32),
  177. 'url_attributes' => [
  178. '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')",
  179. ],
  180. ];
  181. } else {
  182. $actions_array[] = [
  183. 'url' => api_get_path(WEB_CODE_PATH)."chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id'],
  184. 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32),
  185. ];
  186. }
  187. }
  188. $enabled = api_get_plugin_setting('bbb', 'tool_enable');
  189. if ($enabled === 'true') {
  190. $bbb = new bbb();
  191. if ($bbb->hasGroupSupport()) {
  192. $actions_array[] = [
  193. 'url' => api_get_path(WEB_PLUGIN_PATH)."bbb/start.php?".api_get_cidreq(),
  194. 'content' => Display::return_icon('bbb.png', get_lang('VideoConference'), [], 32),
  195. ];
  196. }
  197. }
  198. if (!empty($actions_array)) {
  199. echo Display::actions($actions_array);
  200. }
  201. } else {
  202. $actions_array = [];
  203. // Link to the forum of this group
  204. $forums_of_groups = get_forums_of_group($current_group);
  205. if (is_array($forums_of_groups)) {
  206. if ($current_group['forum_state'] == GroupManager::TOOL_PUBLIC) {
  207. foreach ($forums_of_groups as $key => $value) {
  208. if ($value['forum_group_public_private'] == 'public') {
  209. $actions_array[] = [
  210. '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',
  211. 'content' => Display::return_icon(
  212. 'forum.png',
  213. get_lang('GroupForum'),
  214. [],
  215. ICON_SIZE_MEDIUM
  216. ),
  217. ];
  218. }
  219. }
  220. }
  221. }
  222. if ($current_group['doc_state'] == GroupManager::TOOL_PUBLIC) {
  223. // Link to the documents area of this group
  224. $actions_array[] = [
  225. 'url' => api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq(),
  226. 'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), [], ICON_SIZE_MEDIUM),
  227. ];
  228. }
  229. if ($current_group['calendar_state'] == GroupManager::TOOL_PUBLIC) {
  230. $groupFilter = '';
  231. if (!empty($group_id)) {
  232. $groupFilter = "&type=course&user_id=GROUP:$group_id";
  233. }
  234. // Link to a group-specific part of agenda
  235. $actions_array[] = [
  236. 'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?'.api_get_cidreq().$groupFilter,
  237. 'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), [], 32),
  238. ];
  239. }
  240. if ($current_group['work_state'] == GroupManager::TOOL_PUBLIC) {
  241. // Link to the works area of this group
  242. $actions_array[] = [
  243. 'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(),
  244. 'content' => Display::return_icon('work.png', get_lang('GroupWork'), [], ICON_SIZE_MEDIUM),
  245. ];
  246. }
  247. if ($current_group['announcements_state'] == GroupManager::TOOL_PUBLIC) {
  248. // Link to a group-specific part of announcements
  249. $actions_array[] = [
  250. 'url' => api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(),
  251. 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), [], ICON_SIZE_MEDIUM),
  252. ];
  253. }
  254. if ($current_group['wiki_state'] == GroupManager::TOOL_PUBLIC) {
  255. // Link to the wiki area of this group
  256. $actions_array[] = [
  257. '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'],
  258. 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), [], 32),
  259. ];
  260. }
  261. if ($current_group['chat_state'] == GroupManager::TOOL_PUBLIC) {
  262. // Link to the chat area of this group
  263. if (api_get_course_setting('allow_open_chat_window')) {
  264. $actions_array[] = [
  265. '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') \"",
  266. 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32),
  267. ];
  268. } else {
  269. $actions_array[] = [
  270. 'url' => api_get_path(WEB_CODE_PATH)."chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id'],
  271. 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32),
  272. ];
  273. }
  274. }
  275. if (!empty($actions_array)) {
  276. echo Display::actions($actions_array);
  277. }
  278. }
  279. /*
  280. * List all the tutors of the current group
  281. */
  282. $tutors = GroupManager::get_subscribed_tutors($current_group);
  283. $tutor_info = '';
  284. if (count($tutors) == 0) {
  285. $tutor_info = get_lang('GroupNoneMasc');
  286. } else {
  287. $tutor_info .= '<ul class="thumbnails">';
  288. foreach ($tutors as $index => $tutor) {
  289. $userInfo = api_get_user_info($tutor['user_id']);
  290. $username = api_htmlentities(sprintf(get_lang('LoginX'), $userInfo['username']), ENT_QUOTES);
  291. $completeName = $userInfo['complete_name'];
  292. $photo = '<img src="'.$userInfo['avatar'].'" alt="'.$completeName.'" width="32" height="32" title="'.$completeName.'" />';
  293. $tutor_info .= '<li>';
  294. $tutor_info .= $userInfo['complete_name_with_message_link'];
  295. $tutor_info .= '</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(
  309. 'group_users',
  310. 'get_number_of_group_users',
  311. 'get_group_user_data',
  312. (api_is_western_name_order() xor api_sort_by_first_name()) ? 2 : 1
  313. );
  314. $origin = api_get_origin();
  315. $my_cidreq = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
  316. $my_gidreq = isset($_GET['gidReq']) ? Security::remove_XSS($_GET['gidReq']) : '';
  317. $parameters = ['cidReq' => $my_cidreq, 'origin' => $origin, 'gidReq' => $my_gidreq];
  318. $table->set_additional_parameters($parameters);
  319. $table->set_header(0, '');
  320. if (api_is_western_name_order()) {
  321. $table->set_header(1, get_lang('FirstName'));
  322. $table->set_header(2, get_lang('LastName'));
  323. } else {
  324. $table->set_header(1, get_lang('LastName'));
  325. $table->set_header(2, get_lang('FirstName'));
  326. }
  327. if (api_get_setting('show_email_addresses') == 'true' || api_is_allowed_to_edit() == 'true') {
  328. $table->set_header(3, get_lang('Email'));
  329. $table->set_column_filter(3, 'email_filter');
  330. $table->set_header(4, get_lang('Active'));
  331. $table->set_column_filter(4, 'activeFilter');
  332. } else {
  333. $table->set_header(3, get_lang('Active'));
  334. $table->set_column_filter(3, 'activeFilter');
  335. }
  336. //the order of these calls is important
  337. //$table->set_column_filter(1, 'user_name_filter');
  338. //$table->set_column_filter(2, 'user_name_filter');
  339. $table->set_column_filter(0, 'user_icon_filter');
  340. $table->display();
  341. /**
  342. * Get the number of subscribed users to the group.
  343. *
  344. * @return int
  345. *
  346. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  347. *
  348. * @version April 2008
  349. */
  350. function get_number_of_group_users()
  351. {
  352. $groupInfo = GroupManager::get_group_properties(api_get_group_id());
  353. $course_id = api_get_course_int_id();
  354. if (empty($groupInfo) || empty($course_id)) {
  355. return 0;
  356. }
  357. // Database table definition
  358. $table = Database::get_course_table(TABLE_GROUP_USER);
  359. // Query
  360. $sql = "SELECT count(iid) AS number_of_users
  361. FROM $table
  362. WHERE
  363. c_id = $course_id AND
  364. group_id = '".intval($groupInfo['iid'])."'";
  365. $result = Database::query($sql);
  366. $return = Database::fetch_array($result, 'ASSOC');
  367. return $return['number_of_users'];
  368. }
  369. /**
  370. * Get the details of the users in a group.
  371. *
  372. * @param int $from starting row
  373. * @param int $number_of_items number of items to be displayed
  374. * @param int $column sorting colum
  375. * @param int $direction sorting direction
  376. *
  377. * @return array
  378. *
  379. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  380. *
  381. * @version April 2008
  382. */
  383. function get_group_user_data($from, $number_of_items, $column, $direction)
  384. {
  385. $groupInfo = GroupManager::get_group_properties(api_get_group_id());
  386. $course_id = api_get_course_int_id();
  387. if (empty($groupInfo) || empty($course_id)) {
  388. return 0;
  389. }
  390. // Database table definition
  391. $table_group_user = Database::get_course_table(TABLE_GROUP_USER);
  392. $table_user = Database::get_main_table(TABLE_MAIN_USER);
  393. $tableGroup = Database::get_course_table(TABLE_GROUP);
  394. // Query
  395. if (api_get_setting('show_email_addresses') === 'true') {
  396. $sql = "SELECT user.id AS col0,
  397. ".(
  398. api_is_western_name_order() ?
  399. "user.firstname AS col1,
  400. user.lastname AS col2,"
  401. :
  402. "user.lastname AS col1,
  403. user.firstname AS col2,"
  404. )."
  405. user.email AS col3
  406. , user.active AS col4
  407. FROM $table_user user
  408. INNER JOIN $table_group_user group_rel_user
  409. ON (group_rel_user.user_id = user.id)
  410. INNER JOIN $tableGroup g
  411. ON (group_rel_user.group_id = g.iid)
  412. WHERE
  413. group_rel_user.c_id = $course_id AND
  414. g.iid = '".$groupInfo['iid']."'
  415. ORDER BY col$column $direction
  416. LIMIT $from, $number_of_items";
  417. } else {
  418. if (api_is_allowed_to_edit()) {
  419. $sql = "SELECT DISTINCT
  420. u.id AS col0,
  421. ".(api_is_western_name_order() ?
  422. "u.firstname AS col1,
  423. u.lastname AS col2,"
  424. :
  425. "u.lastname AS col1,
  426. u.firstname AS col2,")."
  427. u.email AS col3
  428. , u.active AS col4
  429. FROM $table_user u
  430. INNER JOIN $table_group_user gu
  431. ON (gu.user_id = u.id)
  432. INNER JOIN $tableGroup g
  433. ON (gu.group_id = g.iid)
  434. WHERE
  435. g.iid = '".$groupInfo['iid']."' AND
  436. gu.c_id = $course_id
  437. ORDER BY col$column $direction
  438. LIMIT $from, $number_of_items";
  439. } else {
  440. $sql = "SELECT DISTINCT
  441. user.id AS col0,
  442. ".(
  443. api_is_western_name_order() ?
  444. "user.firstname AS col1,
  445. user.lastname AS col2 "
  446. :
  447. "user.lastname AS col1,
  448. user.firstname AS col2 "
  449. )."
  450. , user.active AS col3
  451. FROM $table_user user
  452. INNER JOIN $table_group_user group_rel_user
  453. ON (group_rel_user.user_id = user.id)
  454. INNER JOIN $tableGroup g
  455. ON (group_rel_user.group_id = g.iid)
  456. WHERE
  457. g.iid = '".$groupInfo['iid']."' AND
  458. group_rel_user.c_id = $course_id AND
  459. group_rel_user.user_id = user.id AND
  460. g.iid = '".$groupInfo['iid']."'
  461. ORDER BY col$column $direction
  462. LIMIT $from, $number_of_items";
  463. }
  464. }
  465. $return = [];
  466. $result = Database::query($sql);
  467. while ($row = Database::fetch_row($result)) {
  468. $return[] = $row;
  469. }
  470. return $return;
  471. }
  472. /**
  473. * Returns a mailto-link.
  474. *
  475. * @param string $email An email-address
  476. *
  477. * @return string HTML-code with a mailto-link
  478. */
  479. function email_filter($email)
  480. {
  481. return Display::encrypted_mailto_link($email, $email);
  482. }
  483. function activeFilter($isActive)
  484. {
  485. if ($isActive) {
  486. return Display::return_icon('accept.png', get_lang('Active'), [], ICON_SIZE_TINY);
  487. }
  488. return Display::return_icon('error.png', get_lang('Inactive'), [], ICON_SIZE_TINY);
  489. }
  490. /**
  491. * Display a user icon that links to the user page.
  492. *
  493. * @param int $user_id the id of the user
  494. *
  495. * @return string code
  496. *
  497. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  498. *
  499. * @version April 2008
  500. */
  501. function user_icon_filter($user_id)
  502. {
  503. $userInfo = api_get_user_info($user_id);
  504. $photo = '<img src="'.$userInfo['avatar'].'" alt="'.$userInfo['complete_name'].'" width="22" height="22" title="'.$userInfo['complete_name'].'" />';
  505. return Display::url($photo, $userInfo['profile_url']);
  506. }
  507. /**
  508. * Return user profile link around the given user name.
  509. *
  510. * The parameters use a trick of the sorteable table, where the first param is
  511. * the original value of the column
  512. *
  513. * @param string User name (value of the column at the time of calling)
  514. * @param string URL parameters
  515. * @param array Row of the "sortable table" as it is at the time of function call - we extract the user ID from there
  516. *
  517. * @return string HTML link
  518. */
  519. function user_name_filter($name, $url_params, $row)
  520. {
  521. $userInfo = api_get_user_info($row[0]);
  522. return UserManager::getUserProfileLink($userInfo);
  523. }
  524. if ($origin != 'learnpath') {
  525. Display::display_footer();
  526. }