3846f517009c43abc65d227a4695645c9b5f3e8a braney Fri Feb 15 18:31:21 2013 -0800 changes necessary to support assembly hubs (#8072) diff --git src/hg/hgTables/mainPage.c src/hg/hgTables/mainPage.c index 8a4a0aa..044b415 100644 --- src/hg/hgTables/mainPage.c +++ src/hg/hgTables/mainPage.c @@ -6,30 +6,31 @@ #include "htmshell.h" #include "cheapcgi.h" #include "cart.h" #include "textOut.h" #include "jksql.h" #include "hdb.h" #include "web.h" #include "jsHelper.h" #include "hui.h" #include "hgColors.h" #include "trackDb.h" #include "grp.h" #include "hgTables.h" #include "joiner.h" #include "hubConnect.h" +#include "trackHub.h" int trackDbCmpShortLabel(const void *va, const void *vb) /* Sort track by shortLabel. */ { const struct trackDb *a = *((struct trackDb **)va); const struct trackDb *b = *((struct trackDb **)vb); return strcmp(a->shortLabel, b->shortLabel); } static struct dyString *onChangeStart() /* Start up a javascript onChange command */ { struct dyString *dy = jsOnChangeStart(); jsDropDownCarryOver(dy, hgtaTrack); @@ -396,37 +397,40 @@ hPrintf("<OPTION VALUE=\"%s\"", name->name); if (sameString(selTable, name->name)) { hPrintf(" SELECTED"); selTdb = tdb; } if (tdb != NULL) if ((curTrack == NULL) || differentWord(tdb->shortLabel, curTrack->shortLabel)) hPrintf(">%s (%s)\n", tdb->shortLabel, name->name); else hPrintf(">%s\n", name->name); else hPrintf(">%s\n", name->name); } hPrintf("</SELECT>\n"); +if (!trackHubDatabase(database)) + { char *restrictDate = encodeRestrictionDateDisplay(database,selTdb); if (restrictDate) { hPrintf("<A HREF=\'%s\' TARGET=BLANK>restricted until:</A> %s", ENCODE_DATA_RELEASE_POLICY, restrictDate); freeMem(restrictDate); } + } return selTable; } struct outputType /* Info on an output type. */ { struct outputType *next; char *name; /* Symbolic name of type. */ char *label; /* User visible label. */ }; static void showOutDropDown(struct outputType *otList, struct outputType *otDefault) /* Display output drop-down. */ @@ -658,31 +662,34 @@ struct trackDb *tdb = hTrackDbForTrack(database, curTable); struct trackDb *cTdb = hCompositeTrackDbForSubtrack(database, tdb); if (cTdb) curTrack = cTdb; else curTrack = tdb; isMaf = isMafTable(database, curTrack, curTable); } /* Region line */ { char *regionType = cartUsualString(cart, hgtaRegionType, hgtaRegionTypeGenome); char *range = cartUsualString(cart, hgtaRange, ""); if (isPositional) { - boolean doEncode = sqlTableExists(conn, "encodeRegions"); + boolean doEncode = FALSE; + + if (!trackHubDatabase(database)) + doEncode = sqlTableExists(conn, "encodeRegions"); hPrintf("<TR><TD><B>region:</B>\n"); /* If regionType not allowed force it to "genome". */ if ((sameString(regionType, hgtaRegionTypeUserRegions) && userRegionsFileName() == NULL) || (sameString(regionType, hgtaRegionTypeEncode) && !doEncode)) regionType = hgtaRegionTypeGenome; jsTrackingVar("regionType", regionType); makeRegionButton(hgtaRegionTypeGenome, regionType); hPrintf(" genome "); if (doEncode) { makeRegionButton(hgtaRegionTypeEncode, regionType); hPrintf(" ENCODE Pilot regions ");