3 $pkgbuild_uri = sprintf(config_get('options', 'source_file_uri'), 'PKGBUILD', 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']));
8 $max_depends = config_get_int('options', 'max_depends');
10 $uid = uid_from_sid($SID);
12 $pkgid = intval($row['ID']);
13 $base_id = intval($row['BaseID']);
15 $keywords = pkgbase_get_keywords($base_id);
17 $submitter = username_from_id($row["SubmitterUID"]);
18 $maintainer = username_from_id($row["MaintainerUID"]);
19 $comaintainers = pkgbase_get_comaintainers($base_id);
20 $packager = username_from_id($row["PackagerUID"]);
22 if ($row["MaintainerUID"] !== NULL) {
23 $maintainers = array_merge(array($row["MaintainerUID"]), pkgbase_get_comaintainer_uids(array($base_id)));
25 $maintainers = array();
27 $unflaggers = array_merge($maintainers, array($row["FlaggerUID"]));
29 $votes = $row['NumVotes'];
30 $popularity = $row['Popularity'];
32 # In case of wanting to put a custom message
34 $license = empty($row['License']) ?
$msg : $row['License'];
36 # Print the timestamps for last updates
37 $updated_time = ($row["ModifiedTS"] == 0) ?
$msg : date("Y-m-d H:i", intval($row["ModifiedTS"]));
38 $submitted_time = ($row["SubmittedTS"] == 0) ?
$msg : date("Y-m-d H:i", intval($row["SubmittedTS"]));
39 $out_of_date_time = ($row["OutOfDateTS"] == 0) ?
$msg : date("Y-m-d", intval($row["OutOfDateTS"]));
41 $lics = pkg_licenses($row["ID"]);
42 $grps = pkg_groups($row["ID"]);
44 $deps = pkg_dependencies($row["ID"], $max_depends);
46 usort($deps, function($x, $y) {
48 if ($x[1] == "depends") {
50 } elseif ($y[1] == "depends") {
53 return strcmp($x[1], $y[1]);
54 } elseif ($x[3] != $y[3]) {
55 return strcmp($x[3], $y[3]);
57 return strcmp($x[0], $y[0]);
61 $rels = pkg_relations($row["ID"]);
63 usort($rels, function($x, $y) {
65 return strcmp($x[3], $y[3]);
67 return strcmp($x[0], $y[0]);
71 $rels_c = $rels_p = $rels_r = array();
72 foreach ($rels as $rel) {
86 $requiredby = pkg_required($row["Name"], $rels_p, $max_depends);
88 # $sources[0] = 'src';
89 $sources = pkg_sources($row["ID"]);
91 $base_uri = get_pkgbase_uri($row['BaseName']);
94 <div id
="pkgdetails" class="box">
95 <h2
><?
= __('Package Details') . ': ' . htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?
></h2
>
97 <?php
include('pkgbase_actions.php') ?
>
101 <th
><?
= __('Git Clone URL') . ': ' ?
></th
>
103 <a href
="<?= $git_clone_uri_anon ?>"><?
= $git_clone_uri_anon ?
></a
> (<?
= __('read-only') ?
>)
104 <?php
if (in_array($uid, $maintainers)): ?
>
105 <br
/> <a href
="<?= $git_clone_uri_priv ?>"><?
= $git_clone_uri_priv ?
></a
>
110 <th
><?
= __('Package Base') . ': ' ?
></th
>
111 <td
class="wrap"><a href
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>"><?
= htmlspecialchars($row['BaseName']); ?
></a
></td
>
114 <th
><?
= __('Description') . ': ' ?
></th
>
115 <?php
if (!empty($row['Description'])): ?
>
116 <td
class="wrap"><?
= htmlspecialchars($row['Description']); ?
></td
>
118 <td
class="wrap"><?
= __('None') ?
></td
>
122 <th
><?
= __('Upstream URL') . ': ' ?
></th
>
123 <?php
if (!empty($row['URL'])): ?
>
124 <td
><a href
="<?= htmlspecialchars($row['URL'], ENT_QUOTES) ?>" title
="<?= __('Visit the website for') . ' ' . htmlspecialchars( $row['Name'])?>"><?
= htmlspecialchars($row['URL'], ENT_QUOTES
) ?
></a
></td
>
126 <td
class="wrap"><?
= __('None') ?
></td
>
130 if (has_credential(CRED_PKGBASE_SET_KEYWORDS
, $maintainers) ||
count($keywords) > 0):
133 <th
><?
= __('Keywords') . ': ' ?
></th
>
136 if (has_credential(CRED_PKGBASE_SET_KEYWORDS
, $maintainers)):
138 <form method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
140 <input type
="hidden" name
="action" value
="do_SetKeywords" />
142 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
144 <input type
="text" name
="keywords" value
="<?= htmlspecialchars(implode(" ", $keywords), ENT_QUOTES) ?>"/>
145 <input type
="submit" value
="<?= __('Update') ?>"/>
150 foreach ($keywords as $kw) {
151 echo '<a class="keyword" href="';
152 echo get_uri('/packages/') . '?K=' . urlencode($kw) . '&SB=p';
153 echo '">' . htmlspecialchars($kw) . "</a>\n";
160 <?php
if (count($lics) > 0): ?
>
162 <th
><?
= __('Licenses') . ': ' ?
></th
>
164 <?php
foreach($lics as $lic): ?
>
165 <span
class="related">
166 <?php
if ($lic !== end($lics)): ?
>
167 <?
= htmlspecialchars($lic) ?
>,
169 <?
= htmlspecialchars($lic) ?
>
176 <?php
if (count($grps) > 0): ?
>
178 <th
><?
= __('Groups') . ': ' ?
></th
>
180 <?php
foreach($grps as $grp): ?
>
181 <span
class="related">
182 <?php
if ($grp !== end($grps)): ?
>
183 <?
= htmlspecialchars($grp) ?
>,
185 <?
= htmlspecialchars($grp) ?
>
192 <?php
if (count($rels_c) > 0): ?
>
194 <th
><?
= __('Conflicts') . ': ' ?
></th
>
195 <td
class="wrap relatedto">
196 <?php
foreach($rels_c as $rarr): ?
>
197 <span
class="related">
198 <?php
if ($rarr !== end($rels_c)): ?
>
199 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
201 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
208 <?php
if (count($rels_p) > 0): ?
>
210 <th
><?
= __('Provides') . ': ' ?
></th
>
211 <td
class="wrap relatedto">
212 <?php
foreach($rels_p as $rarr): ?
>
213 <span
class="related">
214 <?php
if ($rarr !== end($rels_p)): ?
>
215 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
217 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
224 <?php
if (count($rels_r) > 0): ?
>
226 <th
><?
= __('Replaces') . ': ' ?
></th
>
227 <td
class="wrap relatedto">
228 <?php
foreach($rels_r as $rarr): ?
>
229 <span
class="related">
230 <?php
if ($rarr !== end($rels_r)): ?
>
231 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>,
233 <?
= pkg_rel_html($rarr[0], $rarr[2], $rarr[3]) ?
>
241 <th
><?
= __('Submitter') .': ' ?
></th
>
242 <td
><?
= html_format_username($submitter) ?
></td
>
245 <th
><?
= __('Maintainer') .': ' ?
></th
>
246 <td
><?
= html_format_maintainers($maintainer, $comaintainers) ?
></td
>
249 <th
><?
= __('Last Packager') .': ' ?
></th
>
250 <td
><?
= html_format_username($packager) ?
></td
>
253 <th
><?
= __('Votes') . ': ' ?
></th
>
254 <?php
if (has_credential(CRED_PKGBASE_LIST_VOTERS
)): ?
>
255 <td
><a href
="<?= get_pkgbase_uri($row['BaseName']); ?>voters/"><?
= $votes ?
></a
></td
>
257 <td
><?
= $votes ?
></td
>
261 <th
><?
= __('Popularity') . ': ' ?
></th
>
262 <td
><?
= number_format($popularity, 6) ?
></td
>
265 <th
><?
= __('First Submitted') . ': ' ?
></th
>
266 <td
><?
= $submitted_time ?
></td
>
269 <th
><?
= __('Last Updated') . ': ' ?
></th
>
270 <td
><?
= $updated_time ?
></td
>
275 <div id
="pkgdeps" class="listing">
276 <h3
><?
= __('Dependencies') . " (" . count($deps) . ")"?
></h3
>
277 <?php
if (count($deps) > 0): ?
>
278 <ul id
="pkgdepslist">
279 <?php
while (list($k, $darr) = each($deps)): ?
>
280 <li
><?
= pkg_depend_link($darr[0], $darr[1], $darr[2], $darr[3], $darr[4]); ?
></li
>
285 <div id
="pkgreqs" class="listing">
286 <h3
><?
= __('Required by') . " (" . count($requiredby) . ")"?
></h3
>
287 <?php
if (count($requiredby) > 0): ?
>
288 <ul id
="pkgreqslist">
289 <?php
while (list($k, $darr) = each($requiredby)): ?
>
290 <li
><?
= pkg_requiredby_link($darr[0], $darr[1], $darr[2], $darr[3], $row['Name']); ?
></li
>
295 <div id
="pkgfiles" class="listing">
296 <h3
><?
= __('Sources') . " (" . count($sources) . ")"?
></h3
>
298 <?php
if (count($sources) > 0): ?
>
300 <ul id
="pkgsrcslist">
301 <?php
while (list($k, $src) = each($sources)): ?
>
302 <li
><?
= pkg_source_link($src[0], $src[1], urlencode($row['BaseName'])) ?
></li
>