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 $keywords = pkgbase_get_keywords($base_id);
16 $submitter = username_from_id($row["SubmitterUID"]);
17 $maintainer = username_from_id($row["MaintainerUID"]);
18 $comaintainers = pkgbase_get_comaintainers($base_id);
19 $packager = username_from_id($row["PackagerUID"]);
21 $votes = $row['NumVotes'];
23 # In case of wanting to put a custom message
25 $license = empty($row['License']) ?
$msg : $row['License'];
27 # Print the timestamps for last updates
28 $updated_time = ($row["ModifiedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["ModifiedTS"]));
29 $submitted_time = ($row["SubmittedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"]));
30 $out_of_date_time = ($row["OutOfDateTS"] == 0) ?
$msg : gmdate("Y-m-d", intval($row["OutOfDateTS"]));
32 $lics = pkg_licenses($row["ID"]);
33 $grps = pkg_groups($row["ID"]);
35 $deps = pkg_dependencies($row["ID"]);
36 $requiredby = pkg_required($row["Name"]);
38 usort($deps, function($x, $y) {
40 if ($x[1] == "depends") {
42 } elseif ($y[1] == "depends") {
45 return strcmp($x[1], $y[1]);
46 } elseif ($x[3] != $y[3]) {
47 return strcmp($x[3], $y[3]);
49 return strcmp($x[0], $y[0]);
53 $rels = pkg_relations($row["ID"]);
55 usort($rels, function($x, $y) {
57 return strcmp($x[3], $y[3]);
59 return strcmp($x[0], $y[0]);
63 $rels_c = $rels_p = $rels_r = array();
64 foreach ($rels as $rel) {
78 # $sources[0] = 'src';
79 $sources = pkg_sources($row["ID"]);
81 <div id
="pkgdetails" class="box">
82 <h2
><?
= __('Package Details') . ': ' . htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?
></h2
>
83 <div id
="detailslinks" class="listing">
85 <h4
><?
= __('Package Actions') ?
></h4
>
88 <a href
="<?= $pkgbuild_uri ?>"><?
= __('View PKGBUILD') ?
></a
> /
89 <a href
="<?= $log_uri ?>"><?
= __('View Changes') ?
></a
>
91 <li
><a href
="<?= $snapshot_uri ?>"><?
= __('Download snapshot') ?
></a
>
92 <li
><a href
="https://wiki.archlinux.org/index.php/Special:Search?search=<?= urlencode($row['Name']) ?>"><?
= __('Search wiki') ?
></a
></li
>
93 <li
><span
class="flagged"><?php
if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?
></span
></li
>
95 <?php
if ($row["OutOfDateTS"] === NULL): ?
>
97 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'flag/'; ?>" method
="post">
98 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
99 <input type
="submit" class="button text-button" name
="do_Flag" value
="<?= __('Flag package out-of-date') ?>" />
102 <?php
elseif (($row["OutOfDateTS"] !== NULL) && has_credential(CRED_PKGBASE_UNFLAG
, array($row["MaintainerUID"]))): ?
>
104 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unflag/'; ?>" method
="post">
105 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
106 <input type
="submit" class="button text-button" name
="do_UnFlag" value
="<?= __('Unflag package') ?>" />
110 <?php
if (pkgbase_user_voted($uid, $base_id)): ?
>
112 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unvote/'; ?>" method
="post">
113 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
114 <input type
="submit" class="button text-button" name
="do_UnVote" value
="<?= __('Remove vote') ?>" />
119 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'vote/'; ?>" method
="post">
120 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
121 <input type
="submit" class="button text-button" name
="do_Vote" value
="<?= __('Vote for this package') ?>" />
125 <?php
if (pkgbase_user_notify($uid, $base_id)): ?
>
127 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unnotify/'; ?>" method
="post">
128 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
129 <input type
="submit" class="button text-button" name
="do_UnNotify" value
="<?= __('Disable notifications') ?>" />
134 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'notify/'; ?>" method
="post">
135 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
136 <input type
="submit" class="button text-button" name
="do_Notify" value
="<?= __('Notify of new comments') ?>" />
140 <?php
if (has_credential(CRED_PKGBASE_EDIT_COMAINTAINERS
, array($row["MaintainerUID"]))): ?
>
141 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'comaintainers/'; ?>"><?
= __('Manage Co-Maintainers'); ?
></a
></li
>
143 <li
><span
class="flagged"><?php
if ($row["RequestCount"] > 0) { echo _n('%d pending request', '%d pending requests', $row["RequestCount"]); } ?
></span
></li
>
144 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'request/'; ?>"><?
= __('File Request'); ?
></a
></li
>
145 <?php
if (has_credential(CRED_PKGBASE_DELETE
)): ?
>
146 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'delete/'; ?>"><?
= __('Delete Package'); ?
></a
></li
>
147 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'merge/'; ?>"><?
= __('Merge Package'); ?
></a
></li
>
151 <?php
if ($uid && $row["MaintainerUID"] === NULL): ?
>
153 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'adopt/'; ?>" method
="post">
154 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
155 <input type
="submit" class="button text-button" name
="do_Adopt" value
="<?= __('Adopt Package') ?>" />
158 <?php
elseif (has_credential(CRED_PKGBASE_DISOWN
, array($row["MaintainerUID"]))): ?
>
160 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'disown/'; ?>" method
="post">
161 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
162 <input type
="submit" class="button text-button" name
="do_Disown" value
="<?= __('Disown Package') ?>" />
172 <th
><?
= __('Git Clone URL') . ': ' ?
></th
>
174 <a href
="<?= $git_clone_uri_anon ?>"><?
= $git_clone_uri_anon ?
></a
> (<?
= __('read-only') ?
>)
175 <?php
if ($uid == $row["MaintainerUID"]): ?
>
176 <br
/> <a href
="<?= $git_clone_uri_priv ?>"><?
= $git_clone_uri_priv ?
></a
>
181 <th
><?
= __('Package Base') . ': ' ?
></th
>
182 <td
class="wrap"><a href
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>"><?
= htmlspecialchars($row['BaseName']); ?
></a
></td
>
185 <th
><?
= __('Description') . ': ' ?
></th
>
186 <td
class="wrap"><?
= htmlspecialchars($row['Description']); ?
></td
>
189 <th
><?
= __('Upstream URL') . ': ' ?
></th
>
190 <td
><a href
="<?= htmlspecialchars($row['URL'], ENT_QUOTES) ?>" title
="<?= __('Visit the website for') . ' ' . htmlspecialchars( $row['Name'])?>"><?
= htmlspecialchars($row['URL'], ENT_QUOTES
) ?
></a
></td
>
193 if (has_credential(CRED_PKGBASE_SET_KEYWORDS
, array($row["MaintainerUID"]))):
196 <th
><?
= __('Keywords') . ': ' ?
></th
>
198 <form method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
200 <input type
="hidden" name
="action" value
="do_SetKeywords" />
202 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
204 <input type
="text" name
="keywords" value
="<?= htmlspecialchars(implode(" ", $keywords), ENT_QUOTES) ?>"/>
205 <input type
="submit" value
="<?= __('Update') ?>"/>
211 <?php
if (count($lics) > 0): ?
>
213 <th
><?
= __('Licenses') . ': ' ?
></th
>
215 <?php
foreach($lics as $lic): ?
>
216 <span
class="related">
217 <?php
if ($lic !== end($lics)): ?
>
218 <?
= htmlspecialchars($lic) ?
>,
220 <?
= htmlspecialchars($lic) ?
>
227 <?php
if (count($grps) > 0): ?
>
229 <th
><?
= __('Groups') . ': ' ?
></th
>
231 <?php
foreach($grps as $grp): ?
>
232 <span
class="related">
233 <?php
if ($grp !== end($grps)): ?
>
234 <?
= htmlspecialchars($grp) ?
>,
236 <?
= htmlspecialchars($grp) ?
>
243 <?php
if (count($rels_c) > 0): ?
>
245 <th
><?
= __('Conflicts') . ': ' ?
></th
>
246 <td
class="wrap relatedto">
247 <?php
foreach($rels_c as $rarr): ?
>
248 <span
class="related">
249 <?php
if ($rarr !== end($rels_c)): ?
>
250 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
252 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
259 <?php
if (count($rels_p) > 0): ?
>
261 <th
><?
= __('Provides') . ': ' ?
></th
>
262 <td
class="wrap relatedto">
263 <?php
foreach($rels_p as $rarr): ?
>
264 <span
class="related">
265 <?php
if ($rarr !== end($rels_p)): ?
>
266 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
268 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
275 <?php
if (count($rels_r) > 0): ?
>
277 <th
><?
= __('Replaces') . ': ' ?
></th
>
278 <td
class="wrap relatedto">
279 <?php
foreach($rels_r as $rarr): ?
>
280 <span
class="related">
281 <?php
if ($rarr !== end($rels_r)): ?
>
282 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
284 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
292 <th
><?
= __('Submitter') .': ' ?
></th
>
293 <td
><?
= html_format_username($submitter) ?
></td
>
296 <th
><?
= __('Maintainer') .': ' ?
></th
>
297 <td
><?
= html_format_maintainers($maintainer, $comaintainers) ?
></td
>
300 <th
><?
= __('Last Packager') .': ' ?
></th
>
301 <td
><?
= html_format_username($packager) ?
></td
>
304 <th
><?
= __('Votes') . ': ' ?
></th
>
305 <?php
if (has_credential(CRED_PKGBASE_LIST_VOTERS
)): ?
>
306 <td
><a href
="<?= get_pkgbase_uri($row['BaseName']); ?>voters/"><?
= $votes ?
></a
></td
>
308 <td
><?
= $votes ?
></td
>
312 <th
><?
= __('First Submitted') . ': ' ?
></th
>
313 <td
><?
= $submitted_time ?
></td
>
316 <th
><?
= __('Last Updated') . ': ' ?
></th
>
317 <td
><?
= $updated_time ?
></td
>
322 <div id
="pkgdeps" class="listing">
323 <h3
><?
= __('Dependencies') . " (" . count($deps) . ")"?
></h3
>
324 <?php
if (count($deps) > 0): ?
>
325 <ul id
="pkgdepslist">
326 <?php
while (list($k, $darr) = each($deps)): ?
>
327 <li
><?
= pkg_depend_link($darr[0], $darr[1], $darr[2], $darr[3], $darr[4]); ?
></li
>
332 <div id
="pkgreqs" class="listing">
333 <h3
><?
= __('Required by') . " (" . count($requiredby) . ")"?
></h3
>
334 <?php
if (count($requiredby) > 0): ?
>
335 <ul id
="pkgreqslist">
337 # darr: (PackageName, PackageID)
338 while (list($k, $darr) = each($requiredby)):
340 <li
><a href
="<?= htmlspecialchars(get_pkg_uri($darr[0]), ENT_QUOTES); ?>" title
="<?= __('View packages details for').' ' . htmlspecialchars($darr[0]) ?>"><?
= htmlspecialchars($darr[0]) ?
></a
></li
>
345 <div id
="pkgfiles" class="listing">
346 <h3
><?
= __('Sources') ?
></h3
>
348 <?php
if (count($sources) > 0): ?
>
350 <ul id
="pkgsrcslist">
351 <?php
while (list($k, $src) = each($sources)): ?
>
352 <li
><?
= pkg_source_link($src[0], $src[1]) ?
></li
>