Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

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