Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         JsAdmin
6
 * @author          WebsiteBaker Project, modified by Swen Uth for Website Baker 2.7
7
 * @copyright       (C) 2006, Stepan Riha
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id: jsadmin.php 1377 2011-01-12 18:10:27Z FrankH $
14
 * @filesource		$HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/modules/menu_link/save.php $
15
 * @lastmodified    $Date: 2011-01-10 13:21:47 +0100 (Mo, 10 Jan 2011) $
16
 *
17
*/
18

    
19
function get_setting($name, $default = '') {
20
	global $database;
21
	$rs = $database->query("SELECT value FROM ".TABLE_PREFIX."mod_jsadmin WHERE name = '".$name."'");
22
	if($row = $rs->fetchRow())
23
		return $row['value'];
24
	return
25
		$default;
26
}
27

    
28
function save_setting($name, $value) {
29
	global $database;
30

    
31
	$prev_value = get_setting($name, false);
32

    
33
	if($prev_value === false) {
34
		$database->query("INSERT INTO ".TABLE_PREFIX."mod_jsadmin (name,value) VALUES ('$name','$value')");
35
	} else {
36
		$database->query("UPDATE ".TABLE_PREFIX."mod_jsadmin SET value = '$value' WHERE name = '$name'");
37
	}
38
}
39

    
40
// the follwing variables to use and check existing the YUI
41
$WB_MAIN_RELATIVE_PATH="../..";
42
$YUI_PATH = '/include/yui';
43
$js_yui_min = "-min";  // option for smaller code so faster
44
$js_yui_scripts = Array();
45
$js_yui_scripts[] = $YUI_PATH.'/yahoo/yahoo'.$js_yui_min.'.js';
46
$js_yui_scripts[] = $YUI_PATH.'/event/event'.$js_yui_min.'.js';
47
$js_yui_scripts[] = $YUI_PATH.'/dom/dom'.$js_yui_min.'.js';
48
$js_yui_scripts[] = $YUI_PATH.'/connection/connection'.$js_yui_min.'.js';
49
$js_yui_scripts[] = $YUI_PATH.'/dragdrop/dragdrop'.$js_yui_min.'.js';
50

    
51
?>
(6-6/9)