From ef2029df87ec0df1886510486a5a33914ebb9185 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 3 Aug 2010 16:32:53 -0400 Subject: Reformat file. No functional changes --- usr/local/www/pkg.php | 86 ++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 46 deletions(-) diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php index 1182d50..c641775 100755 --- a/usr/local/www/pkg.php +++ b/usr/local/www/pkg.php @@ -48,10 +48,10 @@ function gentitle_pkg($pgname) { $xml = htmlspecialchars($_REQUEST['xml']); if($xml == "") { - print_info_box_np(gettext("ERROR: No package defined.")); - die; + print_info_box_np(gettext("ERROR: No package defined.")); + die; } else { - $pkg = parse_xml_config_pkg("/usr/local/pkg/" . $xml, "packagegui"); + $pkg = parse_xml_config_pkg("/usr/local/pkg/" . $xml, "packagegui"); } if($pkg['donotsave'] <> "") { @@ -73,19 +73,19 @@ if($_REQUEST['startdisplayingat']) $evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; if ($_GET['act'] == "del") { - // loop through our fieldnames and automatically setup the fieldnames - // in the environment. ie: a fieldname of username with a value of - // testuser would automatically eval $username = "testuser"; - foreach ($evaledvar as $ip) { + // loop through our fieldnames and automatically setup the fieldnames + // in the environment. ie: a fieldname of username with a value of + // testuser would automatically eval $username = "testuser"; + foreach ($evaledvar as $ip) { if($pkg['adddeleteeditpagefields']['columnitem']) foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { ${xml_safe_fieldname($column['fielddescr'])} = $ip[xml_safe_fieldname($column['fieldname'])]; } - } + } - $a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; + $a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; - if ($a_pkg[$_GET['id']]) { + if ($a_pkg[$_GET['id']]) { unset($a_pkg[$_GET['id']]); write_config(); if($pkg['custom_delete_php_command'] <> "") { @@ -104,7 +104,7 @@ $iflist = get_configured_interface_with_descr(false, true); $evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; if($pkg['custom_php_global_functions'] <> "") - eval($pkg['custom_php_global_functions']); + eval($pkg['custom_php_global_functions']); if($pkg['custom_php_command_before_form'] <> "") eval($pkg['custom_php_command_before_form']); @@ -125,29 +125,31 @@ include("fbegin.inc"); "") { - echo ''; + display_top_tabs($tab_array); + echo ''; } ?>
'; - $tab_array = array(); - foreach($pkg['tabs']['tab'] as $tab) { - if(isset($tab['active'])) { - $active = true; - } else { - $active = false; - } - $urltmp = ""; - if($tab['url'] <> "") $urltmp = $tab['url']; - if($tab['xml'] <> "") $urltmp = "pkg_edit.php?xml=" . $tab['xml']; + echo '
'; + $tab_array = array(); + foreach($pkg['tabs']['tab'] as $tab) { + if(isset($tab['active'])) { + $active = true; + } else { + $active = false; + } + $urltmp = ""; + if($tab['url'] <> "") + $urltmp = $tab['url']; + if($tab['xml'] <> "") + $urltmp = "pkg_edit.php?xml=" . $tab['xml']; - $myurl = getenv("HTTP_HOST"); - // eval url so that above $myurl item can be processed if need be. - $url = str_replace('$myurl', $myurl, $urltmp); - $tab_array[] = array( - $tab['text'], - $active, - $url - ); + $myurl = getenv("HTTP_HOST"); + // eval url so that above $myurl item can be processed if need be. + $url = str_replace('$myurl', $myurl, $urltmp); + $tab_array[] = array( + $tab['text'], + $active, + $url + ); } - display_top_tabs($tab_array); - echo '