changed git call from https to git readonly
[atutor.git] / mods / social / module.php
1 <?php\r
2 /****************************************************************/\r
3 /* ATutor                                                                                                               */\r
4 /****************************************************************/\r
5 /* Copyright (c) 2002-2009                                                                              */\r
6 /* Adaptive Technology Resource Centre / University of Toronto  */\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/social/lib/constants.inc.php');        //load constant file right away.\r
25 $savant->addPath('template',    AT_SOCIAL_BASE.'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_SOCIAL',       $this->getPrivilege());\r
36 define('AT_ADMIN_PRIV_SOCIAL', $this->getAdminPrivilege());\r
37 \r
38 /*******\r
39  * create a side menu box/stack.\r
40  */\r
41 $this->_stacks['social'] = array('title_var'=>'social', 'file'=>AT_INCLUDE_PATH.'../mods/social/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_SOCIAL_BASENAME.'index.php';\r
49 \r
50 /*******\r
51  * add the admin pages when needed.\r
52  */\r
53 \r
54 if (admin_authenticate(AT_ADMIN_PRIV_SOCIAL, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
55         $this->_pages[AT_NAV_ADMIN] = array('mods/social/index_admin.php');\r
56         $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['title_var'] = 'social';\r
57         $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['parent']    = AT_NAV_ADMIN;\r
58         $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['children']    = array(AT_SOCIAL_BASENAME.'admin/delete_applications.php');\r
59 \r
60                 $this->_pages[AT_SOCIAL_BASENAME.'admin/delete_applications.php']['title_var'] = 'delete_applications';\r
61                 $this->_pages[AT_SOCIAL_BASENAME.'admin/delete_applications.php']['parent'] = AT_SOCIAL_BASENAME.'index_admin.php';\r
62 }\r
63 \r
64 \r
65 /*******\r
66  * instructor Manage section:\r
67  */\r
68 //$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['title_var'] = 'social';\r
69 //$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['parent']   = 'tools/index.php';\r
70 \r
71 // ** possible alternative: **\r
72 // $this->pages['./index_instructor.php']['title_var'] = 'social';\r
73 // $this->pages['./index_instructor.php']['parent']    = 'tools/index.php';\r
74 \r
75 /*******\r
76  * student page.\r
77  */\r
78 $this->_pages[AT_SOCIAL_BASENAME.'index.php']['title_var'] = 'social';\r
79 $this->_pages[AT_SOCIAL_BASENAME.'index.php']['img']       = AT_SOCIAL_BASENAME.'images/social.jpg';\r
80 \r
81 $this->_pages[AT_SOCIAL_BASENAME.'sprofile.php']['title_var'] = 'social_profile';\r
82 $this->_pages[AT_SOCIAL_BASENAME.'sprofile.php']['parent'] = AT_SOCIAL_BASENAME.'index.php';\r
83 \r
84 $this->_pages[AT_SOCIAL_BASENAME.'edit_profile.php']['title_var'] = 'edit_profile';\r
85 $this->_pages[AT_SOCIAL_BASENAME.'edit_profile.php']['parent'] = AT_SOCIAL_BASENAME.'sprofile.php';\r
86 \r
87 $this->_pages[AT_SOCIAL_BASENAME.'profile_picture.php']['title_var'] = 'picture';\r
88 $this->_pages[AT_SOCIAL_BASENAME.'profile_picture.php']['parent'] = AT_SOCIAL_BASENAME.'edit_profile.php';\r
89 \r
90 $this->_pages[AT_SOCIAL_BASENAME.'basic_profile.php']['title_var'] = 'profile';\r
91 $this->_pages[AT_SOCIAL_BASENAME.'basic_profile.php']['parent'] = AT_SOCIAL_BASENAME.'edit_profile.php';\r
92 \r
93 $this->_pages[AT_SOCIAL_BASENAME.'applications.php']['title_var'] = 'gadgets';\r
94 $this->_pages[AT_SOCIAL_BASENAME.'applications.php']['parent'] = AT_SOCIAL_BASENAME.'index.php';\r
95 \r
96 $this->_pages[AT_SOCIAL_BASENAME.'connections.php']['title_var'] = 'connections';\r
97 $this->_pages[AT_SOCIAL_BASENAME.'connections.php']['parent'] = AT_SOCIAL_BASENAME.'index.php';\r
98 //      $this->_pages['mods/social/add_friends.php']['title_var'] = 'add_friends';\r
99 //      $this->_pages['mods/social/add_friends.php']['parent'] = 'mods/social/connections.php';\r
100 \r
101 $this->_pages[AT_SOCIAL_BASENAME.'activities.php']['title_var'] = 'activities';\r
102 $this->_pages[AT_SOCIAL_BASENAME.'activities.php']['parent'] = AT_SOCIAL_BASENAME.'index.php';\r
103 \r
104 $this->_pages[AT_SOCIAL_BASENAME.'settings.php']['title_var'] = 'settings';\r
105 $this->_pages[AT_SOCIAL_BASENAME.'settings.php']['parent'] = AT_SOCIAL_BASENAME.'index.php';\r
106 \r
107 $this->_pages[AT_SOCIAL_BASENAME.'groups/index.php']['title_var'] = 'social_groups';\r
108 $this->_pages[AT_SOCIAL_BASENAME.'groups/index.php']['parent'] = AT_SOCIAL_BASENAME.'index.php';\r
109 \r
110 $this->_pages[AT_SOCIAL_BASENAME.'groups/create.php']['title_var'] = 'create_groups';\r
111 $this->_pages[AT_SOCIAL_BASENAME.'groups/create.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
112 \r
113 $this->_pages[AT_SOCIAL_BASENAME.'groups/view.php']['title_var'] = 'view_groups';\r
114 $this->_pages[AT_SOCIAL_BASENAME.'groups/view.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
115         $this->_pages[AT_SOCIAL_BASENAME.'groups/delete_message.php']['title_var'] = 'delete_message';\r
116         $this->_pages[AT_SOCIAL_BASENAME.'groups/delete_message.php']['parent'] = AT_SOCIAL_BASENAME.'groups/view.php';\r
117 \r
118 $this->_pages[AT_SOCIAL_BASENAME.'groups/invite.php']['title_var'] = 'invite_groups';\r
119 $this->_pages[AT_SOCIAL_BASENAME.'groups/invite.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
120 \r
121 $this->_pages[AT_SOCIAL_BASENAME.'groups/edit.php']['title_var'] = 'edit_group';\r
122 $this->_pages[AT_SOCIAL_BASENAME.'groups/edit.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
123 \r
124 $this->_pages[AT_SOCIAL_BASENAME.'groups/search.php']['title_var'] = 'search';\r
125 $this->_pages[AT_SOCIAL_BASENAME.'groups/search.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
126 \r
127 $this->_pages[AT_SOCIAL_BASENAME.'groups/list.php']['title_var'] = 'group_members';\r
128 $this->_pages[AT_SOCIAL_BASENAME.'groups/list.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
129 \r
130 /* public pages */\r
131 $this->_pages[AT_NAV_PUBLIC] = array(AT_SOCIAL_BASENAME.'index_public.php');\r
132 $this->_pages[AT_SOCIAL_BASENAME.'index_public.php']['title_var'] = 'social';\r
133 $this->_pages[AT_SOCIAL_BASENAME.'index_public.php']['parent'] = AT_NAV_PUBLIC;\r
134 \r
135 \r
136 /* my start page pages */\r
137 if ($_SESSION['valid_user']==1){\r
138 //$this->_pages[AT_NAV_START]  = array('mods/social/index_mystart.php');\r
139 $this->_pages[AT_NAV_START]  = array(AT_SOCIAL_BASENAME.'index.php');\r
140 $this->_pages[AT_SOCIAL_BASENAME.'index.php']['title_var'] = 'social';\r
141 $this->_pages[AT_SOCIAL_BASENAME.'index.php']['parent'] = AT_NAV_START;\r
142 }\r
143 \r
144 function social_get_group_url($group_id) {\r
145         return AT_SOCIAL_BASENAME.'index.php';\r
146 }\r
147 ?>