Commit 27a06305 authored by Franco Fichtner's avatar Franco Fichtner

system/gateway: style sweep

parent d32c7402
......@@ -50,11 +50,9 @@ $a_gateways = &$config['gateways']['gateway_item'];
$changedesc = gettext("Gateway Groups") . ": ";
if ($_POST) {
$pconfig = $_POST;
if ($_POST['apply']) {
$retval = 0;
$retval = system_routing_configure();
......@@ -67,8 +65,9 @@ if ($_POST) {
setup_gateways_monitor();
$savemsg = get_std_save_message($retval);
if ($retval == 0)
if ($retval == 0) {
clear_subsystem_dirty('staticroutes');
}
foreach ($a_gateway_groups as $gateway_group) {
$gw_subsystem = 'gwgroup.' . $gateway_group['name'];
......@@ -84,9 +83,10 @@ if ($_GET['act'] == "del") {
if ($a_gateway_groups[$_GET['id']]) {
$changedesc .= gettext("removed gateway group") . " {$_GET['id']}";
foreach ($config['filter']['rule'] as $idx => $rule) {
if ($rule['gateway'] == $a_gateway_groups[$_GET['id']]['name'])
if ($rule['gateway'] == $a_gateway_groups[$_GET['id']]['name']) {
unset($config['filter']['rule'][$idx]['gateway']);
}
}
unset($a_gateway_groups[$_GET['id']]);
write_config($changedesc);
mark_subsystem_dirty('staticroutes');
......@@ -114,10 +114,14 @@ $main_buttons = array(
<div class="container-fluid">
<div class="row">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('staticroutes')): ?><br/>
<?php if ($savemsg) {
print_info_box($savemsg);
} ?>
<?php if (is_subsystem_dirty('staticroutes')) :
?><br/>
<?php print_info_box_np(sprintf(gettext("The gateway configuration has been changed.%sYou must apply the changes in order for them to take effect."), "<br />"));?><br /><br />
<?php endif; ?>
<?php
endif; ?>
<section class="col-xs-12">
......@@ -144,7 +148,8 @@ $main_buttons = array(
</tr>
</thead>
<tbody>
<?php $i = 0; foreach ($a_gateway_groups as $gateway_group): ?>
<?php $i = 0; foreach ($a_gateway_groups as $gateway_group) :
?>
<tr>
<td class="listlr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
<?php
......@@ -153,7 +158,7 @@ $main_buttons = array(
</td>
<td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
<?php
foreach($gateway_group['item'] as $item) {
foreach ($gateway_group['item'] as $item) {
$itemsplit = explode("|", $item);
echo htmlspecialchars(strtoupper($itemsplit[0])) . "<br />\n";
}
......@@ -161,7 +166,7 @@ $main_buttons = array(
</td>
<td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
<?php
foreach($gateway_group['item'] as $item) {
foreach ($gateway_group['item'] as $item) {
$itemsplit = explode("|", $item);
echo "Tier ". htmlspecialchars($itemsplit[1]) . "<br />\n";
}
......@@ -174,7 +179,8 @@ $main_buttons = array(
<table border="0" cellspacing="0" cellpadding="1" summary="edit">
<tr>
<td><a href="system_gateway_groups_edit.php?id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a></td>
<td><a href="system_gateway_groups.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this gateway group?");?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a></td>
<td><a href="system_gateway_groups.php?act=del&amp;id=<?=$i;
?>" onclick="return confirm('<?=gettext("Do you really want to delete this gateway group?");?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr>
<tr>
<td width="17"></td>
......@@ -183,12 +189,15 @@ $main_buttons = array(
</table>
</td>
</tr>
<?php $i++; endforeach; ?>
<?php $i++;
endforeach; ?>
<tr style="display:none;"><td></td></tr>
</tbody>
</table>
</div>
<p><b><?=gettext("Note:");?></b> <?=gettext("Remember to use these Gateway Groups in firewall rules in order to enable load balancing, failover, or policy-based routing. Without rules directing traffic into the Gateway Groups, they will not be used.");?></p>
<p><b><?=gettext("Note:");
?></b> <?=gettext("Remember to use these Gateway Groups in firewall rules in order to enable load balancing, failover, or policy-based routing. Without rules directing traffic into the Gateway Groups, they will not be used.");?></p>
</form>
</div>
......@@ -199,4 +208,4 @@ $main_buttons = array(
</section>
<?php include("foot.inc"); ?>
<?php include("foot.inc");
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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