Index: src/hg/hgc/hgc.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgc/hgc.c,v
retrieving revision 1.1583
retrieving revision 1.1584
diff -b -B -U 4 -r1.1583 -r1.1584
--- src/hg/hgc/hgc.c	14 Dec 2009 18:01:46 -0000	1.1583
+++ src/hg/hgc/hgc.c	4 Jan 2010 19:12:26 -0000	1.1584
@@ -2470,29 +2470,14 @@
     }
 pslFreeList(&pslList);
 }
 
-char *getParentTrackName(struct trackDb *tdb)
+
+static char *getParentTrackName(struct trackDb *tdb)
 /* Get the track table name or composite track parent name if applicable. */
 {
-char *trackTable = trackDbSetting(tdb, "subTrack");
-if (trackTable == NULL)
-    {
-    /* Look for parentWigMaf passed in explicitly via CGI, not from cart.
-     * tdb->type in this case is wig not wigMaf... */
-    trackTable = cgiUsualString("parentWigMaf", NULL);
-    if (trackTable == NULL)
-	trackTable = tdb->tableName;
-    trackTable = cloneString(trackTable);
-    }
-else
-    {
-    /* trim off extra words in subTrack setting, if any: */
-    char *words[2];
-    if (chopLine(cloneString(trackTable), words) > 0)
-	trackTable = words[0];
-    }
-return trackTable;
+tdb = trackDbTopLevelSelfOrParent(tdb);
+return tdb->tableName;
 }
 
 void printTBSchemaLink(struct trackDb *tdb)
 /* Make link to TB schema -- unless this is an on-the-fly (tableless) track. */
@@ -2553,20 +2538,21 @@
 void printOrigAssembly(struct trackDb *tdb)
 /* If this annotation has been lifted, print the original
  * freeze, as indicated by the "origAssembly" trackDb setting */
 {
-char *composite;
-struct trackDb *fullTdb = NULL;
+trackDbOrigAssembly(tdb);
+trackDbPrintOrigAssembly(tdb, database);
+}
 
-if (!trackDbOrigAssembly(tdb))
+static char *getHtmlFromSelfOrParent(struct trackDb *tdb)
+/* Get html from self or from parent if not in self. */
+{
+for (;tdb != NULL; tdb = tdb->parent)
     {
-    /* look in composite's settings */
-    if ((composite = trackDbSetting(tdb, "subTrack")) != NULL)
-        fullTdb = hashFindVal(trackHash, composite);
-    if (fullTdb != NULL)
-        tdb = fullTdb;
+    if (tdb->html != NULL && tdb->html[0] != 0)
+        return tdb->html;
     }
-trackDbPrintOrigAssembly(tdb, database);
+return NULL;
 }
 
 void printTrackHtml(struct trackDb *tdb)
 /* If there's some html associated with track print it out. Also print
@@ -2591,12 +2577,13 @@
 	hFreeConn(&conn);
 	}
     printDataRestrictionDate(tdb);
     }
-if (tdb->html != NULL && tdb->html[0] != 0)
+char *html = getHtmlFromSelfOrParent(tdb);
+if (html != NULL && html[0] != 0)
     {
     htmlHorizontalLine();
-    puts(tdb->html);
+    puts(html);
     }
 hPrintf("<BR>\n");
 }
 

