diff options
author | Scott Dale <sdale@pfsense.org> | 2007-05-24 02:38:40 +0000 |
---|---|---|
committer | Scott Dale <sdale@pfsense.org> | 2007-05-24 02:38:40 +0000 |
commit | 775d112b5f7acf0353b871e9b33683d3cb2aec4e (patch) | |
tree | b3150300b93080e123e59ad9b3b236dd559ab4bc | |
parent | 209e67e6deb92c61b756589ce5f27400035ee016 (diff) | |
download | pfsense-775d112b5f7acf0353b871e9b33683d3cb2aec4e.zip pfsense-775d112b5f7acf0353b871e9b33683d3cb2aec4e.tar.gz |
show system information first when no configuration saved
-rwxr-xr-x | usr/local/www/index.php | 86 |
1 files changed, 54 insertions, 32 deletions
diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 1cfddbb..757bab0 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -117,17 +117,19 @@ $directory = "widgets/widgets/"; $dirhandle = opendir($directory); $filename = ""; -$widgetnames = array(); +$widgetnames = array (); $widgetfiles = array(); while (false !== ($filename = readdir($dirhandle))) { $periodpos = strpos($filename, "."); - $widgetnames[] = substr($filename, 0, $periodpos); - if ($widgetnames != "system_information") + $widgetname = substr($filename, 0, $periodpos); + $widgetnames[] = $widgetname; + if ($widgetname != "system_information") $widgetfiles[] = $filename; } sort($widgetfiles); - +array_unshift($widgetfiles, "system_information.widget.php"); + if (!is_array($config['widgets'])) { $config['widgets'] = array(); @@ -389,34 +391,54 @@ echo $jscriptstr; //make the title look nice $nicename = ucwords($nicename); - - if ($displayarray[$widgetcounter] == "show"){ - $divdisplay = "block"; - $display = "block"; - $inputdisplay = "show"; - $showdiv = "none"; - $mindiv = "inline"; - } - else if ($displayarray[$widgetcounter] == "hide") { - $divdisplay = "block"; - $display = "none"; - $inputdisplay = "hide"; - $showdiv = "inline"; - $mindiv = "none"; - } - else if ($displayarray[$widgetcounter] == "close"){ - $divdisplay = "none"; - $display = "block"; - $inputdisplay = "close"; - $showdiv = "none"; - $mindiv = "inline"; + if ($config['widgets']){ + if ($displayarray[$widgetcounter] == "show"){ + $divdisplay = "block"; + $display = "block"; + $inputdisplay = "show"; + $showdiv = "none"; + $mindiv = "inline"; + } + else if ($displayarray[$widgetcounter] == "hide") { + $divdisplay = "block"; + $display = "none"; + $inputdisplay = "hide"; + $showdiv = "inline"; + $mindiv = "none"; + } + else if ($displayarray[$widgetcounter] == "close"){ + $divdisplay = "none"; + $display = "block"; + $inputdisplay = "close"; + $showdiv = "none"; + $mindiv = "inline"; + } + else{ + $divdisplay = "block"; + $display = "block"; + $inputdisplay = "show"; + $showdiv = "none"; + $mindiv = "inline"; + } } - else{ - $divdisplay = "block"; - $display = "block"; - $inputdisplay = "show"; - $showdiv = "none"; - $mindiv = "inline"; + else + { + if ($firstprint == false){ + $divdisplay = "block"; + $display = "block"; + $inputdisplay = "show"; + $showdiv = "none"; + $mindiv = "inline"; + $firstprint = true; + } + else + { + $divdisplay = "none"; + $display = "block"; + $inputdisplay = "close"; + $showdiv = "none"; + $mindiv = "inline"; + } } @@ -486,7 +508,7 @@ echo $jscriptstr; <?php //build list of javascript include files - $jsincludefiles = Array(); + $jsincludefiles = array(); $directory = "widgets/javascript/"; $dirhandle = opendir($directory); $filename = ""; |