summaryrefslogtreecommitdiff
path: root/contrib/feed-browser/index.php
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openembedded.org>2007-07-05 16:15:03 +0000
committerMarcin Juszkiewicz <hrw@openembedded.org>2007-07-05 16:15:03 +0000
commitb0dc3a8d1dc7e79b7960ee7503d80a7d43b8793f (patch)
tree747a316b7e210f4c014883d945ffa9bf0432a7ca /contrib/feed-browser/index.php
parent61b4b0bb672b02698aa4ee479b69ab5f7264dd42 (diff)
feed-browser: simplified URLs (no 'action' var anymore), simplified code a bit
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>