summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-07-24 16:23:09 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-07-24 16:23:09 +0000
commit8191b36e1e5c030ba04b270db63e6f6aaba0bb49 (patch)
treeaf1bd335bbec7d9d9b4efcc01abe7abefd744f72
parent3efa00296a17e03591361c2ef0550ccaaba66c07 (diff)
downloadpfsense-8191b36e1e5c030ba04b270db63e6f6aaba0bb49.zip
pfsense-8191b36e1e5c030ba04b270db63e6f6aaba0bb49.tar.gz
* Fix dashboard thanks to Ermal
* Style fixes * Move POST code to top of form. Why on earth would we want to invoke ajax calls when we are saving data?
-rwxr-xr-xusr/local/www/index.php35
1 files changed, 16 insertions, 19 deletions
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index 8dfde20..dacbf13 100755
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -35,10 +35,23 @@
require_once('guiconfig.inc');
require_once('notices.inc');
+ if ($_POST && $_POST['submit']) {
+ $config['widgets']['sequence'] = $_POST['sequence'];
+
+ foreach ($widgetnames as $widget){
+ if ($_POST[$widget . '-config']){
+ $config['widgets'][$widget . '-config'] = $_POST[$widget . '-config'];
+ }
+ }
+
+ write_config("Widget configuration has been changed.");
+ header("Location: index.php");
+ exit;
+ }
+
## Load Functions Files
require_once('includes/functions.inc.php');
-
## Load AJAX, Initiate Class ###############################################
require_once('includes/sajax.class.php');
@@ -137,25 +150,10 @@ array_unshift($widgetfiles, "system_information.widget.php");
if (!is_array($config['widgets'])) {
$config['widgets'] = array();
}
-
-if ($_POST){
- $config['widgets']['sequence'] = $_POST['sequence'];
-
- foreach ($widgetnames as $widget){
- if ($_POST[$widget . '-config']){
- $config['widgets'][$widget . '-config'] = $_POST[$widget . '-config'];
- }
- }
-
- write_config("Widget configuration has been changed.");
- header("Location: index.php");
- exit;
-}
$pconfig['sequence'] = $config['widgets']['sequence'];
-if ($config['widgets'] && $pconfig['sequence'] != "")
-{
+if ($config['widgets'] && $pconfig['sequence'] != "") {
$widgetlist = $pconfig['sequence'];
$colpos = array();
$savedwidgetfiles = array();
@@ -171,8 +169,7 @@ if ($config['widgets'] && $pconfig['sequence'] != "")
$savedwidgetfiles[] = $widgetname . ".widget.php";
}
$widgetlist = $savedwidgetfiles;
-}
-else{
+} else{
$widgetlist = $widgetfiles;
}
OpenPOWER on IntegriCloud