summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/wizard.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-01-22 22:42:28 +0545
committerStephen Beaver <sbeaver@netgate.com>2016-01-22 12:21:45 -0500
commit3b3a95e5511ef5f60f8142480ddf5adcaed88cb1 (patch)
treec011d618e1b5d6123107f4c148d15fe0a6bb87d7 /src/usr/local/www/wizard.php
parentbea2dd6d5fd711653565ec212d0dd62a44b7f043 (diff)
downloadpfsense-3b3a95e5511ef5f60f8142480ddf5adcaed88cb1.zip
pfsense-3b3a95e5511ef5f60f8142480ddf5adcaed88cb1.tar.gz
Fix #5794 remove print_info_box_np chackes for gettext("apply")
1) Get rid of the stristr() checks to "guess" if an apply button should be used. 2) Change print_info_box() so it can take a button name of "close" , "apply" or none to decide which button to show. 3) Delete function print_info_box_np_undo() - nothing calls it. 4) Add new function print_apply_box() to provide an easy wrapper for print_info_box() with the parameters to be 'warning' level and 'apply' button. 5) Change print_info_box_np() calls to just print_info_box() or print_apply_box() as appropriate. There is 1 direct call to print_info_box_np() from vpn_ipsec_mobile.php remaining. That tries to make a "create" button. It was not working before this change. It needs to be sorted out and fixed separately. After this change there is no dependency on a string containing text like "apply" to make the apply button appear. Then we can work on re-engineering the internal code of print_info_box_np() print_info_box() and print_apply_box() to fit together however we like. It should be easy to preserving the current API to print_info_box() and print_apply_box().
Diffstat (limited to 'src/usr/local/www/wizard.php')
-rw-r--r--src/usr/local/www/wizard.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/usr/local/www/wizard.php b/src/usr/local/www/wizard.php
index 54a82e6..cfe95f9 100644
--- a/src/usr/local/www/wizard.php
+++ b/src/usr/local/www/wizard.php
@@ -89,25 +89,25 @@ if ($_POST['xml']) {
if (empty($xml)) {
$xml = "not_defined";
- print_info_box_np(sprintf(gettext("ERROR: Could not open %s."), $xml));
+ print_info_box(sprintf(gettext("ERROR: Could not open %s."), $xml));
die;
} else {
$wizard_xml_prefix = "{$g['www_path']}/wizards";
$wizard_full_path = "{$wizard_xml_prefix}/{$xml}";
if (substr_compare(realpath($wizard_full_path), $wizard_xml_prefix, 0, strlen($wizard_xml_prefix))) {
- print_info_box_np(gettext("ERROR: Invalid path specified."));
+ print_info_box(gettext("ERROR: Invalid path specified."));
die;
}
if (file_exists($wizard_full_path)) {
$pkg = parse_xml_config_pkg($wizard_full_path, "pfsensewizard");
} else {
- print_info_box_np(sprintf(gettext("ERROR: Could not open %s."), $xml));
+ print_info_box(sprintf(gettext("ERROR: Could not open %s."), $xml));
die;
}
}
if (!is_array($pkg)) {
- print_info_box_np(sprintf(gettext("ERROR: Could not parse %s/wizards/%s file."), $g['www_path'], $xml));
+ print_info_box(sprintf(gettext("ERROR: Could not parse %s/wizards/%s file."), $g['www_path'], $xml));
die;
}
OpenPOWER on IntegriCloud