-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathqwp_settings.ctrl.php
64 lines (57 loc) · 1.7 KB
/
qwp_settings.ctrl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* Copyright (C) 2009-2019 www.seopanel.in. All rights reserved.
* @author Geo Varghese
*
*/
class QWP_Settings extends QuickWebProxy {
// the variable to store the seetings database table name
var $settingsTable = "qwp_settings";
/*
* func to get all plugin settings
*/
function __getAllPluginSettings() {
$sql = "select * from $this->settingsTable order by id";
$settingsList = $this->db->select($sql);
return $settingsList;
}
/*
* function to show plugin settings
*/
function showPluginSettings() {
$this->set('spTextPanel', $this->getLanguageTexts('panel', $_SESSION['lang_code']));
$this->set('list', $this->__getAllPluginSettings());
$this->pluginRender('showsettings');
}
/*
* func to update plugin settings
*/
function updatePluginSettings($postInfo) {
$setList = $this->__getAllPluginSettings();
foreach($setList as $setInfo) {
$sql = "update $this->settingsTable set set_val='".addslashes($postInfo[$setInfo['set_name']])."' where set_name='{$setInfo['set_name']}'";
$this->db->query($sql);
}
$this->set('saved', 1);
$this->set('spTextSettings', $this->getLanguageTexts('settings', $_SESSION['lang_code']));
$this->showPluginSettings();
}
/*
* func to show about us plugin
*/
function showPluginAboutUs() {
$this->pluginRender('aboutus');
}
/*
* function set all plugin settings
*/
function defineAllPluginSystemSettings() {
$settingsList = $this->__getAllPluginSettings();
foreach($settingsList as $settingsInfo){
if(!defined($settingsInfo['set_name'])){
define($settingsInfo['set_name'], $settingsInfo['set_val']);
}
}
}
}
?>