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 if ($row["MaintainerUID"] !== NULL) {
22 $maintainers = array_merge(array($row["MaintainerUID"]), pkgbase_get_comaintainer_uids(array($base_id)));
27 $votes = $row['NumVotes'];
29 # In case of wanting to put a custom message
31 $license = empty($row['License']) ?
$msg : $row['License'];
33 # Print the timestamps for last updates
34 $updated_time = ($row["ModifiedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["ModifiedTS"]));
35 $submitted_time = ($row["SubmittedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"]));
36 $out_of_date_time = ($row["OutOfDateTS"] == 0) ?
$msg : gmdate("Y-m-d", intval($row["OutOfDateTS"]));
38 $lics = pkg_licenses($row["ID"]);
39 $grps = pkg_groups($row["ID"]);
41 $deps = pkg_dependencies($row["ID"]);
42 $requiredby = pkg_required($row["Name"]);
44 usort($deps, function($x, $y) {
46 if ($x[1] == "depends") {
48 } elseif ($y[1] == "depends") {
51 return strcmp($x[1], $y[1]);
52 } elseif ($x[3] != $y[3]) {
53 return strcmp($x[3], $y[3]);
55 return strcmp($x[0], $y[0]);
59 $rels = pkg_relations($row["ID"]);
61 usort($rels, function($x, $y) {
63 return strcmp($x[3], $y[3]);
65 return strcmp($x[0], $y[0]);
69 $rels_c = $rels_p = $rels_r = array();
70 foreach ($rels as $rel) {
84 # $sources[0] = 'src';
85 $sources = pkg_sources($row["ID"]);
87 <div id
="pkgdetails" class="box">
88 <h2
><?
= __('Package Details') . ': ' . htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?
></h2
>
89 <div id
="detailslinks" class="listing">
91 <h4
><?
= __('Package Actions') ?
></h4
>
94 <a href
="<?= $pkgbuild_uri ?>"><?
= __('View PKGBUILD') ?
></a
> /
95 <a href
="<?= $log_uri ?>"><?
= __('View Changes') ?
></a
>
97 <li
><a href
="<?= $snapshot_uri ?>"><?
= __('Download snapshot') ?
></a
>
98 <li
><a href
="https://wiki.archlinux.org/index.php/Special:Search?search=<?= urlencode($row['Name']) ?>"><?
= __('Search wiki') ?
></a
></li
>
99 <li
><span
class="flagged"><?php
if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?
></span
></li
>
101 <?php
if ($row["OutOfDateTS"] === NULL): ?
>
103 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'flag/'; ?>" method
="post">
104 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
105 <input type
="submit" class="button text-button" name
="do_Flag" value
="<?= __('Flag package out-of-date') ?>" />
108 <?php
elseif (($row["OutOfDateTS"] !== NULL) && has_credential(CRED_PKGBASE_UNFLAG
, $maintainers)): ?
>
110 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unflag/'; ?>" method
="post">
111 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
112 <input type
="submit" class="button text-button" name
="do_UnFlag" value
="<?= __('Unflag package') ?>" />
116 <?php
if (pkgbase_user_voted($uid, $base_id)): ?
>
118 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unvote/'; ?>" method
="post">
119 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
120 <input type
="submit" class="button text-button" name
="do_UnVote" value
="<?= __('Remove vote') ?>" />
125 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'vote/'; ?>" method
="post">
126 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
127 <input type
="submit" class="button text-button" name
="do_Vote" value
="<?= __('Vote for this package') ?>" />
131 <?php
if (pkgbase_user_notify($uid, $base_id)): ?
>
133 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unnotify/'; ?>" method
="post">
134 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
135 <input type
="submit" class="button text-button" name
="do_UnNotify" value
="<?= __('Disable notifications') ?>" />
140 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'notify/'; ?>" method
="post">
141 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
142 <input type
="submit" class="button text-button" name
="do_Notify" value
="<?= __('Notify of new comments') ?>" />
146 <?php
if (has_credential(CRED_PKGBASE_EDIT_COMAINTAINERS
, array($row["MaintainerUID"]))): ?
>
147 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'comaintainers/'; ?>"><?
= __('Manage Co-Maintainers'); ?
></a
></li
>
149 <li
><span
class="flagged"><?php
if ($row["RequestCount"] > 0) { echo _n('%d pending request', '%d pending requests', $row["RequestCount"]); } ?
></span
></li
>
150 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'request/'; ?>"><?
= __('File Request'); ?
></a
></li
>
151 <?php
if (has_credential(CRED_PKGBASE_DELETE
)): ?
>
152 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'delete/'; ?>"><?
= __('Delete Package'); ?
></a
></li
>
153 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'merge/'; ?>"><?
= __('Merge Package'); ?
></a
></li
>
157 <?php
if ($uid && $row["MaintainerUID"] === NULL): ?
>
159 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'adopt/'; ?>" method
="post">
160 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
161 <input type
="submit" class="button text-button" name
="do_Adopt" value
="<?= __('Adopt Package') ?>" />
164 <?php
elseif (has_credential(CRED_PKGBASE_DISOWN
, array($row["MaintainerUID"]))): ?
>
166 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'disown/'; ?>" method
="post">
167 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
168 <input type
="submit" class="button text-button" name
="do_Disown" value
="<?= __('Disown Package') ?>" />
178 <th
><?
= __('Git Clone URL') . ': ' ?
></th
>
180 <a href
="<?= $git_clone_uri_anon ?>"><?
= $git_clone_uri_anon ?
></a
> (<?
= __('read-only') ?
>)
181 <?php
if ($uid == $row["MaintainerUID"]): ?
>
182 <br
/> <a href
="<?= $git_clone_uri_priv ?>"><?
= $git_clone_uri_priv ?
></a
>
187 <th
><?
= __('Package Base') . ': ' ?
></th
>
188 <td
class="wrap"><a href
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>"><?
= htmlspecialchars($row['BaseName']); ?
></a
></td
>
191 <th
><?
= __('Description') . ': ' ?
></th
>
192 <td
class="wrap"><?
= htmlspecialchars($row['Description']); ?
></td
>
195 <th
><?
= __('Upstream URL') . ': ' ?
></th
>
196 <td
><a href
="<?= htmlspecialchars($row['URL'], ENT_QUOTES) ?>" title
="<?= __('Visit the website for') . ' ' . htmlspecialchars( $row['Name'])?>"><?
= htmlspecialchars($row['URL'], ENT_QUOTES
) ?
></a
></td
>
199 if (has_credential(CRED_PKGBASE_SET_KEYWORDS
, $maintainers) ||
count($keywords) > 0):
202 <th
><?
= __('Keywords') . ': ' ?
></th
>
205 if (has_credential(CRED_PKGBASE_SET_KEYWORDS
, $maintainers)):
207 <form method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
209 <input type
="hidden" name
="action" value
="do_SetKeywords" />
211 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
213 <input type
="text" name
="keywords" value
="<?= htmlspecialchars(implode(" ", $keywords), ENT_QUOTES) ?>"/>
214 <input type
="submit" value
="<?= __('Update') ?>"/>
219 foreach ($keywords as $kw) {
220 echo '<a class="keyword" href="';
221 echo get_uri('/packages/') . '?K=' . urlencode($kw) . '&SB=p';
222 echo '">' . htmlspecialchars($kw) . "</a>\n";
229 <?php
if (count($lics) > 0): ?
>
231 <th
><?
= __('Licenses') . ': ' ?
></th
>
233 <?php
foreach($lics as $lic): ?
>
234 <span
class="related">
235 <?php
if ($lic !== end($lics)): ?
>
236 <?
= htmlspecialchars($lic) ?
>,
238 <?
= htmlspecialchars($lic) ?
>
245 <?php
if (count($grps) > 0): ?
>
247 <th
><?
= __('Groups') . ': ' ?
></th
>
249 <?php
foreach($grps as $grp): ?
>
250 <span
class="related">
251 <?php
if ($grp !== end($grps)): ?
>
252 <?
= htmlspecialchars($grp) ?
>,
254 <?
= htmlspecialchars($grp) ?
>
261 <?php
if (count($rels_c) > 0): ?
>
263 <th
><?
= __('Conflicts') . ': ' ?
></th
>
264 <td
class="wrap relatedto">
265 <?php
foreach($rels_c as $rarr): ?
>
266 <span
class="related">
267 <?php
if ($rarr !== end($rels_c)): ?
>
268 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
270 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
277 <?php
if (count($rels_p) > 0): ?
>
279 <th
><?
= __('Provides') . ': ' ?
></th
>
280 <td
class="wrap relatedto">
281 <?php
foreach($rels_p as $rarr): ?
>
282 <span
class="related">
283 <?php
if ($rarr !== end($rels_p)): ?
>
284 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
286 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
293 <?php
if (count($rels_r) > 0): ?
>
295 <th
><?
= __('Replaces') . ': ' ?
></th
>
296 <td
class="wrap relatedto">
297 <?php
foreach($rels_r as $rarr): ?
>
298 <span
class="related">
299 <?php
if ($rarr !== end($rels_r)): ?
>
300 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
302 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
310 <th
><?
= __('Submitter') .': ' ?
></th
>
311 <td
><?
= html_format_username($submitter) ?
></td
>
314 <th
><?
= __('Maintainer') .': ' ?
></th
>
315 <td
><?
= html_format_maintainers($maintainer, $comaintainers) ?
></td
>
318 <th
><?
= __('Last Packager') .': ' ?
></th
>
319 <td
><?
= html_format_username($packager) ?
></td
>
322 <th
><?
= __('Votes') . ': ' ?
></th
>
323 <?php
if (has_credential(CRED_PKGBASE_LIST_VOTERS
)): ?
>
324 <td
><a href
="<?= get_pkgbase_uri($row['BaseName']); ?>voters/"><?
= $votes ?
></a
></td
>
326 <td
><?
= $votes ?
></td
>
330 <th
><?
= __('First Submitted') . ': ' ?
></th
>
331 <td
><?
= $submitted_time ?
></td
>
334 <th
><?
= __('Last Updated') . ': ' ?
></th
>
335 <td
><?
= $updated_time ?
></td
>
340 <div id
="pkgdeps" class="listing">
341 <h3
><?
= __('Dependencies') . " (" . count($deps) . ")"?
></h3
>
342 <?php
if (count($deps) > 0): ?
>
343 <ul id
="pkgdepslist">
344 <?php
while (list($k, $darr) = each($deps)): ?
>
345 <li
><?
= pkg_depend_link($darr[0], $darr[1], $darr[2], $darr[3], $darr[4]); ?
></li
>
350 <div id
="pkgreqs" class="listing">
351 <h3
><?
= __('Required by') . " (" . count($requiredby) . ")"?
></h3
>
352 <?php
if (count($requiredby) > 0): ?
>
353 <ul id
="pkgreqslist">
355 # darr: (PackageName, PackageID)
356 while (list($k, $darr) = each($requiredby)):
358 <li
><a href
="<?= htmlspecialchars(get_pkg_uri($darr[0]), ENT_QUOTES); ?>" title
="<?= __('View packages details for').' ' . htmlspecialchars($darr[0]) ?>"><?
= htmlspecialchars($darr[0]) ?
></a
></li
>
363 <div id
="pkgfiles" class="listing">
364 <h3
><?
= __('Sources') ?
></h3
>
366 <?php
if (count($sources) > 0): ?
>
368 <ul id
="pkgsrcslist">
369 <?php
while (list($k, $src) = each($sources)): ?
>
370 <li
><?
= pkg_source_link($src[0], $src[1]) ?
></li
>