diff options
author | Dan McGee <dan@archlinux.org> | 2011-03-01 18:26:21 +0100 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-03-04 10:29:15 +0100 |
commit | d1d0288598bb8f2fca299e0e3e6eadc6d4fbc32d (patch) | |
tree | 89a4ca38853e391eab80fd888facd79619e7d94d /web/html | |
parent | bbc90846f5f40dff92eca7ffafbcf6daa98956e3 (diff) | |
download | aur-d1d0288598bb8f2fca299e0e3e6eadc6d4fbc32d.tar.gz aur-d1d0288598bb8f2fca299e0e3e6eadc6d4fbc32d.tar.xz |
Add action lookup helper function
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html')
-rw-r--r-- | web/html/packages.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/web/html/packages.php b/web/html/packages.php index f84a6c32..c8949a4a 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -38,19 +38,19 @@ if (isset($_POST['IDs'])) { # Determine what action to do $output = ""; -if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { +if (current_action("do_Flag")) { $output = pkg_flag($atype, $ids, True); -} elseif ($_POST['action'] == "do_UnFlag" || isset($_POST['do_UnFlag'])) { +} elseif (current_action("do_UnFlag")) { $output = pkg_flag($atype, $ids, False); -} elseif ($_POST['action'] == "do_Adopt" || isset($_POST['do_Adopt'])) { +} elseif (current_action("do_Adopt")) { $output = pkg_adopt($atype, $ids, True); -} elseif ($_POST['action'] == "do_Disown" || isset($_POST['do_Disown'])) { +} elseif (current_action("do_Disown")) { $output = pkg_adopt($atype, $ids, False); -} elseif ($_POST['action'] == "do_Vote" || isset($_POST['do_Vote'])) { +} elseif (current_action("do_Vote")) { $output = pkg_vote($atype, $ids, True); -} elseif ($_POST['action'] == "do_UnVote" || isset($_POST['do_UnVote'])) { +} elseif (current_action("do_UnVote")) { $output = pkg_vote($atype, $ids, False); -} elseif ($_POST['action'] == "do_Delete" || isset($_POST['do_Delete'])) { +} elseif (current_action("do_Delete")) { if (isset($_POST['confirm_Delete'])) { $output = pkg_delete($atype, $ids); unset($_GET['ID']); @@ -58,13 +58,13 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { else { $output = __("The selected packages have not been deleted, check the confirmation checkbox."); } -} elseif ($_POST['action'] == "do_Notify" || isset($_POST['do_Notify'])) { +} elseif (current_action("do_Notify")) { $output = pkg_notify($atype, $ids); -} elseif ($_POST['action'] == "do_UnNotify" || isset($_POST['do_UnNotify'])) { +} elseif (current_action("do_UnNotify")) { $output = pkg_notify($atype, $ids, False); -} elseif ($_POST['action'] == "do_DeleteComment" || isset($_POST["do_DeleteComment"])) { +} elseif (current_action("do_DeleteComment")) { $output = pkg_delete_comment($atype); -} elseif ($_POST['action'] == "do_ChangeCategory" || isset($_POST['do_ChangeCategory'])) { +} elseif (current_action("do_ChangeCategory")) { $output = pkg_change_category($atype); } |