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