Project

General

Profile

1 601 doc
<?php
2
3
// $Id$
4
5
// JsAdmin module for Website Baker
6
// Copyright (C) 2006, Stepan Riha
7
// www.nonplus.net
8
9
// modified by Swen Uth for Website Baker 2.7
10
11
/*
12
13
 Website Baker Project <http://www.websitebaker.org/>
14
 Copyright (C) 2004-2008, Ryan Djurovich
15
16
 Website Baker is free software; you can redistribute it and/or modify
17
 it under the terms of the GNU General Public License as published by
18
 the Free Software Foundation; either version 2 of the License, or
19
 (at your option) any later version.
20
21
 Website Baker is distributed in the hope that it will be useful,
22
 but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 GNU General Public License for more details.
25
26
 You should have received a copy of the GNU General Public License
27
 along with Website Baker; if not, write to the Free Software
28
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29
30
*/
31
32
function get_setting($name, $default = '') {
33
	global $database;
34
	$rs = $database->query("SELECT value FROM ".TABLE_PREFIX."settings WHERE name = '".$name."'");
35
	if($row = $rs->fetchRow())
36
		return $row['value'];
37
	return
38
		$default;
39
}
40
41
function save_setting($name, $value) {
42
	global $database;
43
44
	$prev_value = get_setting($name, false);
45
46
	if($prev_value === false) {
47
		$database->query("INSERT INTO ".TABLE_PREFIX."settings (name,value) VALUES ('$name','$value')");
48
	} else {
49
		$database->query("UPDATE ".TABLE_PREFIX."settings SET value = '$value' WHERE name = '$name'");
50
	}
51
}
52
53
// the follwing variables to use and check existing the YUI
54
$YUI_PATH = WB_URL.'/include/yui';
55
$js_yui_min = "-min";  // option for smaller code so faster
56
$js_yui_scripts = Array();
57
$js_yui_scripts[] = $YUI_PATH.'/yahoo/yahoo'.$js_yui_min.'.js';
58
$js_yui_scripts[] = $YUI_PATH.'/event/event'.$js_yui_min.'.js';
59
$js_yui_scripts[] = $YUI_PATH.'/dom/dom'.$js_yui_min.'.js';
60
$js_yui_scripts[] = $YUI_PATH.'/connection/connection'.$js_yui_min.'.js';
61
$js_yui_scripts[] = $YUI_PATH.'/dragdrop/dragdrop'.$js_yui_min.'.js';
62
63
?>