Split package flagging and unflagging into separate functions

Currently, package flagging and unflagging takes place within the
pkg_flag() function. A bool is set to true or false depending on the
action.

Create new pkg_unflag() function with sole purpose of unflagging
and keep pkg_flag() in place. This split will be useful in the
overhaul of the notification system.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
canyonknight@gmail.com 2012-12-06 03:03:41 +00:00 committed by Lukas Fleischer
parent c7d20163a4
commit 20407bb8c6
2 changed files with 45 additions and 33 deletions

View file

@ -51,9 +51,9 @@ if (isset($_POST['IDs'])) {
$output = "";
if (check_token()) {
if (current_action("do_Flag")) {
$output = pkg_flag($atype, $ids, true);
$output = pkg_flag($atype, $ids);
} elseif (current_action("do_UnFlag")) {
$output = pkg_flag($atype, $ids, False);
$output = pkg_unflag($atype, $ids);
} elseif (current_action("do_Adopt")) {
$output = pkg_adopt($atype, $ids, true);
} elseif (current_action("do_Disown")) {