dokeos-course_home
[ class tree: dokeos-course_home ] [ index: dokeos-course_home ] [ all elements ]

Source for file course_home.php

Documentation is available at course_home.php

  1. <?php // $Id: course_home.php 13970 2007-12-05 16:56:20Z yannoo $
  2. /*
  3. ==============================================================================
  4.     Dokeos - elearning and course management software
  5.  
  6.     Copyright (c) 2004-2005 Dokeos S.A.
  7.     Copyright (c) 2003 Ghent University
  8.     Copyright (c) 2001 Universite Catholique de Louvain
  9.     Copyright (c) various contributors
  10.  
  11.     For a full list of contributors, see "credits.txt".
  12.     The full license can be read in "license.txt".
  13.  
  14.     This program is free software; you can redistribute it and/or
  15.     modify it under the terms of the GNU General Public License
  16.     as published by the Free Software Foundation; either version 2
  17.     of the License, or (at your option) any later version.
  18.  
  19.     See the GNU General Public License for more details.
  20.  
  21.     Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  22.     Mail: info@dokeos.com
  23. ==============================================================================
  24. */
  25. /**
  26. ==============================================================================
  27. *         HOME PAGE FOR EACH COURSE
  28. *
  29. *    This page, included in every course's index.php is the home
  30. *    page. To make administration simple, the teacher edits his
  31. *    course from the home page. Only the login detects that the
  32. *    visitor is allowed to activate, deactivate home page links,
  33. *    access to the teachers tools (statistics, edit forums...).
  34. *
  35. * Edit visibility of tools
  36. *
  37. *   visibility = 1 - everybody
  38. *   visibility = 0 - course admin (teacher) and platform admin
  39. *
  40. * Who can change visibility ?
  41. *
  42. *   admin = 0 - course admin (teacher) and platform admin
  43. *   admin = 1 - platform admin
  44. *
  45. * Show message to confirm that a tools must be hide from available tools
  46. *
  47. *   visibility 0,1
  48. *
  49. *
  50. *    @package dokeos.course_home
  51. ==============================================================================
  52. */
  53.  
  54. /*
  55. ==============================================================================
  56.         INIT SECTION
  57. ==============================================================================
  58. */
  59.  
  60. $htmlHeadXtra["
  61.         <style type=\"text/css\" media=\"screen, projection\">
  62. .row{
  63. width:100%;
  64. }
  65. div.row div.label {
  66. width: 0%;
  67. }
  68.         
  69. div.row div.formw {
  70. width: 100%;
  71. }
  72.         </style>";
  73.  
  74. // name of the language file that needs to be included
  75. $language_file["course_home";
  76. $use_anonymous true;
  77. // inlcuding the global file
  78. include('../../main/inc/global.inc.php');
  79.  
  80. if(!isset($cidReq))
  81. {
  82.     $cidReq api_get_course_id()// to provide compatibility. with previous system
  83.  
  84.     global $error_msg,$error_no;
  85.     $classError "init";    
  86.     $error_no[$classError]["2";
  87.     $error_level[$classError]["info";
  88.     $error_msg[$classError]["[".__FILE__."][".__LINE__."] cidReq was Missing $cidReq take $dbname;";
  89. }
  90.  
  91. if(isset($_SESSION['_gid'])){
  92.     unset($_SESSION['_gid']);
  93. }
  94.  
  95. // The section for the tabs
  96. $this_section=SECTION_COURSES;
  97.  
  98. /*
  99. -----------------------------------------------------------
  100.     Libraries
  101. -----------------------------------------------------------
  102. */
  103. include_once(api_get_path(LIBRARY_PATH'course.lib.php');
  104. include_once(api_get_path(LIBRARY_PATH'debug.lib.inc.php');
  105.  
  106. /*
  107. -----------------------------------------------------------
  108.     Constants
  109. -----------------------------------------------------------
  110. */
  111. define ("TOOL_PUBLIC""Public");
  112. define ("TOOL_PUBLIC_BUT_HIDDEN""PublicButHide");
  113. define ("TOOL_COURSE_ADMIN""courseAdmin");
  114. define ("TOOL_PLATFORM_ADMIN""platformAdmin");
  115. define ("TOOL_AUTHORING""toolauthoring");
  116. define ("TOOL_INTERACTION""toolinteraction");
  117. define ("TOOL_ADMIN""tooladmin");
  118. define ("TOOL_ADMIN_PLATEFORM""tooladminplatform");
  119. // ("TOOL_ADMIN_PLATFORM_VISIBLE", "tooladminplatformvisible");
  120. //define ("TOOL_ADMIN_PLATFORM_INVISIBLE", "tooladminplatforminvisible");
  121. //define ("TOOL_ADMIN_COURS_INVISIBLE", "tooladmincoursinvisible");
  122. define ("TOOL_STUDENT_VIEW""toolstudentview");
  123. define ("TOOL_ADMIN_VISIBLE""tooladminvisible");
  124. /*
  125.  
  126. -----------------------------------------------------------
  127.     Virtual course support code
  128. -----------------------------------------------------------
  129. */
  130. $user_id api_get_user_id();
  131. $course_code $_course["sysCode"];
  132. $course_info Database::get_course_info($course_code);
  133.  
  134. $return_result CourseManager::determine_course_title_from_course_info($_user['user_id']$course_info);
  135. $course_title $return_result["title"];
  136. $course_code $return_result["code"];
  137.  
  138. $_course["name"$course_title;
  139. $_course['official_code'$course_code;
  140.  
  141.  
  142. /*
  143. -----------------------------------------------------------
  144.     Is the user allowed here?
  145. -----------------------------------------------------------
  146. */
  147. if($is_allowed_in_course == false
  148. {
  149.     api_not_allowed(true);
  150. }
  151. /*
  152. -----------------------------------------------------------
  153.     Header
  154. -----------------------------------------------------------
  155. */
  156. Display::display_header($course_title"Home");
  157.  
  158.  
  159.  
  160.  
  161. /*
  162. -----------------------------------------------------------
  163.     STATISTICS
  164. -----------------------------------------------------------
  165. */
  166. if(!isset($coursesAlreadyVisited[$_cid]) )
  167. {
  168.     include(api_get_path(LIBRARY_PATH'events.lib.inc.php');
  169.     $coursesAlreadyVisited[$_cid1;
  170.     api_session_register('coursesAlreadyVisited');
  171. }
  172.  
  173.  
  174. $temps=time();
  175. $reqdate="&reqdate=$temps";
  176.  
  177.  
  178. /*
  179. ==============================================================================
  180.         MAIN CODE
  181. ==============================================================================
  182. */
  183. //display course title for course home page (similar to toolname for tool pages)
  184. //echo '<h3>'.api_display_tool_title($nameTools) . '</h3>';
  185. /*
  186. -----------------------------------------------------------
  187.     Introduction section
  188.     (editable by course admins)
  189. -----------------------------------------------------------
  190. */
  191.  
  192. $fck_attribute['Width''100%';
  193. $fck_attribute['Height''400';
  194. $fck_attribute['ToolbarSet''Full';
  195.  
  196.  
  197.  
  198. /*
  199. -----------------------------------------------------------
  200.     SWITCH TO A DIFFERENT HOMEPAGE VIEW
  201.     the setting homepage_view is adjustable through
  202.     the platform administration section
  203. -----------------------------------------------------------
  204. */
  205. if(get_setting('homepage_view'== "activity")
  206. {
  207.     include('activity.php');
  208. }
  209. elseif(get_setting('homepage_view'== "2column")
  210. {
  211.     include('2column.php');
  212. }
  213. elseif(get_setting('homepage_view'== "3column")
  214. {
  215.     include('3column.php');
  216. }
  217.  
  218. /*
  219. ==============================================================================
  220.         FOOTER
  221. ==============================================================================
  222. */
  223. ?>

Documentation generated on Thu, 12 Jun 2008 13:15:14 -0500 by phpDocumentor 1.4.1