diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2017-02-04 00:04:22 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2017-02-04 00:36:17 +0100 |
commit | 3b4c6e72a966c5344976990ed3214f2e184c90ad (patch) | |
tree | 9be608ee667633ca6400e8d79c82c8416e8c3cd2 /web/template/pkg_search_results.php | |
parent | ac745f656d4c8d19cdcf8d843d6855c6b45a3974 (diff) | |
download | aur-3b4c6e72a966c5344976990ed3214f2e184c90ad.tar.gz aur-3b4c6e72a966c5344976990ed3214f2e184c90ad.tar.xz |
Refactor pkg_search_page()
* Pass search parameters using an associative array instead of $_GET.
* Add a boolean parameter to enable and disable headers/footers.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/template/pkg_search_results.php')
-rw-r--r-- | web/template/pkg_search_results.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php index 37a90328..7b6b00aa 100644 --- a/web/template/pkg_search_results.php +++ b/web/template/pkg_search_results.php @@ -5,6 +5,7 @@ if (!$result): ?> <div class="box"><p><?= __("No packages matched your search criteria.") ?></p></div> <?php else: ?> <div id="pkglist-results" class="box"> + <?php if ($show_headers): ?> <div class="pkglist-stats"> <p> <?= _n('%d package found.', '%d packages found.', $total) ?> @@ -24,12 +25,13 @@ if (!$result): ?> </p> <?php endif; ?> </div> + <?php endif; ?> <form id="pkglist-results-form" method="post" action="<?= get_uri('/pkgbase/'); ?>?<?= htmlentities($_SERVER['QUERY_STRING']) ?>"> <table class="results"> <thead> <tr> - <?php if ($SID): ?> + <?php if ($SID && $show_headers): ?> <th> </th> <?php endif; ?> <th><a href="?<?= mkurl('SB=n&SO=' . $SO_next) ?>"><?= __("Name") ?></a></th> @@ -48,7 +50,7 @@ if (!$result): ?> <?php while (list($indx, $row) = each($searchresults)): ?> <tr class="<?= ($indx % 2 == 0) ? 'odd' : 'even' ?>"> - <?php if ($SID): ?> + <?php if ($SID && $show_headers): ?> <td><input type="checkbox" name="IDs[<?= $row["PackageBaseID"] ?>]" value="1" /></td> <?php endif; ?> <td><a href="<?= htmlspecialchars(get_pkg_uri($row["Name"]), ENT_QUOTES); ?>"><?= htmlspecialchars($row["Name"]) ?></a></td> @@ -85,6 +87,7 @@ if (!$result): ?> </tbody> </table> + <?php if ($show_headers): ?> <div class="pkglist-stats"> <p> <?= _n('%d package found.', '%d packages found.', $total) ?> @@ -127,6 +130,7 @@ if (!$result): ?> <input type="submit" class="button" style="width: 80px" value="<?= __("Go") ?>" /> </p> <?php endif; # if ($SID) ?> + <?php endif; ?> </form> </div> <?php endif; # search was successful and returned multiple results ?> |