svn commit: samba r7131 - in branches/SAMBA_4_0/swat/scripting: .

tridge at samba.org tridge at samba.org
Tue May 31 02:24:50 GMT 2005


Author: tridge
Date: 2005-05-31 02:24:50 +0000 (Tue, 31 May 2005)
New Revision: 7131

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7131

Log:
support sub-object arrays when displaying objects. This allows the ldb test to 
correctly display multi-value attributes like objectClass

Modified:
   branches/SAMBA_4_0/swat/scripting/common.js


Changeset:
Modified: branches/SAMBA_4_0/swat/scripting/common.js
===================================================================
--- branches/SAMBA_4_0/swat/scripting/common.js	2005-05-31 02:23:47 UTC (rev 7130)
+++ branches/SAMBA_4_0/swat/scripting/common.js	2005-05-31 02:24:50 UTC (rev 7131)
@@ -82,12 +82,32 @@
 
 
 /*
-  display a ejs object as a table
+  display a table element
 */
+function table_element(i, o) {
+	write("<tr><td>" + i + "</td><td>");
+	if (typeof(o[i]) == "object") {
+		var first;
+		first = true;
+		for (j in o[i]) {
+			if (first == false) {
+				write("<br />");
+			}
+			write(o[i][j]);
+			first = false;
+		}
+	} else {
+		write(o[i]);
+	}
+	write("</td></tr>\n");
+}
+/*
+  display a ejs object as a table. The header is optional
+*/
 function simple_table(v) {
 	write("<table class=\"data\">\n");
 	for (r in v) {
-		write("<tr><td>" + r + "</td><td>" + v[r] + "</td></tr>\n");
+		table_element(r, v);
 	}
 	write("</table>\n");
 }
@@ -103,8 +123,7 @@
 		write("<tr><th colspan=2>" + v[header] + "</th></tr>\n");
 		for (r in v) {
 			if (r != header) {
-				write("<tr><td align=left>" + r + 
-				      "</td><td align=left>" + v[r] + "</td></tr>\n");
+			    table_element(r, v);
 			}
 		}
 	}



More information about the samba-cvs mailing list