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: tool.php 1420 2011-01-26 17:43:56Z Luisehahne $
|
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
|
// Must include code to stop this file being access directly
|
20
|
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
|
21
|
|
22
|
// check if module language file exists for the language set by the user (e.g. DE, EN)
|
23
|
if(!file_exists(WB_PATH .'/modules/jsadmin/languages/'.LANGUAGE .'.php')) {
|
24
|
// no module language file exists for the language set by the user, include default module language file EN.php
|
25
|
require_once(WB_PATH .'/modules/jsadmin/languages/EN.php');
|
26
|
} else {
|
27
|
// a module language file exists for the language defined by the user, load it
|
28
|
require_once(WB_PATH .'/modules/jsadmin/languages/'.LANGUAGE .'.php');
|
29
|
}
|
30
|
|
31
|
// check if backend.css file needs to be included into the <body></body>
|
32
|
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH .'/modules/jsadmin/backend.css')) {
|
33
|
echo '<style type="text/css">';
|
34
|
include(WB_PATH .'/modules/jsadmin/backend.css');
|
35
|
echo "\n</style>\n";
|
36
|
}
|
37
|
|
38
|
require_once(WB_PATH.'/modules/jsadmin/jsadmin.php');
|
39
|
|
40
|
// Check if user selected what add-ons to reload
|
41
|
if(isset($_POST['submit']) AND $_POST['submit'] != '') {
|
42
|
if (!$admin->checkFTAN())
|
43
|
{
|
44
|
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
|
45
|
exit();
|
46
|
}
|
47
|
|
48
|
// Include functions file
|
49
|
require_once(WB_PATH.'/framework/functions.php');
|
50
|
save_setting('mod_jsadmin_persist_order', isset($_POST['persist_order']));
|
51
|
save_setting('mod_jsadmin_ajax_order_pages', isset($_POST['ajax_order_pages']));
|
52
|
save_setting('mod_jsadmin_ajax_order_sections', isset($_POST['ajax_order_sections']));
|
53
|
echo '<div style="border: solid 2px #9c9; background: #ffd; padding: 0.5em; margin-top: 1em">'.$MESSAGE['SETTINGS']['SAVED'].'</div>';
|
54
|
}
|
55
|
|
56
|
// Display form
|
57
|
$persist_order = get_setting('mod_jsadmin_persist_order', true) ? 'checked="checked"' : '';
|
58
|
$ajax_order_pages = get_setting('mod_jsadmin_ajax_order_pages', true) ? 'checked="checked"' : '';
|
59
|
$ajax_order_sections = get_setting('mod_jsadmin_ajax_order_sections', true) ? 'checked="checked"' : '';
|
60
|
?>
|
61
|
<?php
|
62
|
|
63
|
// THIS ROUTINE CHECKS THE EXISTING OFF ALL NEEDED YUI FILES
|
64
|
$YUI_ERROR=false; // ist there an Error
|
65
|
$YUI_PUT =''; // String with javascipt includes
|
66
|
$YUI_PUT_MISSING_Files=''; // String with missing files
|
67
|
reset($js_yui_scripts);
|
68
|
foreach($js_yui_scripts as $script) {
|
69
|
if(!file_exists($WB_MAIN_RELATIVE_PATH.$script)){
|
70
|
$YUI_ERROR=true;
|
71
|
$YUI_PUT_MISSING_Files =$YUI_PUT_MISSING_Files."- ".WB_URL.$script."<br />"; // catch all missing files
|
72
|
}
|
73
|
}
|
74
|
if($YUI_ERROR)
|
75
|
{
|
76
|
?><div id="jsadmin_install" style="border: solid 2px #c99; background: #ffd; padding: 0.5em; margin-top: 1em">
|
77
|
|
78
|
<?php echo $MOD_JSADMIN['TXT_ERROR_INSTALLINFO_B'].$YUI_PUT_MISSING_Files; ?>
|
79
|
</div>
|
80
|
<?php
|
81
|
}
|
82
|
else
|
83
|
{
|
84
|
?>
|
85
|
<form id="jsadmin_form" style="margin-top: 1em; display: true;" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
|
86
|
<?php echo $admin->getFTAN(); ?>
|
87
|
<table cellpadding="4" cellspacing="0" border="0">
|
88
|
<tr>
|
89
|
<td colspan="2"><?php echo $MOD_JSADMIN['TXT_HEADING_B']; ?>:</td>
|
90
|
</tr>
|
91
|
<tr>
|
92
|
<td width="20"><input type="checkbox" name="persist_order" id="persist_order" value="true" <?php echo $persist_order; ?>/></td>
|
93
|
<td><label for="persist_order"><?php echo $MOD_JSADMIN['TXT_PERSIST_ORDER_B']; ?></label></td>
|
94
|
</tr>
|
95
|
<tr>
|
96
|
<td width="20"><input type="checkbox" name="ajax_order_pages" id="ajax_order_pages" value="true" <?php echo $ajax_order_pages; ?>/></td>
|
97
|
<td><label for="ajax_order_pages"><?php echo $MOD_JSADMIN['TXT_AJAX_ORDER_PAGES_B']; ?></label></td>
|
98
|
</tr>
|
99
|
<tr>
|
100
|
<td width="20"><input type="checkbox" name="ajax_order_sections" id="ajax_order_sections" value="true" <?php echo $ajax_order_sections; ?>/></td>
|
101
|
<td><label for="ajax_order_sections"><?php echo $MOD_JSADMIN['TXT_AJAX_ORDER_SECTIONS_B']; ?></label></td>
|
102
|
</tr>
|
103
|
<tr>
|
104
|
<td> </td>
|
105
|
<td>
|
106
|
<input type="submit" name="submit" value="<?php echo $TEXT['SAVE']; ?>" />
|
107
|
</td>
|
108
|
</tr>
|
109
|
</table>
|
110
|
</form>
|
111
|
<?php
|
112
|
}
|
113
|
?>
|