From 4b80bc34ffb738ef3cd1a7944e8716d3e8140565 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 28 Jun 2004 19:37:02 +0000 Subject: re-working pkgsearch, NumVotes add to Packages table --- web/html/pkgsearch.php | 116 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 94 insertions(+), 22 deletions(-) (limited to 'web/html/pkgsearch.php') diff --git a/web/html/pkgsearch.php b/web/html/pkgsearch.php index 9d4521c..64d229b 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 "
\n"; + + } else { + # Flag the packages in $ids array, and unflag any other + # packages listed in $_REQUEST["All_IDs"] + # + print "flagging
\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 "
\n"; + + } else { + # Disown the packages in $ids array + # + print "disowning
\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 "
\n"; + + } else { + # Adopt the packages in $ids array + # + print "adopting
\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 "
\n"; + + } else { + # vote on the packages in $ids array. 'unvote' for any packages + # listed in the $_REQUEST["All_IDs"] array. + # + print "adopting
\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
\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$"); ?> -- cgit v1.2.3-70-g09d2