aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/feed-browser/index.php
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openembedded.org>2007-08-09 08:41:19 +0000
committerMarcin Juszkiewicz <hrw@openembedded.org>2007-08-09 08:41:19 +0000
commit9d829ed05c295df608b4fc108eb1c628fd06fd39 (patch)
treec1b27cfe4498f8abef1a61325922906f3e6a32ff /contrib/feed-browser/index.php
parent1434b204e16e87b7f59f074f3036d5dcbcf0116f (diff)
parent6ccac10beeaaa02a86081bd6179fd57c208ad6b1 (diff)
downloadopenembedded-9d829ed05c295df608b4fc108eb1c628fd06fd39.tar.gz
merge of '76e1e69496801009ea0aa69c84f76e858978ab99'
and 'db976a98427dd6a195e2cf167e225de2d0206aea'
Diffstat (limited to 'contrib/feed-browser/index.php')
-rw-r--r--contrib/feed-browser/index.php75
1 files changed, 40 insertions, 35 deletions
diff --git a/contrib/feed-browser/index.php b/contrib/feed-browser/index.php
index 1c902ac66e..eca57e9269 100644
--- a/contrib/feed-browser/index.php
+++ b/contrib/feed-browser/index.php
@@ -1,8 +1,8 @@
<?php
/*
- * (c) Koen Kooi 2006
- * (c) Marcin Juszkiewicz 2006
+ * (c) Koen Kooi 2006, 2007
+ * (c) Marcin Juszkiewicz 2006, 2007
*
* This php script is intended to do the following:
*
@@ -33,45 +33,33 @@
require_once 'includes/config.inc';
require_once 'includes/functions.inc';
-check_database();
-
-$name = '';
-
-if(isset($_GET['name']))
+if(!check_database())
{
- $name = $_GET['name'];
+ die("Database not found and cannot be created.");
}
-$action = '';
+read_vars_from_get(array('name', 'arch', 'pkgsearch', 'letter', 'pkgname', 'section'));
+
+$ipkgoutput = '';
-if(isset($_GET['action']))
+if(!empty($section))
{
- $action = $_GET['action'];
+ $ipkgoutput = searchsection($section);
}
-
-switch($action)
+elseif(!empty($letter))
{
- case "details":
- $ipkgoutput = pkgdetails ($_GET['pnm']);
- break;
-
- case "search":
- $ipkgoutput = searchpkg ("%{$name}%");
- break;
-
- case "section":
- $ipkgoutput = searchsection($_GET['section']);
- break;
-
- case "letter":
- $letter = $_GET['g'];
- $ipkgoutput = searchpkg ("{$letter}%");
- break;
-
- default:
- $ipkgoutput = searchpkg("a");
- break;
+ $ipkgoutput = searchpkg("{$letter}%", $arch);
+}
+elseif(!empty($pkgname))
+{
+ $ipkgoutput = pkgdetails($pkgname);
}
+elseif(!empty($pkgsearch) OR !empty($arch))
+{
+ $ipkgoutput = searchpkg("%{$pkgsearch}%", $arch);
+}
+
+$archs_list = get_arch_list();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -88,8 +76,25 @@ switch($action)
<form action="" method="get">
<fieldset>
<label for="name">Package name</label>
- <input type="text" name="name" value="<?php echo $name; ?>" />
- <input type="hidden" name="action" value="search" />
+ <input type="text" name="pkgsearch" value="<?php echo $pkgsearch; ?>" />
+ <select name="arch">
+ <option value="" selected="selected">all architectures</option>
+ <option value="all">no arch</option>
+<?php
+
+foreach($archs_list as $architecture)
+{
+ echo "<option value='{$architecture['p_arch']}'";
+
+ if($architecture['p_arch'] == $arch)
+ {
+ echo ' selected="selected"';
+ }
+ echo ">{$architecture['p_arch']}</option>";
+}
+
+?>
+ </select>
<input type="submit" value="Search" />
</fieldset>
</form>