feed-browser: mark selected architecture in list of archs, also show entered package...
authorMarcin Juszkiewicz <hrw@openembedded.org>
Thu, 5 Jul 2007 16:40:28 +0000 (16:40 +0000)
committerMarcin Juszkiewicz <hrw@openembedded.org>
Thu, 5 Jul 2007 16:40:28 +0000 (16:40 +0000)
contrib/feed-browser/index.php

index e513c73..eca57e9 100644 (file)
@@ -76,15 +76,21 @@ $archs_list = get_arch_list();
                        <form action="" method="get">
                                <fieldset>
                                        <label for="name">Package name</label>
-                                       <input type="text" name="pkgsearch" value="<?php echo $name; ?>" />
+                                       <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 $arch)
+foreach($archs_list as $architecture)
 {
-    echo "<option value='{$arch['p_arch']}'>{$arch['p_arch']}</option>";
+    echo "<option value='{$architecture['p_arch']}'";
+
+    if($architecture['p_arch'] == $arch)
+    {
+       echo ' selected="selected"';
+    }
+    echo ">{$architecture['p_arch']}</option>";
 }
 
 ?>