From 7f75ddb851edcb96d708c8a727fe65895236bbce Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sat, 31 Oct 2015 23:35:17 +0100 Subject: [PATCH] www: eradiacate print_info_box_np() for #444 --- src/wizard/setup.xml | 30 ++++++------ src/www/guiconfig.inc | 60 ++++-------------------- src/www/load_balancer_monitor.php | 2 +- src/www/load_balancer_pool.php | 2 +- src/www/load_balancer_relay_action.php | 2 +- src/www/load_balancer_relay_protocol.php | 2 +- src/www/load_balancer_setting.php | 2 +- src/www/load_balancer_virtual_server.php | 2 +- src/www/services_dhcp.php | 2 +- src/www/services_dhcpv6.php | 2 +- src/www/services_dnsmasq.php | 2 +- src/www/services_igmpproxy.php | 2 +- src/www/services_unbound.php | 2 +- src/www/services_unbound_acls.php | 2 +- src/www/services_unbound_advanced.php | 2 +- src/www/status_lb_pool.php | 2 +- src/www/status_lb_vs.php | 2 +- src/www/system_advanced_sysctl.php | 2 +- src/www/system_gateway_groups.php | 2 +- src/www/system_gateways.php | 2 +- src/www/system_groupmanager_addprivs.php | 2 +- src/www/system_routes.php | 2 +- src/www/system_usermanager_addprivs.php | 2 +- src/www/vpn_ipsec.php | 2 +- src/www/vpn_ipsec_keys.php | 2 +- src/www/vpn_ipsec_mobile.php | 24 +++++++++- src/www/vpn_l2tp.php | 2 +- src/www/vpn_l2tp_users.php | 2 +- src/www/vpn_openvpn_server.php | 2 +- src/www/vpn_pppoe.php | 13 ++--- src/www/vpn_pptp_users.php | 2 +- src/www/wizard.php | 2 +- 32 files changed, 79 insertions(+), 104 deletions(-) diff --git a/src/wizard/setup.xml b/src/wizard/setup.xml index 7b0c55b2f..05925e8c3 100644 --- a/src/wizard/setup.xml +++ b/src/wizard/setup.xml @@ -108,19 +108,19 @@ @@ -151,7 +151,7 @@ "; - $savebutton .= ""; - if(!empty($_POST['if'])) - $savebutton .= ""; - $savebutton.=""; - } else { - $savebutton = ''; - } - - echo << - - -EOFnp; - -} - -function print_info_box_apply_undo($msg, $undo) -{ - $value = gettext('Apply changes'); - $name= 'apply'; - - $savebutton .= ""; - $savebutton .= ""; - - $url = $_SERVER['REQUEST_URI']; - - echo <<
-
-

{$msg}

-
- {$savebutton} - {$undobutton} -
-
-
-EOFnp; -} - function print_info_box($msg) { - print_info_box_np($msg); + $savebutton = ''; + + echo << + + +EOFnp; } function get_std_save_message() { diff --git a/src/www/load_balancer_monitor.php b/src/www/load_balancer_monitor.php index f7be416c3..d6bb23d4f 100644 --- a/src/www/load_balancer_monitor.php +++ b/src/www/load_balancer_monitor.php @@ -94,7 +94,7 @@ $main_buttons = array( 0) print_input_errors($input_errors); ?>
- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/load_balancer_pool.php b/src/www/load_balancer_pool.php index 70101782e..a851ceaa0 100644 --- a/src/www/load_balancer_pool.php +++ b/src/www/load_balancer_pool.php @@ -106,7 +106,7 @@ $main_buttons = array(
- "));?>
+ "));?>
diff --git a/src/www/load_balancer_relay_action.php b/src/www/load_balancer_relay_action.php index 7d94cca4b..994c31429 100644 --- a/src/www/load_balancer_relay_action.php +++ b/src/www/load_balancer_relay_action.php @@ -109,7 +109,7 @@ include("head.inc"); 0) print_input_errors($input_errors); ?>

- You must apply the changes in order for them to take effect."));?>
+ You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/load_balancer_relay_protocol.php b/src/www/load_balancer_relay_protocol.php index 72f707693..c5489731f 100644 --- a/src/www/load_balancer_relay_protocol.php +++ b/src/www/load_balancer_relay_protocol.php @@ -104,7 +104,7 @@ include("head.inc"); 0) print_input_errors($input_errors); ?>

- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>

diff --git a/src/www/load_balancer_setting.php b/src/www/load_balancer_setting.php index 5b5e5307f..e8b2a47cd 100644 --- a/src/www/load_balancer_setting.php +++ b/src/www/load_balancer_setting.php @@ -100,7 +100,7 @@ include("head.inc"); 0) print_input_errors($input_errors); ?>
- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/load_balancer_virtual_server.php b/src/www/load_balancer_virtual_server.php index 57e89cb89..767456456 100644 --- a/src/www/load_balancer_virtual_server.php +++ b/src/www/load_balancer_virtual_server.php @@ -143,7 +143,7 @@ $main_buttons = array( 0) print_input_errors($input_errors); ?>
- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/services_dhcp.php b/src/www/services_dhcp.php index 4f37c423e..f32b73bc7 100644 --- a/src/www/services_dhcp.php +++ b/src/www/services_dhcp.php @@ -669,7 +669,7 @@ include("head.inc"); 0) print_input_errors($input_errors); ?>
- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/services_dhcpv6.php b/src/www/services_dhcpv6.php index 3b58251c0..ca9ebfc27 100644 --- a/src/www/services_dhcpv6.php +++ b/src/www/services_dhcpv6.php @@ -448,7 +448,7 @@ include("head.inc"); 0) print_input_errors($input_errors); ?>

- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>

diff --git a/src/www/services_dnsmasq.php b/src/www/services_dnsmasq.php index 3734d1827..890623f5f 100644 --- a/src/www/services_dnsmasq.php +++ b/src/www/services_dnsmasq.php @@ -176,7 +176,7 @@ function show_advanced_dns() { 0) print_input_errors($input_errors); ?>
- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/services_igmpproxy.php b/src/www/services_igmpproxy.php index 11b38acf5..77fe15417 100644 --- a/src/www/services_igmpproxy.php +++ b/src/www/services_igmpproxy.php @@ -83,7 +83,7 @@ $main_buttons = array(

- " . gettext("You must apply the changes in order for them to take effect."));?> + " . gettext("You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/services_unbound.php b/src/www/services_unbound.php index dc0b1759a..008a1cf9c 100644 --- a/src/www/services_unbound.php +++ b/src/www/services_unbound.php @@ -193,7 +193,7 @@ function show_advanced_dns() { 0) print_input_errors($input_errors); ?>
- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/services_unbound_acls.php b/src/www/services_unbound_acls.php index b1b0a5da4..88d9431cc 100644 --- a/src/www/services_unbound_acls.php +++ b/src/www/services_unbound_acls.php @@ -196,7 +196,7 @@ include("head.inc"); print_info_box($savemsg); if (is_subsystem_dirty("unbound")) - print_info_box_np(gettext("The settings for the DNS Resolver have changed. You must apply the configuration to take affect.")); + print_info_box_apply(gettext("The settings for the DNS Resolver have changed. You must apply the configuration to take affect.")); ?> diff --git a/src/www/services_unbound_advanced.php b/src/www/services_unbound_advanced.php index bb4e06a41..8debe4bad 100644 --- a/src/www/services_unbound_advanced.php +++ b/src/www/services_unbound_advanced.php @@ -132,7 +132,7 @@ include_once("head.inc"); 0) print_input_errors($input_errors); ?>
- " . gettext("You must apply the changes in order for them to take effect."));?>
+ " . gettext("You must apply the changes in order for them to take effect."));?>
diff --git a/src/www/status_lb_pool.php b/src/www/status_lb_pool.php index c823f8e9c..ec735e941 100644 --- a/src/www/status_lb_pool.php +++ b/src/www/status_lb_pool.php @@ -111,7 +111,7 @@ if ($_POST) {

- "));?> + "));?>
diff --git a/src/www/status_lb_vs.php b/src/www/status_lb_vs.php index 75a13abe8..d190b8b86 100644 --- a/src/www/status_lb_vs.php +++ b/src/www/status_lb_vs.php @@ -57,7 +57,7 @@ include("head.inc");

- "));?> + "));?>
diff --git a/src/www/system_advanced_sysctl.php b/src/www/system_advanced_sysctl.php index 510274e50..14aa83c88 100644 --- a/src/www/system_advanced_sysctl.php +++ b/src/www/system_advanced_sysctl.php @@ -138,7 +138,7 @@ include("head.inc"); print_info_box($savemsg); } if (is_subsystem_dirty('sysctl') && ($act != "edit" )) { - print_info_box_np(gettext("The firewall tunables have changed. You must apply the configuration to take affect.")); + print_info_box_apply(gettext("The firewall tunables have changed. You must apply the configuration to take affect.")); } ?> diff --git a/src/www/system_gateway_groups.php b/src/www/system_gateway_groups.php index b814db209..c88e6f532 100644 --- a/src/www/system_gateway_groups.php +++ b/src/www/system_gateway_groups.php @@ -148,7 +148,7 @@ $main_buttons = array( } ?>
- "));?>

+ "));?>

diff --git a/src/www/system_gateways.php b/src/www/system_gateways.php index 595f2fde7..d6e404d2f 100644 --- a/src/www/system_gateways.php +++ b/src/www/system_gateways.php @@ -215,7 +215,7 @@ $main_buttons = array( print_info_box($savemsg); } if (is_subsystem_dirty('staticroutes')) { - print_info_box_np(gettext("The gateway configuration has been changed.") . "
" . gettext("You must apply the changes in order for them to take effect.")); + print_info_box_apply(gettext("The gateway configuration has been changed.") . "
" . gettext("You must apply the changes in order for them to take effect.")); } ?> diff --git a/src/www/system_groupmanager_addprivs.php b/src/www/system_groupmanager_addprivs.php index ecbd5e663..e658c3c79 100644 --- a/src/www/system_groupmanager_addprivs.php +++ b/src/www/system_groupmanager_addprivs.php @@ -113,7 +113,7 @@ if ($_POST) { /* if ajax is calling, give them an update message */ if (isAjax()) { - print_info_box_np($savemsg); + print_info_box($savemsg); } include("head.inc"); diff --git a/src/www/system_routes.php b/src/www/system_routes.php index e19956f32..501441686 100644 --- a/src/www/system_routes.php +++ b/src/www/system_routes.php @@ -220,7 +220,7 @@ $main_buttons = array( } ?>

- "));?>

+ "));?>

diff --git a/src/www/system_usermanager_addprivs.php b/src/www/system_usermanager_addprivs.php index 11184a8b9..c287228fa 100644 --- a/src/www/system_usermanager_addprivs.php +++ b/src/www/system_usermanager_addprivs.php @@ -105,7 +105,7 @@ if ($_POST) { /* if ajax is calling, give them an update message */ if (isAjax()) { - print_info_box_np($savemsg); + print_info_box($savemsg); } include("head.inc"); diff --git a/src/www/vpn_ipsec.php b/src/www/vpn_ipsec.php index 761a8a8ad..31f4ad4c4 100644 --- a/src/www/vpn_ipsec.php +++ b/src/www/vpn_ipsec.php @@ -267,7 +267,7 @@ function show_phase2(id, buttonid) { print_info_box($savemsg); } if ($pconfig['enable'] && is_subsystem_dirty('ipsec')) { - print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".
" . gettext("You must apply the changes in order for them to take effect.")); + print_info_box_apply(gettext("The IPsec tunnel configuration has been changed") . ".
" . gettext("You must apply the changes in order for them to take effect.")); } ?>
diff --git a/src/www/vpn_ipsec_keys.php b/src/www/vpn_ipsec_keys.php index 81d35511e..b084f5698 100644 --- a/src/www/vpn_ipsec_keys.php +++ b/src/www/vpn_ipsec_keys.php @@ -115,7 +115,7 @@ if (isset($savemsg)) { print_info_box($savemsg); } if (is_subsystem_dirty('ipsec')) { - print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".
" . gettext("You must apply the changes in order for them to take effect.")); + print_info_box_apply(gettext("The IPsec tunnel configuration has been changed") . ".
" . gettext("You must apply the changes in order for them to take effect.")); } ?> diff --git a/src/www/vpn_ipsec_mobile.php b/src/www/vpn_ipsec_mobile.php index 0c845a158..89fae21ad 100644 --- a/src/www/vpn_ipsec_mobile.php +++ b/src/www/vpn_ipsec_mobile.php @@ -325,7 +325,7 @@ if (isset($savemsg)) { print_info_box($savemsg); } if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec')) { - print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".
" . gettext("You must apply the changes in order for them to take effect.")); + print_info_box_apply(gettext("The IPsec tunnel configuration has been changed") . ".
" . gettext("You must apply the changes in order for them to take effect.")); } $ph1found = false; foreach ($config['ipsec']['phase1'] as $ph1ent) { @@ -333,8 +333,28 @@ foreach ($config['ipsec']['phase1'] as $ph1ent) { $ph1found = true; } } + +function print_legacy_box($msg, $name, $value) +{ + $savebutton = "
"; + $savebutton .= ""; + if (!empty($_POST['if'])) { + $savebutton .= ""; + } + $savebutton .= '
'; + + echo << + +
+EOFnp; +} + if (!empty($pconfig['enable']) && !$ph1found) { - print_info_box_np(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".
" . gettext("Please click Create to define one."), gettext("create"), gettext("Create Phase1")); + print_legacy_box(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".
" . gettext("Please click Create to define one."), gettext("create"), gettext("Create Phase1")); } if (isset($input_errors) && count($input_errors) > 0) { print_input_errors($input_errors); diff --git a/src/www/vpn_l2tp.php b/src/www/vpn_l2tp.php index f80619185..5190ca182 100644 --- a/src/www/vpn_l2tp.php +++ b/src/www/vpn_l2tp.php @@ -178,7 +178,7 @@ if ($_POST) { /* if ajax is calling, give them an update message */ if (isAjax()) { - print_info_box_np($savemsg); + print_info_box($savemsg); } } } diff --git a/src/www/vpn_l2tp_users.php b/src/www/vpn_l2tp_users.php index 021ed5a63..ae736f7b2 100644 --- a/src/www/vpn_l2tp_users.php +++ b/src/www/vpn_l2tp_users.php @@ -88,7 +88,7 @@ $main_buttons = array( } ?>
- " . gettext("You must apply the changes in order for them to take effect") . ".
" . gettext("Warning: this will terminate all current l2tp sessions!") . "");?> + " . gettext("You must apply the changes in order for them to take effect") . ".
" . gettext("Warning: this will terminate all current l2tp sessions!") . "");?> diff --git a/src/www/vpn_openvpn_server.php b/src/www/vpn_openvpn_server.php index 411efe5d5..f41681936 100644 --- a/src/www/vpn_openvpn_server.php +++ b/src/www/vpn_openvpn_server.php @@ -705,7 +705,7 @@ function tuntap_change() { print_input_errors($input_errors); } if (isset($savemsg)) { - print_info_box_np($savemsg); + print_info_box($savemsg); } ?> diff --git a/src/www/vpn_pppoe.php b/src/www/vpn_pppoe.php index 5312b1868..366bc55f8 100644 --- a/src/www/vpn_pppoe.php +++ b/src/www/vpn_pppoe.php @@ -97,15 +97,10 @@ $main_buttons = array(
- -
- " . gettext("You must apply the changes in order for them to take effect."));?> - - + +
+ " . gettext("You must apply the changes in order for them to take effect."));?> +
diff --git a/src/www/vpn_pptp_users.php b/src/www/vpn_pptp_users.php index 8853da4e0..d0c7e0cf3 100644 --- a/src/www/vpn_pptp_users.php +++ b/src/www/vpn_pptp_users.php @@ -84,7 +84,7 @@ $main_buttons = array( } ?>
- ".gettext("You must apply the changes in order for them to take effect").".
".gettext("Warning: this will terminate all current PPTP sessions")."!");?>
+ ".gettext("You must apply the changes in order for them to take effect").".
".gettext("Warning: this will terminate all current PPTP sessions")."!");?>
diff --git a/src/www/wizard.php b/src/www/wizard.php index 243fa4b0e..03e1ff1f7 100644 --- a/src/www/wizard.php +++ b/src/www/wizard.php @@ -123,7 +123,7 @@ $listtags = array_flip(array( $pkg = parse_xml_config_raw("/usr/local/wizard/{$xml}.xml", 'opnsensewizard', false); if (!is_array($pkg)) { - print_info_box_np(sprintf(gettext("ERROR: Could not parse %s wizard file."), $xml)); + print_info_box(sprintf(gettext("ERROR: Could not parse %s wizard file."), $xml)); die; }