2 $uid = uid_from_sid($SID);
4 $base_id = intval($row['ID']);
6 $catarr = pkgbase_categories();
8 $submitter = username_from_id($row["SubmitterUID"]);
9 $maintainer = username_from_id($row["MaintainerUID"]);
10 $packager = username_from_id($row["PackagerUID"]);
12 $votes = $row['NumVotes'];
14 # In case of wanting to put a custom message
17 # Print the timestamps for last updates
18 $updated_time = ($row["ModifiedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["ModifiedTS"]));
19 $submitted_time = ($row["SubmittedTS"] == 0) ?
$msg : gmdate("Y-m-d H:i", intval($row["SubmittedTS"]));
20 $out_of_date_time = ($row["OutOfDateTS"] == 0) ?
$msg : gmdate("Y-m-d", intval($row["OutOfDateTS"]));
22 $package_url = config_get('options', 'package_url');
23 $urlpath = $package_url . substr($row['Name'], 0, 2) . "/" . $row['Name'];
25 $pkgs = pkgbase_get_pkgnames($base_id);
27 <div id
="pkgdetails" class="box">
28 <h2
><?
= __('Package Base Details') . ': ' . htmlspecialchars($row['Name']) ?
></h2
>
29 <div id
="detailslinks" class="listing">
31 <h4
><?
= __('Package Actions') ?
></h4
>
33 <li
><a href
="<?= $urlpath ?>/PKGBUILD"><?
= __('View PKGBUILD') ?
></a
></li
>
34 <li
><a href
="<?= $urlpath . '/' . $row['Name'] ?>.tar.gz"><?
= __('Download tarball') ?
></a
></li
>
35 <li
><a href
="https://wiki.archlinux.org/index.php/Special:Search?search=<?= urlencode($row['Name']) ?>"><?
= __('Search wiki') ?
></a
></li
>
36 <li
><span
class="flagged"><?php
if ($row["OutOfDateTS"] !== NULL) { echo __('Flagged out-of-date')." (${out_of_date_time})"; } ?
></span
></li
>
38 <?php
if ($row["OutOfDateTS"] === NULL): ?
>
40 <form action
="<?= get_pkgbase_uri($row['Name']) . 'flag/'; ?>" method
="post">
41 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
42 <input type
="submit" class="button text-button" name
="do_Flag" value
="<?= __('Flag package out-of-date') ?>" />
45 <?php
elseif (($row["OutOfDateTS"] !== NULL) && has_credential(CRED_PKGBASE_UNFLAG
, array($row["MaintainerUID"]))): ?
>
47 <form action
="<?= get_pkgbase_uri($row['Name']) . 'unflag/'; ?>" method
="post">
48 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
49 <input type
="submit" class="button text-button" name
="do_UnFlag" value
="<?= __('Unflag package') ?>" />
53 <?php
if (pkgbase_user_voted($uid, $base_id)): ?
>
55 <form action
="<?= get_pkgbase_uri($row['Name']) . 'unvote/'; ?>" method
="post">
56 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
57 <input type
="submit" class="button text-button" name
="do_UnVote" value
="<?= __('Remove vote') ?>" />
62 <form action
="<?= get_pkgbase_uri($row['Name']) . 'vote/'; ?>" method
="post">
63 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
64 <input type
="submit" class="button text-button" name
="do_Vote" value
="<?= __('Vote for this package') ?>" />
68 <?php
if (pkgbase_user_notify($uid, $base_id)): ?
>
70 <form action
="<?= get_pkgbase_uri($row['Name']) . 'unnotify/'; ?>" method
="post">
71 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
72 <input type
="submit" class="button text-button" name
="do_UnNotify" value
="<?= __('Disable notifications') ?>" />
77 <form action
="<?= get_pkgbase_uri($row['Name']) . 'notify/'; ?>" method
="post">
78 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
79 <input type
="submit" class="button text-button" name
="do_Notify" value
="<?= __('Notify of new comments') ?>" />
83 <li
><span
class="flagged"><?php
if ($row["RequestCount"] > 0) { echo _n('%d pending request', '%d pending requests', $row["RequestCount"]); } ?
></span
></li
>
84 <li
><a href
="<?= get_pkgbase_uri($row['Name']) . 'request/'; ?>"><?
= __('File Request'); ?
></a
></li
>
85 <?php
if (has_credential(CRED_PKGBASE_DELETE
)): ?
>
86 <li
><a href
="<?= get_pkgbase_uri($row['Name']) . 'delete/'; ?>"><?
= __('Delete Package'); ?
></a
></li
>
87 <li
><a href
="<?= get_pkgbase_uri($row['Name']) . 'merge/'; ?>"><?
= __('Merge Package'); ?
></a
></li
>
91 <?php
if ($uid && $row["MaintainerUID"] === NULL): ?
>
93 <form action
="<?= get_pkgbase_uri($row['Name']) . 'adopt/'; ?>" method
="post">
94 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
95 <input type
="submit" class="button text-button" name
="do_Adopt" value
="<?= __('Adopt Package') ?>" />
98 <?php
elseif (has_credential(CRED_PKGBASE_DISOWN
, array($row["MaintainerUID"]))): ?
>
100 <form action
="<?= get_pkgbase_uri($row['Name']) . 'disown/'; ?>" method
="post">
101 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
102 <input type
="submit" class="button text-button" name
="do_Disown" value
="<?= __('Disown Package') ?>" />
112 <th
><?
= __('Category') . ': ' ?
></th
>
114 if (has_credential(CRED_PKGBASE_CHANGE_CATEGORY
, array($row["MaintainerUID"]))):
117 <form method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($row['Name']), ENT_QUOTES); ?>">
119 <input type
="hidden" name
="action" value
="do_ChangeCategory" />
121 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
123 <select name
="category_id">
125 foreach ($catarr as $cid => $catname):
127 <option value
="<?= $cid ?>"<?php
if ($cid == $row["CategoryID"]) { ?
> selected
="selected" <?php
} ?
>><?
= $catname ?
></option
>
130 <input type
="submit" value
="<?= __('Change category') ?>"/>
135 <a href
="<?= get_uri('/packages/'); ?>?C=<?= $row['CategoryID'] ?>"><?
= $row['Category'] ?
></a
>
140 <th
><?
= __('Submitter') .': ' ?
></th
>
141 <?php
if ($row["SubmitterUID"] && $SID): ?
>
142 <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
>
143 <?php
elseif ($row["SubmitterUID"] && !$SID): ?
>
144 <td
><?
= html_format_username($submitter) ?
></td
>
146 <td
><?
= __('None') ?
></td
>
150 <th
><?
= __('Maintainer') .': ' ?
></th
>
151 <?php
if ($row["MaintainerUID"] && $SID): ?
>
152 <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
>
153 <?php
elseif ($row["MaintainerUID"] && !$SID): ?
>
154 <td
><?
= html_format_username($maintainer) ?
></td
>
156 <td
><?
= __('None') ?
></td
>
160 <th
><?
= __('Last Packager') .': ' ?
></th
>
161 <?php
if ($row["PackagerUID"] && $SID): ?
>
162 <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
>
163 <?php
elseif ($row["PackagerUID"] && !$SID): ?
>
164 <td
><?
= html_format_username($packager) ?
></td
>
166 <td
><?
= __('None') ?
></td
>
170 <th
><?
= __('Votes') . ': ' ?
></th
>
171 <?php
if (has_credential(CRED_PKGBASE_LIST_VOTERS
)): ?
>
172 <td
><a href
="<?= get_pkgbase_uri($row['Name']); ?>voters/"><?
= $votes ?
></a
></td
>
174 <td
><?
= $votes ?
></td
>
178 <th
><?
= __('First Submitted') . ': ' ?
></th
>
179 <td
><?
= $submitted_time ?
></td
>
182 <th
><?
= __('Last Updated') . ': ' ?
></th
>
183 <td
><?
= $updated_time ?
></td
>
188 <div id
="pkgs" class="listing">
189 <h3
><?
= __('Packages') . " (" . count($pkgs) . ")"?
></h3
>
190 <?php
if (count($pkgs) > 0): ?
>
193 while (list($k, $pkg) = each($pkgs)):
195 <li
><a href
="<?= htmlspecialchars(get_pkg_uri($pkg), ENT_QUOTES); ?>" title
="<?= __('View packages details for').' '. htmlspecialchars($pkg) ?>"><?
= htmlspecialchars($pkg) ?
></a
></li
>