3 $pkgbuild_uri = sprintf(config_get('options', 'pkgbuild_uri'), urlencode($row['BaseName']));
4 $log_uri = sprintf(config_get('options', 'log_uri'), urlencode($row['BaseName']));
5 $snapshot_uri = sprintf(config_get('options', 'snapshot_uri'), urlencode($row['BaseName']));
6 $git_clone_uri_anon = sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($row['BaseName']));
7 $git_clone_uri_priv = sprintf(config_get('options', 'git_clone_uri_priv'), htmlspecialchars($row['BaseName']));
9 $uid = uid_from_sid($SID);
11 $pkgid = intval($row['ID']);
12 $base_id = intval($row['BaseID']);
14 $catarr = pkgbase_categories();
16 $submitter = username_from_id($row["SubmitterUID"]);
17 $maintainer = username_from_id($row["MaintainerUID"]);
18 $packager = username_from_id($row["PackagerUID"]);
20 $votes = $row['NumVotes'];
22 # In case of wanting to put a custom message
24 $license = empty($row['License']) ?
$msg : $row['License'];
26 # Print the timestamps for last updates
27 $updated_time = ($row["ModifiedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["ModifiedTS"]));
28 $submitted_time = ($row["SubmittedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"]));
29 $out_of_date_time = ($row["OutOfDateTS"] == 0) ?
$msg : gmdate("Y-m-d", intval($row["OutOfDateTS"]));
31 $lics = pkg_licenses($row["ID"]);
32 $grps = pkg_groups($row["ID"]);
34 $deps = pkg_dependencies($row["ID"]);
35 $requiredby = pkg_required($row["Name"]);
37 usort($deps, function($x, $y) {
39 if ($x[1] == "depends") {
41 } elseif ($y[1] == "depends") {
44 return strcmp($x[1], $y[1]);
45 } elseif ($x[3] != $y[3]) {
46 return strcmp($x[3], $y[3]);
48 return strcmp($x[0], $y[0]);
52 $rels = pkg_relations($row["ID"]);
54 usort($rels, function($x, $y) {
56 return strcmp($x[3], $y[3]);
58 return strcmp($x[0], $y[0]);
62 $rels_c = $rels_p = $rels_r = array();
63 foreach ($rels as $rel) {
77 # $sources[0] = 'src';
78 $sources = pkg_sources($row["ID"]);
80 <div id
="pkgdetails" class="box">
81 <h2
><?
= __('Package Details') . ': ' . htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?
></h2
>
82 <div id
="detailslinks" class="listing">
84 <h4
><?
= __('Package Actions') ?
></h4
>
87 <a href
="<?= $pkgbuild_uri ?>"><?
= __('View PKGBUILD') ?
></a
> /
88 <a href
="<?= $log_uri ?>"><?
= __('View Changes') ?
></a
>
90 <li
><a href
="<?= $snapshot_uri ?>"><?
= __('Download snapshot') ?
></a
>
91 <li
><a href
="https://wiki.archlinux.org/index.php/Special:Search?search=<?= urlencode($row['Name']) ?>"><?
= __('Search wiki') ?
></a
></li
>
92 <li
><span
class="flagged"><?php
if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?
></span
></li
>
94 <?php
if ($row["OutOfDateTS"] === NULL): ?
>
96 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'flag/'; ?>" method
="post">
97 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
98 <input type
="submit" class="button text-button" name
="do_Flag" value
="<?= __('Flag package out-of-date') ?>" />
101 <?php
elseif (($row["OutOfDateTS"] !== NULL) && has_credential(CRED_PKGBASE_UNFLAG
, array($row["MaintainerUID"]))): ?
>
103 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unflag/'; ?>" method
="post">
104 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
105 <input type
="submit" class="button text-button" name
="do_UnFlag" value
="<?= __('Unflag package') ?>" />
109 <?php
if (pkgbase_user_voted($uid, $base_id)): ?
>
111 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unvote/'; ?>" method
="post">
112 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
113 <input type
="submit" class="button text-button" name
="do_UnVote" value
="<?= __('Remove vote') ?>" />
118 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'vote/'; ?>" method
="post">
119 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
120 <input type
="submit" class="button text-button" name
="do_Vote" value
="<?= __('Vote for this package') ?>" />
124 <?php
if (pkgbase_user_notify($uid, $base_id)): ?
>
126 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unnotify/'; ?>" method
="post">
127 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
128 <input type
="submit" class="button text-button" name
="do_UnNotify" value
="<?= __('Disable notifications') ?>" />
133 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'notify/'; ?>" method
="post">
134 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
135 <input type
="submit" class="button text-button" name
="do_Notify" value
="<?= __('Notify of new comments') ?>" />
139 <?php
if (has_credential(CRED_PKGBASE_EDIT_COMAINTAINERS
, array($row["MaintainerUID"]))): ?
>
140 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'comaintainers/'; ?>"><?
= __('Manage Co-Maintainers'); ?
></a
></li
>
142 <li
><span
class="flagged"><?php
if ($row["RequestCount"] > 0) { echo _n('%d pending request', '%d pending requests', $row["RequestCount"]); } ?
></span
></li
>
143 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'request/'; ?>"><?
= __('File Request'); ?
></a
></li
>
144 <?php
if (has_credential(CRED_PKGBASE_DELETE
)): ?
>
145 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'delete/'; ?>"><?
= __('Delete Package'); ?
></a
></li
>
146 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'merge/'; ?>"><?
= __('Merge Package'); ?
></a
></li
>
150 <?php
if ($uid && $row["MaintainerUID"] === NULL): ?
>
152 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'adopt/'; ?>" method
="post">
153 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
154 <input type
="submit" class="button text-button" name
="do_Adopt" value
="<?= __('Adopt Package') ?>" />
157 <?php
elseif (has_credential(CRED_PKGBASE_DISOWN
, array($row["MaintainerUID"]))): ?
>
159 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'disown/'; ?>" method
="post">
160 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
161 <input type
="submit" class="button text-button" name
="do_Disown" value
="<?= __('Disown Package') ?>" />
171 <th
><?
= __('Git Clone URL') . ': ' ?
></th
>
173 <a href
="<?= $git_clone_uri_anon ?>"><?
= $git_clone_uri_anon ?
></a
>
174 <?php
if ($uid == $row["MaintainerUID"]): ?
>
175 <br
/> <a href
="<?= $git_clone_uri_priv ?>"><?
= $git_clone_uri_priv ?
></a
>
180 <th
><?
= __('Package Base') . ': ' ?
></th
>
181 <td
class="wrap"><a href
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>"><?
= htmlspecialchars($row['BaseName']); ?
></a
></td
>
184 <th
><?
= __('Description') . ': ' ?
></th
>
185 <td
class="wrap"><?
= htmlspecialchars($row['Description']); ?
></td
>
188 <th
><?
= __('Upstream URL') . ': ' ?
></th
>
189 <td
><a href
="<?= htmlspecialchars($row['URL'], ENT_QUOTES) ?>" title
="<?= __('Visit the website for') . ' ' . htmlspecialchars( $row['Name'])?>"><?
= htmlspecialchars($row['URL'], ENT_QUOTES
) ?
></a
></td
>
192 <th
><?
= __('Category') . ': ' ?
></th
>
194 if (has_credential(CRED_PKGBASE_CHANGE_CATEGORY
, array($row["MaintainerUID"]))):
197 <form method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
199 <input type
="hidden" name
="action" value
="do_ChangeCategory" />
201 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
203 <select name
="category_id">
205 foreach ($catarr as $cid => $catname):
207 <option value
="<?= $cid ?>"<?php
if ($cid == $row["CategoryID"]) { ?
> selected
="selected" <?php
} ?
>><?
= $catname ?
></option
>
210 <input type
="submit" value
="<?= __('Change category') ?>"/>
215 <a href
="<?= get_uri('/packages/'); ?>?C=<?= $row['CategoryID'] ?>"><?
= $row['Category'] ?
></a
>
219 <?php
if (count($lics) > 0): ?
>
221 <th
><?
= __('Licenses') . ': ' ?
></th
>
223 <?php
foreach($lics as $lic): ?
>
224 <span
class="related">
225 <?php
if ($lic !== end($lics)): ?
>
226 <?
= htmlspecialchars($lic) ?
>,
228 <?
= htmlspecialchars($lic) ?
>
235 <?php
if (count($grps) > 0): ?
>
237 <th
><?
= __('Groups') . ': ' ?
></th
>
239 <?php
foreach($grps as $grp): ?
>
240 <span
class="related">
241 <?php
if ($grp !== end($grps)): ?
>
242 <?
= htmlspecialchars($grp) ?
>,
244 <?
= htmlspecialchars($grp) ?
>
251 <?php
if (count($rels_c) > 0): ?
>
253 <th
><?
= __('Conflicts') . ': ' ?
></th
>
254 <td
class="wrap relatedto">
255 <?php
foreach($rels_c as $rarr): ?
>
256 <span
class="related">
257 <?php
if ($rarr !== end($rels_c)): ?
>
258 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
260 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
267 <?php
if (count($rels_p) > 0): ?
>
269 <th
><?
= __('Provides') . ': ' ?
></th
>
270 <td
class="wrap relatedto">
271 <?php
foreach($rels_p as $rarr): ?
>
272 <span
class="related">
273 <?php
if ($rarr !== end($rels_p)): ?
>
274 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
276 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
283 <?php
if (count($rels_r) > 0): ?
>
285 <th
><?
= __('Replaces') . ': ' ?
></th
>
286 <td
class="wrap relatedto">
287 <?php
foreach($rels_r as $rarr): ?
>
288 <span
class="related">
289 <?php
if ($rarr !== end($rels_r)): ?
>
290 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
292 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
300 <th
><?
= __('Submitter') .': ' ?
></th
>
301 <?php
if ($row["SubmitterUID"] && $SID): ?
>
302 <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
>
303 <?php
elseif ($row["SubmitterUID"] && !$SID): ?
>
304 <td
><?
= html_format_username($submitter) ?
></td
>
306 <td
><?
= __('None') ?
></td
>
310 <th
><?
= __('Maintainer') .': ' ?
></th
>
311 <?php
if ($row["MaintainerUID"] && $SID): ?
>
312 <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
>
313 <?php
elseif ($row["MaintainerUID"] && !$SID): ?
>
314 <td
><?
= html_format_username($maintainer) ?
></td
>
316 <td
><?
= __('None') ?
></td
>
320 <th
><?
= __('Last Packager') .': ' ?
></th
>
321 <?php
if ($row["PackagerUID"] && $SID): ?
>
322 <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
>
323 <?php
elseif ($row["PackagerUID"] && !$SID): ?
>
324 <td
><?
= html_format_username($packager) ?
></td
>
326 <td
><?
= __('None') ?
></td
>
330 <th
><?
= __('Votes') . ': ' ?
></th
>
331 <?php
if (has_credential(CRED_PKGBASE_LIST_VOTERS
)): ?
>
332 <td
><a href
="<?= get_pkgbase_uri($row['BaseName']); ?>voters/"><?
= $votes ?
></a
></td
>
334 <td
><?
= $votes ?
></td
>
338 <th
><?
= __('First Submitted') . ': ' ?
></th
>
339 <td
><?
= $submitted_time ?
></td
>
342 <th
><?
= __('Last Updated') . ': ' ?
></th
>
343 <td
><?
= $updated_time ?
></td
>
348 <div id
="pkgdeps" class="listing">
349 <h3
><?
= __('Dependencies') . " (" . count($deps) . ")"?
></h3
>
350 <?php
if (count($deps) > 0): ?
>
351 <ul id
="pkgdepslist">
352 <?php
while (list($k, $darr) = each($deps)): ?
>
353 <li
><?
= pkg_depend_link($darr[0], $darr[1], $darr[2], $darr[3], $darr[4]); ?
></li
>
358 <div id
="pkgreqs" class="listing">
359 <h3
><?
= __('Required by') . " (" . count($requiredby) . ")"?
></h3
>
360 <?php
if (count($requiredby) > 0): ?
>
361 <ul id
="pkgreqslist">
363 # darr: (PackageName, PackageID)
364 while (list($k, $darr) = each($requiredby)):
366 <li
><a href
="<?= htmlspecialchars(get_pkg_uri($darr[0]), ENT_QUOTES); ?>" title
="<?= __('View packages details for').' ' . htmlspecialchars($darr[0]) ?>"><?
= htmlspecialchars($darr[0]) ?
></a
></li
>
371 <div id
="pkgfiles" class="listing">
372 <h3
><?
= __('Sources') ?
></h3
>
374 <?php
if (count($sources) > 0): ?
>
376 <ul id
="pkgsrcslist">
377 <?php
while (list($k, $src) = each($sources)): ?
>
378 <li
><?
= pkg_source_link($src[0], $src[1]) ?
></li
>