From 32c580703fb09b02127e4f71ed430c0412419125 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 11 Jul 2010 19:57:33 -0400 Subject: Adding drag and drop feature to firewall rules ordering. Simply start dragging a rule and release and the page will refresh with the new order. If all goes well I will duplicate this feature to other pages with rule reordering functionality. --- usr/local/www/firewall_rules.php | 68 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index b9888e6..a91f851 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -98,6 +98,42 @@ if ($_POST['if']) $ifdescs = get_configured_interface_with_descr(); +// Drag and drop reordering +if($_REQUEST['dragdroporder']) { + // First create a new ruleset array and tmp arrays + $a_filter_unorder = array(); + $a_filter_order = array(); + $a_filter_order_tmp = array(); + // Pointer to id of item being reordered + $found = 0; + $drag_order = $_REQUEST['dragtable']; + // Next traverse through rules building a new order for interface + for ($i = 0; isset($a_filter[$i]); $i++) { + if($a_filter[$i]['interface'] <> $_REQUEST['if']) + $a_filter_unorder[] = $a_filter[$i]; + else + $a_filter_order_tmp[] = $a_filter[$i]; + } + // Reorder rules with the posted order + for ($i = 0; $i + )" id="frd" ondblclick="document.location='firewall_rules_edit.php?id=';"> - + + @@ -649,7 +691,8 @@ echo " -- cgit v1.1