fa815602bbac262a6e07ac577e40558abcf93144 max Tue Oct 15 04:53:53 2024 -0700 suppress download link for protected tracks, refs #34629 diff --git src/hg/hgTables/hgTables.c src/hg/hgTables/hgTables.c index b22fa39..15b2ec1 100644 --- src/hg/hgTables/hgTables.c +++ src/hg/hgTables/hgTables.c @@ -222,41 +222,49 @@ return curTrack->shortLabel; else return curTable; } char *getScriptName() /* returns script name from environment or hardcoded for command line */ { char *script = cgiScriptName(); if (script != NULL) return script; else return hgTablesName(); } -void printDownloadLink(char *typeLabel, char *fileName) +void printDownloadLink(char *typeLabel, struct trackDb *tdb, char *fileName) /* print a link to the file, so the user can download it right here */ { if (fileName==NULL) return; + +boolean disableGenome = (tdb && cartTrackDbIsNoGenome(database, tdb->table)); + +if (disableGenome) + printNoGenomeWarning(tdb); +else + { char *downPrefix = ""; if (startsWith("/gbdb", fileName)) downPrefix = "https://hgdownload.soe.ucsc.edu"; hPrintf("<B>%s File Download:</B> <A HREF='%s%s'>%s</A>", typeLabel, downPrefix, fileName, fileName); } +} boolean printTypeHelpDesc(char *type) /* print a little link to our help docs given a track type. Return true if file type is a big* file format. */ { boolean isBig = FALSE; if (startsWith("vcf", type)) { hPrintf("See the <A HREF=\"%s\" target=_blank>Variant Call Format specification</A> for more details<BR>\n", "http://www.1000genomes.org/wiki/analysis/vcf4.0"); } else if (startsWithWord("bigWig", type)) { printf("<BR>The data is stored in the binary " "<A HREF=\"/goldenPath/help/bigWig.html\" TARGET=_BLANK>"