userInfo.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. <?php // $Id: userInfo.php 20425 2009-05-08 20:45:38Z herodoto $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004-2008 Dokeos SPRL
  6. Copyright (c) 2003 Ghent University (UGent)
  7. For a full list of contributors, see "credits.txt".
  8. The full license can be read in "license.txt".
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License
  11. as published by the Free Software Foundation; either version 2
  12. of the License, or (at your option) any later version.
  13. See the GNU General Public License for more details.
  14. Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
  15. ==============================================================================
  16. */
  17. /**
  18. ==============================================================================
  19. * This script displays info about one specific user, specified through
  20. * a GET parameter, e.g. uInfo=2
  21. *
  22. * @todo clean up script in clean sections:
  23. * (1) gather information
  24. * (2) tool logic
  25. * (3) display
  26. * @author original author (unknown, probably thomas,hugues,moosh)
  27. * @author Roan Embrechts, minor modification: virtual courses support
  28. * @author Julio Montoya Armas Several fixes
  29. * @package dokeos.user
  30. ==============================================================================
  31. */
  32. /*
  33. ==============================================================================
  34. INIT SECTION
  35. ==============================================================================
  36. */
  37. // name of the language file that needs to be included
  38. $language_file = array ('registration', 'userInfo');
  39. include ("../inc/global.inc.php");
  40. require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  41. require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
  42. $htmlHeadXtra[] = '<script type="text/javascript">
  43. function show_image(image,width,height) {
  44. width = parseInt(width) + 20;
  45. height = parseInt(height) + 20;
  46. window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
  47. }
  48. </script>';
  49. $editMainUserInfo = Security::remove_XSS($_REQUEST['editMainUserInfo']);
  50. $uInfo = $editMainUserInfo;
  51. $this_section = SECTION_COURSES;
  52. $nameTools = get_lang('Users');
  53. api_protect_course_script(true);
  54. if(api_is_anonymous())
  55. {
  56. api_not_allowed(true);
  57. }
  58. //prepare variables used in userInfoLib.php functions
  59. $TBL_USERINFO_DEF = Database :: get_course_table(TABLE_USER_INFO);
  60. $TBL_USERINFO_CONTENT = Database :: get_course_table(TABLE_USER_INFO_CONTENT);
  61. $interbreadcrumb[] = array ('url' => 'user.php', 'name' => get_lang('Users'));
  62. if ($origin != 'learnpath')
  63. { //so we are not in learnpath tool
  64. Display :: display_header($nameTools, "User");
  65. }
  66. else
  67. {
  68. ?> <link rel="stylesheet" type="text/css" href="<?php echo api_get_path(WEB_CODE_PATH);?>css/default.css" /> <?php
  69. }
  70. $currentCourse = $currentCourseID;
  71. // api_display_tool_title(get_lang("Users"));
  72. /*
  73. * data found in settings are :
  74. * $uid
  75. * $isAdmin
  76. * $isAdminOfCourse
  77. * $_configuration['main_database']
  78. * $currentCourseID
  79. */
  80. //$userIdViewed = $uInfo; // Id of the user we want to view coming from the user.php
  81. //get information about one user
  82. $userIdViewed = Security::remove_XSS($_REQUEST['uInfo']);
  83. /*
  84. -----------------------------------------------------------
  85. Connection layer between Dokeos and the current script
  86. -----------------------------------------------------------
  87. */
  88. $mainDB = $_configuration['main_database'];
  89. $courseCode = $currentCourseID = $_course['sysCode'];
  90. $tbl_coursUser = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  91. $userIdViewer = $_user['user_id']; // id fo the user currently online
  92. //$userIdViewed = $_GET['userIdViewed']; // Id of the user we want to view
  93. $allowedToEditContent = ($userIdViewer == $userIdViewed) || $is_platformAdmin;
  94. $allowedToEditDef = api_is_allowed_to_edit();
  95. $is_allowedToTrack = api_is_allowed_to_edit() && $_configuration['tracking_enabled'];
  96. // Library connection
  97. include ("userInfoLib.php");
  98. /*
  99. ==============================================================================
  100. FUNCTIONS
  101. ==============================================================================
  102. */
  103. /*
  104. ==============================================================================
  105. COMMANDS SECTION
  106. ==============================================================================
  107. */
  108. $displayMode = "viewContentList";
  109. $removeDef = Security::remove_XSS($_GET['removeDef']);
  110. $editDef = Security::remove_XSS($_GET['editDef']);
  111. $moveUpDef = Security::remove_XSS($_GET['moveUpDef']);
  112. $moveDownDef = Security::remove_XSS($_GET['moveDownDef']);
  113. if ($allowedToEditDef)
  114. {
  115. if (!empty($_POST['submitDef']))
  116. {
  117. if (!empty($_POST['id']))
  118. {
  119. edit_cat_def($_POST['id'], $_POST['title'], $_POST['comment'], $_POST['nbline']);
  120. }
  121. else
  122. {
  123. create_cat_def($_POST['title'], $_POST['comment'], $_POST['nbline']);
  124. }
  125. $displayMode = "viewDefList";
  126. }
  127. elseif (!empty($_GET['removeDef']))
  128. {
  129. remove_cat_def($_GET['removeDef'], true);
  130. $displayMode = "viewDefList";
  131. }
  132. elseif (!empty($_GET['editDef']))
  133. {
  134. $displayMode = "viewDefEdit";
  135. }
  136. elseif (!empty ($_POST['addDef']))
  137. {
  138. $displayMode = "viewDefEdit";
  139. }
  140. elseif (!empty($_GET['moveUpDef']))
  141. {
  142. move_cat_rank($_GET['moveUpDef'], "up");
  143. $displayMode = "viewDefList";
  144. }
  145. elseif (!empty($_GET['moveDownDef']))
  146. {
  147. move_cat_rank($_GET['moveDownDef'], "down");
  148. $displayMode = "viewDefList";
  149. }
  150. elseif (!empty($_POST['viewDefList']))
  151. {
  152. $displayMode = "viewDefList";
  153. }
  154. elseif (!empty($_GET['editMainUserInfo']))
  155. {
  156. $userIdViewed = strval(intval($_GET['editMainUserInfo']));
  157. $displayMode = "viewMainInfoEdit";
  158. }
  159. elseif (!empty($_REQUEST['submitMainUserInfo']))
  160. {
  161. /*
  162. if (isset ($_REQUEST['submitMainUserInfo']))
  163. {
  164. */
  165. $userIdViewed = strval(intval($_REQUEST['submitMainUserInfo']));
  166. /*
  167. //is teacher
  168. $promoteCourseAdmin=$_REQUEST['promoteCourseAdmin'];
  169. $userProperties['status'] = 5;
  170. if ($promoteCourseAdmin)
  171. {
  172. $userProperties['status'] = 1;
  173. }
  174. // deprecated feature
  175. // is coach
  176. if (isset ($_REQUEST['promoteTutor']))
  177. {
  178. $promoteTutor=$_REQUEST['promoteTutor'];
  179. $userProperties['tutor'] = 0;
  180. if ($promoteTutor)
  181. {
  182. $userProperties['tutor'] = 1;
  183. }
  184. }
  185. // role is a string
  186. if (isset ($_REQUEST['role']))
  187. {
  188. $role=$_REQUEST['role'];
  189. $userProperties['role'] = $role;
  190. }
  191. */
  192. //get information about one user - task #3009
  193. if(!empty($_POST['promoteCourseAdmin']) && $_POST['promoteCourseAdmin']){
  194. $userProperties['status'] = 1;
  195. }else{
  196. $userProperties['status'] = 5;
  197. }
  198. if(!empty($_POST['promoteTutor']) && $_POST['promoteTutor']){
  199. $userProperties['tutor'] = 1;
  200. }else{
  201. $userProperties['tutor'] = 0;
  202. }
  203. $userProperties['role'] = $_POST['role'];
  204. update_user_course_properties($userIdViewed, $courseCode, $userProperties);
  205. $displayMode = "viewContentList";
  206. }
  207. }
  208. // COMMON COMMANDS
  209. if ($allowedToEditContent)
  210. {
  211. if (isset($_POST['submitContent']))
  212. {
  213. if ($_POST['cntId']) // submit a content change
  214. {
  215. edit_cat_content($_POST['catId'], $userIdViewed, $_POST['content'], $_SERVER['REMOTE_ADDR']);
  216. }
  217. else // submit a totally new content
  218. {
  219. fill_new_cat_content($_POST['catId'], $userIdViewed, $_POST['content'], $_SERVER['REMOTE_ADDR']);
  220. }
  221. $displayMode = "viewContentList";
  222. }
  223. elseif (!empty($_GET['editContent']))
  224. {
  225. $displayMode = "viewContentEdit";
  226. $userIdViewed = $userIdViewed;
  227. }
  228. }
  229. /*
  230. ==============================================================================
  231. DISPLAY MODES
  232. ==============================================================================
  233. */
  234. // Back button for each display mode (Top)
  235. echo '<div class="actions">';
  236. echo '<a href="user.php?'.api_get_cidreq().'&amp;origin='.$origin.'">'.Display::return_icon('members.gif',get_lang('BackUser')).get_lang('BackUser').'</a>';
  237. if (!is_numeric($_GET['editMainUserInfo']))
  238. {
  239. echo '<a href="userInfo.php?'.api_get_cidreq().'&amp;origin='.$origin.'&amp;editMainUserInfo='.$userIdViewed.'">'.Display::return_icon('edit.gif',get_lang('EditUser')).get_lang('EditUser').'</a>';
  240. }
  241. else
  242. {
  243. echo '<a href="userInfo.php?'.api_get_cidreq().'&amp;origin='.$origin.'&amp;uInfo='.$userIdViewed.'">'.Display::return_icon('edit.gif',get_lang('ViewUser')).get_lang('ViewUser').'</a>';
  244. }
  245. echo '<a href="../mySpace/myStudents.php?'.api_get_cidreq().'&amp;origin=user_course&amp;student='.$userIdViewed.'&amp;details=true&amp;course='.$_course['id'].'">'.Display::return_icon('statistics.gif',get_lang('UserStatistics')).get_lang('UserStatistics').'</a>';
  246. echo '</div>';
  247. if ($displayMode == "viewDefEdit")
  248. {
  249. /*>>>>>>>>>>>> CATEGORIES DEFINITIONS : EDIT <<<<<<<<<<<<*/
  250. $catToEdit = get_cat_def($_GET['editDef']);
  251. $edit_heading_form = new FormValidator('edit_heading_form');
  252. $edit_heading_form->addElement('hidden', 'id');
  253. $edit_heading_form->add_textfield('title', get_lang('Title'));
  254. $edit_heading_form->addElement('textarea', 'comment', get_lang('Comment'), array ('cols' => 60, 'rows' => 4));
  255. $possible_line_nrs[1] = '1 '.get_lang('Line');
  256. $possible_line_nrs[3] = '3 '.get_lang('Lines');
  257. $possible_line_nrs[5] = '5 '.get_lang('Lines');
  258. $possible_line_nrs[10] = '10 '.get_lang('Lines');
  259. $possible_line_nrs[15] = '15 '.get_lang('Lines');
  260. $edit_heading_form->addElement('select', 'nbline', get_lang('LineNumber'), $possible_line_nrs);
  261. $edit_heading_form->addElement('submit', 'submitDef', get_lang('Ok'));
  262. $edit_heading_form->setDefaults($catToEdit);
  263. $edit_heading_form->display();
  264. }
  265. elseif ($displayMode == "viewDefList")
  266. {
  267. /*>>>>>>>>>>>> CATEGORIES DEFINITIONS : LIST <<<<<<<<<<<<*/
  268. $catList = get_cat_def_list();
  269. if ($catList)
  270. {
  271. foreach ($catList as $thisCat)
  272. {
  273. // displays Title and comments
  274. echo "<p>", "<b>".htmlize($thisCat['title'])."</b><br>\n", "<i>".htmlize($thisCat['comment'])."</i>\n", "</p>";
  275. // displays lines
  276. echo "<blockquote>\n", "<font color=\"gray\">\n";
  277. for ($i = 1; $i <= $thisCat['nbline']; $i ++)
  278. {
  279. echo "<br>__________________________________________\n";
  280. }
  281. echo "</font>\n", "</blockquote>\n";
  282. // displays commands
  283. echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&removeDef=", $thisCat['catId'], "\">", "<img src=\"../img/delete.gif\" border=\"0\" alt=\"".get_lang('Remove')."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset))."')) return false;\">", "</a>", "<a href=\"".api_get_self()."?".api_get_cidreq()."&editDef=", $thisCat['catId'], "\">", "<img src=\"../img/edit.gif\" border=\"0\" alt=\"".get_lang('Edit')."\" />", "</a>", "<a href=\"".api_get_self()."?".api_get_cidreq()."&moveUpDef=", $thisCat['catId'], "\">", "<img src=\"../img/up.gif\" border=\"0\" alt=\"".get_lang('MoveUp')."\">", "</a>", "<a href=\"".api_get_self()."?".api_get_cidreq()."&moveDownDef=", $thisCat['catId'], "\">", "<img src=\"../img/down.gif\" border=\"0\" alt=\"".get_lang('MoveDown')."\">", "</a>\n";
  284. } // end for each
  285. } // end if ($catList)
  286. echo "<center>\n",
  287. "<form method=\"post\" action=\"".api_get_self()."\">",
  288. "<input type=\"submit\" name=\"addDef\" value=\"".get_lang('AddNewHeading')."\" />",
  289. "</form>\n",
  290. "<center>\n";
  291. }
  292. elseif ($displayMode == "viewContentEdit")
  293. {
  294. /*>>>>>>>>>>>> CATEGORIES CONTENTS : EDIT <<<<<<<<<<<<*/
  295. $catToEdit = get_cat_content($userIdViewed, $_GET['editContent']);
  296. $content_heading_form = new FormValidator('content_heading_form');
  297. $content_heading_form->addElement('hidden', 'cntId');
  298. $content_heading_form->addElement('hidden', 'catId');
  299. $content_heading_form->addElement('hidden', 'uInfo');
  300. $content_heading_form->addElement('static', null, $catToEdit['title'], htmlize($catToEdit['comment']));
  301. if ($catToEdit['nbline'] == 1)
  302. {
  303. $content_heading_form->addElement('text', 'content', null, array ('size' => 80));
  304. }
  305. else
  306. {
  307. $content_heading_form->addElement('textarea', 'content', null, array ('cols' => 60, 'rows' => $catToEdit['nbline']));
  308. }
  309. $content_heading_form->addElement('submit', 'submitContent', get_lang('Ok'));
  310. $defaults = $catToEdit;
  311. $defaults['cntId'] = $catToEdit['contentId'];
  312. $defaults['uInfo'] = $userIdViewed;
  313. $content_heading_form->setDefaults($defaults);
  314. $content_heading_form->display();
  315. }
  316. elseif ($displayMode == "viewMainInfoEdit")
  317. {
  318. /*>>>>>>>>>>>> CATEGORIES MAIN INFO : EDIT <<<<<<<<<<<<*/
  319. $mainUserInfo = get_main_user_info($userIdViewed, $courseCode);
  320. if ($mainUserInfo)
  321. {
  322. ($mainUserInfo['status'] == 1) ? $courseAdminChecked = "checked" : $courseAdminChecked = "";
  323. ($mainUserInfo['tutor_id'] == 1) ? $tutorChecked = "checked" : $tutorChecked = "";
  324. $image_array=UserManager::get_user_picture_path_by_id($userIdViewed,'web',false,true);
  325. // get the path,width and height from original picture
  326. $big_image = $image_array['dir'].'big_'.$image_array['file'];
  327. $big_image_size = @getimagesize($big_image);
  328. $big_image_width= $big_image_size[0];
  329. $big_image_height= $big_image_size[1];
  330. $url_big_image = $big_image.'?rnd='.time();
  331. if ($image_array['file']=='unknown.jpg') {
  332. echo '<img src="'.$image_array['dir'].$image_array['file'].'" border="1">';
  333. } else {
  334. echo '<input type="image" src="'.$image_array['dir'].$image_array['file'].'" onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
  335. }
  336. //"<td>", get_lang('Tutor'), "</td>\n",
  337. echo "<form action=\"".api_get_self()."\" method=\"post\">\n",
  338. "<input type=\"hidden\" name=\"submitMainUserInfo\" value=\"$userIdViewed\" />\n",
  339. "<table width=\"80%\" border=\"0\">",
  340. "<tr align=\"center\" bgcolor=\"#E6E6E6\">\n",
  341. "<td align=\"left\">", get_lang('Name'), "</td>\n",
  342. "<td width=\"100px\" align=\"left\">", get_lang('Description'), "</td>\n",
  343. "<td>", get_lang('Tutor'), "</td>\n",
  344. "<td>", get_lang('CourseManager'), "</td>\n",
  345. "</tr>\n",
  346. "<tr align=\"center\">",
  347. "<td align=\"left\"><b>", htmlize($mainUserInfo['firstName']), " ", htmlize($mainUserInfo['lastName']), "</b></td>\n",
  348. "<td align=\"left\"><input type=\"text\" name =\"role\" value=\"", $mainUserInfo['role'], "\" maxlength=\"40\" /></td>",
  349. "<td><input class=\"checkbox\" type=\"checkbox\" name=\"promoteTutor\" value=\"1\" ", $tutorChecked, " /></td>";
  350. if (!($is_courseAdmin && $_user['user_id'] == $userIdViewed))
  351. {
  352. echo "<td><input class=\"checkbox\" type=\"checkbox\" name=\"promoteCourseAdmin\" value=\"1\"", $courseAdminChecked, " /></td>\n";
  353. }
  354. else
  355. {
  356. echo "<td>", get_lang('CourseManager'), "</td>\n";
  357. }
  358. echo "<td><button class=\"save\" type=\"submit\" name=\"submit\">".get_lang('SaveChanges')."</button></td>\n", "</tr>", "</table>", "</form>\n";
  359. echo "<p>".Display :: encrypted_mailto_link($mainUserInfo['email'], $mainUserInfo['email'])."</p>";
  360. if (api_get_setting('extended_profile') == 'true')
  361. {
  362. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyCompetences').'</strong></div><div>'.$mainUserInfo['competences'].'</div>';
  363. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div><div>'.$mainUserInfo['diplomas'].'</div>';
  364. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyTeach').'</strong></div><div>'.$mainUserInfo['teach'].'</div>';
  365. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div><div>'.$mainUserInfo['openarea'].'</div>';
  366. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyProductions').'</strong></div><div>'.UserManager::build_production_list($mainUserInfo['user_id']).'</div>';
  367. }
  368. }
  369. else
  370. {
  371. Display :: display_normal_message(get_lang('ThisStudentIsSubscribeThroughASession'));
  372. }
  373. }
  374. elseif ($displayMode == "viewContentList") // default display
  375. {
  376. /*>>>>>>>>>>>> CATEGORIES CONTENTS : LIST <<<<<<<<<<<<*/
  377. $virtual_course_code = $_GET["virtual_course"];
  378. if (isset ($virtual_course_code))
  379. {
  380. $courseCode = $virtual_course_code;
  381. //not supported yet: editing users of virtual courses
  382. $allowedToEditDef = false;
  383. }
  384. $mainUserInfo = get_main_user_info($userIdViewed, $courseCode);
  385. if ($mainUserInfo)
  386. {
  387. $image_array=UserManager::get_user_picture_path_by_id($userIdViewed,'web',false,true);
  388. // get the path,width and height from original picture
  389. $big_image = $image_array['dir'].'big_'.$image_array['file'];
  390. $big_image_size = @getimagesize($big_image);
  391. $big_image_width= $big_image_size[0];
  392. $big_image_height= $big_image_size[1];
  393. $url_big_image = $big_image.'?rnd='.time();
  394. if ($image_array['file']=='unknown.jpg') {
  395. echo '<img src="'.$image_array['dir'].$image_array['file'].'" border="1">';
  396. } else {
  397. echo '<input type="image" src="'.$image_array['dir'].$image_array['file'].'" onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
  398. }
  399. //DISPLAY TABLE HEADING
  400. if ($origin == 'learnpath') { $allowedToEditDef=false; $is_allowedToTrack=false; }
  401. //"<td>",get_lang('Tutor'),"</td>\n",
  402. echo "<table width=\"80%\" border=\"0\">",
  403. "<tr align=\"center\" bgcolor=\"#E6E6E6\">\n",
  404. "<td align=\"left\">",get_lang('Name'),"</td>\n",
  405. "<td width=\"100px\" align=\"left\">",get_lang('Description'),"</td>\n",
  406. "<td>",get_lang('Tutor'),"</td>\n",
  407. "<td>",get_lang('CourseManager'),"</td>\n",
  408. ($allowedToEditDef?"<td>".get_lang('Edit')."</td>\n":""),
  409. ($is_allowedToTrack?"<td>".get_lang('Tracking')."</td>\n":""),
  410. "</tr>\n",
  411. "<tr align=\"center\">\n",
  412. "<td align=\"left\"><b>",htmlize($mainUserInfo['firstName'])," ",htmlize($mainUserInfo['lastName']),"</b></td>\n",
  413. "<td align=\"left\">",htmlize($mainUserInfo['role']),"</td>";
  414. //DISPLAY TABLE CONTENT
  415. // deprecated feature
  416. if ($mainUserInfo['tutor_id'] == 1)
  417. {
  418. echo "<td>",get_lang('Tutor'),"</td>\n";
  419. }
  420. else
  421. {
  422. echo "<td> - </td>\n";
  423. }
  424. if ($mainUserInfo['status'] == 1)
  425. {
  426. echo "<td>",get_lang('CourseManager'),"</td>";
  427. }
  428. else
  429. {
  430. echo "<td> - </td>\n";
  431. }
  432. if ($allowedToEditDef)
  433. {
  434. echo "<td>",
  435. "<a href=\"".api_get_self()."?".api_get_cidreq()."&editMainUserInfo=$userIdViewed\">",
  436. "<img border=\"0\" alt=\"\" src=\"../img/edit.gif\" />",
  437. "</a>",
  438. "</td>";
  439. }
  440. if ($is_allowedToTrack)
  441. {
  442. echo "<td>",
  443. "<a href=\"../mySpace/myStudents.php?".api_get_cidreq()."&origin=user_course&student=$userIdViewed&details=true&course=".$_course['id']."\">",
  444. "<img border=\"0\" alt=\"".get_lang('Tracking')." : $userIdViewed\" src=\"../img/statistics.gif\" />",
  445. "</a>",
  446. "</td>";
  447. }
  448. echo "</tr>",
  449. "</table>";
  450. //"<p><a href=\"mailto:",$mainUserInfo['email'],"\">",$mainUserInfo['email'],"</a>",
  451. if (api_get_setting("show_email_addresses") == "true")
  452. {
  453. echo "<p>". Display::encrypted_mailto_link($mainUserInfo['email'],$mainUserInfo['email']). "</p>";
  454. }
  455. else
  456. {
  457. if (api_is_allowed_to_edit())
  458. {
  459. echo "<p>". Display::encrypted_mailto_link($mainUserInfo['email'],$mainUserInfo['email']). "</p>";
  460. }
  461. }
  462. if (api_get_setting('extended_profile') == 'true')
  463. {
  464. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyCompetences').'</strong></div><div>'.$mainUserInfo['competences'].'</div>';
  465. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div><div>'.$mainUserInfo['diplomas'].'</div>';
  466. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyTeach').'</strong></div><div>'.$mainUserInfo['teach'].'</div>';
  467. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div><div>'.$mainUserInfo['openarea'].'</div>';
  468. echo '<div style="margin-top:10px;" class="actions-message"><strong>'.get_lang('MyProductions').'</strong></div><div>'.UserManager::build_production_list($mainUserInfo['user_id']).'</div>';
  469. }
  470. }
  471. else{
  472. Display :: display_normal_message(get_lang('ThisStudentIsSubscribeThroughASession'));
  473. }
  474. if (get_setting('allow_user_headings') == 'true' && $allowedToEditDef) // only course administrators see this line
  475. {
  476. echo "<div align=right>",
  477. "<form method=\"post\" action=\"".api_get_self()."\">",
  478. get_lang('CourseAdministratorOnly')," : ",
  479. "<input type=\"submit\" name=\"viewDefList\" value=\"".get_lang('DefineHeadings')."\" />",
  480. "</form>",
  481. "<hr noshade size=\"1\" style=\"color:#99CCFF\">",
  482. "</div>\n";
  483. }
  484. $catList = get_course_user_info($userIdViewed);
  485. if ($catList)
  486. {
  487. foreach ($catList as $thisCat)
  488. {
  489. // Category title
  490. echo "<p><b>",$thisCat['title'],"</b></p>\n";
  491. // Category content
  492. echo "<blockquote>\n";
  493. if ($thisCat['content'])
  494. {
  495. echo htmlize($thisCat['content'])."\n";
  496. }
  497. else
  498. {
  499. echo "....";
  500. }
  501. // Edit command
  502. if ($allowedToEditContent)
  503. {
  504. echo "<br><br>\n",
  505. "<a href=\"".api_get_self()."?".api_get_cidreq()."&editContent=",$thisCat['catId'],"&uInfo=",$userIdViewed,"\">",
  506. "<img src=\"../img/edit.gif\" border=\"0\" alt=\"edit\">",
  507. "</a>\n";
  508. }
  509. echo "</blockquote>\n";
  510. }
  511. }
  512. }
  513. // Back button for each display mode (bottom)
  514. //echo "<div class=\"actions\"><a href=\"user.php?".api_get_cidreq()."&amp;origin=".$origin."\">".get_lang('BackUser')."</a></div>\n";
  515. /*
  516. ==============================================================================
  517. FOOTER
  518. ==============================================================================
  519. */
  520. Display :: display_footer();
  521. ?>