summaryrefslogtreecommitdiff
path: root/contrib/feed-browser/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/feed-browser/index.php')
-rw-r--r--contrib/feed-browser/index.php51
1 files changed, 18 insertions, 33 deletions
diff --git a/contrib/feed-browser/index.php b/contrib/feed-browser/index.php
index 0c9f17edc2..366b4d76c0 100644
--- a/contrib/feed-browser/index.php
+++ b/contrib/feed-browser/index.php
@@ -38,39 +38,25 @@ if(!check_database())
die("Database not found and cannot be created.");
}
-read_vars_from_get(array('name', 'arch', 'action', 'letter', 'pnm', 'section'));
+read_vars_from_get(array('name', 'arch', 'pkgsearch', 'letter', 'pkgname', 'section'));
-switch($action)
-{
- case "details":
- $ipkgoutput = pkgdetails ($pnm);
- break;
-
- case "search":
- if ( $arch == "" ) {
- $ipkgoutput = searchpkg ("%{$name}%");
- }
- else {
- $ipkgoutput = searchpkgarch ("%{$name}%", "{$arch}");
- }
- break;
-
- case "section":
- $ipkgoutput = searchsection($section);
- break;
+$ipkgoutput = '';
- case "letter":
- if ( $arch == "" ) {
- $ipkgoutput = searchpkg ("{$letter}%");
- }
- else {
- $ipkgoutput = searchpkgarch ("{$letter}%", "{$arch}");
- }
- break;
-
- default:
- $ipkgoutput = searchpkg("a");
- break;
+if(!empty($section))
+{
+ $ipkgoutput = searchsection($section);
+}
+elseif(!empty($letter))
+{
+ $ipkgoutput = searchpkg("{$letter}%", $arch);
+}
+elseif(!empty($pkgname))
+{
+ $ipkgoutput = pkgdetails($pkgname);
+}
+elseif(!empty($pkgsearch))
+{
+ $ipkgoutput = searchpkg("%{$pkgsearch}%", $arch);
}
?>
@@ -88,7 +74,7 @@ switch($action)
<form action="" method="get">
<fieldset>
<label for="name">Package name</label>
- <input type="text" name="name" value="<?php echo $name; ?>" />
+ <input type="text" name="pkgsearch" value="<?php echo $name; ?>" />
<select name="arch">
<option value="" selected="selected">all architectures</option>
<option value="all">noarch</option>
@@ -106,7 +92,6 @@ switch($action)
<option value="ppc603e">ppc603e</option>
<option value="sparc">sparc</option>
</select>
- <input type="hidden" name="action" value="search" />
<input type="submit" value="Search" />
</fieldset>
</form>