user_portal.php 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161
  1. <?php
  2. // $Id: user_portal.php,v 1.10 2006/08/19 09:33:14 yannoo Exp $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2004-2005 Dokeos SPRL
  7. Copyright (c) 2003 Ghent University (UGent)
  8. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9. Copyright (c) various contributors
  10. For a full list of contributors, see "credits.txt".
  11. The full license can be read in "license.txt".
  12. This program is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU General Public License
  14. as published by the Free Software Foundation; either version 2
  15. of the License, or (at your option) any later version.
  16. See the GNU General Public License for more details.
  17. Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  18. Mail: info@dokeos.com
  19. ==============================================================================
  20. */
  21. /**
  22. ==============================================================================
  23. * This is the index file displayed when a user is logged in on Dokeos.
  24. *
  25. * It displays:
  26. * - personal course list
  27. * - menu bar
  28. *
  29. * Part of the what's new ideas were based on a rene haentjens hack
  30. *
  31. * Search for
  32. * CONFIGURATION parameters
  33. * to modify settings
  34. *
  35. * @todo rewrite code to separate display, logic, database code
  36. * @package dokeos.main
  37. ==============================================================================
  38. */
  39. /**
  40. * @todo shouldn't the SCRIPTVAL_ and CONFVAL_ constant be moved to the config page? Has anybody any idea what the are used for?
  41. * if these are really configuration settings then we can add those to the dokeos config settings
  42. * @todo move get_personal_course_list and some other functions to a more appripriate place course.lib.php or user.lib.php
  43. * @todo use api_get_path instead of $rootAdminWeb
  44. * @todo check for duplication of functions with index.php (user_portal.php is orginally a copy of index.php)
  45. * @todo display_digest, shouldn't this be removed and be made into an extension?
  46. */
  47. /*
  48. ==============================================================================
  49. INIT SECTION
  50. ==============================================================================
  51. */
  52. // Don't change these settings
  53. define('SCRIPTVAL_No', 0);
  54. define('SCRIPTVAL_InCourseList', 1);
  55. define('SCRIPTVAL_UnderCourseList', 2);
  56. define('SCRIPTVAL_Both', 3);
  57. define('SCRIPTVAL_NewEntriesOfTheDay', 4);
  58. define('SCRIPTVAL_NewEntriesOfTheDayOfLastLogin', 5);
  59. define('SCRIPTVAL_NoTimeLimit', 6);
  60. // End 'don't change' section
  61. // name of the language file that needs to be included
  62. $language_file = array ('courses', 'index');
  63. $cidReset = true; /* Flag forcing the 'current course' reset,
  64. as we're not inside a course anymore */
  65. /*
  66. -----------------------------------------------------------
  67. Included libraries
  68. -----------------------------------------------------------
  69. */
  70. include_once ('./main/inc/global.inc.php');
  71. include_once (api_get_path(LIBRARY_PATH).'course.lib.php');
  72. include_once (api_get_path(LIBRARY_PATH).'debug.lib.inc.php');
  73. include_once (api_get_path(LIBRARY_PATH).'system_announcements.lib.php');
  74. include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
  75. include_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
  76. api_block_anonymous_users(); // only users who are logged in can proceed
  77. /*
  78. -----------------------------------------------------------
  79. Table definitions
  80. -----------------------------------------------------------
  81. */
  82. //Database table definitions
  83. $main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
  84. $main_admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
  85. $main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
  86. $main_course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  87. $main_category_table = Database :: get_main_table(TABLE_MAIN_CATEGORY);
  88. /*
  89. -----------------------------------------------------------
  90. Constants and CONFIGURATION parameters
  91. -----------------------------------------------------------
  92. */
  93. // ---- Course list options ----
  94. define('CONFVAL_showCourseLangIfNotSameThatPlatform', TRUE);
  95. // Preview of course content
  96. // to disable all: set CONFVAL_maxTotalByCourse = 0
  97. // to enable all: set e.g. CONFVAL_maxTotalByCourse = 5
  98. // by default disabled since what's new icons are better (see function display_digest() )
  99. define('CONFVAL_maxValvasByCourse', 2); // Maximum number of entries
  100. define('CONFVAL_maxAgendaByCourse', 2); // collected from each course
  101. define('CONFVAL_maxTotalByCourse', 0); // and displayed in summary.
  102. define('CONFVAL_NB_CHAR_FROM_CONTENT', 80);
  103. // Order to sort data
  104. $orderKey = array('keyTools', 'keyTime', 'keyCourse'); // default "best" Choice
  105. //$orderKey = array('keyTools', 'keyCourse', 'keyTime');
  106. //$orderKey = array('keyCourse', 'keyTime', 'keyTools');
  107. //$orderKey = array('keyCourse', 'keyTools', 'keyTime');
  108. define('CONFVAL_showExtractInfo', SCRIPTVAL_UnderCourseList);
  109. // SCRIPTVAL_InCourseList // best choice if $orderKey[0] == 'keyCourse'
  110. // SCRIPTVAL_UnderCourseList // best choice
  111. // SCRIPTVAL_Both // probably only for debug
  112. //define('CONFVAL_dateFormatForInfosFromCourses', get_lang('dateFormatShort'));
  113. define('CONFVAL_dateFormatForInfosFromCourses', get_lang('dateFormatLong'));
  114. //define("CONFVAL_limitPreviewTo",SCRIPTVAL_NewEntriesOfTheDay);
  115. //define("CONFVAL_limitPreviewTo",SCRIPTVAL_NoTimeLimit);
  116. define("CONFVAL_limitPreviewTo", SCRIPTVAL_NewEntriesOfTheDayOfLastLogin);
  117. /*if(api_is_allowed_to_create_course() && !isset($_GET['sessionview'])){
  118. $nosession = true;
  119. }
  120. else {
  121. $nosession = false;
  122. }*/
  123. $nosession=false;
  124. if(api_get_setting('use_session_mode')=='true' && !$nosession)
  125. {
  126. if (isset($_GET['inactives'])){
  127. $display_actives = false;
  128. }
  129. else {
  130. $display_actives = true;
  131. }
  132. }
  133. $nameTools = get_lang('MyCourses');
  134. $this_section = SECTION_COURSES;
  135. /*
  136. -----------------------------------------------------------
  137. Check configuration parameters integrity
  138. -----------------------------------------------------------
  139. */
  140. if (CONFVAL_showExtractInfo != SCRIPTVAL_UnderCourseList and $orderKey[0] != "keyCourse")
  141. {
  142. // CONFVAL_showExtractInfo must be SCRIPTVAL_UnderCourseList to accept $orderKey[0] !="keyCourse"
  143. if (DEBUG || api_is_platform_admin()) // Show bug if admin. Else force a new order
  144. die('
  145. <strong>config error:'.__FILE__.'</strong><br />
  146. set
  147. <ul>
  148. <li>
  149. CONFVAL_showExtractInfo = SCRIPTVAL_UnderCourseList
  150. (actually : '.CONFVAL_showExtractInfo.')
  151. </li>
  152. </ul>
  153. or
  154. <ul>
  155. <li>
  156. $orderKey[0] != "keyCourse"
  157. (actually : '.$orderKey[0].')
  158. </li>
  159. </ul>');
  160. else
  161. {
  162. $orderKey = array ('keyCourse', 'keyTools', 'keyTime');
  163. }
  164. }
  165. /*
  166. -----------------------------------------------------------
  167. Header
  168. include the HTTP, HTML headers plus the top banner
  169. -----------------------------------------------------------
  170. */
  171. Display :: display_header($nameTools);
  172. /*
  173. ==============================================================================
  174. FUNCTIONS
  175. display_admin_links()
  176. display_create_course_link()
  177. display_edit_course_list_links()
  178. display_digest($toolsList, $digest, $orderKey, $courses)
  179. show_notification($my_course)
  180. get_personal_course_list($user_id)
  181. get_logged_user_course_html($my_course)
  182. get_user_course_categories()
  183. ==============================================================================
  184. */
  185. /*
  186. -----------------------------------------------------------
  187. Database functions
  188. some of these can go to database layer.
  189. -----------------------------------------------------------
  190. */
  191. /**
  192. * Database function that gets the list of courses for a particular user.
  193. * @param $user_id, the id of the user
  194. * @return an array with courses
  195. */
  196. function get_personal_course_list($user_id)
  197. {
  198. // initialisation
  199. $personal_course_list = array();
  200. // table definitions
  201. $main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
  202. $main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
  203. $main_course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  204. $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
  205. $tbl_session_course_user= Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
  206. $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
  207. $personal_course_list = array ();
  208. //Courses in which we suscribed out of any session
  209. $personal_course_list_sql = "SELECT course.code k, course.directory d, course.visual_code c, course.db_name db, course.title i,
  210. course.tutor_name t, course.course_language l, course_rel_user.status s, course_rel_user.sort sort,
  211. course_rel_user.user_course_cat user_course_cat
  212. FROM ".$main_course_table." course,".$main_course_user_table." course_rel_user
  213. WHERE course.code = course_rel_user.course_code"."
  214. AND course_rel_user.user_id = '".$user_id."'
  215. ORDER BY course_rel_user.user_course_cat, course_rel_user.sort ASC,i";
  216. $course_list_sql_result = api_sql_query($personal_course_list_sql, __FILE__, __LINE__);
  217. while ($result_row = mysql_fetch_array($course_list_sql_result))
  218. {
  219. $personal_course_list[] = $result_row;
  220. }
  221. //$personal_course_list = array_merge($personal_course_list, $course_list_sql_result);
  222. $personal_course_list_sql = "SELECT DISTINCT course.code k, course.directory d, course.visual_code c, course.db_name db, course.title i, course.tutor_name t, course.course_language l, 5 as s
  223. FROM $main_course_table as course, $tbl_session_course_user as srcru
  224. WHERE srcru.course_code=course.code AND srcru.id_user='$user_id'";
  225. $course_list_sql_result = api_sql_query($personal_course_list_sql, __FILE__, __LINE__);
  226. while ($result_row = mysql_fetch_array($course_list_sql_result))
  227. {
  228. $personal_course_list[] = $result_row;
  229. }
  230. //$personal_course_list = array_merge($personal_course_list, $course_list_sql_result);
  231. $personal_course_list_sql = "SELECT DISTINCT course.code k, course.directory d, course.visual_code c, course.db_name db, course.title i, course.tutor_name t, course.course_language l, 2 as s
  232. FROM $main_course_table as course, $tbl_session_course as src, $tbl_session as session
  233. WHERE session.id_coach='$user_id' AND session.id=src.id_session AND src.course_code=course.code";
  234. $course_list_sql_result = api_sql_query($personal_course_list_sql, __FILE__, __LINE__);
  235. //$personal_course_list = array_merge($personal_course_list, $course_list_sql_result);
  236. while ($result_row = mysql_fetch_array($course_list_sql_result))
  237. {
  238. $personal_course_list[] = $result_row;
  239. }
  240. return $personal_course_list;
  241. }
  242. /*
  243. -----------------------------------------------------------
  244. Display functions
  245. -----------------------------------------------------------
  246. */
  247. /**
  248. * Warning: this function defines a global.
  249. * @todo use the correct get_path function
  250. */
  251. function display_admin_links()
  252. {
  253. global $rootAdminWeb;
  254. echo "<li><a href=\"".$rootAdminWeb."\">".get_lang("PlatformAdmin")."</a></li>";
  255. }
  256. /**
  257. * Enter description here...
  258. *
  259. */
  260. function display_create_course_link()
  261. {
  262. echo "<li><a href=\"main/create_course/add_course.php\">".get_lang("CourseCreate")."</a></li>";
  263. }
  264. /**
  265. * Enter description here...
  266. *
  267. */
  268. function display_edit_course_list_links()
  269. {
  270. echo "<li><a href=\"main/auth/courses.php\">".get_lang("CourseManagement")."</a></li>";
  271. }
  272. /**
  273. * Displays a digest e.g. short summary of new agenda and announcements items.
  274. * This used to be displayed in the right hand menu, but is now
  275. * disabled by default (see config settings in this file) because most people like
  276. * the what's new icons better.
  277. *
  278. * @version 1.0
  279. */
  280. function display_digest($toolsList, $digest, $orderKey, $courses)
  281. {
  282. if (is_array($digest) && (CONFVAL_showExtractInfo == SCRIPTVAL_UnderCourseList || CONFVAL_showExtractInfo == SCRIPTVAL_Both))
  283. {
  284. // // // LEVEL 1 // // //
  285. reset($digest);
  286. echo "<br/><br/>\n";
  287. while (list ($key1) = each($digest))
  288. {
  289. if (is_array($digest[$key1]))
  290. {
  291. // // // Title of LEVEL 1 // // //
  292. echo "<b>\n";
  293. if ($orderKey[0] == 'keyTools')
  294. {
  295. $tools = $key1;
  296. echo $toolsList[$key1][name];
  297. }
  298. elseif ($orderKey[0] == 'keyCourse')
  299. {
  300. $courseSysCode = $key1;
  301. echo "<a href=\"", api_get_path(WEB_COURSE_PATH), $courses[$key1][coursePath], "\">", $courses[$key1][courseCode], "</a>\n";
  302. }
  303. elseif ($orderKey[0] == 'keyTime')
  304. {
  305. echo format_locale_date(CONFVAL_dateFormatForInfosFromCourses, strtotime($digest[$key1]));
  306. }
  307. echo "</b>\n";
  308. // // // End Of Title of LEVEL 1 // // //
  309. // // // LEVEL 2 // // //
  310. reset($digest[$key1]);
  311. while (list ($key2) = each($digest[$key1]))
  312. {
  313. // // // Title of LEVEL 2 // // //
  314. echo "<p>\n", "\n";
  315. if ($orderKey[1] == 'keyTools')
  316. {
  317. $tools = $key2;
  318. echo $toolsList[$key2][name];
  319. }
  320. elseif ($orderKey[1] == 'keyCourse')
  321. {
  322. $courseSysCode = $key2;
  323. echo "<a href=\"", api_get_path(WEB_COURSE_PATH), $courses[$key2]['coursePath'], "\">", $courses[$key2]['courseCode'], "</a>\n";
  324. }
  325. elseif ($orderKey[1] == 'keyTime')
  326. {
  327. echo format_locale_date(CONFVAL_dateFormatForInfosFromCourses, strtotime($key2));
  328. }
  329. echo "\n";
  330. echo "</p>";
  331. // // // End Of Title of LEVEL 2 // // //
  332. // // // LEVEL 3 // // //
  333. reset($digest[$key1][$key2]);
  334. while (list ($key3, $dataFromCourse) = each($digest[$key1][$key2]))
  335. {
  336. // // // Title of LEVEL 3 // // //
  337. if ($orderKey[2] == 'keyTools')
  338. {
  339. $level3title = "<a href=\"".$toolsList[$key3]["path"].$courseSysCode."\">".$toolsList[$key3]["name"]."</a>";
  340. }
  341. elseif ($orderKey[2] == 'keyCourse')
  342. {
  343. $level3title = "&#8226; <a href=\"".$toolsList[$tools]["path"].$key3."\">".$courses[$key3]['courseCode']."</a>\n";
  344. }
  345. elseif ($orderKey[2] == 'keyTime')
  346. {
  347. $level3title = "&#8226; <a href=\"".$toolsList[$tools]["path"].$courseSysCode."\">".format_locale_date(CONFVAL_dateFormatForInfosFromCourses, strtotime($key3))."</a>";
  348. }
  349. // // // End Of Title of LEVEL 3 // // //
  350. // // // LEVEL 4 (data) // // //
  351. reset($digest[$key1][$key2][$key3]);
  352. while (list ($key4, $dataFromCourse) = each($digest[$key1][$key2][$key3]))
  353. {
  354. echo $level3title, ' &ndash; ', substr(strip_tags($dataFromCourse), 0, CONFVAL_NB_CHAR_FROM_CONTENT);
  355. //adding ... (three dots) if the texts are too large and they are shortened
  356. if (strlen($dataFromCourse) >= CONFVAL_NB_CHAR_FROM_CONTENT)
  357. {
  358. echo '...';
  359. }
  360. }
  361. echo "<br/>\n";
  362. }
  363. }
  364. }
  365. }
  366. }
  367. } // end function display_digest
  368. /**
  369. * Display code for one specific course a logged in user is subscribed to.
  370. * Shows a link to the course, what's new icons...
  371. *
  372. * $my_course['d'] - course directory
  373. * $my_course['i'] - course title
  374. * $my_course['c'] - visual course code
  375. * $my_course['k'] - system course code
  376. * $my_course['db'] - course database
  377. *
  378. * @version 1.0.3
  379. * @todo refactor into different functions for database calls | logic | display
  380. * @todo replace single-character $my_course['d'] indices
  381. * @todo move code for what's new icons to a separate function to clear things up
  382. * @todo add a parameter user_id so that it is possible to show the courselist of other users (=generalisation). This will prevent having to write a new function for this.
  383. */
  384. function get_logged_user_course_html($my_course)
  385. {
  386. global $nosession;
  387. if(api_get_setting('use_session_mode')=='true' && !$nosession)
  388. {
  389. global $now, $date_start, $date_end;
  390. }
  391. //initialise
  392. $result = '';
  393. // Table definitions
  394. //$statistic_database = Database::get_statistic_database();
  395. $course_database = $my_course['db'];
  396. $course_tool_table = Database :: get_course_table(TABLE_TOOL_LIST, $course_database);
  397. $tool_edit_table = Database :: get_course_table(TABLE_ITEM_PROPERTY, $course_database);
  398. $course_group_user_table = Database :: get_course_table(TOOL_USER, $course_database);
  399. $user_id = api_get_user_id();
  400. $course_system_code = $my_course['k'];
  401. $course_visual_code = $my_course['c'];
  402. $course_title = $my_course['i'];
  403. $course_directory = $my_course['d'];
  404. $course_teacher = $my_course['t'];
  405. $course_teacher_email = $my_course['email'];
  406. $course_info = Database :: get_course_info($course_system_code);
  407. $course_access_settings = CourseManager :: get_access_settings($course_system_code);
  408. $course_id = $course_info['course_id'];
  409. $course_visibility = $course_access_settings['visibility'];
  410. $user_in_course_status = CourseManager :: get_user_in_course_status(api_get_user_id(), $course_system_code);
  411. //function logic - act on the data
  412. $is_virtual_course = CourseManager :: is_virtual_course_from_system_code($my_course['k']);
  413. if ($is_virtual_course)
  414. {
  415. // If the current user is also subscribed in the real course to which this
  416. // virtual course is linked, we don't need to display the virtual course entry in
  417. // the course list - it is combined with the real course entry.
  418. $target_course_code = CourseManager :: get_target_of_linked_course($course_system_code);
  419. $is_subscribed_in_target_course = CourseManager :: is_user_subscribed_in_course(api_get_user_id(), $target_course_code);
  420. if ($is_subscribed_in_target_course)
  421. {
  422. return; //do not display this course entry
  423. }
  424. }
  425. $has_virtual_courses = CourseManager :: has_virtual_courses_from_code($course_system_code, api_get_user_id());
  426. if ($has_virtual_courses)
  427. {
  428. $return_result = CourseManager :: determine_course_title_from_course_info(api_get_user_id(), $course_info);
  429. $course_display_title = $return_result['title'];
  430. $course_display_code = $return_result['code'];
  431. }
  432. else
  433. {
  434. $course_display_title = $course_title;
  435. $course_display_code = $course_visual_code;
  436. }
  437. $s_course_status=$my_course["s"];
  438. $s_htlm_status_icon="";
  439. if($s_course_status==1)
  440. {
  441. $s_htlm_status_icon=Display::return_icon('teachers.gif');
  442. }
  443. if($s_course_status==2)
  444. {
  445. $s_htlm_status_icon=Display::return_icon('coachs.gif');
  446. }
  447. if($s_course_status==5)
  448. {
  449. $s_htlm_status_icon=Display::return_icon('students.gif');
  450. }
  451. //display course entry
  452. $result.="\n\t";
  453. $result .= '<li class="courses"><div class="coursestatusicons">'.$s_htlm_status_icon.'</div>';
  454. //show a hyperlink to the course, unless the course is closed and user is not course admin
  455. if ($course_visibility != COURSE_VISIBILITY_CLOSED || $user_in_course_status == COURSEMANAGER)
  456. {
  457. if(api_get_setting('use_session_mode')=='true' && !$nosession)
  458. {
  459. if(empty($my_course['id_session']))
  460. {
  461. $my_course['id_session'] = 0;
  462. }
  463. if($user_in_course_status == COURSEMANAGER || ($date_start <= $now && $date_end >= $now) || $date_start=='0000-00-00')
  464. {
  465. $result .= '<a href="'.api_get_path(WEB_COURSE_PATH).$course_directory.'/?id_session='.$my_course['id_session'].'">'.$course_display_title.'</a>';
  466. }
  467. }
  468. else
  469. {
  470. $result .= '<a href="'.api_get_path(WEB_COURSE_PATH).$course_directory.'/">'.$course_display_title.'</a>';
  471. }
  472. }
  473. else
  474. {
  475. $result .= $course_display_title." "." ".get_lang("CourseClosed")."";
  476. }
  477. // show the course_code and teacher if chosen to display this
  478. if (get_setting("display_coursecode_in_courselist") == "true" OR get_setting("display_teacher_in_courselist") == "true")
  479. {
  480. $result .= "<br/>";
  481. }
  482. if (get_setting("display_coursecode_in_courselist") == "true")
  483. {
  484. $result .= $course_display_code;
  485. }
  486. if (get_setting("display_coursecode_in_courselist") == "true" AND get_setting("display_teacher_in_courselist") == "true")
  487. {
  488. $result .= ' &ndash; ';
  489. }
  490. if (get_setting("display_teacher_in_courselist") == "true")
  491. {
  492. $result .= $course_teacher;
  493. if(!empty($course_teacher_email))
  494. {
  495. $result .= ' ('.$course_teacher_email.')';
  496. }
  497. }
  498. $current_course_settings = CourseManager :: get_access_settings($my_course['k']);
  499. // display the what's new icons
  500. $result .= show_notification($my_course);
  501. if ((CONFVAL_showExtractInfo == SCRIPTVAL_InCourseList || CONFVAL_showExtractInfo == SCRIPTVAL_Both) && $nbDigestEntries > 0)
  502. {
  503. reset($digest);
  504. $result .= "<ul>";
  505. while (list ($key2) = each($digest[$thisCourseSysCode]))
  506. {
  507. $result .= "<li>";
  508. if ($orderKey[1] == 'keyTools')
  509. {
  510. $result .= "<a href=\"$toolsList[$key2] [\"path\"] $thisCourseSysCode \">";
  511. $result .= "$toolsList[$key2][\"name\"]</a>";
  512. }
  513. else
  514. {
  515. $result .= format_locale_date(CONFVAL_dateFormatForInfosFromCourses, strtotime($key2));
  516. }
  517. $result .= "</li>";
  518. $result .= "<ul>";
  519. reset($digest[$thisCourseSysCode][$key2]);
  520. while (list ($key3, $dataFromCourse) = each($digest[$thisCourseSysCode][$key2]))
  521. {
  522. $result .= "<li>";
  523. if ($orderKey[2] == 'keyTools')
  524. {
  525. $result .= "<a href=\"$toolsList[$key3] [\"path\"] $thisCourseSysCode \">";
  526. $result .= "$toolsList[$key3][\"name\"]</a>";
  527. }
  528. else
  529. {
  530. $result .= format_locale_date(CONFVAL_dateFormatForInfosFromCourses, strtotime($key3));
  531. }
  532. $result .= "<ul compact=\"compact\">";
  533. reset($digest[$thisCourseSysCode][$key2][$key3]);
  534. while (list ($key4, $dataFromCourse) = each($digest[$thisCourseSysCode][$key2][$key3]))
  535. {
  536. $result .= "<li>";
  537. $result .= htmlspecialchars(substr(strip_tags($dataFromCourse), 0, CONFVAL_NB_CHAR_FROM_CONTENT));
  538. $result .= "</li>";
  539. }
  540. $result .= "</ul>";
  541. $result .= "</li>";
  542. }
  543. $result .= "</ul>";
  544. $result .= "</li>";
  545. }
  546. $result .= "</ul>";
  547. }
  548. $result .= "</li>";
  549. if(api_get_setting('use_session_mode')=='true' && !$nosession)
  550. {
  551. if(!empty($my_course['session_name']))
  552. {
  553. $session = $my_course['session_name'];
  554. if($my_course['date_start']=='0000-00-00')
  555. {
  556. $session .= ' - '.get_lang('WithoutTimeLimits');
  557. $active = true;
  558. }
  559. else
  560. {
  561. $session .= ' - '.get_lang('From').' '.$my_course['date_start'].' '.get_lang('To').' '.$my_course['date_end'];
  562. $active = ($date_start <= $now && $date_end >= $now)?true:false;
  563. }
  564. }
  565. $output = array ($my_course['user_course_cat'], $result, $my_course['id_session'], $session, 'active'=>$active);
  566. }
  567. else
  568. {
  569. $output = array ($my_course['user_course_cat'], $result);
  570. }
  571. return $output;
  572. }
  573. /**
  574. * Returns the "what's new" icon notifications
  575. * @version
  576. */
  577. function show_notification($my_course)
  578. {
  579. $statistic_database = Database :: get_statistic_database();
  580. $user_id = api_get_user_id();
  581. $course_database = $my_course['db'];
  582. $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST, $course_database);
  583. $tool_edit_table = Database::get_course_table(TABLE_ITEM_PROPERTY, $course_database);
  584. $course_group_user_table = Database :: get_course_table(TABLE_GROUP_USER, $course_database);
  585. // get the user's last access dates to all tools of this course
  586. $sqlLastTrackInCourse = "SELECT * FROM $statistic_database.track_e_lastaccess
  587. USE INDEX (access_cours_code, access_user_id)
  588. WHERE access_cours_code = '".$my_course['k']."'
  589. AND access_user_id = '$user_id'";
  590. $resLastTrackInCourse = api_sql_query($sqlLastTrackInCourse, __FILE__, __LINE__);
  591. $oldestTrackDate = "3000-01-01 00:00:00";
  592. while ($lastTrackInCourse = mysql_fetch_array($resLastTrackInCourse))
  593. {
  594. $lastTrackInCourseDate[$lastTrackInCourse["access_tool"]] = $lastTrackInCourse["access_date"];
  595. if ($oldestTrackDate > $lastTrackInCourse["access_date"])
  596. $oldestTrackDate = $lastTrackInCourse["access_date"];
  597. }
  598. // get the last edits of all tools of this course
  599. $sql = "SELECT tet.*, tet.lastedit_date last_date, tet.tool tool, tet.ref ref,
  600. tet.lastedit_type type, tet.to_group_id group_id,
  601. ctt.image image, ctt.link link
  602. FROM $tool_edit_table tet, $course_tool_table ctt
  603. WHERE tet.lastedit_date > '$oldestTrackDate'
  604. AND ctt.name = tet.tool
  605. AND ctt.visibility = '1'
  606. AND tet.lastedit_user_id != $user_id
  607. ORDER BY tet.lastedit_date";
  608. $res = api_sql_query($sql);
  609. //get the group_id's with user membership
  610. $group_ids = GroupManager :: get_group_ids($course_database, $user_id);
  611. $groups_ids[] = 0; //add group 'everyone'
  612. //filter all selected items
  613. while ($res && ($item_property = mysql_fetch_array($res)))
  614. {
  615. if ((!isset ($lastTrackInCourseDate[$item_property['tool']]) || $lastTrackInCourseDate[$item_property['tool']] < $item_property['lastedit_date']) && (in_array($item_property['to_group_id'], $groups_ids) || $item_property['to_user_id'] == $user_id) && ($item_property['visibility'] == '1' || ($my_course['s'] == '1' && $item_property['visibility'] == '0') || !isset ($item_property['visibility'])))
  616. {
  617. $notifications[$item_property['tool']] = $item_property;
  618. }
  619. }
  620. //show all tool icons where there is something new
  621. $retvalue = '&nbsp;';
  622. if (isset ($notifications))
  623. {
  624. while (list ($key, $notification) = each($notifications))
  625. {
  626. $lastDate = date("d/m/Y H:i", convert_mysql_date($notification['lastedit_date']));
  627. $type = $notification['lastedit_type'];
  628. //$notification[image]=str_replace(".png","gif",$notification[image]);
  629. //$notification[image]=str_replace(".gif","_s.gif",$notification[image]);
  630. $retvalue .= '<a href="'.api_get_path(WEB_CODE_PATH).$notification['link'].'?cidReq='.$my_course['k'].'&amp;ref='.$notification['ref'].'">'.'<img title="-- '.get_lang(ucfirst($notification['tool'])).' -- '.get_lang('_title_notification').": ".get_lang($type)." ($lastDate).\"".' src="'.api_get_path(WEB_CODE_PATH).'img/'.$notification['image'].'" border="0" align="absbottom" /></a>&nbsp;';
  631. }
  632. }
  633. return $retvalue;
  634. }
  635. /**
  636. * retrieves the user defined course categories
  637. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  638. * @return array containing all the titles of the user defined courses with the id as key of the array
  639. */
  640. function get_user_course_categories()
  641. {
  642. global $_user;
  643. $table_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
  644. $sql = "SELECT * FROM ".$table_category." WHERE user_id='".$_user['user_id']."'";
  645. $result = api_sql_query($sql,__FILE__,__LINE__);
  646. while ($row = mysql_fetch_array($result))
  647. {
  648. $output[$row['id']] = $row['title'];
  649. }
  650. return $output;
  651. }
  652. /*
  653. ==============================================================================
  654. MAIN CODE
  655. ==============================================================================
  656. */
  657. /*
  658. ==============================================================================
  659. PERSONAL COURSE LIST
  660. ==============================================================================
  661. */
  662. if (!isset ($maxValvas))
  663. {
  664. $maxValvas = CONFVAL_maxValvasByCourse; // Maximum number of entries
  665. }
  666. if (!isset ($maxAgenda))
  667. {
  668. $maxAgenda = CONFVAL_maxAgendaByCourse; // collected from each course
  669. }
  670. if (!isset ($maxCourse))
  671. {
  672. $maxCourse = CONFVAL_maxTotalByCourse; // and displayed in summary.
  673. }
  674. $maxValvas = (int) $maxValvas;
  675. $maxAgenda = (int) $maxAgenda;
  676. $maxCourse = (int) $maxCourse; // 0 if invalid
  677. if ($maxCourse > 0)
  678. {
  679. unset ($allentries); // we shall collect all summary$key1 entries in here:
  680. $toolsList['agenda']['name'] = get_lang('Agenda');
  681. $toolsList['agenda']['path'] = api_get_path(WEB_CODE_PATH)."calendar/agenda.php?cidReq=";
  682. $toolsList['valvas']['name'] = get_lang('Valvas');
  683. $toolsList['valvas']['path'] = api_get_path(WEB_CODE_PATH)."announcements/announcements.php?cidReq=";
  684. }
  685. echo "<div class=\"maincontent\">"; // start of content for logged in users
  686. // Plugins for the my courses main area
  687. api_plugin('mycourses_main');
  688. // link to see the session view or course view
  689. /*if(api_get_setting('use_session_mode')=='true' && api_is_allowed_to_create_course()) {
  690. if(isset($_GET['sessionview'])){
  691. echo '<a href="'.api_get_self().'">'.get_lang('CourseView').'</a>';
  692. }
  693. else {
  694. echo '<a href="'.api_get_self().'?sessionview=true">'.get_lang('SessionView').'</a>';
  695. }
  696. }*/
  697. /*
  698. -----------------------------------------------------------------------------
  699. System Announcements
  700. -----------------------------------------------------------------------------
  701. */
  702. $announcement = $_GET['announcement'] ? $_GET['announcement'] : -1;
  703. $visibility = api_is_allowed_to_create_course() ? VISIBLE_TEACHER : VISIBLE_STUDENT;
  704. SystemAnnouncementManager :: display_announcements($visibility, $announcement);
  705. if (!empty ($_GET['include']) && !strstr($_GET['include'], '/') && strstr($_GET['include'], '.html'))
  706. {
  707. include ('./home/'.$_GET['include']);
  708. $pageIncluded = true;
  709. }
  710. else
  711. {
  712. /*--------------------------------------
  713. DISPLAY COURSES
  714. --------------------------------------*/
  715. $list = '';
  716. $personal_course_list = UserManager::get_personal_session_course_list($_user['user_id']);
  717. /*if(api_get_setting('use_session_mode')=='true' && !$nosession)
  718. {
  719. echo "bouh";
  720. $personal_course_list = UserManager::get_personal_session_course_list($_user['user_id']);
  721. }
  722. else
  723. {
  724. $personal_course_list = get_personal_course_list($_user['user_id']);
  725. }*/
  726. foreach ($personal_course_list as $my_course)
  727. {
  728. $thisCourseDbName = $my_course['db'];
  729. $thisCourseSysCode = $my_course['k'];
  730. $thisCoursePublicCode = $my_course['c'];
  731. $thisCoursePath = $my_course['d'];
  732. $sys_course_path = api_get_path(SYS_COURSE_PATH);
  733. /*
  734. currently disabled functionality, should return
  735. $thisCoursePath = $sys_course_path . $thisCoursePath;
  736. if(! file_exists($thisCoursePath))
  737. {
  738. echo "<li>".$my_course['i']."<br/>";
  739. echo "".get_lang("CourseDoesntExist")." (<a href=\"main/install/update_courses.php\">";
  740. echo "".get_lang("GetCourseFromOldPortal")."</a>)</li>";
  741. continue;
  742. }*/
  743. $dbname = $my_course['k'];
  744. $status[$dbname] = $my_course['s'];
  745. $nbDigestEntries = 0; // number of entries already collected
  746. if ($maxCourse < $maxValvas)
  747. $maxValvas = $maxCourse;
  748. if ($maxCourse > 0)
  749. {
  750. $courses[$thisCourseSysCode]['coursePath'] = $thisCoursePath;
  751. $courses[$thisCourseSysCode]['courseCode'] = $thisCoursePublicCode;
  752. }
  753. /*
  754. -----------------------------------------------------------
  755. Announcements
  756. -----------------------------------------------------------
  757. */
  758. $course_database = $my_course['db'];
  759. $course_tool_table = Database::get_course_table(TABLE_TOOL_LIST, $course_database);
  760. $query = "SELECT visibility FROM $course_tool_table WHERE link = 'announcements/announcements.php' AND visibility = 1";
  761. $result = api_sql_query($query);
  762. // collect from announcements, but only if tool is visible for the course
  763. if ($result && $maxValvas > 0 && mysql_num_rows($result) > 0)
  764. {
  765. //Search announcements table
  766. //Take the entries listed at the top of advalvas/announcements tool
  767. $course_announcement_table = Database::get_course_table(TABLE_ANNOUNCEMENT);
  768. $sqlGetLastAnnouncements = "SELECT end_date publicationDate, content
  769. FROM ".$course_announcement_table;
  770. switch (CONFVAL_limitPreviewTo)
  771. {
  772. case SCRIPTVAL_NewEntriesOfTheDay :
  773. $sqlGetLastAnnouncements .= "WHERE DATE_FORMAT(end_date,'%Y %m %d') >= '".date("Y m d")."'";
  774. break;
  775. case SCRIPTVAL_NoTimeLimit :
  776. break;
  777. case SCRIPTVAL_NewEntriesOfTheDayOfLastLogin :
  778. // take care mysql -> DATE_FORMAT(time,format) php -> date(format,date)
  779. $sqlGetLastAnnouncements .= "WHERE DATE_FORMAT(end_date,'%Y %m %d') >= '".date("Y m d", $_user["lastLogin"])."'";
  780. }
  781. $sqlGetLastAnnouncements .= "ORDER BY end_date DESC
  782. LIMIT ".$maxValvas;
  783. $resGetLastAnnouncements = api_sql_query($sqlGetLastAnnouncements, __FILE__, __LINE__);
  784. if ($resGetLastAnnouncements)
  785. {
  786. while ($annoncement = mysql_fetch_array($resGetLastAnnouncements))
  787. {
  788. $keyTools = "valvas";
  789. $keyTime = $annoncement['publicationDate'];
  790. $keyCourse = $thisCourseSysCode;
  791. $digest[$$orderKey[0]][$$orderKey[1]][$$orderKey[2]][] = htmlspecialchars(substr(strip_tags($annoncement["content"]), 0, CONFVAL_NB_CHAR_FROM_CONTENT));
  792. $nbDigestEntries ++; // summary has same order as advalvas
  793. }
  794. }
  795. }
  796. /*
  797. -----------------------------------------------------------
  798. Agenda
  799. -----------------------------------------------------------
  800. */
  801. $course_database = $my_course['db'];
  802. $course_tool_table = Database :: get_course_table(TABLE_TOOL_LIST,$course_database);
  803. $query = "SELECT visibility FROM $course_tool_table WHERE link = 'calendar/agenda.php' AND visibility = 1";
  804. $result = api_sql_query($query);
  805. $thisAgenda = $maxCourse - $nbDigestEntries; // new max entries for agenda
  806. if ($maxAgenda < $thisAgenda)
  807. $thisAgenda = $maxAgenda;
  808. // collect from agenda, but only if tool is visible for the course
  809. if ($result && $thisAgenda > 0 && mysql_num_rows($result) > 0)
  810. {
  811. $tableCal = $courseTablePrefix.$thisCourseDbName.$_configuration['db_glue']."calendar_event";
  812. $sqlGetNextAgendaEvent = "SELECT start_date , title content, start_time
  813. FROM $tableCal
  814. WHERE start_date >= CURDATE()
  815. ORDER BY start_date, start_time
  816. LIMIT $maxAgenda";
  817. $resGetNextAgendaEvent = api_sql_query($sqlGetNextAgendaEvent, __FILE__, __LINE__);
  818. if ($resGetNextAgendaEvent)
  819. {
  820. while ($agendaEvent = mysql_fetch_array($resGetNextAgendaEvent))
  821. {
  822. $keyTools = 'agenda';
  823. $keyTime = $agendaEvent['start_date'];
  824. $keyCourse = $thisCourseSysCode;
  825. $digest[$$orderKey[0]][$$orderKey[1]][$$orderKey[2]][] = htmlspecialchars(substr(strip_tags($agendaEvent["content"]), 0, CONFVAL_NB_CHAR_FROM_CONTENT));
  826. $nbDigestEntries ++; // summary has same order as advalvas
  827. }
  828. }
  829. }
  830. /*
  831. -----------------------------------------------------------
  832. Digest Display
  833. take collected data and display it
  834. -----------------------------------------------------------
  835. */
  836. $list[] = get_logged_user_course_html($my_course);
  837. } //end while mycourse...
  838. }
  839. if (is_array($list))
  840. {
  841. //Courses whithout sessions
  842. $old_user_category = 0;
  843. foreach($list as $key=>$value)
  844. {
  845. if($value[2]==0){
  846. $userdefined_categories = get_user_course_categories();
  847. echo "<ul>\n";
  848. if ($old_user_category<>$value[0])
  849. {
  850. if ($key<>0 OR $value[0]<>0) // there are courses in the previous category
  851. {
  852. echo "\n</ul>";
  853. }
  854. echo "\n\n\t<ul class=\"user_course_category\"><li>".$userdefined_categories[$value[0]]."</li></ul>\n";
  855. if ($key<>0 OR $value[0]<>0) // there are courses in the previous category
  856. {
  857. echo "<ul>";
  858. }
  859. $old_user_category=$value[0];
  860. }
  861. echo $value[1];
  862. echo "</ul>\n";
  863. }
  864. }
  865. $listActives = $listInactives = $listCourses = array();
  866. foreach($list as $key=>$value){
  867. if($value['active'])
  868. $listActives[] = $value;
  869. else if(!empty($value[2]))
  870. $listInactives[] = $value;
  871. }
  872. $old_user_category = 0;
  873. $userdefined_categories = get_user_course_categories();
  874. if(count($listActives)>0 && $display_actives){
  875. echo "<ul style=\"line-height: 20px; margin-top: 20px;\">\n";
  876. foreach ($listActives as $key => $value)
  877. {
  878. if(!empty($value[2])){
  879. if($old_session != $value[2]){
  880. $old_session = $value[2];
  881. if($key != 0){
  882. echo "\n</ul>";
  883. }
  884. echo "\n\n\t<ul class=\"user_course_category\" style=\"margin-bottom: 10px;\"><li>".$value[3]."</li></ul>\n";
  885. echo "<ul style=\"padding: 0px; margin: 0px;\">";
  886. }
  887. }
  888. echo $value[1];
  889. }
  890. echo "\n</ul><br /><br />\n";
  891. }
  892. if(count($listInactives)>0 && !$display_actives){
  893. echo "<ul style=\"line-height: 20px;\">";
  894. foreach ($listInactives as $key => $value)
  895. {
  896. if(!empty($value[2])){
  897. if($old_session != $value[2]){
  898. $old_session = $value[2];
  899. if($key != 0){
  900. echo "\n</ul>";
  901. }
  902. echo "\n\n\t<ul class=\"user_course_category\"><li>".$value[3]."</li></ul>\n";
  903. echo "<ul>";
  904. }
  905. }
  906. echo $value[1];
  907. }
  908. echo "\n</ul><br /><br />\n";
  909. }
  910. /*if(api_get_setting('use_session_mode')=='true' && !$nosession)
  911. {
  912. $listActives = $listInactives = $listCourses = array();
  913. foreach($list as $key=>$value){
  914. if($value['active'])
  915. $listActives[] = $value;
  916. else if(!empty($value[2]))
  917. $listInactives[] = $value;
  918. }
  919. $old_user_category = 0;
  920. $userdefined_categories = get_user_course_categories();
  921. //Courses which belong to no sessions
  922. //echo "<ul style=\"line-height: 20px;\">\n\n\n\t<ul class=\"user_course_category\"><li>".get_lang("Courses_no_sessions")."</li></ul>\n</ul>";
  923. if(count($listActives)>0 && $display_actives){
  924. echo "<ul style=\"line-height: 20px;\">\n";
  925. foreach ($listActives as $key => $value)
  926. {
  927. if(!empty($value[2])){
  928. if($old_session != $value[2]){
  929. $old_session = $value[2];
  930. if($key != 0){
  931. echo "\n</ul>";
  932. }
  933. echo "\n\n\t<ul class=\"user_course_category\"><li>".$value[3]."</li></ul>\n";
  934. echo "<ul>";
  935. }
  936. }
  937. echo $value[1];
  938. }
  939. echo "\n</ul></ul><br /><br />\n";
  940. }
  941. if(count($listInactives)>0 && !$display_actives){
  942. echo "<ul style=\"line-height: 20px;\">";
  943. foreach ($listInactives as $key => $value)
  944. {
  945. if(!empty($value[2])){
  946. if($old_session != $value[2]){
  947. $old_session = $value[2];
  948. if($key != 0){
  949. echo "\n</ul>";
  950. }
  951. echo "\n\n\t<ul class=\"user_course_category\"><li>".$value[3]."</li></ul>\n";
  952. echo "<ul>";
  953. }
  954. }
  955. echo $value[1];
  956. }
  957. echo "\n</ul><br /><br />\n";
  958. }
  959. }
  960. else
  961. {
  962. $old_user_category = 0;
  963. $userdefined_categories = get_user_course_categories();
  964. echo "<ul>\n";
  965. foreach ($list as $key => $value)
  966. {
  967. if ($old_user_category<>$value[0])
  968. {
  969. if ($key<>0 OR $value[0]<>0) // there are courses in the previous category
  970. {
  971. echo "\n</ul>";
  972. }
  973. echo "\n\n\t<ul class=\"user_course_category\"><li>".$userdefined_categories[$value[0]]."</li></ul>\n";
  974. if ($key<>0 OR $value[0]<>0) // there are courses in the previous category
  975. {
  976. echo "<ul>";
  977. }
  978. $old_user_category=$value[0];
  979. }
  980. echo $value[1];
  981. }
  982. echo "\n</ul>\n";
  983. }*/
  984. }
  985. echo "</div>"; // end of content section
  986. // Register whether full admin or null admin course
  987. // by course through an array dbname x user status
  988. api_session_register('status');
  989. /*
  990. ==============================================================================
  991. RIGHT MENU
  992. ==============================================================================
  993. */
  994. echo "<div class=\"menu\">";
  995. // tabs that are deactivated are added here
  996. if (!empty($menu_navigation))
  997. {
  998. echo "<div class=\"menusection\">";
  999. echo "<span class=\"menusectioncaption\">".get_lang("MainNavigation")."</span>";
  1000. echo "<ul class=\"menulist\">";
  1001. foreach($menu_navigation as $section => $navigation_info)
  1002. {
  1003. $current = ($section == $GLOBALS['this_section'] ? ' id="current"' : '');
  1004. echo '<li'.$current.'>';
  1005. echo '<a href="'.$navigation_info['url'].'" target="_top">'.$navigation_info['title'].'</a>';
  1006. echo '</li>';
  1007. echo "\n";
  1008. }
  1009. echo "</ul>";
  1010. echo '</div>';
  1011. }
  1012. // api_display_language_form(); // moved to the profile page.
  1013. echo "<div class=\"menusection\">";
  1014. echo "<span class=\"menusectioncaption\">".get_lang("MenuUser")."</span>";
  1015. echo "<ul class=\"menulist\">";
  1016. $display_add_course_link = api_is_allowed_to_create_course() && ($_SESSION["studentview"] != "studentenview");
  1017. if ($display_add_course_link)
  1018. display_create_course_link();
  1019. display_edit_course_list_links();
  1020. display_digest($toolsList, $digest, $orderKey, $courses);
  1021. echo "</ul>";
  1022. echo "</div>";
  1023. // plugins for the my courses menu
  1024. if (is_array($_plugins['mycourses_menu'])){
  1025. echo '<div class="note" style="background: none">';
  1026. api_plugin('mycourses_menu');
  1027. echo "</div>";
  1028. }
  1029. echo "</div>"; // end of menu
  1030. /*
  1031. ==============================================================================
  1032. FOOTER
  1033. ==============================================================================
  1034. */
  1035. Display :: display_footer();
  1036. ?>