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: tool.php 1457 2011-06-25 17:18:50Z 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['save_settings']))  {
42
	if (!$admin->checkFTAN())
43
	{
44
		$admin->print_header();
45
		$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$_SERVER['REQUEST_URI']);
46
	}
47
	$admin->print_header();
48

    
49
	// Include functions file
50
	require_once(WB_PATH.'/framework/functions.php');
51
	save_setting('mod_jsadmin_persist_order', isset($_POST['persist_order']));
52
	save_setting('mod_jsadmin_ajax_order_pages', isset($_POST['ajax_order_pages']));
53
	save_setting('mod_jsadmin_ajax_order_sections', isset($_POST['ajax_order_sections']));
54
   // 	echo '<div style="border: solid 2px #9c9; background: #ffd; padding: 0.5em; margin-top: 1em">'.$MESSAGE['SETTINGS']['SAVED'].'</div>';
55
	// check if there is a database error, otherwise say successful
56
	if($database->is_error()) {
57
		$admin->print_error($database->get_error(), $js_back);
58
	} else {
59

    
60
		$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/admintools/tool.php?tool=jsadmin');
61
	}
62

    
63
} else {
64
	// $admin->print_header();
65
}
66

    
67
// Display form
68
	$persist_order = get_setting('mod_jsadmin_persist_order', true) ? 'checked="checked"' : '';
69
	$ajax_order_pages = get_setting('mod_jsadmin_ajax_order_pages', true) ? 'checked="checked"' : '';
70
	$ajax_order_sections = get_setting('mod_jsadmin_ajax_order_sections', true) ? 'checked="checked"' : '';
71

    
72
// THIS ROUTINE CHECKS THE EXISTING OFF ALL NEEDED YUI FILES
73
  $YUI_ERROR=false; // ist there an Error
74
  $YUI_PUT ='';   // String with javascipt includes
75
  $YUI_PUT_MISSING_Files=''; // String with missing files
76
  reset($js_yui_scripts);
77
  foreach($js_yui_scripts as $script) {
78
     if(!file_exists($WB_MAIN_RELATIVE_PATH.$script)){
79
        $YUI_ERROR=true;
80
        $YUI_PUT_MISSING_Files =$YUI_PUT_MISSING_Files."- ".WB_URL.$script."<br />";   // catch all missing files
81
    }
82
	}
83
	if($YUI_ERROR)
84
	{
85
?>
86
	<div id="jsadmin_install" style="border: solid 2px #c99; background: #ffd; padding: 0.5em; margin-top: 1em">
87

    
88
     <?php echo $MOD_JSADMIN['TXT_ERROR_INSTALLINFO_B'].$YUI_PUT_MISSING_Files; ?>
89
      </div>
90
<?php
91
  }
92
  else
93
  {
94
  ?>
95
   <form id="jsadmin_form" name="store_settings" style="margin-top: 1em; display: true;" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
96
	<?php echo $admin->getFTAN(); ?>
97
   <table cellpadding="4" cellspacing="0" border="0">
98
   <tr>
99
	     <td colspan="2"><?php echo $MOD_JSADMIN['TXT_HEADING_B']; ?>:</td>
100
   </tr>
101
   <tr>
102
	     <td width="20"><input type="checkbox" name="persist_order" id="persist_order" value="true" <?php echo $persist_order; ?>/></td>
103
	     <td><label for="persist_order"><?php echo $MOD_JSADMIN['TXT_PERSIST_ORDER_B']; ?></label></td>
104
   </tr>
105
   <tr>
106
	     <td width="20"><input type="checkbox" name="ajax_order_pages" id="ajax_order_pages" value="true" <?php echo $ajax_order_pages; ?>/></td>
107
	     <td><label for="ajax_order_pages"><?php echo $MOD_JSADMIN['TXT_AJAX_ORDER_PAGES_B']; ?></label></td>
108
   </tr>
109
   <tr>
110
	     <td width="20"><input type="checkbox" name="ajax_order_sections" id="ajax_order_sections" value="true" <?php echo $ajax_order_sections; ?>/></td>
111
	     <td><label for="ajax_order_sections"><?php echo $MOD_JSADMIN['TXT_AJAX_ORDER_SECTIONS_B']; ?></label></td>
112
   </tr>
113
   <tr>
114
	     <td>&nbsp;</td>
115
	     <td>
116
		   <input type="submit" name="save_settings" value="<?php echo $TEXT['SAVE']; ?>" />
117
	    </td>
118
   </tr>
119
   </table>
120
   </form>
121
 <?php
122
 }
(9-9/10)