2 /****************************************************************/
\r
4 /****************************************************************/
\r
5 /* Copyright (c) 2002-2009 */
\r
6 /* Adaptive Technology Resource Centre / University of Toronto */
\r
7 /* http://atutor.ca */
\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
16 * doesn't allow this file to be loaded with a browser.
\r
18 if (!defined('AT_INCLUDE_PATH')) { exit; }
\r
21 * add savant variable
\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
28 * this file must only be included within a Module obj
\r
30 if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }
\r
33 * assign the instructor and admin privileges to the constants.
\r
35 define('AT_PRIV_SOCIAL', $this->getPrivilege());
\r
36 define('AT_ADMIN_PRIV_SOCIAL', $this->getAdminPrivilege());
\r
39 * create a side menu box/stack.
\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
46 * if this module is to be made available to students on the Home or Main Navigation.
\r
48 $_group_tool = $_student_tool = AT_SOCIAL_BASENAME.'index.php';
\r
51 * add the admin pages when needed.
\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
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
66 * instructor Manage section:
\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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
144 function social_get_group_url($group_id) {
\r
145 return AT_SOCIAL_BASENAME.'index.php';
\r