changeset 148:6480620d2e4a misc

Minor cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 21 Dec 2010 02:47:17 +0000
parents 9330b5ce7e1c
children 762e30af53f6
files materials/index.php
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/materials/index.php	Tue Dec 21 02:45:23 2010 +0000
+++ b/materials/index.php	Tue Dec 21 02:47:17 2010 +0000
@@ -108,15 +108,14 @@
    <select name="f[14]">
 <?
 $typeFilter = isset($colFilters[14]) ? $colFilters[14] : -1;
+if ($typeFilter == -1) unset($colFilters[14]);
 $typeTable = $transTable[14];
 $typeTable[-1] = "EVERYTHING";
 ksort($typeTable);
 foreach ($typeTable as $key => $value) {
-  echo "    <option value=\"$key\"";
-  if ($typeFilter == $key) {
-    echo " selected=\"selected\"";
-  }
-  echo ">".htmlentities($value)."</option>\n";
+  echo "    <option value=\"$key\"".
+    ($typeFilter == $key ? " selected=\"selected\"" : "").
+    ">".htmlentities($value)."</option>\n";
 }
 
 ?>