remove old readme
[atutor.git] / docs / mods / _standard / social / module.php
1 <?php\r
2 /****************************************************************/\r
3 /* ATutor                                                                                                               */\r
4 /****************************************************************/\r
5 /* Copyright (c) 2002-2009                                                                              */\r
6 /* Inclusive Design Institute                                   */\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/_standard/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/_standard/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.AT_SOCIAL_INDEX;\r
49 \r
50 $this->_list['social'] = array('title_var'=>'social','file'=>'mods/_standard/social/sublinks.php');\r
51 $this->_pages[AT_SOCIAL_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 \r
57 if (admin_authenticate(AT_ADMIN_PRIV_SOCIAL, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
58         //$this->_pages[AT_NAV_ADMIN] = array('mods/_standard/social/index_admin.php');\r
59         $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['title_var'] = 'social';\r
60         $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['parent']    = 'admin/config_edit.php';\r
61         $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['children']    = array(AT_SOCIAL_BASENAME.'admin/delete_applications.php');\r
62 \r
63                 $this->_pages[AT_SOCIAL_BASENAME.'admin/delete_applications.php']['title_var'] = 'delete_applications';\r
64                 $this->_pages[AT_SOCIAL_BASENAME.'admin/delete_applications.php']['parent'] = AT_SOCIAL_BASENAME.'index_admin.php';\r
65 }\r
66 \r
67 \r
68 /*******\r
69  * instructor Manage section:\r
70  */\r
71 //$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['title_var'] = 'social';\r
72 //$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['parent']   = 'tools/index.php';\r
73 \r
74 // ** possible alternative: **\r
75 // $this->pages['./index_instructor.php']['title_var'] = 'social';\r
76 // $this->pages['./index_instructor.php']['parent']    = 'tools/index.php';\r
77 \r
78 /*******\r
79  * student page.\r
80  */\r
81 $this->_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['title_var'] = 'social';\r
82 $this->_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['img']       = AT_SOCIAL_BASENAME.'images/social.gif';\r
83 $this->_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['children'] = array_merge(\r
84 array(AT_SOCIAL_BASENAME.'connections.php',\r
85 AT_SOCIAL_BASENAME.'sprofile.php', \r
86 AT_SOCIAL_BASENAME.'applications.php', \r
87 AT_SOCIAL_BASENAME.'groups/index.php',\r
88 AT_SOCIAL_BASENAME.'settings.php'),\r
89 isset($_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['children']) ? $_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['children'] : array());\r
90 \r
91 $this->_pages[AT_SOCIAL_BASENAME.'sprofile.php']['title_var'] = 'social_profile';\r
92 $this->_pages[AT_SOCIAL_BASENAME.'sprofile.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;\r
93 \r
94 $this->_pages[AT_SOCIAL_BASENAME.'edit_profile.php']['title_var'] = 'edit_profile';\r
95 $this->_pages[AT_SOCIAL_BASENAME.'edit_profile.php']['parent'] = AT_SOCIAL_BASENAME.'sprofile.php';\r
96 $this->_pages[AT_SOCIAL_BASENAME.'sprofile.php']['guide']     = 'general/?p=my_profile.php';\r
97 \r
98 $this->_pages[AT_SOCIAL_BASENAME.'profile_picture.php']['title_var'] = 'picture';\r
99 $this->_pages[AT_SOCIAL_BASENAME.'profile_picture.php']['parent'] = AT_SOCIAL_BASENAME.'edit_profile.php';\r
100 \r
101 $this->_pages[AT_SOCIAL_BASENAME.'basic_profile.php']['title_var'] = 'profile';\r
102 $this->_pages[AT_SOCIAL_BASENAME.'basic_profile.php']['parent'] = AT_SOCIAL_BASENAME.'edit_profile.php';\r
103 \r
104 $this->_pages[AT_SOCIAL_BASENAME.'applications.php']['title_var'] = 'applications';\r
105 $this->_pages[AT_SOCIAL_BASENAME.'applications.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;\r
106 $this->_pages[AT_SOCIAL_BASENAME.'applications.php']['guide']     = 'general/?p=my_gadgets.php';\r
107 \r
108 $this->_pages[AT_SOCIAL_BASENAME.'connections.php']['title_var'] = 'connections';\r
109 $this->_pages[AT_SOCIAL_BASENAME.'connections.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;\r
110 $this->_pages[AT_SOCIAL_BASENAME.'connections.php']['guide']     = 'general/?p=my_contacts.php';\r
111 //      $this->_pages['mods/social/add_friends.php']['title_var'] = 'add_friends';\r
112 //      $this->_pages['mods/social/add_friends.php']['parent'] = 'mods/social/connections.php';\r
113 \r
114 $this->_pages[AT_SOCIAL_BASENAME.'activities.php']['title_var'] = 'activities';\r
115 $this->_pages[AT_SOCIAL_BASENAME.'activities.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;\r
116 \r
117 $this->_pages[AT_SOCIAL_BASENAME.'settings.php']['title_var'] = 'settings';\r
118 $this->_pages[AT_SOCIAL_BASENAME.'settings.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;\r
119 $this->_pages[AT_SOCIAL_BASENAME.'settings.php']['guide']     = 'general/?p=my_settings.php';\r
120 \r
121 $this->_pages[AT_SOCIAL_BASENAME.'groups/index.php']['title_var'] = 'social_groups';\r
122 $this->_pages[AT_SOCIAL_BASENAME.'groups/index.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;\r
123 $this->_pages[AT_SOCIAL_BASENAME.'groups/index.php']['guide']     = 'general/?p=my_groups.php';\r
124 \r
125 $this->_pages[AT_SOCIAL_BASENAME.'groups/create.php']['title_var'] = 'create_groups';\r
126 $this->_pages[AT_SOCIAL_BASENAME.'groups/create.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
127 \r
128 $this->_pages[AT_SOCIAL_BASENAME.'groups/view.php']['title_var'] = 'view_groups';\r
129 $this->_pages[AT_SOCIAL_BASENAME.'groups/view.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
130         $this->_pages[AT_SOCIAL_BASENAME.'groups/delete_message.php']['title_var'] = 'delete_message';\r
131         $this->_pages[AT_SOCIAL_BASENAME.'groups/delete_message.php']['parent'] = AT_SOCIAL_BASENAME.'groups/view.php';\r
132 \r
133 $this->_pages[AT_SOCIAL_BASENAME.'groups/invite.php']['title_var'] = 'invite_groups';\r
134 $this->_pages[AT_SOCIAL_BASENAME.'groups/invite.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
135 \r
136 $this->_pages[AT_SOCIAL_BASENAME.'groups/edit.php']['title_var'] = 'edit_group';\r
137 $this->_pages[AT_SOCIAL_BASENAME.'groups/edit.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
138 \r
139 $this->_pages[AT_SOCIAL_BASENAME.'groups/search.php']['title_var'] = 'search';\r
140 $this->_pages[AT_SOCIAL_BASENAME.'groups/search.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
141 \r
142 $this->_pages[AT_SOCIAL_BASENAME.'groups/list.php']['title_var'] = 'group_members';\r
143 $this->_pages[AT_SOCIAL_BASENAME.'groups/list.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';\r
144 \r
145 /* public pages */\r
146 $this->_pages[AT_NAV_PUBLIC] = array(AT_SOCIAL_BASENAME.'index_public.php');\r
147 $this->_pages[AT_SOCIAL_BASENAME.'index_public.php']['title_var'] = 'social';\r
148 $this->_pages[AT_SOCIAL_BASENAME.'index_public.php']['parent'] = AT_NAV_PUBLIC;\r
149 \r
150 /* my start page pages */\r
151 if ($_SESSION['valid_user']==1){\r
152 $this->_pages[AT_NAV_START]  = array('mods/social/index_mystart.php');\r
153 $this->_pages[AT_NAV_START]  = array(AT_SOCIAL_BASENAME.'index_mystart.php');\r
154 $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['title_var'] = 'social';\r
155 $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['guide']     = 'general/?p=my_network.php';\r
156 $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['parent'] = AT_NAV_START;\r
157 \r
158 $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children'] = array_merge(\r
159 array(AT_SOCIAL_BASENAME.'connections.php',\r
160 AT_SOCIAL_BASENAME.'sprofile.php', \r
161 AT_SOCIAL_BASENAME.'applications.php', \r
162 AT_SOCIAL_BASENAME.'groups/index.php',\r
163 AT_SOCIAL_BASENAME.'settings.php'),\r
164 isset($_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children']) ? $_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children'] : array());\r
165 \r
166 $this->_pages[AT_SOCIAL_BASENAME.'index.php']['title_var'] = 'social';\r
167 $this->_pages[AT_SOCIAL_BASENAME.'index.php']['guide']     = 'general/?p=my_network.php';\r
168 }\r
169 \r
170 function social_get_group_url($group_id) {\r
171         return AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;\r
172 }\r
173 ?>