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 2009-2011, Website Baker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.x
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: jsadmin.php 2070 2014-01-03 01:21:42Z darkviper $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/jsadmin/jsadmin.php $
|
14
|
* @lastmodified $Date: 2014-01-03 02:21:42 +0100 (Fri, 03 Jan 2014) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
// prevent this file from being accessed directly
|
19
|
/* -------------------------------------------------------- */
|
20
|
if(defined('WB_PATH') == false)
|
21
|
{
|
22
|
// Stop this file being access directly
|
23
|
die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
|
24
|
}
|
25
|
/* -------------------------------------------------------- */
|
26
|
|
27
|
function get_setting($name, $default = '') {
|
28
|
global $database;
|
29
|
$rs = $database->query("SELECT value FROM ".TABLE_PREFIX."mod_jsadmin WHERE name = '".$name."'");
|
30
|
if($row = $rs->fetchRow())
|
31
|
return $row['value'];
|
32
|
return
|
33
|
$default;
|
34
|
}
|
35
|
|
36
|
function save_setting($name, $value) {
|
37
|
global $database;
|
38
|
|
39
|
$prev_value = get_setting($name, false);
|
40
|
|
41
|
if($prev_value === false) {
|
42
|
$database->query("INSERT INTO ".TABLE_PREFIX."mod_jsadmin (name,value) VALUES ('$name','$value')");
|
43
|
} else {
|
44
|
$database->query("UPDATE ".TABLE_PREFIX."mod_jsadmin SET value = '$value' WHERE name = '$name'");
|
45
|
}
|
46
|
}
|
47
|
|
48
|
// the follwing variables to use and check existing the YUI
|
49
|
$WB_MAIN_RELATIVE_PATH="../..";
|
50
|
$YUI_PATH = '/include/yui';
|
51
|
$js_yui_min = "-min"; // option for smaller code so faster
|
52
|
$js_yui_scripts = Array();
|
53
|
$js_yui_scripts[] = $YUI_PATH.'/yahoo/yahoo'.$js_yui_min.'.js';
|
54
|
$js_yui_scripts[] = $YUI_PATH.'/event/event'.$js_yui_min.'.js';
|
55
|
$js_yui_scripts[] = $YUI_PATH.'/dom/dom'.$js_yui_min.'.js';
|
56
|
$js_yui_scripts[] = $YUI_PATH.'/connection/connection'.$js_yui_min.'.js';
|
57
|
$js_yui_scripts[] = $YUI_PATH.'/dragdrop/dragdrop'.$js_yui_min.'.js';
|