Commit fd3e179f authored by Franco Fichtner's avatar Franco Fichtner

firewall: do not probe translations for other translated words; fixes #321

parent eddee1fd
......@@ -243,7 +243,7 @@ $main_buttons = array(
<?php if (isset($savemsg)) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('natconf')): ?>
<?php print_info_box_np(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
<?php print_info_box_apply(gettext("The NAT configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
<?php endif; ?>
<section class="col-xs-12">
......
......@@ -388,12 +388,13 @@ include("head.inc");
<?php if (isset($savemsg)) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('filter')): ?><p>
<?php
if($_REQUEST['undodrag']) {
foreach($_REQUEST['dragtable'] as $dt)
if ($_REQUEST['undodrag']) {
foreach ($_REQUEST['dragtable'] as $dt) {
$dragtable .= "&dragtable[]={$dt}";
print_info_box_np_undo(gettext("The firewall rule configuration has been changed.<br />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.<br />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.<br />You must apply the changes in order for them to take effect."));
print_info_box_apply(gettext("The firewall rule configuration has been changed.<br />You must apply the changes in order for them to take effect."));
}
?>
......
......@@ -179,6 +179,28 @@ function print_input_errors($input_errors) {
echo "</ul></div></div>";
}
function print_info_box_apply($msg)
{
$value = gettext('Apply changes');
$name= 'apply';
$savebutton = '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">';
$savebutton .= '<input name="' . $name . '" type="submit" class="btn btn-default" id="' . $name . '" value="' . $value . '" />';
if ($_POST['if']) {
$savebutton .= '<input type="hidden" name="if" value="' . htmlspecialchars($_POST['if']) . '" />';
}
$savebutton .= '</form>';
echo <<<EOFnp
<div class="col-xs-12">
<div class="alert alert-info alert-dismissible" role="alert">
{$savebutton}
<p>{$msg}</p>
</div>
</div>
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 .= "<input class=\"btn btn-default\" type=\"button\" value=\"". gettext("Undo") . "\" onclick=\"document.location='{$undo}'\" />";
$savebutton .= "<input class=\"btn btn-default\" name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\" />";
if(isset($_POST['if']))
$savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
} else {
$savebutton = "<input class=\"btn btn-default\" value=\"" . gettext("Close") . "\" type=\"button\" onclick=\"$('#redboxtable').hide();\" />";
}
function print_info_box_apply_undo($msg, $undo)
{
$value = gettext('Apply changes');
$name= 'apply';
$savebutton .= "<input class=\"btn btn-default\" type=\"button\" value=\"". gettext("Undo") . "\" onclick=\"document.location='{$undo}'\" />";
$savebutton .= "<input class=\"btn btn-default\" name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\" />";
$url = $_SERVER['REQUEST_URI'];
echo <<<EOFnp
<div class="col-xs-12" id="redboxtable"><form action="{$url}" method="post">
<div class="alert alert-warning" summary="red box table">
<p>{$msg}<br /><br /></p>
......@@ -232,10 +248,10 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und
</div>
</form></div>
EOFnp;
}
function print_info_box($msg) {
function print_info_box($msg)
{
print_info_box_np($msg);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment