2 $atype = account_from_sid($SID);
3 $uid = uid_from_sid($SID);
5 $pkgid = intval($row['ID']);
6 $base_id = intval($row['BaseID']);
8 $catarr = pkgbase_categories();
10 $submitter = username_from_id($row["SubmitterUID"]);
11 $maintainer = username_from_id($row["MaintainerUID"]);
12 $packager = username_from_id($row["PackagerUID"]);
14 $votes = $row['NumVotes'];
16 # In case of wanting to put a custom message
18 $license = empty($row['License']) ?
$msg : $row['License'];
20 # Print the timestamps for last updates
21 $updated_time = ($row["ModifiedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["ModifiedTS"]));
22 $submitted_time = ($row["SubmittedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"]));
23 $out_of_date_time = ($row["OutOfDateTS"] == 0) ?
$msg : gmdate("Y-m-d", intval($row["OutOfDateTS"]));
25 $urlpath = URL_DIR
. 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 $rels = pkg_relations($row["ID"]);
34 $rels_c = $rels_p = $rels_r = array();
35 foreach ($rels as $rel) {
49 # $sources[0] = 'src';
50 $sources = pkg_sources($row["ID"]);
52 <div id
="pkgdetails" class="box">
53 <h2
><?
= __('Package Details') . ': ' . htmlspecialchars($row['Name']) . ' ' . htmlspecialchars($row['Version']) ?
></h2
>
54 <div id
="detailslinks" class="listing">
56 <h4
><?
= __('Package Actions') ?
></h4
>
58 <li
><a href
="<?= $urlpath ?>/PKGBUILD"><?
= __('View PKGBUILD') ?
></a
></li
>
59 <li
><a href
="<?= $urlpath . '/' . $row['BaseName'] ?>.tar.gz"><?
= __('Download tarball') ?
></a
></li
>
60 <li
><span
class="flagged"><?php
if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?
></span
></li
>
61 <?php
if ($USE_VIRTUAL_URLS && $uid): ?
>
62 <?php
if ($row["OutOfDateTS"] === NULL): ?
>
64 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'flag/'; ?>" method
="post">
65 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
66 <input type
="submit" class="button text-button" name
="do_Flag" value
="<?= __('Flag package out-of-date') ?>" />
69 <?php
elseif (($row["OutOfDateTS"] !== NULL) &&
70 ($uid == $row["MaintainerUID"] ||
$atype == "Trusted User" ||
$atype == "Developer")): ?
>
72 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unflag/'; ?>" method
="post">
73 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
74 <input type
="submit" class="button text-button" name
="do_UnFlag" value
="<?= __('Unflag package') ?>" />
78 <?php
if (pkgbase_user_voted($uid, $base_id)): ?
>
80 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unvote/'; ?>" method
="post">
81 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
82 <input type
="submit" class="button text-button" name
="do_UnVote" value
="<?= __('Remove vote') ?>" />
87 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'vote/'; ?>" method
="post">
88 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
89 <input type
="submit" class="button text-button" name
="do_Vote" value
="<?= __('Vote for this package') ?>" />
93 <?php
if (pkgbase_user_notify($uid, $base_id)): ?
>
95 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'unnotify/'; ?>" method
="post">
96 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
97 <input type
="submit" class="button text-button" name
="do_UnNotify" value
="<?= __('Disable notifications') ?>" />
102 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'notify/'; ?>" method
="post">
103 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
104 <input type
="submit" class="button text-button" name
="do_Notify" value
="<?= __('Notify of new comments') ?>" />
108 <?php
if ($atype == "Trusted User" ||
$atype == "Developer"): ?
>
109 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'delete/'; ?>"><?
= __('Delete Package'); ?
></a
></li
>
110 <li
><a href
="<?= get_pkgbase_uri($row['BaseName']) . 'merge/'; ?>"><?
= __('Merge Package'); ?
></a
></li
>
114 <?php
if ($uid && $row["MaintainerUID"] === NULL): ?
>
116 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'adopt/'; ?>" method
="post">
117 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
118 <input type
="submit" class="button text-button" name
="do_Adopt" value
="<?= __('Adopt Package') ?>" />
121 <?php
elseif ($uid && $uid == $row["MaintainerUID"] ||
122 $atype == "Trusted User" ||
$atype == "Developer"): ?
>
124 <form action
="<?= get_pkgbase_uri($row['BaseName']) . 'disown/'; ?>" method
="post">
125 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
126 <input type
="submit" class="button text-button" name
="do_Disown" value
="<?= __('Disown Package') ?>" />
136 <th
><?
= __('Package Base') . ': ' ?
></th
>
137 <td
class="wrap"><a href
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>"><?
= htmlspecialchars($row['BaseName']); ?
></a
></td
>
140 <th
><?
= __('Description') . ': ' ?
></th
>
141 <td
class="wrap"><?
= htmlspecialchars($row['Description']); ?
></td
>
144 <th
><?
= __('Upstream URL') . ': ' ?
></th
>
145 <td
><a href
="<?= htmlspecialchars($row['URL'], ENT_QUOTES) ?>" title
="<?= __('Visit the website for') . ' ' . htmlspecialchars( $row['Name'])?>"><?
= htmlspecialchars($row['URL'], ENT_QUOTES
) ?
></a
></td
>
148 <th
><?
= __('Category') . ': ' ?
></th
>
150 if ($SID && ($uid == $row["MaintainerUID"] ||
151 ($atype == "Developer" ||
$atype == "Trusted User"))):
154 <form method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
156 <input type
="hidden" name
="action" value
="do_ChangeCategory" />
158 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
160 <select name
="category_id">
162 foreach ($catarr as $cid => $catname):
164 <option value
="<?= $cid ?>"<?php
if ($cid == $row["CategoryID"]) { ?
> selected
="selected" <?php
} ?
>><?
= $catname ?
></option
>
167 <input type
="submit" value
="<?= __('Change category') ?>"/>
172 <a href
="<?= get_uri('/packages/'); ?>?C=<?= $row['CategoryID'] ?>"><?
= $row['Category'] ?
></a
>
176 <?php
if (count($lics) > 0): ?
>
178 <th
><?
= __('Licenses') . ': ' ?
></th
>
180 <?php
foreach($lics as $lic): ?
>
181 <span
class="related">
182 <?php
if ($lic !== end($lics)): ?
>
183 <?
= htmlspecialchars($lic) ?
>,
185 <?
= htmlspecialchars($lic) ?
>
192 <?php
if (count($grps) > 0): ?
>
194 <th
><?
= __('Groups') . ': ' ?
></th
>
196 <?php
foreach($grps as $grp): ?
>
197 <span
class="related">
198 <?php
if ($grp !== end($grps)): ?
>
199 <?
= htmlspecialchars($grp) ?
>,
201 <?
= htmlspecialchars($grp) ?
>
208 <?php
if (count($rels_c) > 0): ?
>
210 <th
><?
= __('Conflicts') . ': ' ?
></th
>
211 <td
class="wrap relatedto">
212 <?php
foreach($rels_c as $rarr): ?
>
213 <span
class="related">
214 <?php
if ($rarr !== end($rels_c)): ?
>
215 <?
= htmlspecialchars($rarr[0]) ?
>,
217 <?
= htmlspecialchars($rarr[0]) ?
>
224 <?php
if (count($rels_p) > 0): ?
>
226 <th
><?
= __('Provides') . ': ' ?
></th
>
227 <td
class="wrap relatedto">
228 <?php
foreach($rels_p as $rarr): ?
>
229 <span
class="related">
230 <?php
if ($rarr !== end($rels_p)): ?
>
231 <?
= htmlspecialchars($rarr[0]) ?
>,
233 <?
= htmlspecialchars($rarr[0]) ?
>
240 <?php
if (count($rels_r) > 0): ?
>
242 <th
><?
= __('Replaces') . ': ' ?
></th
>
243 <td
class="wrap relatedto">
244 <?php
foreach($rels_r as $rarr): ?
>
245 <span
class="related">
246 <?php
if ($rarr !== end($rels_r)): ?
>
247 <?
= htmlspecialchars($rarr[0]) ?
>,
249 <?
= htmlspecialchars($rarr[0]) ?
>
257 <th
><?
= __('Submitter') .': ' ?
></th
>
259 if ($row["SubmitterUID"]):
261 if (!$USE_VIRTUAL_URLS):
263 <td
><a href
="<?= get_uri('/account/'); ?>?Action=AccountInfo&ID=<?= htmlspecialchars($row['SubmitterUID'], ENT_QUOTES) ?>" title
="<?= __('View account information for')?> <?= htmlspecialchars($submitter) ?>"><?
= htmlspecialchars($submitter) ?
></a
></td
>
265 <td
><a href
="<?= get_uri('/account/') . htmlspecialchars($submitter, ENT_QUOTES) ?>" title
="<?= __('View account information for %s', htmlspecialchars($submitter)) ?>"><?
= htmlspecialchars($submitter) ?
></a
></td
>
268 <td
><?
= htmlspecialchars($submitter) ?
></td
>
271 <td
><?
= __('None') ?
></td
>
275 <th
><?
= __('Maintainer') .': ' ?
></th
>
277 if ($row["MaintainerUID"]):
279 if (!$USE_VIRTUAL_URLS):
281 <td
><a href
="<?= get_uri('/account/'); ?>?Action=AccountInfo&ID=<?= htmlspecialchars($row['MaintainerUID'], ENT_QUOTES) ?>" title
="<?= __('View account information for')?> <?= htmlspecialchars($maintainer) ?>"><?
= htmlspecialchars($maintainer) ?
></a
></td
>
283 <td
><a href
="<?= get_uri('/account/') . htmlspecialchars($maintainer, ENT_QUOTES) ?>" title
="<?= __('View account information for %s', htmlspecialchars($maintainer)) ?>"><?
= htmlspecialchars($maintainer) ?
></a
></td
>
286 <td
><?
= htmlspecialchars($maintainer) ?
></td
>
289 <td
><?
= __('None') ?
></td
>
293 <th
><?
= __('Last Packager') .': ' ?
></th
>
295 if ($row["PackagerUID"]):
297 if (!$USE_VIRTUAL_URLS):
299 <td
><a href
="<?= get_uri('/account/'); ?>?Action=AccountInfo&ID=<?= htmlspecialchars($row['PackagerUID'], ENT_QUOTES) ?>" title
="<?= __('View account information for')?> <?= htmlspecialchars($packager) ?>"><?
= htmlspecialchars($packager) ?
></a
></td
>
301 <td
><a href
="<?= get_uri('/account/') . htmlspecialchars($packager, ENT_QUOTES) ?>" title
="<?= __('View account information for %s', htmlspecialchars($packager)) ?>"><?
= htmlspecialchars($packager) ?
></a
></td
>
304 <td
><?
= htmlspecialchars($packager) ?
></td
>
307 <td
><?
= __('None') ?
></td
>
311 <th
><?
= __('Votes') . ': ' ?
></th
>
312 <?php
if ($atype == "Developer" ||
$atype == "Trusted User"): ?
>
313 <?php
if ($USE_VIRTUAL_URLS): ?
>
314 <td
><a href
="<?= get_pkgbase_uri($row['BaseName']); ?>voters/"><?
= $votes ?
></a
></td
>
316 <td
><a href
="<?= get_uri('/voters/'); ?>?N=<?= htmlspecialchars($row['BaseName'], ENT_QUOTES) ?>"><?
= $votes ?
></a
></td
>
319 <td
><?
= $votes ?
></td
>
323 <th
><?
= __('First Submitted') . ': ' ?
></th
>
324 <td
><?
= $submitted_time ?
></td
>
327 <th
><?
= __('Last Updated') . ': ' ?
></th
>
328 <td
><?
= $updated_time ?
></td
>
333 <div id
="pkgdeps" class="listing">
334 <h3
><?
= __('Dependencies') . " (" . count($deps) . ")"?
></h3
>
335 <?php
if (count($deps) > 0): ?
>
336 <ul id
="pkgdepslist">
337 <?php
while (list($k, $darr) = each($deps)): ?
>
338 <li
><?
= pkg_depend_link($darr[0], $darr[1], $darr[2], $darr[3]); ?
></li
>
343 <div id
="pkgreqs" class="listing">
344 <h3
><?
= __('Required by') . " (" . count($requiredby) . ")"?
></h3
>
345 <?php
if (count($requiredby) > 0): ?
>
346 <ul id
="pkgreqslist">
348 # darr: (PackageName, PackageID)
349 while (list($k, $darr) = each($requiredby)):
351 <li
><a href
="<?= htmlspecialchars(get_pkg_uri($darr[0]), ENT_QUOTES); ?>" title
="<?= __('View packages details for').' ' . htmlspecialchars($darr[0]) ?>"><?
= htmlspecialchars($darr[0]) ?
></a
></li
>
356 <div id
="pkgfiles" class="listing">
357 <h3
><?
= __('Sources') ?
></h3
>
359 <?php
if (count($sources) > 0): ?
>
363 while (list($k, $src) = each($sources)):
364 $src = explode('::', $src);
365 $parsed_url = parse_url($src[0]);
367 # It is an external source
368 if (isset($parsed_url['scheme']) ||
isset($src[1])):
370 <li
><a href
="<?= htmlspecialchars((isset($src[1]) ? $src[1] : $src[0]), ENT_QUOTES) ?>"><?
= htmlspecialchars($src[0]) ?
> </a
></li
>
373 # It is presumably an internal source
376 <li
><?
= htmlspecialchars($src) ?
></li
>