mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add package base detail pages
This adds package base details pages, similar to the package details pages. Each package base details page contains general information (package base name, category, submitter, maintainer, ...) and links to all the corresponding packages. As on the package details pages, comments and links to several package actions are also provided. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
fb81bfd8df
commit
f7d13b5b36
5 changed files with 380 additions and 1 deletions
|
@ -69,6 +69,22 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
|
|||
}
|
||||
}
|
||||
|
||||
include get_route('/' . $tokens[1]);
|
||||
} elseif (!empty($tokens[1]) && '/' . $tokens[1] == get_pkgbase_route()) {
|
||||
if (!empty($tokens[2])) {
|
||||
/* TODO: Create a proper data structure to pass variables from
|
||||
* the routing framework to the individual pages instead of
|
||||
* initializing arbitrary variables here. */
|
||||
$pkgbase_name = $tokens[2];
|
||||
$base_id = pkgbase_from_name($pkgbase_name);
|
||||
|
||||
if (!$base_id) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
include "./404.php";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
include get_route('/' . $tokens[1]);
|
||||
} elseif (!empty($tokens[1]) && '/' . $tokens[1] == get_user_route()) {
|
||||
if (!empty($tokens[2])) {
|
||||
|
|
55
web/html/pkgbase.php
Normal file
55
web/html/pkgbase.php
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
|
||||
|
||||
include_once("aur.inc.php");
|
||||
set_lang();
|
||||
include_once('pkgfuncs.inc.php');
|
||||
check_sid();
|
||||
|
||||
/*
|
||||
* Retrieve package base ID and name, unless initialized by the routing
|
||||
* framework.
|
||||
*/
|
||||
if (!isset($base_id) || !isset($pkgbase_name)) {
|
||||
if (isset($_GET['ID'])) {
|
||||
$base_id = intval($_GET['ID']);
|
||||
$pkgbase_name = pkgbase_name_from_id($_GET['ID']);
|
||||
} else if (isset($_GET['N'])) {
|
||||
$base_id = pkgbase_from_name($_GET['N']);
|
||||
$pkgbase_name = $_GET['N'];
|
||||
} else {
|
||||
unset($base_id, $pkgbase_name);
|
||||
}
|
||||
|
||||
if ($base_id == 0 || $base_id == NULL || $pkgbase_name == NULL) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
include "./404.php";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the title to package base name. */
|
||||
$title = $pkgbase_name;
|
||||
|
||||
/* Retrieve account type. */
|
||||
if (isset($_COOKIE["AURSID"])) {
|
||||
$atype = account_from_sid($_COOKIE["AURSID"]);
|
||||
} else {
|
||||
$atype = "";
|
||||
}
|
||||
|
||||
$details = get_pkgbase_details($base_id);
|
||||
html_header($title, $details);
|
||||
?>
|
||||
|
||||
<?php
|
||||
include('pkg_search_form.php');
|
||||
if (isset($_COOKIE["AURSID"])) {
|
||||
display_pkgbase_details($base_id, $details, $_COOKIE["AURSID"]);
|
||||
} else {
|
||||
display_pkgbase_details($base_id, $details, null);
|
||||
}
|
||||
|
||||
html_footer(AUR_VERSION);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue