| 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 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$
|
| 13 |
1477
|
Luisehahne
|
* @filesource $HeadURL$
|
| 14 |
|
|
* @lastmodified $Date$
|
| 15 |
1377
|
FrankH
|
*
|
| 16 |
601
|
doc
|
*/
|
| 17 |
|
|
|
| 18 |
1537
|
Luisehahne
|
// 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 |
1420
|
Luisehahne
|
|
| 27 |
601
|
doc
|
function get_setting($name, $default = '') {
|
| 28 |
|
|
global $database;
|
| 29 |
677
|
thorn
|
$rs = $database->query("SELECT value FROM ".TABLE_PREFIX."mod_jsadmin WHERE name = '".$name."'");
|
| 30 |
601
|
doc
|
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 |
677
|
thorn
|
$database->query("INSERT INTO ".TABLE_PREFIX."mod_jsadmin (name,value) VALUES ('$name','$value')");
|
| 43 |
601
|
doc
|
} else {
|
| 44 |
677
|
thorn
|
$database->query("UPDATE ".TABLE_PREFIX."mod_jsadmin SET value = '$value' WHERE name = '$name'");
|
| 45 |
601
|
doc
|
}
|
| 46 |
|
|
}
|
| 47 |
|
|
|
| 48 |
|
|
// the follwing variables to use and check existing the YUI
|
| 49 |
626
|
doc
|
$WB_MAIN_RELATIVE_PATH="../..";
|
| 50 |
|
|
$YUI_PATH = '/include/yui';
|
| 51 |
601
|
doc
|
$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';
|