diff options
author | Callan Barrett <wizzomafizzo@gmail.com> | 2008-01-18 01:11:12 +0900 |
---|---|---|
committer | Simo Leone <simo@archlinux.org> | 2008-01-20 03:18:16 -0600 |
commit | d14def92ff34122bffa4de1fac01598b1d913648 (patch) | |
tree | d37e7257f4f14b3e3f5e801b26fb4091e4014b3a /web | |
parent | 52a770e7e7c9a1701e96aa3c66f25d810394aeaf (diff) | |
download | aurweb-d14def92ff34122bffa4de1fac01598b1d913648.tar.xz |
Turn action bar into drop box
Moves the action bar down to the bottom right of the search results and turns it
into a drop-down selection box.
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
Diffstat (limited to 'web')
-rw-r--r-- | web/html/packages.php | 26 | ||||
-rw-r--r-- | web/lang/en/search_po.inc | 2 | ||||
-rw-r--r-- | web/lib/pkgfuncs.inc | 67 | ||||
-rw-r--r-- | web/template/header.php | 2 |
4 files changed, 35 insertions, 62 deletions
diff --git a/web/html/packages.php b/web/html/packages.php index 143fbdf..a6e2ef9 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -47,7 +47,7 @@ if (isset($_COOKIE["AURSID"])) { # grab the list of Package IDs to be operated on # -isset($_REQUEST["IDs"]) ? $ids = $_REQUEST["IDs"] : $ids = array(); +isset($_POST["IDs"]) ? $ids = $_POST["IDs"] : $ids = array(); #isset($_REQUEST["All_IDs"]) ? # $all_ids = explode(":", $_REQUEST["All_IDs"]) : # $all_ids = array(); @@ -55,7 +55,7 @@ isset($_REQUEST["IDs"]) ? $ids = $_REQUEST["IDs"] : $ids = array(); # determine what button the visitor clicked # -if (isset($_REQUEST["do_Flag"])) { +if ($_POST['action'] == "do_Flag") { if (!$atype) { print __("You must be logged in before you can flag packages."); print "<br />\n"; @@ -111,7 +111,7 @@ if (isset($_REQUEST["do_Flag"])) { } } -} elseif (isset($_REQUEST["do_UnFlag"])) { +} elseif ($_POST['action'] == "do_UnFlag") { if (!$atype) { print __("You must be logged in before you can unflag packages."); print "<br />\n"; @@ -148,7 +148,7 @@ if (isset($_REQUEST["do_Flag"])) { } -} elseif (isset($_REQUEST["do_Disown"])) { +} elseif ($_POST['action'] == "do_Disown") { if (!$atype) { print __("You must be logged in before you can disown packages."); print "<br />\n"; @@ -204,7 +204,7 @@ if (isset($_REQUEST["do_Flag"])) { } -} elseif (isset($_REQUEST["do_Delete"])) { +} elseif ($_POST['action'] == "do_Delete") { if (!$atype) { print __("You must be logged in before you can disown packages."); print "<br />\n"; @@ -309,7 +309,7 @@ if (isset($_REQUEST["do_Flag"])) { } # end if (!empty($ids)) } # end if (!atype) -} elseif (isset($_REQUEST["do_Adopt"])) { +} elseif ($_POST['action'] == "do_Adopt") { if (!$atype) { print __("You must be logged in before you can adopt packages."); print "<br />\n"; @@ -367,7 +367,7 @@ if (isset($_REQUEST["do_Flag"])) { } -} elseif (isset($_REQUEST["do_Vote"])) { +} elseif ($_POST['action'] == "do_Vote") { if (!$atype) { print __("You must be logged in before you can vote for packages."); print "<br />\n"; @@ -425,7 +425,7 @@ if (isset($_REQUEST["do_Flag"])) { } -} elseif (isset($_REQUEST["do_UnVote"])) { +} elseif ($_POST['action'] == "do_UnVote") { if (!$atype) { print __("You must be logged in before you can un-vote for packages."); print "<br />\n"; @@ -475,18 +475,16 @@ if (isset($_REQUEST["do_Flag"])) { } -} elseif (isset($_REQUEST["ID"])) { +} elseif (isset($_GET["ID"])) { - if (!intval($_REQUEST["ID"])) { + if (!intval($_GET["ID"])) { print __("Error trying to retrieve package details.")."<br />\n"; } else { - package_details($_REQUEST["ID"], $_COOKIE["AURSID"]); + package_details($_GET["ID"], $_COOKIE["AURSID"]); } - # FIXME: If someone hits the detail page's vote button, this link dies - -} elseif (isset($_REQUEST["do_Notify"])) { +} elseif ($_POST['action'] == "do_Notify") { # I realize that the implementation here seems a bit convoluted, but we want to # ensure that everything happens as it should, even if someone called this page # without having clicked a button somewhere (naughty naughty). This also leaves diff --git a/web/lang/en/search_po.inc b/web/lang/en/search_po.inc index 601782c..6c73a1a 100644 --- a/web/lang/en/search_po.inc +++ b/web/lang/en/search_po.inc @@ -39,7 +39,7 @@ $_t["en"]["Error trying to retrieve package details."] = "Error trying to retrie $_t["en"]["The selected packages have been adopted."] = "The selected packages have been adopted."; -$_t["en"]["You have been removed from the comment notification list for %s."] = "You have been removed from the comment notification listfor %s."; +$_t["en"]["You have been removed from the comment notification list for %s."] = "You have been removed from the comment notification list for %s."; $_t["en"]["Your votes have been cast for the selected packages."] = "Your votes have been cast for the selected packages."; diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 713eb6b..3608012 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -766,8 +766,10 @@ function pkg_search_page($SID="") { print "</tr>\n"; print "</table>\n"; print "</center>\n"; + print "</form>"; print "<br />\n"; + print "<form action='/packages.php' method='post'>\n"; # query to pull out package info # # $q = "SELECT Packages.*, IF(ISNULL(PackageID), 0, COUNT(*)) AS Votes "; @@ -879,51 +881,8 @@ function pkg_search_page($SID="") { $qnext = $q."LIMIT ".($O+$PP).", ".$PP; //next page's worth $q.= "LIMIT ".$O.", ".$PP; - if ($SID) { - # The 'Actions' table - # - print "<center>\n"; - print "<table cellspacing='3' class='boxSoft'>\n"; - print "<tr>\n"; - print " <td class='boxSoftTitle' align='right'>\n"; - print " <span class='f3'>".__("Actions")."</span>\n"; - print " </td>\n"; - print "</tr>\n"; - print "<tr>\n"; - print " <td class='boxSoft'>\n"; - print "<table style='width: 100%' align='center'>\n"; - print "<tr>\n"; - print " <td align='center'>"; - print "<input type='submit' class='button' name='do_Flag'"; - print " value='".__("Flag Out-of-date")."'></td>\n"; - print " <td align='center'>"; - print "<input type='submit' class='button' name='do_UnFlag'"; - print " value='".__("Unflag Out-of-date")."'></td>\n"; - print " <td align='center'>"; - print "<input type='submit' class='button' name='do_Adopt'"; - print " value='".__("Adopt Packages")."'></td>\n"; - print " <td align='center'>"; - print "<input type='submit' class='button' name='do_Disown'"; - print " value='".__("Disown Packages")."'></td>\n"; - print " <td align='center'>"; - print "<input type='submit' class='button' name='do_Delete'"; - print " value='".__("Delete Packages")."'></td>\n"; - print " <td align='center'>"; - print "<input type='submit' class='button' name='do_Notify'"; - print " value='".__("Toggle Notify")."'></td>\n"; - print " <td align='center'>"; - print "</tr>\n"; - print "</table>\n"; - print " </td>\n"; - print "</tr>\n"; - print "</table>\n"; - print "</center>\n"; - print "<br />\n"; - } - - // Why? - // print "<!-- Query: ".$q." -->\n"; + $result = db_query($q, $dbh); print "<center>\n"; @@ -1100,13 +1059,29 @@ function pkg_search_page($SID="") { if ($_REQUEST["do_Orphans"]) { print "<input type='hidden' name='do_Orphans' value='1'>\n"; } - + + if ($SID) { + # The 'Actions' box + # + print "<div style='text-align: right; padding: 5px 5% 5px 0'>"; + print "<select name='action'>"; + print "<option value='do_Flag'>".__("Flag Out-of-date")."</option>\n"; + print "<option value='do_UnFlag'>".__("Unflag Out-of-date")."</option>\n"; + print "<option value='do_Adopt'>".__("Adopt Packages")."</option>\n"; + print "<option value='do_Disown'>".__("Disown Packages")."</option>\n"; + print "<option value='do_Delete'>".__("Delete Packages")."</option>\n"; + print "<option value='do_Notify'>".__("Toggle Notify")."</option>\n"; + print "</select>"; + print "<input type='submit' class='button' style='width: 80px' value='" . __("Go") . "' />"; + print "</div>"; + } + print "<table width='90%' cellspacing='0' cellpadding='2'>\n"; print "<tr>\n"; print " <td>\n"; print " <table border='0' cellpadding='0' cellspacing='0' width='100%'>\n"; print " <tr>\n"; - + # figure out the results to use $first = $O + 1; diff --git a/web/template/header.php b/web/template/header.php index 6e114fd..488d290 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -93,7 +93,7 @@ if (isset($_COOKIE["AURSID"])) { } ?> <form method='post'> <?php print __("Username:"); ?> - <input type='text' name='user' size='30' maxlength='64' value='<?php if (isset($_POST['user'])) { print htmlspecialchars($_POST['user'], ENT_QUOTES); } ?>'> + <input type='text' name='user' size='30' maxlength='64' value='<?php if (isset($_POST['user'])) { print htmlspecialchars($_POST['user'], ENT_QUOTES); } ?>'> <?php print __("Password:"); ?> <input type='password' name='pass' size='30' maxlength='32'> <input type='submit' class='button' value='<?php print __("Login"); ?>'> |