diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-02-22 13:06:55 +0100 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-02-22 18:33:27 +0100 |
commit | c39183c3ee7eb1b127e981d1f023a13fd88cbea9 (patch) | |
tree | 63d7e54849de0f702d65117cf69d56b7dc0b701c | |
parent | 4b2b8afb8aad83588cd9d0cf9af28acfb5d3bb74 (diff) | |
download | aur-c39183c3ee7eb1b127e981d1f023a13fd88cbea9.tar.gz aur-c39183c3ee7eb1b127e981d1f023a13fd88cbea9.tar.xz |
Add ability to search for non-out-of-date packages (fixes FS#17896).
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r-- | web/lib/pkgfuncs.inc | 7 | ||||
-rw-r--r-- | web/template/pkg_search_form.php | 19 |
2 files changed, 20 insertions, 6 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index fd855ac1..53868b64 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -491,7 +491,12 @@ function pkg_search_page($SID="") { } if (isset($_GET['outdated'])) { - $q .= "AND OutOfDateTS IS NOT NULL "; + if ($_GET['outdated'] == 'on') { + $q .= "AND OutOfDateTS IS NOT NULL "; + } + elseif ($_GET['outdated'] == 'off') { + $q .= "AND OutOfDateTS IS NULL "; + } } $order = $_GET["SO"] == 'd' ? 'DESC' : 'ASC'; diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php index fdeb01b8..a2b634df 100644 --- a/web/template/pkg_search_form.php +++ b/web/template/pkg_search_form.php @@ -105,11 +105,20 @@ </li> <li> <label><?php echo __('Out of Date'); ?></label> - <?php if (isset($_GET['outdated'])): ?> - <input type="checkbox" name="outdated" checked /> - <?php else: ?> - <input type="checkbox" name="outdated" /> - <?php endif; ?> + <select name='outdated'> + <?php + $outdated_flags = array('' => __('All'), 'on' => __('Flagged'), 'off' => __('Not Flagged')); + foreach ($outdated_flags as $k => $v): + if ($_REQUEST['outdated'] == $k): + ?> + <option value='<?php print $k; ?>' selected="selected"><?php print $v; ?></option> + <?php else: ?> + <option value='<?php print $k; ?>'><?php print $v; ?></option> + <?php + endif; + endforeach; + ?> + </select> </li> </ul> </div> |