summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsearch.php
diff options
context:
space:
mode:
authoreric <eric>2004-06-28 21:37:02 +0200
committereric <eric>2004-06-28 21:37:02 +0200
commit4b80bc34ffb738ef3cd1a7944e8716d3e8140565 (patch)
treed371144998ca570b0808be07ff10c3a697a37bac /web/html/pkgsearch.php
parentefcca46f26247ee69b33cb1effb0d34077817a80 (diff)
downloadaur-4b80bc34ffb738ef3cd1a7944e8716d3e8140565.tar.gz
aur-4b80bc34ffb738ef3cd1a7944e8716d3e8140565.tar.xz
re-working pkgsearch, NumVotes add to Packages table
Diffstat (limited to 'web/html/pkgsearch.php')
-rw-r--r--web/html/pkgsearch.php116
1 files changed, 94 insertions, 22 deletions
diff --git a/web/html/pkgsearch.php b/web/html/pkgsearch.php
index 9d4521ce..64d229bc 100644
--- a/web/html/pkgsearch.php
+++ b/web/html/pkgsearch.php
@@ -6,14 +6,6 @@ set_lang(); # this sets up the visitor's language
check_sid(); # see if they're still logged in
html_header(); # print out the HTML header
-# TODO Maybe pkgsearch, pkgvote can be consolidated? This script can
-# provide a search form. In the results, it can contain a checkbox
-# for 'flag out of date', 'vote', 'details' link, and a link to 'pkgmgmnt'.
-#
-# the results page should have columns for,
-# pkg name/ver, location, maintainer, description, O-O-D, Vote, details, mgmnt
-#
-
# get login privileges
#
@@ -25,30 +17,110 @@ if (isset($_COOKIE["AURSID"])) {
$atype = "";
}
+# grab the list of Package IDs to be operated on
+#
+isset($_REQUEST["IDs"]) ? $ids = $_REQUEST["IDs"] : $ids = array();
+
+
+# determine what button the visitor clicked
+#
+if (isset($_REQUEST["do_Flag"])) {
+ if (!$atype) {
+ print __("You must be logged in before you can flag packages.");
+ print "<br />\n";
+
+ } else {
+ # Flag the packages in $ids array, and unflag any other
+ # packages listed in $_REQUEST["All_IDs"]
+ #
+ print "flagging<br />\n";
+
+ # After flagging, show the search page again (or maybe print out
+ # a message and give the user a link to resume where they were
+ # in the search
+ #
+ pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
+ $_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
+ $_REQUEST["PP"]);
+ }
+
+
+} elseif (isset($_REQUEST["do_Disown"])) {
+ if ($atype != "User" && $atype != "") {
+ print __("You do not have access to disown packages.");
+ print "<br />\n";
+
+ } else {
+ # Disown the packages in $ids array
+ #
+ print "disowning<br />\n";
+
+ # After disowning, show the search page again (or maybe print out
+ # a message and give the user a link to resume where they were
+ # in the search
+ #
+ pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
+ $_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
+ $_REQUEST["PP"]);
+ }
-if ($atype && $_REQUEST["Action"] == "Something") {
- # do something based on what the user specifies
- #
-} elseif ($atype && $_REQUEST["Action"] == "SomethingElse") {
- # do something else based on what the user specifies
+} elseif (isset($_REQUEST["do_Adopt"])) {
+ if ($atype != "User" && $atype != "") {
+ print __("You do not have access to adopt packages.");
+ print "<br />\n";
+
+ } else {
+ # Adopt the packages in $ids array
+ #
+ print "adopting<br />\n";
+
+ # After adopting, show the search page again (or maybe print out
+ # a message and give the user a link to resume where they were
+ # in the search
+ #
+ pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
+ $_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
+ $_REQUEST["PP"]);
+ }
+
+
+} elseif (isset($_REQUEST["do_Vote"])) {
+ if (!$atype) {
+ print __("You must be logged in before you can vote for packages.");
+ print "<br />\n";
+
+ } else {
+ # vote on the packages in $ids array. 'unvote' for any packages
+ # listed in the $_REQUEST["All_IDs"] array.
+ #
+ print "adopting<br />\n";
+
+ # After voting, show the search page again (or maybe print out
+ # a message and give the user a link to resume where they were
+ # in the search
+ #
+ pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
+ $_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
+ $_REQUEST["PP"]);
+ }
+
+
+} elseif (isset($_REQUEST["do_Details"])) {
+ # give a link to 'manage', and another to return to search
+ # results.
#
+ print "details for package<br />\n";
+
-} elseif ($_REQUEST["Action"] == "SearchPkgs") {
- # the visitor has requested search options and/or hit the less/more button
+} else {
+ # do_More/do_Less/do_Search/do_MyPackages - just do a search
#
pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
$_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
$_REQUEST["PP"]);
-} else {
- # do the default thing - give the user a search form that they
- # can specify: location, category, maintainer, name, 'my pkgs'
- # and display a list of packages based on no search options.
- #
- pkg_search_page($_COOKIE["AURSID"]);
}
-
html_footer("\$Id$");
?>