Commit 3faaec3474fa36093594e6626c15288f26f64101

Authored by Jarrett Jordaan
1 parent 95b34c8b

PT-2378610 : Redundant user preference admin section.

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
plugins/user-preferences/manageUserPreferences.php deleted
1 -<?php  
2 -/*  
3 - * $Id: $  
4 - *  
5 - * The contents of this file are subject to the KnowledgeTree  
6 - * Commercial Editions On-Premise License ("License");  
7 - * You may not use this file except in compliance with the License.  
8 - * You may obtain a copy of the License at  
9 - * http://www.knowledgetree.com/about/legal/  
10 - * The terms of this license may change from time to time and the latest  
11 - * license will be published from time to time at the above Internet address.  
12 - *  
13 - * This edition of the KnowledgeTree software  
14 - * is NOT licensed to you under Open Source terms.  
15 - * You may not redistribute this source code.  
16 - * For more information please see the License above.  
17 - *  
18 - * (c) 2008, 2009, 2010 KnowledgeTree Inc.  
19 - * All Rights Reserved.  
20 - *  
21 - */  
22 -  
23 -require_once('UserPreferences.inc.php'); //  
24 -  
25 -require_once(KT_LIB_DIR . '/templating/templating.inc.php'); //  
26 -require_once(KT_LIB_DIR . '/util/ktutil.inc');  
27 -require_once(KT_LIB_DIR . '/dispatcher.inc.php');  
28 -require_once(KT_LIB_DIR . '/templating/kt3template.inc.php');  
29 -  
30 -class ManageUserPreferencesDispatcher extends KTStandardDispatcher {  
31 - //--------------------------------  
32 - // Forms  
33 - //--------------------------------  
34 -  
35 - /**  
36 - *  
37 - *  
38 - * @author KnowledgeTree Team  
39 - * @access public  
40 - * @param none  
41 - * @return html  
42 - */  
43 - public function do_main() {  
44 - return "Coming Soon";  
45 - }  
46 -  
47 - /**  
48 - *  
49 - *  
50 - * @author KnowledgeTree Team  
51 - * @access public  
52 - * @param none  
53 - * @return html  
54 - */  
55 - // TODO : Write generic, this only for zoho warning  
56 - public function do_saveUserPreference() {  
57 - $sValue = KTUtil::arrayGet($_GET, 'zohoWarning', '');  
58 - if($sValue != '') {  
59 - $aUserPreference = UserPreferences::getUserPreferences($this->oUser->getId(), 'zohoWarning'); // Get user preference  
60 - if(empty($aUserPreference) || is_null($aUserPreference)) { // Create the prefernce  
61 - $oUserPreference = new UserPreferences( $this->oUser->getId(), 'zohoWarning', $sValue);  
62 - DBUtil::startTransaction();  
63 - $oUserPreference->create();  
64 - DBUtil::commit();  
65 - } else {  
66 - foreach ($aUserPreference as $oUserPreference) { // Access object  
67 - if($oUserPreference->getValue() != $sValue) { // Update preference  
68 - $oUserPreference->setValue($sValue);  
69 - DBUtil::startTransaction();  
70 - $oUserPreference->update();  
71 - DBUtil::commit();  
72 - }  
73 - }  
74 - }  
75 - }  
76 - exit();  
77 - }  
78 -  
79 - public function do_setPreference($sKey, $sValue) {  
80 -  
81 - }  
82 -}  
83 -  
84 -class adminManageUserPreferencesDispatcher extends ManageUserPreferencesDispatcher {  
85 - var $bAdminRequired = true;  
86 - var $sSection = 'administration';  
87 -  
88 - function adminManageUserPreferencesDispatcher() {  
89 - $this->aBreadcrumbs = array(array('action' => 'administration', 'name' => _kt('Administration')),);  
90 -  
91 - return parent::KTStandardDispatcher();  
92 - }  
93 -}  
94 -  
95 -class manageUserPreferencesNavigationPortlet extends KTPortlet {  
96 - var $bActive = true;  
97 -  
98 - function manageUserPreferencesNavigationPortlet($sTitle) {  
99 - parent::KTPortlet($sTitle);  
100 - }  
101 -}  
102 -  
103 -?>