src/hg/hgc/hgc.c 1.1622
1.1622 2010/05/14 21:38:54 kent
Starting a generic click handler for containers. Not really useful now though since decided to just go straight to hgTrackUi for multiWigs.
Index: src/hg/hgc/hgc.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgc/hgc.c,v
retrieving revision 1.1621
retrieving revision 1.1622
diff -b -B -U 4 -r1.1621 -r1.1622
--- src/hg/hgc/hgc.c 14 May 2010 16:08:51 -0000 1.1621
+++ src/hg/hgc/hgc.c 14 May 2010 21:38:54 -0000 1.1622
@@ -3469,44 +3469,65 @@
genericHeader(tdb, NULL);
printTrackHtml(tdb);
}
+static void genericContainerClick(struct sqlConnection *conn, char *containerType,
+ struct trackDb *tdb, char *item, char *itemForUrl)
+/* Print page for container of some sort. */
+{
+if (sameString(containerType, "multiWig"))
+ {
+ errAbort("It's suprising that multiWig container gets to hgc. It should go to hgTrackUi.");
+ }
+else
+ {
+ errAbort("Unrecognized container type %s for %s", containerType, tdb->track);
+ }
+}
+
void genericClickHandlerPlus(
struct trackDb *tdb, char *item, char *itemForUrl, char *plus)
/* Put up generic track info, with additional text appended after item. */
{
char *dupe, *type, *words[16], *headerItem;
int wordCount;
int start = cartInt(cart, "o");
struct sqlConnection *conn = hAllocConnTrack(database, tdb);
-char *imagePath = trackDbSettingClosestToHome(tdb, ITEM_IMAGE_PATH);
+char *imagePath = trackDbSetting(tdb, ITEM_IMAGE_PATH);
+char *container = trackDbSetting(tdb, "container");
if (itemForUrl == NULL)
itemForUrl = item;
dupe = cloneString(tdb->type);
wordCount = chopLine(dupe, words);
headerItem = cloneString(item);
-if (wordCount > 0)
+/* Suppress printing item name in page header, as it is not informative for these types of
+ * tracks... */
+if (container == NULL && wordCount > 0)
{
type = words[0];
if (sameString(type, "maf") || sameString(type, "wigMaf") || sameString(type, "netAlign")
|| sameString(type, "encodePeak"))
- /* suppress printing item name in page header, as it is
- not informative for these track types */
headerItem = NULL;
else if ((sameString(type, "narrowPeak") || sameString(type, "broadPeak") || sameString(type, "gappedPeak"))
&& headerItem && sameString(headerItem, "."))
headerItem = NULL;
}
+
+/* Print header. */
genericHeader(tdb, headerItem);
printCustomUrl(tdb, itemForUrl, item == itemForUrl);
if (plus != NULL)
{
fputs(plus, stdout);
}
-if (wordCount > 0)
+if (container != NULL)
+ {
+ genericContainerClick(conn, container, tdb, item, itemForUrl);
+ }
+else if (wordCount > 0)
{
type = words[0];
if (sameString(type, "bed"))
{