3726f698ba5e4374f79bdb1e40a2a94c7b1e1e89
[atutor.git] / mods / photos / module.php
1 <?php\r
2 /***********************************************************************/\r
3 /* ATutor                                                                                                                          */\r
4 /***********************************************************************/\r
5 /* Copyright (c) 2002-2009                                                                                         */\r
6 /* Adaptive Technology Resource Centre / Inclusive Design Institution  */\r
7 /* http://atutor.ca                                                                                                        */\r
8 /*                                                                                                                                         */\r
9 /* This program is free software. You can redistribute it and/or           */\r
10 /* modify it under the terms of the GNU General Public License             */\r
11 /* as published by the Free Software Foundation.                                           */\r
12 /***********************************************************************/\r
13 // $Id$\r
14 \r
15 /*******\r
16  * doesn't allow this file to be loaded with a browser.\r
17  */\r
18 if (!defined('AT_INCLUDE_PATH')) { exit; }\r
19 \r
20 /*******\r
21  * add savant variable\r
22  */\r
23 global $savant;\r
24 require(AT_INCLUDE_PATH.'../mods/photos/include/constants.inc.php');    //load constant file right away.\r
25 $savant->addPath('template', AT_PA_INCLUDE.'html/');\r
26 \r
27 /******\r
28  * this file must only be included within a Module obj\r
29  */\r
30 if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }\r
31 \r
32 /*******\r
33  * assign the instructor and admin privileges to the constants.\r
34  */\r
35 define('AT_PRIV_PHOTO_ALBUM',       $this->getPrivilege());\r
36 define('AT_ADMIN_PRIV_PHOTO_ALBUM', $this->getAdminPrivilege());\r
37 \r
38 /*******\r
39  * create a side menu box/stack.\r
40  */\r
41 $this->_stacks['pa_photo_gallery'] = array('title_var'=>'pa_photo_gallery', 'file'=>AT_INCLUDE_PATH.'../mods/photos/side_menu.inc.php');\r
42 // ** possible alternative: **\r
43 // $this->addStack('social', array('title_var' => 'social', 'file' => './side_menu.inc.php');\r
44 \r
45 /*******\r
46  * if this module is to be made available to students on the Home or Main Navigation.\r
47  */\r
48 $_group_tool = $_student_tool = AT_PA_BASENAME.'index.php';\r
49 \r
50 $this->_list['pa_photo_gallery'] = array('title_var'=>'pa_photo_gallery','file'=>AT_PA_BASE.'sublinks.php');\r
51 $this->_pages[AT_PA_BASENAME.'index.php']['icon']      = 'images/home-directory_sm.png';\r
52 \r
53 /*******\r
54  * add the admin pages when needed.\r
55  */\r
56 if (admin_authenticate(AT_ADMIN_PRIV_PHOTO_ALBUM, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
57         $this->_pages[AT_NAV_ADMIN] = array('mods/photos/index_admin.php');\r
58         $this->_pages[AT_PA_BASENAME.'index_admin.php']['title_var'] = 'pa_photo_gallery';\r
59         $this->_pages[AT_PA_BASENAME.'index_admin.php']['parent']    = AT_NAV_ADMIN;\r
60         $this->_pages[AT_PA_BASENAME.'index_admin.php']['children']    = array(AT_PA_BASENAME.'admin/preferences.php');\r
61                 $this->_pages[AT_PA_BASENAME.'admin/preferences.php']['title_var'] = 'pa_preferences';\r
62                 $this->_pages[AT_PA_BASENAME.'admin/preferences.php']['parent'] = AT_PA_BASENAME.'index_admin.php';\r
63 \r
64 }\r
65 \r
66 /*******\r
67  * instructor Manage section:\r
68  */\r
69 //$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['title_var'] = 'social';\r
70 //$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['parent']   = 'tools/index.php';\r
71 \r
72 // ** possible alternative: **\r
73 // $this->pages['./index_instructor.php']['title_var'] = 'social';\r
74 // $this->pages['./index_instructor.php']['parent']    = 'tools/index.php';\r
75 \r
76 /*******\r
77  * student page.\r
78  */\r
79 //Temp _pages \r
80 $this->_pages[AT_SOCIAL_BASENAME.'index.php']['children'] = array(AT_PA_BASENAME.'index.php');\r
81 //end temp\r
82 \r
83 //$this->_pages[AT_PA_BASENAME.'index.php']['title_var'] = _AT('test');\r
84 //$this->_pages[AT_PA_BASENAME.'index.php']['parent'] = AT_SOCIAL_BASENAME.'index.php';\r
85 //$this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children'] = array_push($this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children'], AT_PA_BASENAME.'index.php');\r
86 \r
87 \r
88 $this->_pages[AT_PA_BASENAME.'index.php']['title_var'] = 'pa_photo_gallery';\r
89 $this->_pages[AT_PA_BASENAME.'index.php']['img']       = AT_PA_BASENAME.'images/photo_gallery.png';\r
90 \r
91 if($_SESSION['course_id'] < 1){\r
92         $this->_pages[AT_PA_BASENAME.'index.php']['children'] = array(AT_PA_BASENAME.'profile_album.php', AT_PA_BASENAME.'create_album.php');\r
93 }else{\r
94         $this->_pages[AT_PA_BASENAME.'index.php']['children'] = array(AT_PA_BASENAME.'profile_album.php', AT_PA_BASENAME.'course_albums.php', AT_PA_BASENAME.'shared_albums.php', AT_PA_BASENAME.'create_album.php');\r
95         $this->_pages[AT_PA_BASENAME.'course_albums.php']['title_var'] = 'pa_course_albums';\r
96         $this->_pages[AT_PA_BASENAME.'course_albums.php']['parent'] = AT_PA_BASENAME.'index.php';\r
97         $this->_pages[AT_PA_BASENAME.'course_albums.php']['guide']     = 'general/?p=pa_index.php';\r
98 }\r
99 \r
100 $this->_pages[AT_PA_BASENAME.'index.php']['guide']     = 'general/?p=pa_index.php';\r
101 $this->_pages[AT_PA_BASENAME.'index.php']['parent'] = AT_SOCIAL_BASENAME.'index_mystart.php';\r
102 $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children'] = array_merge(isset($this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children']) ? $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children'] : array(), array(AT_PA_BASENAME.'index.php'));\r
103 \r
104 //$this->_pages[AT_PA_BASENAME.'my_albums.php']['title_var'] = 'pa_my_albums';\r
105 //$this->_pages[AT_PA_BASENAME.'my_albums.php']['parent'] = AT_PA_BASENAME.'index.php';\r
106 \r
107 $this->_pages[AT_PA_BASENAME.'create_album.php']['title_var'] = 'pa_create_album';\r
108 $this->_pages[AT_PA_BASENAME.'create_album.php']['parent'] = AT_PA_BASENAME.'index.php';\r
109 $this->_pages[AT_PA_BASENAME.'create_album.php']['guide']     = 'general/?p=pa_index.php';\r
110 \r
111 $this->_pages[AT_PA_BASENAME.'profile_album.php']['title_var'] = 'pa_profile_album';\r
112 $this->_pages[AT_PA_BASENAME.'profile_album.php']['parent'] = AT_PA_BASENAME.'index.php';\r
113 $this->_pages[AT_PA_BASENAME.'profile_album.php']['guide']     = 'general/?p=pa_albums.php';\r
114 \r
115 $this->_pages[AT_PA_BASENAME.'shared_albums.php']['title_var'] = 'pa_shared_albums';\r
116 $this->_pages[AT_PA_BASENAME.'shared_albums.php']['parent'] = AT_PA_BASENAME.'index.php';\r
117 $this->_pages[AT_PA_BASENAME.'shared_albums.php']['guide']     = 'general/?p=pa_albums.php';\r
118 \r
119 $this->_pages[AT_PA_BASENAME.'search.php']['title_var'] = 'search';\r
120 $this->_pages[AT_PA_BASENAME.'search.php']['parent'] = AT_PA_BASENAME.'index.php';\r
121 $this->_pages[AT_PA_BASENAME.'search.php']['guide']     = 'general/?p=pa_albums.php';\r
122 \r
123 $this->_pages[AT_PA_BASENAME.'edit_album.php']['title_var'] = 'pa_edit_album';\r
124 $this->_pages[AT_PA_BASENAME.'edit_album.php']['parent'] = AT_PA_BASENAME.'index.php';\r
125 $this->_pages[AT_PA_BASENAME.'edit_album.php']['guide']     = 'general/?p=pa_albums.php';\r
126 \r
127 $this->_pages[AT_PA_BASENAME.'delete_album.php']['title_var'] = 'pa_delete_album';\r
128 $this->_pages[AT_PA_BASENAME.'delete_album.php']['parent'] = AT_PA_BASENAME.'index.php';\r
129 \r
130 $this->_pages[AT_PA_BASENAME.'albums.php']['title_var'] = 'pa_albums';\r
131 $this->_pages[AT_PA_BASENAME.'albums.php']['parent'] = AT_PA_BASENAME.'index.php';\r
132 $this->_pages[AT_PA_BASENAME.'albums.php']['guide']     = 'general/?p=pa_albums.php';\r
133 //$this->_pages[AT_PA_BASENAME.'albums.php']['children']  = array(AT_PA_BASENAME.'photo.php');\r
134 \r
135 $this->_pages[AT_PA_BASENAME.'photo.php']['title_var'] = 'pa_photo';\r
136 $this->_pages[AT_PA_BASENAME.'photo.php']['parent'] = AT_PA_BASENAME.'albums.php';\r
137 $this->_pages[AT_PA_BASENAME.'photo.php']['guide']     = 'general/?p=pa_photo.php';\r
138         $this->_pages[AT_PA_BASENAME.'delete_photo.php']['title_var'] = 'pa_delete_photo';\r
139         $this->_pages[AT_PA_BASENAME.'delete_photo.php']['parent'] = AT_PA_BASENAME.'photo.php';\r
140 \r
141 $this->_pages[AT_PA_BASENAME.'edit_photos.php']['title_var'] = 'pa_edit_photos';\r
142 $this->_pages[AT_PA_BASENAME.'edit_photos.php']['parent'] = AT_PA_BASENAME.'albums.php';\r
143 $this->_pages[AT_PA_BASENAME.'edit_photos.php']['guide']     = 'general/?p=pa_albums.php';\r
144 \r
145 $this->_pages[AT_PA_BASENAME.'delete_comment.php']['title_var'] = 'pa_delete_comment';\r
146 $this->_pages[AT_PA_BASENAME.'delete_comment.php']['parent'] = AT_PA_BASENAME.'photo.php';\r
147 \r
148 ?>\r