summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_rules.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-07-12 13:28:52 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-07-12 13:30:01 -0400
commit619f2dbd0722d8f1a9c2ed5106cbd43a487b67e2 (patch)
treecbf497a5721427804142cb137b42b94b8afd4362 /usr/local/www/firewall_rules.php
parent2a0e85128c5076a038743a5e0634c58c11019655 (diff)
downloadpfsense-619f2dbd0722d8f1a9c2ed5106cbd43a487b67e2.zip
pfsense-619f2dbd0722d8f1a9c2ed5106cbd43a487b67e2.tar.gz
Add undo button for drag and drop reordering
Diffstat (limited to 'usr/local/www/firewall_rules.php')
-rwxr-xr-xusr/local/www/firewall_rules.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php
index cd358da..704f394 100755
--- a/usr/local/www/firewall_rules.php
+++ b/usr/local/www/firewall_rules.php
@@ -126,7 +126,17 @@ if($_REQUEST['dragdroporder']) {
$config = write_config("Drag and drop firewall rules ordering update.");
// Redirect back to page
mark_subsystem_dirty('filter');
- Header("Location: firewall_rules.php?if=" . $_REQUEST['if']);
+ $undo = array();
+ foreach($_REQUEST['dragtable'] as $dt)
+ $undo[] = "";
+ $counter = 0;
+ foreach($_REQUEST['dragtable'] as $dt) {
+ $undo[$dt] = $counter;
+ $counter++;
+ }
+ foreach($undo as $dt)
+ $undotxt .= "&dragtable[]={$dt}";
+ Header("Location: firewall_rules.php?if=" . $_REQUEST['if'] . "&undodrag=true" . $undotxt);
exit;
}
@@ -286,7 +296,16 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
</script>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('filter')): ?><p>
-<?php print_info_box_np("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
+<?php
+if($_REQUEST['undodrag']) {
+ foreach($_REQUEST['dragtable'] as $dt)
+ $dragtable .= "&dragtable[]={$dt}";
+ print_info_box_np_undo("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect.", "apply" , "Apply changes" , "firewall_rules.php?if={$_REQUEST['if']}&dragdroporder=true&{$dragtable}");
+} else {
+ print_info_box_np("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect.");
+}
+?>
+<br>
<?php endif; ?>
<div id="loading" style="visibity:hidden">
<img src="/themes/<?=$g['theme']?>/images/misc/loader.gif"> Loading, please wait...
OpenPOWER on IntegriCloud