3 set_include_path(get_include_path() . PATH_SEPARATOR
. '../lib');
5 include_once("aur.inc.php"); # access AUR common functions
6 set_lang(); # this sets up the visitor's language
7 include_once('pkgfuncs.inc.php'); # package specific functions
8 check_sid(); # see if they're still logged in
10 # Retrieve package ID and name, unless initialized by the routing framework
11 if (!isset($pkgid) ||
!isset($pkgname)) {
12 if (isset($_GET['ID'])) {
13 $pkgid = intval($_GET['ID']);
14 $pkgname = pkg_name_from_id($_GET['ID']);
15 } else if (isset($_GET['N'])) {
16 $pkgid = pkg_from_name($_GET['N']);
17 $pkgname = $_GET['N'];
19 unset($pkgid, $pkgname);
22 if (isset($pkgid) && ($pkgid == 0 ||
$pkgid == NULL ||
$pkgname == NULL)) {
23 header("HTTP/1.0 404 Not Found");
29 # Set the title to the current query or package name
30 if (isset($pkgname)) {
32 } else if (!empty($_GET['K'])) {
33 $title = __("Search Criteria") . ": " . $_GET['K'];
35 $title = __("Packages");
39 if (isset($pkgname)) {
40 $details = pkg_get_details($pkgid);
43 html_header($title, $details);
46 <script type
="text/javascript" src
="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script
>
47 <script type
="text/javascript">
48 function collapseDependsList(list) {
50 // Hide everything past a given limit. Don't do anything if we don't have
51 // enough items, or the link already exists.
53 linkid
= list.attr('id') +
'link',
54 items
= list.find('li').slice(limit
);
55 if (items
.length
<= 1 || $
('#' + linkid
).length
> 0) {
59 list.after('<p><a id="' + linkid +
'" href="#">Show Moreā¦</a></p>');
61 // add link and wire it up to show the hidden items
62 $
('#' + linkid
).click(function(event
) {
63 event
.preventDefault();
64 list.find('li').show();
65 // remove the full <p/> node from the DOM
66 $
(this
).parent().remove();
70 $
(document
).ready(function() {
71 collapseDependsList("#pkgdepslist");
72 collapseDependsList("#pkgreqslist");
73 collapseDependsList("#pkgsrcslist");
79 include('pkg_search_form.php');
81 if (isset($_COOKIE["AURSID"])) {
82 pkg_display_details($pkgid, $details, $_COOKIE["AURSID"]);
85 pkg_display_details($pkgid, $details, null);
88 print __("Error trying to retrieve package details.")."<br />\n";
91 if (!isset($_GET['K']) && !isset($_GET['SB'])) {
95 if (isset($_COOKIE["AURSID"])) {
96 pkg_search_page($_COOKIE["AURSID"]);
102 html_footer(AURWEB_VERSION
);