group_space.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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).'course.lib.php';
  16. require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
  17. require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
  18. require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
  19. require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php';
  20. /* MAIN CODE */
  21. $current_group = GroupManager :: get_group_properties($_SESSION['_gid']);
  22. if (!is_array($current_group) ) {
  23. //display some error message
  24. }
  25. $this_section = SECTION_COURSES;
  26. $nameTools = get_lang('GroupSpace');
  27. $interbreadcrumb[] = array ('url' => 'group.php', 'name' => get_lang('Groups'));
  28. /* Ensure all private groups // Juan Carlos Raña Trabado */
  29. $forums_of_groups = get_forums_of_group($current_group['id']);
  30. $forum_state_public = 0;
  31. if (is_array($forums_of_groups)) {
  32. foreach ($forums_of_groups as $key => $value) {
  33. if($value['forum_group_public_private'] == 'public') {
  34. $forum_state_public = 1;
  35. }
  36. }
  37. }
  38. 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) {
  39. if (!api_is_allowed_to_edit(null,true) && !GroupManager :: is_user_in_group($_user['user_id'], $current_group['id'])) {
  40. echo api_not_allowed($print_headers);
  41. }
  42. }
  43. /* Header */
  44. Display::display_header($nameTools.' '.stripslashes($current_group['name']), 'Group');
  45. /* Introduction section (editable by course admin) */
  46. Display::display_introduction_section(group_space_.$_SESSION['_gid']);
  47. /* Actions and Action links */
  48. /*
  49. * User wants to register in this group
  50. */
  51. if (!empty($_GET['selfReg']) && GroupManager :: is_self_registration_allowed($_SESSION['_user']['user_id'], $current_group['id'])) {
  52. GroupManager :: subscribe_users($_SESSION['_user']['user_id'], $current_group['id']);
  53. Display :: display_normal_message(get_lang('GroupNowMember'));
  54. }
  55. /*
  56. * User wants to unregister from this group
  57. */
  58. if (!empty($_GET['selfUnReg']) && GroupManager :: is_self_unregistration_allowed($_SESSION['_user']['user_id'], $current_group['id'])) {
  59. GroupManager :: unsubscribe_users($_SESSION['_user']['user_id'], $current_group['id']);
  60. Display::display_normal_message(get_lang('StudentDeletesHimself'));
  61. }
  62. echo '<div class="actions">';
  63. echo '<a href="group.php">'.Display::return_icon('back.png',get_lang('BackToGroupList'),'','32').'</a>';
  64. /*
  65. * Edit the group
  66. */
  67. if (api_is_allowed_to_edit(false, true) or GroupManager :: is_tutor($_user['user_id'])) {
  68. $my_origin = isset($origin) ? $origin : '';
  69. echo '<a href="group_edit.php?origin=$my_origin">'.Display::return_icon('settings.png', get_lang('EditGroup'),'','32').'</a>';
  70. }
  71. /*
  72. * Register to group
  73. */
  74. if (GroupManager :: is_self_registration_allowed($_SESSION['_user']['user_id'], $current_group['id'])) {
  75. echo '<a 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;">'.Display::return_icon('groupadd.gif').get_lang("RegIntoGroup").'</a>';
  76. }
  77. /*
  78. * Unregister from group
  79. */
  80. if (GroupManager :: is_self_unregistration_allowed($_SESSION['_user']['user_id'], $current_group['id'])) {
  81. echo '<a href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."'".')) return false;">'.Display::return_icon('group_delete.gif').get_lang("StudentUnsubscribe").'</a>';
  82. }
  83. echo '&nbsp;</div>';
  84. if (isset($_GET['action'])) {
  85. switch ($_GET['action']) {
  86. case 'show_msg':
  87. Display::display_normal_message(Security::remove_XSS($_GET['msg']));
  88. break;
  89. }
  90. }
  91. /* Main Display Area */
  92. $course_code = $_course['sysCode'];
  93. $is_course_member = CourseManager :: is_user_subscribed_in_real_or_linked_course($_SESSION['_user']['user_id'], $course_code);
  94. /*
  95. * Group title and comment
  96. */
  97. //api_display_tool_title($nameTools.' '.stripslashes($current_group['name']));
  98. if (!empty($current_group['description'])) {
  99. echo '<blockquote>'.stripslashes($current_group['description']).'</blockquote>';
  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) OR GroupManager :: is_user_in_group($_SESSION['_user']['user_id'], $current_group['id'])) {
  106. echo '<ul>';
  107. $tools = '';
  108. // Link to the forum of this group
  109. $forums_of_groups = get_forums_of_group($current_group['id']);
  110. if (is_array($forums_of_groups)) {
  111. if ($current_group['forum_state'] != TOOL_NOT_AVAILABLE ) {
  112. foreach ($forums_of_groups as $key => $value) {
  113. 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)) {
  114. $tools .= '<li style="display:inline; margin:5px;">'.Display::return_icon('forum.gif', get_lang('GroupForum')) . ' <a href="../forum/viewforum.php?forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&amp;origin=group">'.get_lang('Forum').': '.$value['forum_title'].'</a></li>';
  115. //$tools .= Display::return_icon('forum.gif', get_lang('Forum')) . ' <a href="../forum/viewforum.php?forum='.$value['forum_id'].'">'.get_lang('Forum').': '.$value['forum_title'].'</a><br />';
  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_document.gif', get_lang('GroupDocument')).'&nbsp;'.get_lang('GroupDocument').'</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.gif', get_lang('GroupCalendar')).'&nbsp;'.get_lang('GroupCalendar').'</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('works.gif', get_lang('GroupWork')).'&nbsp;'.get_lang('GroupWork').'</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('valves.gif', get_lang('GroupAnnouncements')).'&nbsp;'.get_lang('GroupAnnouncements').'</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.gif', get_lang('GroupWiki')).'&nbsp;'.get_lang('GroupWiki').'</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'),'','22')."&nbsp;".get_lang('Chat')."</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.gif', get_lang('Chat'))."&nbsp;".get_lang('Chat')."</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;">'.Display::return_icon('forum.gif', get_lang('GroupForum')) . ' <a href="../forum/viewforum.php?forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&amp;origin=group">'.$value['forum_title'].'</a></li>';
  163. //$tools.= Display::return_icon('forum.gif', get_lang('Forum')) . ' <a href="../forum/viewforum.php?forum='.$value['forum_id'].'">'.get_lang("Forum").': '.$value['forum_title'].'</a><br />';
  164. }
  165. }
  166. }
  167. }
  168. if ($current_group['doc_state'] == TOOL_PUBLIC) {
  169. // Link to the documents area of this group
  170. $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_document.gif', get_lang('GroupDocument')).'&nbsp;'.get_lang('GroupDocument').'</a></li>';
  171. }
  172. if ($current_group['calendar_state'] == TOOL_PUBLIC) {
  173. // Link to a group-specific part of agenda
  174. $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.gif', get_lang('GroupCalendar')).'&nbsp;'.get_lang('GroupCalendar').'</a></li>';
  175. }
  176. if ($current_group['work_state'] == TOOL_PUBLIC) {
  177. // Link to the works area of this group
  178. $tools .= '<li style="display:inline; margin:5px;"><a href="../work/work.php?'.api_get_cidreq().'&amp;toolgroup='.$current_group['id'].'">'.Display::return_icon('works.gif', get_lang('GroupWork')).'&nbsp;'.get_lang('GroupWork').'</a></li>';
  179. }
  180. if ($current_group['announcements_state'] == TOOL_PUBLIC) {
  181. // Link to a group-specific part of announcements
  182. $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('valves.gif', get_lang('GroupAnnouncements')).'&nbsp;'.get_lang('GroupAnnouncements').'</a></li>';
  183. }
  184. if ($current_group['wiki_state'] == TOOL_PUBLIC) {
  185. // Link to the wiki area of this group
  186. $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.gif', get_lang('GroupWiki')).'&nbsp;'.get_lang('GroupWiki').'</a></li>';
  187. }
  188. if ($current_group['chat_state'] == TOOL_PUBLIC ) {
  189. // Link to the chat area of this group
  190. if (api_get_course_setting('allow_open_chat_window')) {
  191. $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.gif', get_lang("Chat"))."&nbsp;".get_lang("Chat")."</a></li>";
  192. } else {
  193. $tools .= "<li style=\"display:inline; margin:5px;\"><a href=\"../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."\">".Display::return_icon('chat.gif', get_lang("Chat"))."&nbsp;".get_lang("Chat")."</a></li>";
  194. }
  195. }
  196. echo '</ul>';
  197. echo '<div class="actions-message" style="margin-bottom:4px;"><b>'.get_lang('Tools').'</b></div>';
  198. if (!empty($tools)) {
  199. echo '<div style="margin-left:5px; margin-bottom:4px; margin-top:4px;">'.$tools.'</div>';
  200. }
  201. }
  202. /*
  203. * List all the tutors of the current group
  204. */
  205. $tutors = GroupManager::get_subscribed_tutors($current_group['id']);
  206. $tutor_info = '';
  207. if (count($tutors) == 0) {
  208. $tutor_info = get_lang('GroupNoneMasc');
  209. } else {
  210. isset($origin)?$my_origin = $origin:$my_origin='';
  211. foreach($tutors as $index => $tutor) {
  212. $image_path = UserManager::get_user_picture_path_by_id($tutor['user_id'], 'web', false, true);
  213. $image_repository = $image_path['dir'];
  214. $existing_image = $image_path['file'];
  215. $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']).'" />';
  216. $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>';
  217. }
  218. }
  219. echo '<div class="actions-message" style="margin-bottom:4px;style="margin:4px;"><b>'.get_lang('GroupTutors').'</b></div>';
  220. if (!empty($tutor_info)) {
  221. echo '<div style="margin-left:5px;">'.$tutor_info.'</div>';
  222. }
  223. echo '<br />';
  224. /*
  225. * List all the members of the current group
  226. */
  227. echo '<b>'.get_lang("GroupMembers").'</b>';
  228. $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);
  229. $my_cidreq = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
  230. $my_origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
  231. $my_gidreq = isset($_GET['gidReq']) ? Security::remove_XSS($_GET['gidReq']) : '';
  232. $parameters = array('cidReq' => $my_cidreq, 'origin'=> $my_origin, 'gidReq' => $my_gidreq);
  233. $table->set_additional_parameters($parameters);
  234. $table->set_header(0, '');
  235. if (api_is_western_name_order()) {
  236. $table->set_header(1, get_lang('FirstName'));
  237. $table->set_header(2, get_lang('LastName'));
  238. } else {
  239. $table->set_header(1, get_lang('LastName'));
  240. $table->set_header(2, get_lang('FirstName'));
  241. }
  242. if (api_get_setting('show_email_addresses') == 'true') {
  243. $table->set_header(3, get_lang('Email'));
  244. $table->set_column_filter(3, 'email_filter');
  245. } else {
  246. if (api_is_allowed_to_edit() == 'true') {
  247. $table->set_header(3, get_lang('Email'));
  248. $table->set_column_filter(3, 'email_filter');
  249. }
  250. }
  251. $table->set_column_filter(0, 'user_icon_filter');
  252. $table->display();
  253. /**
  254. * Get the number of subscribed users to the group
  255. *
  256. * @return integer
  257. *
  258. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  259. * @version April 2008
  260. */
  261. function get_number_of_group_users() {
  262. global $current_group;
  263. // Database table definition
  264. $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
  265. // Query
  266. $sql = "SELECT count(id) AS number_of_users
  267. FROM ".$table_group_user."
  268. WHERE group_id='".Database::escape_string($current_group['id'])."'";
  269. $result = Database::query($sql);
  270. $return = Database::fetch_array($result,'ASSOC');
  271. return $return['number_of_users'];
  272. }
  273. /**
  274. * Get the details of the users in a group
  275. *
  276. * @param integer $from starting row
  277. * @param integer $number_of_items number of items to be displayed
  278. * @param integer $column sorting colum
  279. * @param integer $direction sorting direction
  280. * @return array
  281. *
  282. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  283. * @version April 2008
  284. */
  285. function get_group_user_data($from, $number_of_items, $column, $direction) {
  286. global $current_group;
  287. // Database table definition
  288. $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
  289. $table_user = Database :: get_main_table(TABLE_MAIN_USER);
  290. // Query
  291. if (api_get_setting('show_email_addresses') == 'true') {
  292. $sql = "SELECT
  293. user.user_id AS col0,
  294. ".(api_is_western_name_order() ?
  295. "user.firstname AS col1,
  296. user.lastname AS col2,"
  297. :
  298. "user.lastname AS col1,
  299. user.firstname AS col2,"
  300. )."
  301. user.email AS col3
  302. FROM ".$table_user." user, ".$table_group_user." group_rel_user
  303. WHERE group_rel_user.user_id = user.user_id
  304. AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
  305. $sql .= " ORDER BY col$column $direction ";
  306. $sql .= " LIMIT $from,$number_of_items";
  307. } else {
  308. if (api_is_allowed_to_edit()) {
  309. $sql = "SELECT
  310. user.user_id AS col0,
  311. ".(api_is_western_name_order() ?
  312. "user.firstname AS col1,
  313. user.lastname AS col2,"
  314. :
  315. "user.lastname AS col1,
  316. user.firstname AS col2,"
  317. )."
  318. user.email AS col3
  319. FROM ".$table_user." user, ".$table_group_user." group_rel_user
  320. WHERE group_rel_user.user_id = user.user_id
  321. AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
  322. $sql .= " ORDER BY col$column $direction ";
  323. $sql .= " LIMIT $from,$number_of_items";
  324. } else {
  325. $sql = "SELECT
  326. user.user_id AS col0,
  327. ". (api_is_western_name_order() ?
  328. "user.firstname AS col1,
  329. user.lastname AS col2 "
  330. :
  331. "user.lastname AS col1,
  332. user.firstname AS col2 "
  333. )."
  334. FROM ".$table_user." user, ".$table_group_user." group_rel_user
  335. WHERE group_rel_user.user_id = user.user_id
  336. AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
  337. $sql .= " ORDER BY col$column $direction ";
  338. $sql .= " LIMIT $from,$number_of_items";
  339. }
  340. }
  341. $return = array();
  342. $result = Database::query($sql);
  343. while ($row = Database::fetch_row($result)) {
  344. $return[] = $row;
  345. }
  346. return $return;
  347. }
  348. /**
  349. * Returns a mailto-link
  350. * @param string $email An email-address
  351. * @return string HTML-code with a mailto-link
  352. */
  353. function email_filter($email) {
  354. return Display :: encrypted_mailto_link($email, $email);
  355. }
  356. /**
  357. * Display a user icon that links to the user page
  358. *
  359. * @param integer $user_id the id of the user
  360. * @return html code
  361. *
  362. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  363. * @version April 2008
  364. */
  365. function user_icon_filter($user_id) {
  366. global $origin;
  367. $userinfo = Database::get_user_info_from_id($user_id);
  368. $image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
  369. $image_repository = $image_path['dir'];
  370. $existing_image = $image_path['file'];
  371. $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>';
  372. return '<a href="../user/userInfo.php?origin='.$origin.'&amp;uInfo='.$user_id.'">'.$photo;
  373. }
  374. // Footer
  375. $orig = isset($origin) ? $origin : '';
  376. if ($orig != 'learnpath') {
  377. Display::display_footer();
  378. }