2 $uid = uid_from_sid($SID);
4 $pkgid = intval($row['ID']);
5 $base_id = intval($row['BaseID']);
7 $catarr = pkgbase_categories();
9 $submitter = username_from_id($row["SubmitterUID"]);
10 $maintainer = username_from_id($row["MaintainerUID"]);
11 $packager = username_from_id($row["PackagerUID"]);
13 $votes = $row['NumVotes'];
15 # In case of wanting to put a custom message
17 $license = empty($row['License']) ?
$msg : $row['License'];
19 # Print the timestamps for last updates
20 $updated_time = ($row["ModifiedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["ModifiedTS"]));
21 $submitted_time = ($row["SubmittedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"]));
22 $out_of_date_time = ($row["OutOfDateTS"] == 0) ?
$msg : gmdate("Y-m-d", intval($row["OutOfDateTS"]));
24 $package_url = config_get('options', 'package_url');
25 $urlpath = $package_url . substr($row['BaseName'], 0, 2) . "/" . $row['BaseName'];
27 $lics = pkg_licenses($row["ID"]);
28 $grps = pkg_groups($row["ID"]);
30 $deps = pkg_dependencies($row["ID"]);
31 $requiredby = pkg_required($row["Name"]);
33 usort($deps, function($x, $y) {
35 if ($x[1] == "depends") {
37 } elseif ($y[1] == "depends") {
40 return strcmp($x[1], $y[1]);
41 } elseif ($x[3] != $y[3]) {
42 return strcmp($x[3], $y[3]);
44 return strcmp($x[0], $y[0]);
48 $rels = pkg_relations($row["ID"]);
50 usort($rels, function($x, $y) {
52 return strcmp($x[3], $y[3]);
54 return strcmp($x[0], $y[0]);
58 $rels_c = $rels_p = $rels_r = array();
59 foreach ($rels as $rel) {
73 # $sources[0] = 'src';
74 $sources = pkg_sources($row["ID"]);
76 <div id
="pkgdetails" class="box">
77 <h2
><?
= __('Package Details') . ': ' . htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?
></h2
>
78 <div id
="detailslinks" class="listing">
80 <h4
><?
= __('Package Actions') ?
></h4
>
82 <li
><a href
="<?= $urlpath ?>/PKGBUILD"><?
= __('View PKGBUILD') ?
></a
></li
>
83 <li
><a href
="<?= $urlpath . '/' . $row['BaseName'] ?>.tar.gz"><?
= __('Download tarball') ?
></a
></li
>
84 <li
><a href
="https://wiki.archlinux.org/index.php/Special:Search?search=<?= urlencode($row['Name']) ?>"><?
= __('Search wiki') ?
></a
></li
>
85 <li
><span
class="flagged"><?php
if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?
></span
></li
>
87 <?php
if ($row["OutOfDateTS"] === NULL): ?
>
89 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'flag/'; ?>" method
="post">
90 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
91 <input type
="submit" class="button text-button" name
="do_Flag" value
="<?= __('Flag package out-of-date') ?>" />
94 <?php
elseif (($row["OutOfDateTS"] !== NULL) && has_credential(CRED_PKGBASE_UNFLAG
, array($row["MaintainerUID"]))): ?
>
96 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unflag/'; ?>" method
="post">
97 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
98 <input type
="submit" class="button text-button" name
="do_UnFlag" value
="<?= __('Unflag package') ?>" />
102 <?php
if (pkgbase_user_voted($uid, $base_id)): ?
>
104 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unvote/'; ?>" method
="post">
105 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
106 <input type
="submit" class="button text-button" name
="do_UnVote" value
="<?= __('Remove vote') ?>" />
111 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'vote/'; ?>" method
="post">
112 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
113 <input type
="submit" class="button text-button" name
="do_Vote" value
="<?= __('Vote for this package') ?>" />
117 <?php
if (pkgbase_user_notify($uid, $base_id)): ?
>
119 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unnotify/'; ?>" method
="post">
120 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
121 <input type
="submit" class="button text-button" name
="do_UnNotify" value
="<?= __('Disable notifications') ?>" />
126 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'notify/'; ?>" method
="post">
127 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
128 <input type
="submit" class="button text-button" name
="do_Notify" value
="<?= __('Notify of new comments') ?>" />
132 <li
><span
class="flagged"><?php
if ($row["RequestCount"] > 0) { echo _n('%d pending request', '%d pending requests', $row["RequestCount"]); } ?
></span
></li
>
133 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'request/'; ?>"><?
= __('File Request'); ?
></a
></li
>
134 <?php
if (has_credential(CRED_PKGBASE_DELETE
)): ?
>
135 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'delete/'; ?>"><?
= __('Delete Package'); ?
></a
></li
>
136 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'merge/'; ?>"><?
= __('Merge Package'); ?
></a
></li
>
140 <?php
if ($uid && $row["MaintainerUID"] === NULL): ?
>
142 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'adopt/'; ?>" method
="post">
143 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
144 <input type
="submit" class="button text-button" name
="do_Adopt" value
="<?= __('Adopt Package') ?>" />
147 <?php
elseif (has_credential(CRED_PKGBASE_DISOWN
, array($row["MaintainerUID"]))): ?
>
149 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'disown/'; ?>" method
="post">
150 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
151 <input type
="submit" class="button text-button" name
="do_Disown" value
="<?= __('Disown Package') ?>" />
161 <th
><?
= __('Package Base') . ': ' ?
></th
>
162 <td
class="wrap"><a href
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>"><?
= htmlspecialchars($row['BaseName']); ?
></a
></td
>
165 <th
><?
= __('Description') . ': ' ?
></th
>
166 <td
class="wrap"><?
= htmlspecialchars($row['Description']); ?
></td
>
169 <th
><?
= __('Upstream URL') . ': ' ?
></th
>
170 <td
><a href
="<?= htmlspecialchars($row['URL'], ENT_QUOTES) ?>" title
="<?= __('Visit the website for') . ' ' . htmlspecialchars( $row['Name'])?>"><?
= htmlspecialchars($row['URL'], ENT_QUOTES
) ?
></a
></td
>
173 <th
><?
= __('Category') . ': ' ?
></th
>
175 if (has_credential(CRED_PKGBASE_CHANGE_CATEGORY
, array($row["MaintainerUID"]))):
178 <form method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
180 <input type
="hidden" name
="action" value
="do_ChangeCategory" />
182 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
184 <select name
="category_id">
186 foreach ($catarr as $cid => $catname):
188 <option value
="<?= $cid ?>"<?php
if ($cid == $row["CategoryID"]) { ?
> selected
="selected" <?php
} ?
>><?
= $catname ?
></option
>
191 <input type
="submit" value
="<?= __('Change category') ?>"/>
196 <a href
="<?= get_uri('/packages/'); ?>?C=<?= $row['CategoryID'] ?>"><?
= $row['Category'] ?
></a
>
200 <?php
if (count($lics) > 0): ?
>
202 <th
><?
= __('Licenses') . ': ' ?
></th
>
204 <?php
foreach($lics as $lic): ?
>
205 <span
class="related">
206 <?php
if ($lic !== end($lics)): ?
>
207 <?
= htmlspecialchars($lic) ?
>,
209 <?
= htmlspecialchars($lic) ?
>
216 <?php
if (count($grps) > 0): ?
>
218 <th
><?
= __('Groups') . ': ' ?
></th
>
220 <?php
foreach($grps as $grp): ?
>
221 <span
class="related">
222 <?php
if ($grp !== end($grps)): ?
>
223 <?
= htmlspecialchars($grp) ?
>,
225 <?
= htmlspecialchars($grp) ?
>
232 <?php
if (count($rels_c) > 0): ?
>
234 <th
><?
= __('Conflicts') . ': ' ?
></th
>
235 <td
class="wrap relatedto">
236 <?php
foreach($rels_c as $rarr): ?
>
237 <span
class="related">
238 <?php
if ($rarr !== end($rels_c)): ?
>
239 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
241 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
248 <?php
if (count($rels_p) > 0): ?
>
250 <th
><?
= __('Provides') . ': ' ?
></th
>
251 <td
class="wrap relatedto">
252 <?php
foreach($rels_p as $rarr): ?
>
253 <span
class="related">
254 <?php
if ($rarr !== end($rels_p)): ?
>
255 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
257 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
264 <?php
if (count($rels_r) > 0): ?
>
266 <th
><?
= __('Replaces') . ': ' ?
></th
>
267 <td
class="wrap relatedto">
268 <?php
foreach($rels_r as $rarr): ?
>
269 <span
class="related">
270 <?php
if ($rarr !== end($rels_r)): ?
>
271 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
273 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
281 <th
><?
= __('Submitter') .': ' ?
></th
>
282 <?php
if ($row["SubmitterUID"] && $SID): ?
>
283 <td
><a href
="<?= get_uri('/account/') . html_format_username($submitter, ENT_QUOTES) ?>" title
="<?= __('View account information for %s', html_format_username($submitter)) ?>"><?
= html_format_username($submitter) ?
></a
></td
>
284 <?php
elseif ($row["SubmitterUID"] && !$SID): ?
>
285 <td
><?
= html_format_username($submitter) ?
></td
>
287 <td
><?
= __('None') ?
></td
>
291 <th
><?
= __('Maintainer') .': ' ?
></th
>
292 <?php
if ($row["MaintainerUID"] && $SID): ?
>
293 <td
><a href
="<?= get_uri('/account/') . html_format_username($maintainer) ?>" title
="<?= __('View account information for %s', html_format_username($maintainer)) ?>"><?
= html_format_username($maintainer) ?
></a
></td
>
294 <?php
elseif ($row["MaintainerUID"] && !$SID): ?
>
295 <td
><?
= html_format_username($maintainer) ?
></td
>
297 <td
><?
= __('None') ?
></td
>
301 <th
><?
= __('Last Packager') .': ' ?
></th
>
302 <?php
if ($row["PackagerUID"] && $SID): ?
>
303 <td
><a href
="<?= get_uri('/account/') . html_format_username($packager) ?>" title
="<?= __('View account information for %s', html_format_username($packager)) ?>"><?
= html_format_username($packager) ?
></a
></td
>
304 <?php
elseif ($row["PackagerUID"] && !$SID): ?
>
305 <td
><?
= html_format_username($packager) ?
></td
>
307 <td
><?
= __('None') ?
></td
>
311 <th
><?
= __('Votes') . ': ' ?
></th
>
312 <?php
if (has_credential(CRED_PKGBASE_LIST_VOTERS
)): ?
>
313 <td
><a href
="<?= get_pkgbase_uri($row['Name']); ?>voters/"><?
= $votes ?
></a
></td
>
315 <td
><?
= $votes ?
></td
>
319 <th
><?
= __('First Submitted') . ': ' ?
></th
>
320 <td
><?
= $submitted_time ?
></td
>
323 <th
><?
= __('Last Updated') . ': ' ?
></th
>
324 <td
><?
= $updated_time ?
></td
>
329 <div id
="pkgdeps" class="listing">
330 <h3
><?
= __('Dependencies') . " (" . count($deps) . ")"?
></h3
>
331 <?php
if (count($deps) > 0): ?
>
332 <ul id
="pkgdepslist">
333 <?php
while (list($k, $darr) = each($deps)): ?
>
334 <li
><?
= pkg_depend_link($darr[0], $darr[1], $darr[2], $darr[3], $darr[4]); ?
></li
>
339 <div id
="pkgreqs" class="listing">
340 <h3
><?
= __('Required by') . " (" . count($requiredby) . ")"?
></h3
>
341 <?php
if (count($requiredby) > 0): ?
>
342 <ul id
="pkgreqslist">
344 # darr: (PackageName, PackageID)
345 while (list($k, $darr) = each($requiredby)):
347 <li
><a href
="<?= htmlspecialchars(get_pkg_uri($darr[0]), ENT_QUOTES); ?>" title
="<?= __('View packages details for').' ' . htmlspecialchars($darr[0]) ?>"><?
= htmlspecialchars($darr[0]) ?
></a
></li
>
352 <div id
="pkgfiles" class="listing">
353 <h3
><?
= __('Sources') ?
></h3
>
355 <?php
if (count($sources) > 0): ?
>
357 <ul id
="pkgsrcslist">
358 <?php
while (list($k, $src) = each($sources)): ?
>
359 <li
><?
= pkg_source_link($src[0], $src[1]) ?
></li
>