ATutor 2.0
[atutor.git] / jscripts / ATutor_js.php
1 <?php 
2 /************************************************************************/
3 /* ATutor                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002 - 2010                                            */
6 /* Inclusive Design Institute                                           */
7 /* http://atutor.ca                                                     */
8 /*                                                                      */
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.                        */
12 /************************************************************************/
13 // $Id: $
14 //
15 // This file is essentially a javascript file, but needs to be terminated with
16 // a .php extension so that php calls can be used within it. Please put pure javascript
17 // in ATutor.js
18 ?>
19 ATutor = ATutor || {};
20 ATutor.course = ATutor.course || {};
21
22 (function () {
23
24     ATutor.base_href = "<?php echo AT_BASE_HREF; ?>";
25     ATutor.course.show = "<?php echo _AT('show'); ?>";
26     ATutor.course.hide = "<?php echo _AT('hide'); ?>";
27     ATutor.course.theme = "<?php echo $_SESSION['prefs']['PREF_THEME']; ?>";
28
29     //everything in the document.ready block executes after the page is fully loaded
30     jQuery(document).ready( function () {
31         ATutor.users.preferences.setStyles(
32                      '<?php echo $_SESSION["prefs"]["PREF_BG_COLOUR"]; ?>',
33                      '<?php echo $_SESSION["prefs"]["PREF_FG_COLOUR"]; ?>',
34                      '<?php echo $_SESSION["prefs"]["PREF_HL_COLOUR"]; ?>',
35                      '<?php echo $_SESSION["prefs"]["PREF_FONT_FACE"]; ?>',
36                      '<?php echo $_SESSION["prefs"]["PREF_FONT_TIMES"]; ?>');
37
38         ATutor.users.preferences.addPrefWizClickHandler();
39         ATutor.users.preferences.course_id = "<?php echo $_SESSION['course_id']; ?>";                
40 <?php 
41         if (isset($_SESSION['course_id']) && ($_SESSION['course_id'] > 0)) {
42 ?>
43             var myName = self.name;
44             if (myName != "prefWizWindow" && myName != "progWin") {
45                 ATutor.course.doSideMenus();
46                 ATutor.course.doMenuToggle();
47             }
48 <?php   }
49 ?>        
50      });
51 })();
52
53