f307d65144ee95bd8afcfd61ca437b6f3fb1c0aa
kent
  Wed Aug 4 16:43:01 2010 -0700
Adding hPrintAbbreviationTable to library so can use it in both hgc and hgTrackUi.
diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index ab74a11..7c449a3 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -23,6 +23,7 @@
 #include "customTrack.h"
 #include "encode/encodePeak.h"
 #include "mdb.h"
+#include "web.h"
 
 static char const rcsid[] = "$Id: hui.c,v 1.297 2010/06/02 19:27:51 tdreszer Exp $";
 
@@ -6583,3 +6584,25 @@
 return normScoreAvailable;
 }
 
+void hPrintAbbreviationTable(struct sqlConnection *conn, char *sourceTable, char *label)
+/* Print out table of abbreviations. */
+{
+char query[256];
+safef(query, sizeof(query), "select name,description from %s order by name", sourceTable);
+struct sqlResult *sr = sqlGetResult(conn, query);
+webPrintLinkTableStart();
+webPrintLabelCell("Symbol");
+webPrintLabelCell(label);
+char **row;
+while ((row = sqlNextRow(sr)) != NULL)
+    {
+    printf("</TR><TR>\n");
+    char *name = row[0];
+    char *description = row[1];
+    webPrintLinkCell(name);
+    webPrintLinkCell(description);
+    }
+sqlFreeResult(&sr);
+webPrintLinkTableEnd();
+}
+