From fd3e179f6faed3d6798ae3ed603edd6f34dd0616 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 17 Aug 2015 07:39:58 +0200 Subject: [PATCH] firewall: do not probe translations for other translated words; fixes #321 --- src/www/firewall_nat.php | 2 +- src/www/firewall_rules.php | 9 ++++---- src/www/guiconfig.inc | 44 ++++++++++++++++++++++++++------------ 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/src/www/firewall_nat.php b/src/www/firewall_nat.php index 00fc373c7a3..92a5a62fb32 100644 --- a/src/www/firewall_nat.php +++ b/src/www/firewall_nat.php @@ -243,7 +243,7 @@ function delete_id($id, &$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/firewall_rules.php b/src/www/firewall_rules.php index 1fd6db30878..f9e44ff9df8 100644 --- a/src/www/firewall_rules.php +++ b/src/www/firewall_rules.php @@ -388,12 +388,13 @@ function(){

You must apply the changes in order for them to take effect."), "apply" , gettext("Apply changes") , "firewall_rules.php?if={$_REQUEST['if']}&dragdroporder=true&{$dragtable}"); + } + print_info_box_apply_undo(gettext("The firewall rule configuration has been changed.
You must apply the changes in order for them to take effect."), "firewall_rules.php?if={$_REQUEST['if']}&dragdroporder=true&{$dragtable}"); } else { - print_info_box_np(gettext("The firewall rule configuration has been changed.
You must apply the changes in order for them to take effect.")); + print_info_box_apply(gettext("The firewall rule configuration has been changed.
You must apply the changes in order for them to take effect.")); } ?> diff --git a/src/www/guiconfig.inc b/src/www/guiconfig.inc index 88de5b25f9b..c9024489a1d 100644 --- a/src/www/guiconfig.inc +++ b/src/www/guiconfig.inc @@ -179,6 +179,28 @@ function print_input_errors($input_errors) { echo ""; } +function print_info_box_apply($msg) +{ + $value = gettext('Apply changes'); + $name= 'apply'; + + $savebutton = '

'; + $savebutton .= ''; + if ($_POST['if']) { + $savebutton .= ''; + } + $savebutton .= '
'; + + echo << + + +EOFnp; +} + function print_info_box_np($msg, $name="apply",$value="", $showapply=false) { if(empty($value)) { $value = gettext("Apply changes"); @@ -205,23 +227,17 @@ EOFnp; } -function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $undo) { - if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) { - - $savebutton .= ""; - $savebutton .= ""; - - if(isset($_POST['if'])) - $savebutton .= ""; - } else { - $savebutton = ""; - } +function print_info_box_apply_undo($msg, $undo) +{ + $value = gettext('Apply changes'); + $name= 'apply'; + $savebutton .= ""; + $savebutton .= ""; $url = $_SERVER['REQUEST_URI']; echo <<

{$msg}

@@ -232,10 +248,10 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und
EOFnp; - } -function print_info_box($msg) { +function print_info_box($msg) +{ print_info_box_np($msg); }