3 * doesn't allow this file to be loaded with a browser.
\r
5 if (!defined('AT_INCLUDE_PATH')) { exit; }
\r
8 * this file must only be included within a Module obj
\r
10 if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }
\r
13 * assign the instructor and admin privileges to the constants.
\r
15 define('AT_PRIV_CALENDAR', $this->getPrivilege());
\r
16 define('AT_ADMIN_PRIV_CALENDAR', $this->getAdminPrivilege());
\r
19 * create a side menu box/stack.
\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
26 * if this module is to be made available to students on the Home or Main Navigation.
\r
29 $_student_tool = 'mods/calendar/index.php';
\r
31 // ** possible alternative: **
\r
32 // $this->addTool('./index.php');
\r
35 * add the admin pages when needed.
\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
48 * instructor Manage section:
\r
50 $this->_pages['mods/calendar/index.php']['title_var'] = 'calendar';
\r
51 $this->_pages['mods/calendar/index.php']['parent'] = 'tools/index.php';
\r
53 // Instructor and student calendars are the same, so grant access to sync dabatases only if the user is the course instructor.
\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
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
67 $this->_pages['mods/calendar/index.php']['title_var'] = 'calendar';
\r
68 $this->_pages['mods/calendar/index.php']['img'] = 'mods/calendar/calendar.gif';
\r