diff options
Diffstat (limited to 'web/template')
-rw-r--r-- | web/template/pkg_details.php | 14 | ||||
-rw-r--r-- | web/template/pkgbase_details.php | 14 |
2 files changed, 26 insertions, 2 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 90e57294..2f121e72 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) . '&SB=p'; + echo '">' . htmlspecialchars($kw) . "</a>\n"; + } +endif; +?> </td> </tr> <?php endif; ?> diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php index 99893699..dc30e48e 100644 --- a/web/template/pkgbase_details.php +++ b/web/template/pkgbase_details.php @@ -129,11 +129,14 @@ $pkgs = pkgbase_get_pkgnames($base_id); </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['Name']), ENT_QUOTES); ?>"> <div> <input type="hidden" name="action" value="do_SetKeywords" /> @@ -144,6 +147,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) . '&SB=p'; + echo '">' . htmlspecialchars($kw) . "</a>\n"; + } +endif; +?> </td> </tr> <?php endif; ?> |