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 1477 2011-07-21 02:47:28Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/jsadmin/jsadmin.php $
15
 * @lastmodified    $Date: 2011-07-21 04:47:28 +0200 (Thu, 21 Jul 2011) $
16
 *
17
*/
18

    
19
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21

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

    
31
function save_setting($name, $value) {
32
	global $database;
33

    
34
	$prev_value = get_setting($name, false);
35

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

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

    
54
?>
(7-7/11)