X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=philter%2Fphilter%2Finclude%2Fform_filter.inc.php;h=49aac89c212a4c844ab1a714c69a9dda80447bfc;hb=98b878f3cd8da2904e0e1066ce55b0720b1ac4b3;hp=e81acad5382b5522b476273fda6310ec88ac110c;hpb=edb68514425ca5f23deff10f71a92ad89a38191d;p=old-projects.git diff --git a/philter/philter/include/form_filter.inc.php b/philter/philter/include/form_filter.inc.php index e81acad..49aac89 100644 --- a/philter/philter/include/form_filter.inc.php +++ b/philter/philter/include/form_filter.inc.php @@ -1,7 +1,19 @@ handle_form()) - echo "

".$philter->error()."

\n"; +if(count($_POST)) { // a FORM has been submitted + if(!empty($_POST['order']['action'])) // FORM order + if($_POST['order']['action']=='submit') { + foreach($filter->rules as $id=>$rule) + if(isset($_POST['order'][$id])) + $filter->rules[$id]->move_to($_POST['order'][$id], $filter->uid, $id); + uasort($filter->rules, 'rule_cmp'); + } elseif($_POST['order']['action']=='delete' && !empty($_POST['order']['select'])) { + $filter->delete_rule($_POST['order']['select']); + $_POST['order']['select'] = min(count($filter->rules),$_POST['order']['select']); + } + if(!empty($_POST['rule'])) + if(!$filter->handle_form()) + echo "

".$philter->error()."

\n"; +} require("include/js_factory.inc.php"); ?>