2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2009 */
6 /* Inclusive Design Institute */
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 /****************************************************************/
14 $_user_location = 'public';
16 define('AT_INCLUDE_PATH', '../../../include/');
17 require (AT_INCLUDE_PATH.'vitals.inc.php');
18 require(AT_SOCIAL_INCLUDE.'constants.inc.php');
19 include(AT_SOCIAL_INCLUDE.'classes/PrivacyControl/PrivacyObject.class.php');
20 include(AT_SOCIAL_INCLUDE.'classes/PrivacyControl/PrivacyController.class.php');
21 include(AT_SOCIAL_INCLUDE.'classes/Application.class.php');
22 $_custom_css = $_base_path . AT_SOCIAL_BASENAME . 'module.css'; // use a custom stylesheet
24 if (!$_SESSION['valid_user']) {
25 require(AT_INCLUDE_PATH.'header.inc.php');
26 $info = array('INVALID_USER', $_SESSION['course_id']);
27 $msg->printInfos($info);
28 require(AT_INCLUDE_PATH.'footer.inc.php');
32 $controller = new PrivacyController();
33 $private_obj = $controller->getPrivacyObject($_SESSION['member_id']);
36 include(AT_INCLUDE_PATH.'header.inc.php');
38 <div class="social-wrapper">
42 $savant->display('social/pubmenu.tmpl.php');
43 $savant->display('social/settings/settings_menu.tmpl.php');
44 if (isset($_REQUEST['n']) && $_REQUEST['n']=='account_settings'){
46 //Default to account settings
47 //Page prints from here
48 $savant->display('social/settings/account_settings.tmpl.php');
49 } elseif (isset($_REQUEST['n']) && $_REQUEST['n']=='application_settings'){
50 $app = new Application();
51 //handle application setting updates
52 if (isset($_POST['submit'])){
54 $app->setHomeDisplaySettings($_POST['app']);
55 //TODO print message/feedback
56 $msg->addFeedback('SOCIAL_SETTINGS_SAVED');
61 $savant->assign('home_display', $app->getHomeDisplaySettings());
62 $savant->assign('my_apps', $list_of_my_apps = $app->listMyApplications());
63 $savant->display('social/settings/application_settings.tmpl.php');
65 //handle privacy setting updates
66 if (isset($_POST['submit'])){
68 $private_obj->setProfile($_POST['profile_prefs']);
69 $private_obj->setSearch($_POST['search_prefs']);
70 $private_obj->setActivity($activity_prefs);
72 //update privacy preference
73 PrivacyController::updatePrivacyPreference($_SESSION['member_id'], $private_obj);
75 //TODO print message/feedback
76 $msg->addFeedback('SOCIAL_SETTINGS_SAVED');
80 //Page prints from here
81 $savant->assign('controller', $controller);
82 $savant->assign('profile_prefs', $private_obj->getProfile());
83 $savant->assign('search_prefs', $private_obj->getSearch());
84 $savant->assign('application_prefs', $private_obj->getActivity());
85 $savant->display('social/settings/privacy_settings.tmpl.php');
88 <div style="clear:both;"></div>
91 include(AT_INCLUDE_PATH.'footer.inc.php');