37a331259beee4fa8ebe7aa7f4d5b9d765a14c7f kent Thu Jan 6 15:45:34 2011 -0800 Starting to make hgHubConnect talk with hgTracks and hgTrackUi. Right now the tracks appear on the track list, but are not displaying properly. diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c index fb4a710..c368772 100644 --- src/hg/hgHubConnect/hgHubConnect.c +++ src/hg/hgHubConnect/hgHubConnect.c @@ -46,30 +46,31 @@ return TRUE; } commaList = strchr(commaList, ','); if (commaList == NULL) return FALSE; commaList += 1; } } void hgHubConnect() /* Put up the list of hubs and other controls for the page. */ { destUrl = cartUsualString(cart, hgHubConnectCgiDestUrl, destUrl); printf("<FORM ACTION=\"%s\" METHOD=\"POST\" NAME=\"mainForm\">\n", destUrl); cartSaveSession(cart); +cgiMakeHiddenVar(hgHubConnectRemakeTrackHub, "on"); printf( "<P>Track hubs are collections of tracks from outside of UCSC that can be imported into the " "Genome Browser. To import a hub check the box in the list below. " "After import the hub will show up as a group of tracks with it's own blue " "bar and label underneath the main browser graphic, and in the configure page. To arrange " "for your own track hub to appear in this list, please contact genome@soe.ucsc.edu.</P>\n" ); getDbAndGenome(cart, &database, &organism, oldVars); printf("<B>genome:</B> %s <B>assembly:</B> %s [%s] ", organism, hFreezeDate(database), database); cgiMakeButton("submit", "submit"); printf("<BR>"); struct sqlConnection *conn = hConnectCentral(); char query[512]; safef(query, sizeof(query), "select id,shortLabel,longLabel,errorMessage,hubUrl,dbList from %s", @@ -79,45 +80,45 @@ boolean gotAnyRows = FALSE; while ((row = sqlNextRow(sr)) != NULL) { char *id = row[0], *shortLabel = row[1], *longLabel = row[2], *errorMessage = row[3], *url = row[4], *dbList = row[5]; if (nameInCommaList(database, dbList)) { if (gotAnyRows) webPrintLinkTableNewRow(); else { webPrintLinkTableStart(); gotAnyRows = TRUE; } - if (errorMessage) - webPrintLinkCell("error"); - else + if (isEmpty(errorMessage)) { webPrintLinkCellStart(); char hubName[32]; - safef(hubName, sizeof(hubName), "hub_%s", id); + safef(hubName, sizeof(hubName), "%s%s", hgHubConnectHubVarPrefix, id); cartMakeCheckBox(cart, hubName, FALSE); webPrintLinkCellEnd(); } - webPrintLinkCell(shortLabel); - if (errorMessage) - webPrintLinkCell(errorMessage); else + webPrintLinkCell("error"); + webPrintLinkCell(shortLabel); + if (isEmpty(errorMessage)) webPrintLinkCell(longLabel); + else + webPrintLinkCell(errorMessage); webPrintLinkCell(url); } } sqlFreeResult(&sr); if (gotAnyRows) webPrintLinkTableEnd(); else printf("No Track Hubs for this genome assembly"); printf("</FORM>\n"); hDisconnectCentral(&conn); } void doMiddle(struct cart *theCart) /* Write header and body of html page. */ {