1 |
601
|
doc
|
<?php
|
2 |
1377
|
FrankH
|
/**
|
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$
|
14 |
1477
|
Luisehahne
|
* @filesource $HeadURL$
|
15 |
|
|
* @lastmodified $Date$
|
16 |
1377
|
FrankH
|
*
|
17 |
601
|
doc
|
*/
|
18 |
|
|
|
19 |
1420
|
Luisehahne
|
// Must include code to stop this file being access directly
|
20 |
|
|
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
|
21 |
|
|
|
22 |
601
|
doc
|
function get_setting($name, $default = '') {
|
23 |
|
|
global $database;
|
24 |
677
|
thorn
|
$rs = $database->query("SELECT value FROM ".TABLE_PREFIX."mod_jsadmin WHERE name = '".$name."'");
|
25 |
601
|
doc
|
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 |
677
|
thorn
|
$database->query("INSERT INTO ".TABLE_PREFIX."mod_jsadmin (name,value) VALUES ('$name','$value')");
|
38 |
601
|
doc
|
} else {
|
39 |
677
|
thorn
|
$database->query("UPDATE ".TABLE_PREFIX."mod_jsadmin SET value = '$value' WHERE name = '$name'");
|
40 |
601
|
doc
|
}
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
// the follwing variables to use and check existing the YUI
|
44 |
626
|
doc
|
$WB_MAIN_RELATIVE_PATH="../..";
|
45 |
|
|
$YUI_PATH = '/include/yui';
|
46 |
601
|
doc
|
$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 |
|
|
?>
|