changed git call from https to git readonly
[atutor.git] / mods / calendar / module.php
1 <?php\r
2 /*******\r
3  * doesn't allow this file to be loaded with a browser.\r
4  */\r
5 if (!defined('AT_INCLUDE_PATH')) { exit; }\r
6 \r
7 /******\r
8  * this file must only be included within a Module obj\r
9  */\r
10 if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }\r
11 \r
12 /*******\r
13  * assign the instructor and admin privileges to the constants.\r
14  */\r
15 define('AT_PRIV_CALENDAR',       $this->getPrivilege());\r
16 define('AT_ADMIN_PRIV_CALENDAR', $this->getAdminPrivilege());\r
17 \r
18 /*******\r
19  * create a side menu box/stack.\r
20  */\r
21 $this->_stacks['calendar'] = array('title_var'=>'calendar', 'file'=>dirname(__FILE__).'/side_menu.inc.php');\r
22 // ** possible alternative: **\r
23 // $this->addStack('hello_world', array('title_var' => 'hello_world', 'file' => './side_menu.inc.php');\r
24 \r
25 /*******\r
26  * if this module is to be made available to students on the Home or Main Navigation.\r
27  */\r
28 \r
29 $_student_tool = 'mods/calendar/index.php';\r
30 \r
31 // ** possible alternative: **\r
32 // $this->addTool('./index.php');\r
33 \r
34 /*******\r
35  * add the admin pages when needed.\r
36  */\r
37 if (admin_authenticate(AT_ADMIN_PRIV_CALENDAR, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
38         $this->_pages[AT_NAV_ADMIN] = array('mods/calendar/index_admin.php');\r
39         $this->_pages['mods/calendar/index_admin.php']['parent']    = AT_NAV_ADMIN;\r
40         $this->_pages['mods/calendar/index_admin.php']['title_var'] = 'webcalendar';\r
41         $this->_pages['mods/calendar/admin_cal.php']['title_var'] = 'admin_cal';\r
42         $this->_pages['mods/calendar/index_admin.php']['children'] = array('mods/calendar/admin_cal.php');\r
43         $this->_pages['mods/calendar/admin_cal.php']['parent']    = 'mods/calendar/index_admin.php';\r
44 \r
45 }\r
46 \r
47 /*******\r
48  * instructor Manage section:\r
49  */\r
50 $this->_pages['mods/calendar/index.php']['title_var'] = 'calendar';\r
51 $this->_pages['mods/calendar/index.php']['parent']   = 'tools/index.php';\r
52 \r
53 // Instructor and student calendars are the same, so grant access to sync dabatases only if the user is the course instructor.\r
54 \r
55 if($_SESSION['is_admin']){\r
56         $this->_pages['mods/calendar/sync_cal.php']['title_var'] = 'webcalendar_sync_dbs';\r
57         $this->_pages['mods/calendar/index.php']['children'] = array('mods/calendar/sync_cal.php');\r
58         $this->_pages['mods/calendar/sync_cal.php']['parent']    = 'mods/calendar/index.php';\r
59 }\r
60 // ** possible alternative: **\r
61 // $this->pages['./index_instructor.php']['title_var'] = 'hello_world';\r
62 // $this->pages['./index_instructor.php']['parent']    = 'tools/index.php';\r
63 \r
64 /*******\r
65  * student page.\r
66  */\r
67 $this->_pages['mods/calendar/index.php']['title_var'] = 'calendar';\r
68 $this->_pages['mods/calendar/index.php']['img']       = 'mods/calendar/calendar.gif';\r
69 \r
70 // }\r
71 \r
72 ?>