summaryrefslogtreecommitdiffstats
path: root/web/template/pkg_details.php
diff options
context:
space:
mode:
authorMarcel Korpel <marcel.korpel@gmail.com>2015-06-18 17:11:48 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-06-19 14:40:08 +0200
commitd852da79e4c3de66552bc216a76bdfa40bc1e0bd (patch)
tree145d3fc7ebf14c5a8de9cabae4269f7b1161f1f4 /web/template/pkg_details.php
parent6e3cbb9e65c0a743b5f8d88de42e2fddaaaaaa99 (diff)
downloadaurweb-d852da79e4c3de66552bc216a76bdfa40bc1e0bd.tar.xz
pkgbase_details.php/pkg_details.php: Show keywords
Keywords are hyperlinked so a user can search for other packages with the same name and/or keyword. Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/template/pkg_details.php')
-rw-r--r--web/template/pkg_details.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index 90e5729..2f121e7 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -190,11 +190,14 @@ $sources = pkg_sources($row["ID"]);
<td><a href="<?= htmlspecialchars($row['URL'], ENT_QUOTES) ?>" title="<?= __('Visit the website for') . ' ' . htmlspecialchars( $row['Name'])?>"><?= htmlspecialchars($row['URL'], ENT_QUOTES) ?></a></td>
</tr>
<?php
-if (has_credential(CRED_PKGBASE_SET_KEYWORDS, array($row["MaintainerUID"]))):
+if (has_credential(CRED_PKGBASE_SET_KEYWORDS, array($row["MaintainerUID"])) || count($keywords) > 0):
?>
<tr>
<th><?= __('Keywords') . ': ' ?></th>
<td>
+<?php
+if (has_credential(CRED_PKGBASE_SET_KEYWORDS, array($row["MaintainerUID"]))):
+?>
<form method="post" action="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>">
<div>
<input type="hidden" name="action" value="do_SetKeywords" />
@@ -205,6 +208,15 @@ if (has_credential(CRED_PKGBASE_SET_KEYWORDS, array($row["MaintainerUID"]))):
<input type="submit" value="<?= __('Update') ?>"/>
</div>
</form>
+<?php
+else:
+ foreach ($keywords as $kw) {
+ echo '<a class="keyword" href="';
+ echo get_uri('/packages/') . '?K=' . urlencode($kw) . '&amp;SB=p';
+ echo '">' . htmlspecialchars($kw) . "</a>\n";
+ }
+endif;
+?>
</td>
</tr>
<?php endif; ?>