From 6de155ca05ee56af9e916cfa2eea941f006e0055 Mon Sep 17 00:00:00 2001
From: "Leigh B. Stoller" <stoller@flux.utah.edu>
Date: Wed, 17 Oct 2007 23:04:27 +0000
Subject: [PATCH] Minor tweaks to support a couple of things in new
 template_search page.

---
 www/form_defs.php | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/www/form_defs.php b/www/form_defs.php
index 804978d68e..b2e7756003 100644
--- a/www/form_defs.php
+++ b/www/form_defs.php
@@ -129,7 +129,14 @@ function FormRenderRadio($name, $attrs)
 
 function FormRenderSelect($name, $attrs)
 {
-    $html = "<select name=\"formfields[$name]\" ";
+    $html = "<select ";
+
+    if (array_key_exists('#name', $attrs)) {
+	$html .= " name='" . $attrs['#name'] . "' ";
+    }
+    else {
+	$html .= " name=\"formfields[$name]\" ";
+    }
     if (isset($attrs['#class'])) {
 	$html .= "class=\"" . $attrs['#class'] . "\" ";
     }
@@ -139,6 +146,9 @@ function FormRenderSelect($name, $attrs)
     if (isset($attrs['#javascript'])) {
 	$html .= $attrs['#javascript'] . " ";
     }
+    if (array_key_exists('#id', $attrs)) {
+	$html .= " id='" . $attrs['#id'] . "' ";
+    }
     $html .= ">\n";
 
     if (isset($attrs['#default']))
@@ -370,7 +380,7 @@ function FormRenderElements($fields, $submitted)
 	    $html .= "<tr>";
 	    if ($attributes['#type'] != "submit" &&
 		!isset($attributes['#colspan'])) {
-		$html .= "<td $mouseover $cols>";
+		$html .= "<td align=left $mouseover $cols>";
 
 		# Required fields mark with *
 		if (isset($attributes['#required']) &&
@@ -390,7 +400,7 @@ function FormRenderElements($fields, $submitted)
 		}
 		else {
 		    $html .= "</td>";
-		    $html .= "<td>$field_html</td>";
+		    $html .= "<td align=left>$field_html</td>";
 		}
 	    }
 	    else {
-- 
GitLab