remove old readme
[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 // Look for tree icons for displaying content navigation from theme image folder,
20 // if the icon is not there, look up in atutor root image folder
21 global $rtl;
22
23 $tree_collapse_icon = AT_BASE_HREF.find_image($rtl.'tree/tree_collapse.gif', '');
24 $tree_expand_icon = AT_BASE_HREF.find_image($rtl.'tree/tree_expand.gif', '');
25                 
26 ?>
27 ATutor = ATutor || {};
28 ATutor.course = ATutor.course || {};
29
30 (function () {
31
32     ATutor.base_href = "<?php echo AT_BASE_HREF; ?>";
33     ATutor.course.show = "<?php echo _AT('show'); ?>";
34     ATutor.course.hide = "<?php echo _AT('hide'); ?>";
35     ATutor.course.theme = "<?php echo $_SESSION['prefs']['PREF_THEME']; ?>";
36     ATutor.course.collapse_icon = "<?php echo $tree_collapse_icon; ?>";
37     ATutor.course.expand_icon = "<?php echo $tree_expand_icon; ?>";
38
39     //everything in the document.ready block executes after the page is fully loaded
40     jQuery(document).ready( function () {
41         ATutor.users.preferences.setStyles(
42                      '<?php echo $_SESSION["prefs"]["PREF_BG_COLOUR"]; ?>',
43                      '<?php echo $_SESSION["prefs"]["PREF_FG_COLOUR"]; ?>',
44                      '<?php echo $_SESSION["prefs"]["PREF_HL_COLOUR"]; ?>',
45                      '<?php echo $_SESSION["prefs"]["PREF_FONT_FACE"]; ?>',
46                      '<?php echo $_SESSION["prefs"]["PREF_FONT_TIMES"]; ?>');
47
48         ATutor.users.preferences.addPrefWizClickHandler();
49         ATutor.users.preferences.course_id = "<?php echo $_SESSION['course_id']; ?>";                
50 <?php 
51         if (isset($_SESSION['course_id']) && ($_SESSION['course_id'] > 0)) {
52 ?>
53             var myName = self.name;
54             if (myName != "prefWizWindow" && myName != "progWin") {
55                 ATutor.course.doSideMenus();
56                 ATutor.course.doMenuToggle();
57             }
58 <?php   }
59 ?>        
60      });
61 })();
62
63 ATutor.addJavascript(ATutor.base_href+"jscripts/lib/jquery.autoHeight.js");