3 $pkgbuild_uri = sprintf(config_get('options', 'source_file_uri'), 'PKGBUILD', urlencode($row['Name']));
4 $log_uri = sprintf(config_get('options', 'log_uri'), urlencode($row['Name']));
5 $snapshot_uri = sprintf(config_get('options', 'snapshot_uri'), urlencode($row['Name']));
6 $git_clone_uri_anon = sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($row['Name']));
7 $git_clone_uri_priv = sprintf(config_get('options', 'git_clone_uri_priv'), htmlspecialchars($row['Name']));
9 $uid = uid_from_sid($SID);
11 $base_id = intval($row['ID']);
13 $keywords = pkgbase_get_keywords($base_id);
15 $submitter = username_from_id($row["SubmitterUID"]);
16 $maintainer = username_from_id($row["MaintainerUID"]);
17 $comaintainers = pkgbase_get_comaintainers($base_id);
18 $packager = username_from_id($row["PackagerUID"]);
20 if ($row["MaintainerUID"] !== NULL) {
21 $maintainers = array_merge(array($row["MaintainerUID"]), pkgbase_get_comaintainer_uids(array($base_id)));
23 $maintainers = array();
25 $unflaggers = array_merge($maintainers, array($row["FlaggerUID"]));
27 $votes = $row['NumVotes'];
28 $popularity = $row['Popularity'];
30 # In case of wanting to put a custom message
33 # Print the timestamps for last updates
34 $updated_time = ($row["ModifiedTS"] == 0) ?
$msg : date("Y-m-d H:i", intval($row["ModifiedTS"]));
35 $submitted_time = ($row["SubmittedTS"] == 0) ?
$msg : date("Y-m-d H:i", intval($row["SubmittedTS"]));
36 $out_of_date_time = ($row["OutOfDateTS"] == 0) ?
$msg : date("Y-m-d", intval($row["OutOfDateTS"]));
38 $pkgs = pkgbase_get_pkgnames($base_id);
40 $base_uri = get_pkgbase_uri($row['Name']);
43 <div id
="pkgdetails" class="box">
44 <h2
><?
= __('Package Base Details') . ': ' . htmlspecialchars($row['Name']) ?
></h2
>
46 <?php
include('pkgbase_actions.php') ?
>
50 <th
><?
= __('Git Clone URL') . ': ' ?
></th
>
52 <a
class="copy" href
="<?= $git_clone_uri_anon ?>"><?
= $git_clone_uri_anon ?
></a
> (<?
= __('read-only') ?
>, <?
= __('click to copy') ?
>)
53 <?php
if (in_array($uid, $maintainers)): ?
>
54 <br
/> <a
class="copy" href
="<?= $git_clone_uri_priv ?>"><?
= $git_clone_uri_priv ?
></a
> (<?
= __('click to copy') ?
>)
59 if (has_credential(CRED_PKGBASE_SET_KEYWORDS
, array($row["MaintainerUID"])) ||
count($keywords) > 0):
62 <th
><?
= __('Keywords') . ': ' ?
></th
>
65 if (has_credential(CRED_PKGBASE_SET_KEYWORDS
, array($row["MaintainerUID"]))):
67 <form method
="post" action
="<?= htmlspecialchars(get_pkgbase_uri($row['Name']), ENT_QUOTES); ?>">
69 <input type
="hidden" name
="action" value
="do_SetKeywords" />
71 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
73 <input type
="text" name
="keywords" value
="<?= htmlspecialchars(implode(" ", $keywords), ENT_QUOTES) ?>"/>
74 <input type
="submit" value
="<?= __('Update') ?>"/>
79 foreach ($keywords as $kw) {
80 echo '<a class="keyword" href="';
81 echo get_uri('/packages/') . '?K=' . urlencode($kw) . '&SB=p';
82 echo '">' . htmlspecialchars($kw) . "</a>\n";
90 <th
><?
= __('Submitter') .': ' ?
></th
>
91 <td
><?
= html_format_username($submitter) ?
></td
>
94 <th
><?
= __('Maintainer') .': ' ?
></th
>
95 <td
><?
= html_format_maintainers($maintainer, $comaintainers) ?
></td
>
98 <th
><?
= __('Last Packager') .': ' ?
></th
>
99 <td
><?
= html_format_username($packager) ?
></td
>
102 <th
><?
= __('Votes') . ': ' ?
></th
>
103 <?php
if (has_credential(CRED_PKGBASE_LIST_VOTERS
)): ?
>
104 <td
><a href
="<?= get_pkgbase_uri($row['Name']); ?>voters/"><?
= $votes ?
></a
></td
>
106 <td
><?
= $votes ?
></td
>
110 <th
><?
= __('Popularity') . ': ' ?
></th
>
111 <td
><?
= number_format($popularity, $popularity >= .2 ?
2 : 6) ?
></td
>
114 <th
><?
= __('First Submitted') . ': ' ?
></th
>
115 <td
><?
= $submitted_time ?
></td
>
118 <th
><?
= __('Last Updated') . ': ' ?
></th
>
119 <td
><?
= $updated_time ?
></td
>
124 <div id
="pkgs" class="listing">
125 <h3
><?
= __('Packages') . " (" . count($pkgs) . ")"?
></h3
>
126 <?php
if (count($pkgs) > 0): ?
>
129 foreach ($pkgs as $k => $pkg):
131 <li
><a href
="<?= htmlspecialchars(get_pkg_uri($pkg), ENT_QUOTES); ?>" title
="<?= __('View packages details for').' '. htmlspecialchars($pkg) ?>"><?
= htmlspecialchars($pkg) ?
></a
></li
>
140 $
(document
).ready(function() {
141 $
('.copy').click(function(e
) {
142 var tmp
= $
("<input>");
143 $
("body").append(tmp
);
144 tmp
.val($
(this
).text()).select();
145 document
.execCommand("copy");