mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Tweaks of various page layouts and handling of data
This is a patch that fixes a lot of little things: * We no longer have pkgsearch or pkgdetails link functions and all references to them are gone, that's what a back button is for and if we really need it we can come up with something better * No longer have do_Details variable, this means links on the package search are simply ?ID=foo * On the pkgdetails pages when there are either no deps, deps by, sources or comments for a package the list for each will display "None" instead of nothing at all (ruining the layout) * Fixed a bug where if a package had no sources or no deps pkgsubmit.php would submit an empty one * Translation of the word "Search'" has been changed to "Search" Most of these relate to each other. Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
This commit is contained in:
parent
dbbf50ac90
commit
d4b07f2b33
15 changed files with 189 additions and 245 deletions
|
@ -92,9 +92,6 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
print __("You did not select any packages to flag.");
|
print __("You did not select any packages to flag.");
|
||||||
print "</p>\n";
|
print "</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgsearch_results_link();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif (isset($_REQUEST["do_UnFlag"])) {
|
} elseif (isset($_REQUEST["do_UnFlag"])) {
|
||||||
|
@ -131,7 +128,6 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
print "</p>\n";
|
print "</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgsearch_results_link();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +183,6 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
print "</p>\n";
|
print "</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgsearch_results_link();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +290,6 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
print __("You did not select any packages to delete.");
|
print __("You did not select any packages to delete.");
|
||||||
print "</p>\n";
|
print "</p>\n";
|
||||||
} # end if (!empty($ids))
|
} # end if (!empty($ids))
|
||||||
pkgsearch_results_link();
|
|
||||||
} # end if (!atype)
|
} # end if (!atype)
|
||||||
|
|
||||||
} elseif (isset($_REQUEST["do_Adopt"])) {
|
} elseif (isset($_REQUEST["do_Adopt"])) {
|
||||||
|
@ -353,9 +347,6 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
print __("You did not select any packages to adopt.");
|
print __("You did not select any packages to adopt.");
|
||||||
print "</p>\n";
|
print "</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgsearch_results_link();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -414,13 +405,6 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
print __("You did not select any packages to vote for.");
|
print __("You did not select any packages to vote for.");
|
||||||
print "</p>\n";
|
print "</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST["ID"])) {
|
|
||||||
pkgdetails_link($_REQUEST["ID"]);
|
|
||||||
} else {
|
|
||||||
pkgsearch_results_link();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -471,28 +455,19 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
print __("You did not select any packages to un-vote for.");
|
print __("You did not select any packages to un-vote for.");
|
||||||
print "</p>\n";
|
print "</p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST["ID"])) {
|
|
||||||
pkgdetails_link($_REQUEST["ID"]);
|
|
||||||
} else {
|
|
||||||
pkgsearch_results_link();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} elseif (isset($_REQUEST["do_Details"])) {
|
} elseif (isset($_REQUEST["ID"])) {
|
||||||
|
|
||||||
if (!isset($_REQUEST["ID"]) || !intval($_REQUEST["ID"])) {
|
if (!intval($_REQUEST["ID"])) {
|
||||||
print __("Error trying to retrieve package details.")."<br />\n";
|
print __("Error trying to retrieve package details.")."<br />\n";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
package_details($_REQUEST["ID"], $_COOKIE["AURSID"]);
|
package_details($_REQUEST["ID"], $_COOKIE["AURSID"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br />\n";
|
|
||||||
# FIXME: If someone hits the detail page's vote button, this link dies
|
# FIXME: If someone hits the detail page's vote button, this link dies
|
||||||
pkgsearch_results_link();
|
|
||||||
|
|
||||||
} elseif (isset($_REQUEST["do_Notify"])) {
|
} elseif (isset($_REQUEST["do_Notify"])) {
|
||||||
# I realize that the implementation here seems a bit convoluted, but we want to
|
# I realize that the implementation here seems a bit convoluted, but we want to
|
||||||
|
@ -532,7 +507,6 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
print '<br /></p>';
|
print '<br /></p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pkgdetails_link($pid);
|
|
||||||
} else {
|
} else {
|
||||||
print '<p>';
|
print '<p>';
|
||||||
print __("Couldn't add to notification list.");
|
print __("Couldn't add to notification list.");
|
||||||
|
|
|
@ -58,7 +58,6 @@ if ($_REQUEST["del_Comment"]) {
|
||||||
} else {
|
} else {
|
||||||
print __("Missing comment ID.")."<br />\n";
|
print __("Missing comment ID.")."<br />\n";
|
||||||
}
|
}
|
||||||
pkgdetails_link($_REQUEST["ID"]);
|
|
||||||
html_footer(AUR_VERSION);
|
html_footer(AUR_VERSION);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -76,8 +75,7 @@ if ($_REQUEST["add_Comment"]) {
|
||||||
$q.= "'".mysql_real_escape_string($_REQUEST["comment"])."', ";
|
$q.= "'".mysql_real_escape_string($_REQUEST["comment"])."', ";
|
||||||
$q.= "UNIX_TIMESTAMP())";
|
$q.= "UNIX_TIMESTAMP())";
|
||||||
db_query($q, $dbh);
|
db_query($q, $dbh);
|
||||||
print __("Comment has been added.")."<br /> <br />\n";
|
print __("Comment has been added.");
|
||||||
pkgdetails_link($_REQUEST["ID"]);
|
|
||||||
|
|
||||||
# Send email notifications
|
# Send email notifications
|
||||||
#
|
#
|
||||||
|
@ -144,8 +142,6 @@ if ($_REQUEST["change_Category"]) {
|
||||||
} else {
|
} else {
|
||||||
print __("Invalid category ID.")."<br />\n";
|
print __("Invalid category ID.")."<br />\n";
|
||||||
}
|
}
|
||||||
pkgdetails_link($_REQUEST["ID"]);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
# Prompt visitor for new category_id
|
# Prompt visitor for new category_id
|
||||||
#
|
#
|
||||||
|
@ -179,10 +175,7 @@ if ($_REQUEST["change_Category"]) {
|
||||||
|
|
||||||
print __("You've found a bug if you see this....")."<br />\n";
|
print __("You've found a bug if you see this....")."<br />\n";
|
||||||
|
|
||||||
html_footer(AUR_VERSION); # Use the $Id$ keyword
|
html_footer(AUR_VERSION);
|
||||||
# NOTE: when checking in a new file, use
|
|
||||||
# 'svn propset svn:keywords "Id" filename.php'
|
|
||||||
# to tell svn to expand the "Id" keyword.
|
|
||||||
|
|
||||||
# vim: ts=2 sw=2 noet ft=php
|
# vim: ts=2 sw=2 noet ft=php
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -421,11 +421,15 @@ if ($_COOKIE["AURSID"]) {
|
||||||
db_query($q, $dbh);
|
db_query($q, $dbh);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sources = explode(" ", $new_pkgbuild['source']);
|
# Insert sources, if they don't exist don't inser them
|
||||||
while (list($k, $v) = each($sources)) {
|
#
|
||||||
$q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
|
if ($new_pkgbuild['source'] != "") {
|
||||||
$q .= $pdata["ID"].", '".mysql_real_escape_string($v)."')";
|
$sources = explode(" ", $new_pkgbuild['source']);
|
||||||
db_query($q, $dbh);
|
while (list($k, $v) = each($sources)) {
|
||||||
|
$q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
|
||||||
|
$q .= $pdata["ID"].", '".mysql_real_escape_string($v)."')";
|
||||||
|
db_query($q, $dbh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# this is a brand new package
|
# this is a brand new package
|
||||||
|
@ -483,11 +487,15 @@ if ($_COOKIE["AURSID"]) {
|
||||||
db_query($q, $dbh);
|
db_query($q, $dbh);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sources = explode(" ", $new_pkgbuild['source']);
|
# insert sources
|
||||||
while (list($k, $v) = each($sources)) {
|
#
|
||||||
$q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
|
if ($new_pkgbuild['source'] != "") {
|
||||||
$q .= $packageID.", '".mysql_real_escape_string($v)."')";
|
$sources = explode(" ", $new_pkgbuild['source']);
|
||||||
db_query($q, $dbh);
|
while (list($k, $v) = each($sources)) {
|
||||||
|
$q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
|
||||||
|
$q .= $packageID.", '".mysql_real_escape_string($v)."')";
|
||||||
|
db_query($q, $dbh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ global $_t;
|
||||||
|
|
||||||
$_t["ca"]["Missing a required field."] = "Manca un camp requerit.";
|
$_t["ca"]["Missing a required field."] = "Manca un camp requerit.";
|
||||||
|
|
||||||
$_t["ca"]["Search'"] = "Cerca'";
|
$_t["ca"]["Search"] = "Cerca'";
|
||||||
|
|
||||||
$_t["ca"]["The account, %h%s%h, has been successfully created."] = "El compte, %h%s%h, s'ha creat satisfactòriament.";
|
$_t["ca"]["The account, %h%s%h, has been successfully created."] = "El compte, %h%s%h, s'ha creat satisfactòriament.";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ global $_t;
|
||||||
|
|
||||||
$_t["de"]["Missing a required field."] = "Ein benötigtes Feld fehlt.";
|
$_t["de"]["Missing a required field."] = "Ein benötigtes Feld fehlt.";
|
||||||
|
|
||||||
$_t["de"]["Search'"] = "Suche'";
|
$_t["de"]["Search"] = "Suche'";
|
||||||
|
|
||||||
$_t["de"]["The account, %h%s%h, has been successfully created."] = "Das Konto %h%s%h wurde erfolgreich angelegt.";
|
$_t["de"]["The account, %h%s%h, has been successfully created."] = "Das Konto %h%s%h wurde erfolgreich angelegt.";
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ global $_t;
|
||||||
|
|
||||||
$_t["en"]["Missing a required field."] = "Missing a required field.";
|
$_t["en"]["Missing a required field."] = "Missing a required field.";
|
||||||
|
|
||||||
$_t["en"]["Search'"] = "Search'";
|
$_t["en"]["Search"] = "Search";
|
||||||
|
|
||||||
$_t["en"]["The account, %h%s%h, has been successfully created."] = "The account, %h%s%h, has been successfully created.";
|
$_t["en"]["The account, %h%s%h, has been successfully created."] = "The account, %h%s%h, has been successfully created.";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ global $_t;
|
||||||
|
|
||||||
$_t["es"]["Missing a required field."] = "Falta un campo obligatorio.";
|
$_t["es"]["Missing a required field."] = "Falta un campo obligatorio.";
|
||||||
|
|
||||||
$_t["es"]["Search'"] = "Buscar'";
|
$_t["es"]["Search"] = "Buscar'";
|
||||||
|
|
||||||
$_t["es"]["The account, %h%s%h, has been successfully created."] = "La cuenta, %h%s%h, se creó correctamente.";
|
$_t["es"]["The account, %h%s%h, has been successfully created."] = "La cuenta, %h%s%h, se creó correctamente.";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ global $_t;
|
||||||
|
|
||||||
$_t["fr"]["Missing a required field."] = "Il manque un champ requis.";
|
$_t["fr"]["Missing a required field."] = "Il manque un champ requis.";
|
||||||
|
|
||||||
$_t["fr"]["Search'"] = "Rechercher'";
|
$_t["fr"]["Search"] = "Rechercher'";
|
||||||
|
|
||||||
$_t["fr"]["The account, %h%s%h, has been successfully created."] = "Le compte, %h%s%h, a été créé avec succès.";
|
$_t["fr"]["The account, %h%s%h, has been successfully created."] = "Le compte, %h%s%h, a été créé avec succès.";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ global $_t;
|
||||||
|
|
||||||
$_t["it"]["Missing a required field."] = "Manca un campo obbligatorio.";
|
$_t["it"]["Missing a required field."] = "Manca un campo obbligatorio.";
|
||||||
|
|
||||||
$_t["it"]["Search'"] = "Cerca'";
|
$_t["it"]["Search"] = "Cerca'";
|
||||||
|
|
||||||
$_t["it"]["The account, %h%s%h, has been successfully created."] = "L'account %h%s%h è stato creato con successo.";
|
$_t["it"]["The account, %h%s%h, has been successfully created."] = "L'account %h%s%h è stato creato con successo.";
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ $_t["pl"]["Re-type password"] = "Hasło (ponownie)";
|
||||||
$_t["pl"]["Language is not currently supported."] = "Język nie jest obecnie obsługiwany.";
|
$_t["pl"]["Language is not currently supported."] = "Język nie jest obecnie obsługiwany.";
|
||||||
$_t["pl"]["Missing User ID"] = "Brakuje ID użytkownika";
|
$_t["pl"]["Missing User ID"] = "Brakuje ID użytkownika";
|
||||||
$_t["pl"]["Developer"] = "Developer";
|
$_t["pl"]["Developer"] = "Developer";
|
||||||
$_t["pl"]["Search'"] = "Szukaj'";
|
$_t["pl"]["Search"] = "Szukaj'";
|
||||||
$_t["pl"]["Status"] = "Status";
|
$_t["pl"]["Status"] = "Status";
|
||||||
$_t["pl"]["No results matched your search criteria."] = "Wyszukiwanie nie przyniosło rezultatu.";
|
$_t["pl"]["No results matched your search criteria."] = "Wyszukiwanie nie przyniosło rezultatu.";
|
||||||
$_t["pl"]["Never"] = "Nigdy";
|
$_t["pl"]["Never"] = "Nigdy";
|
||||||
|
|
|
@ -13,7 +13,7 @@ global $_t;
|
||||||
|
|
||||||
$_t["pt"]["Missing a required field."] = "Um campo requerido não foi informado.";
|
$_t["pt"]["Missing a required field."] = "Um campo requerido não foi informado.";
|
||||||
|
|
||||||
$_t["pt"]["Search'"] = "Pesquisa'";
|
$_t["pt"]["Search"] = "Pesquisa'";
|
||||||
|
|
||||||
$_t["pt"]["The account, %h%s%h, has been successfully created."] = "A conta, %h%s%h, foi criada com sucesso.";
|
$_t["pt"]["The account, %h%s%h, has been successfully created."] = "A conta, %h%s%h, foi criada com sucesso.";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ global $_t;
|
||||||
|
|
||||||
$_t["ru"]["Missing a required field."] = "Отсутствует обязательное значение.";
|
$_t["ru"]["Missing a required field."] = "Отсутствует обязательное значение.";
|
||||||
|
|
||||||
$_t["ru"]["Search'"] = "Поиск'";
|
$_t["ru"]["Search"] = "Поиск'";
|
||||||
|
|
||||||
$_t["ru"]["The account, %h%s%h, has been successfully created."] = "Учетная запись %h%s%h успешно создана.";
|
$_t["ru"]["The account, %h%s%h, has been successfully created."] = "Учетная запись %h%s%h успешно создана.";
|
||||||
|
|
||||||
|
|
|
@ -6,42 +6,6 @@ include_once("config.inc");
|
||||||
#
|
#
|
||||||
$pkgsearch_vars = array("O", "L", "C", "K", "SB", "SO", "PP", "do_MyPackages", "do_Orphans", "SeB");
|
$pkgsearch_vars = array("O", "L", "C", "K", "SB", "SO", "PP", "do_MyPackages", "do_Orphans", "SeB");
|
||||||
|
|
||||||
|
|
||||||
# print out the 'return to package details' link
|
|
||||||
#
|
|
||||||
function pkgdetails_link($id=0) {
|
|
||||||
$url_data = "<a href='/packages.php?do_Details=1&ID=".intval($id)."'>";
|
|
||||||
print __("Go back to %hpackage details view%h.",
|
|
||||||
array($url_data, "</a>"));
|
|
||||||
print "\n<br />\n";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# print out the 'return to search results' link
|
|
||||||
#
|
|
||||||
function pkgsearch_results_link() {
|
|
||||||
global $_REQUEST;
|
|
||||||
global $pkgsearch_vars;
|
|
||||||
|
|
||||||
$url_data = "<a href='/packages.php?do_Search=1";
|
|
||||||
while (list($k, $var) = each($pkgsearch_vars)) {
|
|
||||||
if (($var == "do_MyPackages" || $var == "do_Orphans") && $_REQUEST[$var]) {
|
|
||||||
$url_data.="&".$var."=1";
|
|
||||||
} else {
|
|
||||||
$url_data.="&".$var."=".rawurlencode(stripslashes($_REQUEST[$var]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$url_data .= "'>";
|
|
||||||
print "<center>";
|
|
||||||
print __("Go back to %hsearch results%h.",
|
|
||||||
array($url_data, "</a>"));
|
|
||||||
print "</center>";
|
|
||||||
print "\n<br />\n";
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make sure this visitor can delete the requested package comment
|
# Make sure this visitor can delete the requested package comment
|
||||||
# They can delete if they were the comment submitter, or if they are a TU/Dev
|
# They can delete if they were the comment submitter, or if they are a TU/Dev
|
||||||
#
|
#
|
||||||
|
@ -387,21 +351,25 @@ function package_details($id=0, $SID="") {
|
||||||
echo __("Dependencies")."</span></td></tr>\n";
|
echo __("Dependencies")."</span></td></tr>\n";
|
||||||
echo " <tr><td class='boxSoft'>";
|
echo " <tr><td class='boxSoft'>";
|
||||||
$deps = package_dependencies($row["ID"]); # $deps[0] = array('id','name', 'dummy');
|
$deps = package_dependencies($row["ID"]); # $deps[0] = array('id','name', 'dummy');
|
||||||
while (list($k, $darr) = each($deps)) {
|
if (count($deps) == 0) {
|
||||||
$url = "<a href='/packages.php?do_Details=1&ID=".$darr[0];
|
print "None\n";
|
||||||
while(list($k, $var) = each($pkgsearch_vars)) {
|
} else {
|
||||||
if (($var == "do_MyPackages" || $var == "do_Orphans") && $_REQUEST[$var]) {
|
while (list($k, $darr) = each($deps)) {
|
||||||
$url .= "&".$var."=1";
|
$url = "<a href='/packages.php?do_Details=1&ID=".$darr[0];
|
||||||
} else {
|
while(list($k, $var) = each($pkgsearch_vars)) {
|
||||||
$url .= "&".$var."=".rawurlencode(stripslashes($_REQUEST[$var]));
|
if (($var == "do_MyPackages" || $var == "do_Orphans") && $_REQUEST[$var]) {
|
||||||
|
$url .= "&".$var."=1";
|
||||||
|
} else {
|
||||||
|
$url .= "&".$var."=".rawurlencode(stripslashes($_REQUEST[$var]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
reset($pkgsearch_vars);
|
||||||
|
|
||||||
|
// $darr[3] is the DepCondition
|
||||||
|
|
||||||
|
if ($darr[2] == 0) echo $url."'>".$darr[1].$darr[3]."</a><br />\n";
|
||||||
|
else echo "<a href='http://archlinux.org/packages/search/".$darr[1]."'>".$darr[1].$darr[3]."</a><br />\n";
|
||||||
}
|
}
|
||||||
reset($pkgsearch_vars);
|
|
||||||
|
|
||||||
// $darr[3] is the DepCondition
|
|
||||||
|
|
||||||
if ($darr[2] == 0) echo $url."'>".$darr[1].$darr[3]."</a><br />\n";
|
|
||||||
else echo "<a href='http://archlinux.org/packages/search/".$darr[1]."'>".$darr[1].$darr[3]."</a><br />\n";
|
|
||||||
}
|
}
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
echo "</table></td>";
|
echo "</table></td>";
|
||||||
|
@ -413,58 +381,66 @@ function package_details($id=0, $SID="") {
|
||||||
echo __("Required by")."</span></td></tr>\n";
|
echo __("Required by")."</span></td></tr>\n";
|
||||||
echo "<tr><td class='boxSoft'>";
|
echo "<tr><td class='boxSoft'>";
|
||||||
$deps = package_required($row["ID"]);
|
$deps = package_required($row["ID"]);
|
||||||
while (list($k, $darr) = each($deps)) {
|
if (count($deps) == 0) {
|
||||||
$url = "<a href='/packages.php?do_Details=1&ID=".$darr[0];
|
print "None\n";
|
||||||
while(list($k, $var) = each($pkgsearch_vars)) {
|
} else {
|
||||||
if (($var == "do_MyPackages" || $var == "do_Orphans") && $_REQUEST[$var]) {
|
while (list($k, $darr) = each($deps)) {
|
||||||
$url .= "&".$var."=1";
|
$url = "<a href='/packages.php?do_Details=1&ID=".$darr[0];
|
||||||
} else {
|
while(list($k, $var) = each($pkgsearch_vars)) {
|
||||||
$url .= "&".$var."=".rawurlencode(stripslashes($_REQUEST[$var]));
|
if (($var == "do_MyPackages" || $var == "do_Orphans") && $_REQUEST[$var]) {
|
||||||
|
$url .= "&".$var."=1";
|
||||||
|
} else {
|
||||||
|
$url .= "&".$var."=".rawurlencode(stripslashes($_REQUEST[$var]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
reset($pkgsearch_vars);
|
||||||
|
|
||||||
|
// $darr[3] is the DepCondition
|
||||||
|
|
||||||
|
if ($darr[2] == 0) print $url."'>".$darr[1].$darr[3]."</a><br />\n";
|
||||||
|
else print "<a href='http://archlinux.org/packages/search/".$darr[1]."'>".$darr[1].$darr[3]."</a><br />\n";
|
||||||
}
|
}
|
||||||
reset($pkgsearch_vars);
|
|
||||||
|
|
||||||
// $darr[3] is the DepCondition
|
|
||||||
|
|
||||||
if ($darr[2] == 0) print $url."'>".$darr[1].$darr[3]."</a><br />\n";
|
|
||||||
else print "<a href='http://archlinux.org/packages/search/".$darr[1]."'>".$darr[1].$darr[3]."</a><br />\n";
|
|
||||||
}
|
}
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
echo " </table>\n";
|
echo " </table>\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " <td valign='top'>\n";
|
echo " <td valign='top'>\n";
|
||||||
echo " <table class='boxSoft' style='width: 200px'>\n";
|
echo " <table class='boxSoft' style='width: 200px'>\n";
|
||||||
echo " <tr><td class='boxSoftTitle'><span class='f3'>";
|
echo " <tr><td class='boxSoftTitle'><span class='f3'>";
|
||||||
echo __("Sources")."</span></td></tr>\n";
|
echo __("Sources")."</span></td></tr>\n";
|
||||||
echo " <tr><td class='boxSoft'>";
|
echo " <tr><td class='boxSoft'>";
|
||||||
$sources = package_sources($row["ID"]); # $sources[0] = 'src';
|
$sources = package_sources($row["ID"]); # $sources[0] = 'src';
|
||||||
while (list($k, $src) = each($sources)) {
|
if (count($sources) == 0) {
|
||||||
$parsed_url = parse_url($src);
|
print "None\n";
|
||||||
if ($parsed_url['scheme'])
|
} else {
|
||||||
{
|
while (list($k, $src) = each($sources)) {
|
||||||
//It is an external source
|
$parsed_url = parse_url($src);
|
||||||
echo "<a href='".$src."'>".$src."</a><br />\n";
|
if ($parsed_url['scheme'])
|
||||||
}
|
{
|
||||||
else
|
//It is an external source
|
||||||
{
|
echo "<a href='".$src."'>".$src."</a><br />\n";
|
||||||
//It is presumably an internal source
|
}
|
||||||
if ($row["LocationID"] == 2) {
|
else
|
||||||
echo "<a href='".dirname($row['URLPath'])."/".$row['Name'];
|
{
|
||||||
echo "/".$src."'>".$src."</a><br />\n";
|
//It is presumably an internal source
|
||||||
} elseif ($row["LocationID"] == 3) {
|
if ($row["LocationID"] == 2) {
|
||||||
echo "<a href='http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/*checkout*/".$row["Category"]."/".$row["Name"]."/".$src."/?rev=HEAD&cvsroot=AUR&only_with_tag=CURRENT'>";
|
echo "<a href='".dirname($row['URLPath'])."/".$row['Name'];
|
||||||
echo $src."</a><br />\n";
|
echo "/".$src."'>".$src."</a><br />\n";
|
||||||
|
} elseif ($row["LocationID"] == 3) {
|
||||||
|
echo "<a href='http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/*checkout*/".$row["Category"]."/".$row["Name"]."/".$src."/?rev=HEAD&cvsroot=AUR&only_with_tag=CURRENT'>";
|
||||||
|
echo $src."</a><br />\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
echo " </table>\n";
|
echo " </table>\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " </tr>\n";
|
echo " </tr>\n";
|
||||||
echo " </table>\n";
|
echo " </table>\n";
|
||||||
echo " </div>\n";
|
echo " </div>\n";
|
||||||
echo "</div>\n\n";
|
echo "</div>\n\n";
|
||||||
echo "<br />\n\n";
|
echo "<br />\n\n";
|
||||||
|
|
||||||
|
|
||||||
# Actions Bar
|
# Actions Bar
|
||||||
|
@ -534,19 +510,20 @@ function package_details($id=0, $SID="") {
|
||||||
|
|
||||||
# Comments
|
# Comments
|
||||||
#
|
#
|
||||||
echo "<div class=\"pgbox\">\n";
|
echo "<div class=\"pgbox\">\n";
|
||||||
echo " <div class=\"pgboxtitle\"><span class=\"f3\">".__("Comments")."</span></div>\n";
|
echo " <div class=\"pgboxtitle\"><span class=\"f3\">".__("Comments")."</span></div>\n";
|
||||||
echo " <div class=\"pgboxbody-comment\">\n";
|
echo " <div class=\"pgboxbody-comment\">\n";
|
||||||
echo " <table width='100%'>\n";
|
echo " <table width='100%'>\n";
|
||||||
echo " <tr>\n";
|
if (isset($_COOKIE['AURSID'])) {
|
||||||
echo " <td colspan='2'>\n";
|
echo "<tr><td>";
|
||||||
echo " <form action='/pkgedit.php' method='post'>\n";
|
echo " <form action='/pkgedit.php' method='post'>\n";
|
||||||
echo " <input type='hidden' name='ID' value='".$row["ID"]."'>\n";
|
echo " <input type='hidden' name='ID' value='".$row["ID"]."'>\n";
|
||||||
echo " <input type='submit' class='button' name='add_Comment' value=\"";
|
echo " <input type='submit' class='button' name='add_Comment' value=\"";
|
||||||
echo __("Add Comment")."\">\n";
|
echo __("Add Comment")."\">\n";
|
||||||
echo " </form>\n";
|
echo " </form>\n";
|
||||||
echo " </td>\n";
|
echo "</tr></td>";
|
||||||
echo " </tr>\n";
|
//echo "<br />\n";
|
||||||
|
}
|
||||||
$comments = package_comments($row["ID"]);
|
$comments = package_comments($row["ID"]);
|
||||||
if (!empty($comments)) {
|
if (!empty($comments)) {
|
||||||
while (list($indx, $carr) = each($comments)) {
|
while (list($indx, $carr) = each($comments)) {
|
||||||
|
@ -554,8 +531,8 @@ function package_details($id=0, $SID="") {
|
||||||
echo " <tr>\n";
|
echo " <tr>\n";
|
||||||
echo " <td valign='top' style='padding-right: 10' colspan='2'>\n";
|
echo " <td valign='top' style='padding-right: 10' colspan='2'>\n";
|
||||||
echo " <table class='boxSoft' width='100%'>\n";
|
echo " <table class='boxSoft' width='100%'>\n";
|
||||||
echo " <tr>\n";
|
echo " <tr>\n";
|
||||||
echo " <td class='boxSoftTitle'><span class='f3'>";
|
echo " <td class='boxSoftTitle'><span class='f3'>";
|
||||||
if (canDeleteComment($carr["ID"], account_from_sid($SID), $SID)) {
|
if (canDeleteComment($carr["ID"], account_from_sid($SID), $SID)) {
|
||||||
$durl = "<a href='/pkgedit.php?del_Comment=1";
|
$durl = "<a href='/pkgedit.php?del_Comment=1";
|
||||||
$durl.= "&comment_id=".$carr["ID"]."&ID=".$row["ID"];
|
$durl.= "&comment_id=".$carr["ID"]."&ID=".$row["ID"];
|
||||||
|
@ -573,24 +550,24 @@ function package_details($id=0, $SID="") {
|
||||||
array("<b>",$carr["UserName"],"</b>",
|
array("<b>",$carr["UserName"],"</b>",
|
||||||
"<i>",gmdate("Ymd [H:i:s]",$carr["CommentTS"]),"</i>"));
|
"<i>",gmdate("Ymd [H:i:s]",$carr["CommentTS"]),"</i>"));
|
||||||
}
|
}
|
||||||
echo "</span></td>\n";
|
echo "</span></td>\n";
|
||||||
echo " </tr>\n";
|
echo " </tr>\n";
|
||||||
echo " <tr>\n";
|
echo " <tr>\n";
|
||||||
echo " <td class='boxSoft'>";
|
echo " <td class='boxSoft'>";
|
||||||
echo "<code>\n";
|
echo "<code>\n";
|
||||||
echo nl2br(htmlspecialchars($carr["Comments"]));
|
echo nl2br(htmlspecialchars($carr["Comments"]));
|
||||||
echo "</code></td>\n";
|
echo "</code></td>\n";
|
||||||
echo " </tr>\n";
|
echo " </tr>\n";
|
||||||
echo " </table>\n";
|
echo " </table>\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " </tr>\n";
|
echo " </tr>\n";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
print "<tr><td>None</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo " </table>\n";
|
echo " </table>\n";
|
||||||
echo " </div>\n";
|
echo " </div>\n";
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -942,61 +919,77 @@ function pkg_search_page($SID="") {
|
||||||
$q.= "ORDER BY Name ".$order.", LocationID ASC, CategoryID DESC ";
|
$q.= "ORDER BY Name ".$order.", LocationID ASC, CategoryID DESC ";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$qnext = $q."LIMIT ".($O+$PP).", ".$PP; //next page's worth
|
$qnext = $q."LIMIT ".($O+$PP).", ".$PP; //next page's worth
|
||||||
$q.= "LIMIT ".$O.", ".$PP;
|
$q.= "LIMIT ".$O.", ".$PP;
|
||||||
|
|
||||||
print "<!-- Query: ".$q." -->\n";
|
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);
|
$result = db_query($q, $dbh);
|
||||||
|
|
||||||
|
print "<center>\n";
|
||||||
|
print "<table cellspacing='3' class='boxSoft'>\n";
|
||||||
|
print "<tr>\n";
|
||||||
|
print " <td class='boxSoftTitle' align='right'>\n";
|
||||||
|
print " <span class='f3'>".__("Package Listing")."</span>\n";
|
||||||
|
print " </td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
print "<tr>\n";
|
||||||
|
print " <td class='boxSoft'>\n";
|
||||||
|
print "<table width='100%' cellspacing='0' cellpadding='2'>\n";
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
print "<div class='pgboxbody'>";
|
||||||
print __("Error retrieving package list.");
|
print __("Error retrieving package list.");
|
||||||
|
print "</div>";
|
||||||
} elseif (!mysql_num_rows($result)) {
|
} elseif (!mysql_num_rows($result)) {
|
||||||
|
print "<div class='pgboxbody'>";
|
||||||
print __("No packages matched your search criteria.");
|
print __("No packages matched your search criteria.");
|
||||||
|
print "</div>";
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
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";
|
|
||||||
}
|
|
||||||
|
|
||||||
# print out package search results
|
# print out package search results
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -1006,17 +999,6 @@ function pkg_search_page($SID="") {
|
||||||
} else {
|
} else {
|
||||||
$SO_next="d";
|
$SO_next="d";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<center>\n";
|
|
||||||
print "<table cellspacing='3' class='boxSoft'>\n";
|
|
||||||
print "<tr>\n";
|
|
||||||
print " <td class='boxSoftTitle' align='right'>\n";
|
|
||||||
print " <span class='f3'>".__("Package Listing")."</span>\n";
|
|
||||||
print " </td>\n";
|
|
||||||
print "</tr>\n";
|
|
||||||
print "<tr>\n";
|
|
||||||
print " <td class='boxSoft'>\n";
|
|
||||||
print "<table width='100%' cellspacing='0' cellpadding='2'>\n";
|
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
if ($SID) {
|
if ($SID) {
|
||||||
print " <th style='border-bottom: #666 1px solid; vertical-align:";
|
print " <th style='border-bottom: #666 1px solid; vertical-align:";
|
||||||
|
@ -1064,10 +1046,10 @@ function pkg_search_page($SID="") {
|
||||||
(($i % 2) == 0) ? $c = "data1" : $c = "data2";
|
(($i % 2) == 0) ? $c = "data1" : $c = "data2";
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
if ($SID) {
|
if ($SID) {
|
||||||
print " <td class='".$c."'>";
|
|
||||||
if ($row["OutOfDate"]) {
|
if ($row["OutOfDate"]) {
|
||||||
$c = "outofdate";
|
$c = "outofdate";
|
||||||
}
|
}
|
||||||
|
print " <td class='".$c."'>";
|
||||||
print "<input type='checkbox' name='IDs[".$row["ID"]."]' value='1'>";
|
print "<input type='checkbox' name='IDs[".$row["ID"]."]' value='1'>";
|
||||||
# if ($i == 0) {
|
# if ($i == 0) {
|
||||||
# $all_ids = $row["ID"];
|
# $all_ids = $row["ID"];
|
||||||
|
@ -1085,20 +1067,8 @@ function pkg_search_page($SID="") {
|
||||||
print $cats[$row["CategoryID"]]."</span></span></td>\n";
|
print $cats[$row["CategoryID"]]."</span></span></td>\n";
|
||||||
print " <td class='".$c."'><span class='f4'>";
|
print " <td class='".$c."'><span class='f4'>";
|
||||||
$url = "<a href='/packages.php?";
|
$url = "<a href='/packages.php?";
|
||||||
$url .= "do_Details=1&ID=";
|
$url .= "ID=";
|
||||||
$url .= $row["ID"];
|
$url .= $row["ID"];
|
||||||
while (list($k, $var) = each($pkgsearch_vars)) {
|
|
||||||
# I'm never convinced how to do this encoding/decoding properly.
|
|
||||||
# php.net recommends htmlentities(urlencode(data)), but that
|
|
||||||
# doesn't work!
|
|
||||||
#
|
|
||||||
if (($var == "do_MyPackages" || $var == "do_Orphans") && $_REQUEST[$var]) {
|
|
||||||
$url .= "&".$var."=1";
|
|
||||||
} else {
|
|
||||||
$url .= "&".$var."=".rawurlencode(stripslashes($_REQUEST[$var]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
reset($pkgsearch_vars);
|
|
||||||
$url.= "'>";
|
$url.= "'>";
|
||||||
$url.="<span class='black'>";
|
$url.="<span class='black'>";
|
||||||
$url.=$row["Name"];
|
$url.=$row["Name"];
|
||||||
|
@ -1210,13 +1180,12 @@ function pkg_search_page($SID="") {
|
||||||
}
|
}
|
||||||
print " </td>\n";
|
print " </td>\n";
|
||||||
print " </tr>\n";
|
print " </tr>\n";
|
||||||
|
|
||||||
print " </table>\n";
|
|
||||||
print " </td>\n";
|
|
||||||
print "</tr>\n";
|
|
||||||
print "</table>\n";
|
|
||||||
print "</center>\n";
|
|
||||||
}
|
}
|
||||||
|
print " </table>\n";
|
||||||
|
print " </td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
print "</table>\n";
|
||||||
|
print "</center>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -43,7 +43,7 @@ if (isset($_COOKIE["AURSID"])) {
|
||||||
.__("My Packages")."</a></li>\n";
|
.__("My Packages")."</a></li>\n";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<li><a href="http://www.archlinux.org/mailman/listinfo/tur-users/">
|
<li><a href="http://archlinux.org/mailman/listinfo/aur-general">
|
||||||
<?php print __("Discussion"); ?></a></li>
|
<?php print __("Discussion"); ?></a></li>
|
||||||
<li><a href="http://bugs.archlinux.org/index.php?tasks=all&project=2"><?php print __("Bugs"); ?></a></li>
|
<li><a href="http://bugs.archlinux.org/index.php?tasks=all&project=2"><?php print __("Bugs"); ?></a></li>
|
||||||
<li><a href="packages.php"><?php print __("Packages"); ?></a></li>
|
<li><a href="packages.php"><?php print __("Packages"); ?></a></li>
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td align='left'> <br/>
|
<td align='left'> <br/>
|
||||||
<input type='submit' class='button'
|
<input type='submit' class='button'
|
||||||
value="<?php print __("Search'"); ?>">
|
value="<?php print __("Search"); ?>">
|
||||||
<input type='reset' class='button'
|
<input type='reset' class='button'
|
||||||
value="<?php print __("Reset"); ?>"></td>
|
value="<?php print __("Reset"); ?>"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Add table
Reference in a new issue