dacec81196967c10d494c7b77a49cc41a5aa63ce kent Thu Jan 28 22:10:56 2021 -0800 Making a couple of more variables use the varPrefix rather than be hard coded. diff --git src/hg/hgFacetedBars/hgFacetedBars.c src/hg/hgFacetedBars/hgFacetedBars.c index 0cfc09f..d01c3e7 100644 --- src/hg/hgFacetedBars/hgFacetedBars.c +++ src/hg/hgFacetedBars/hgFacetedBars.c @@ -9,84 +9,154 @@ #include "web.h" #include "cheapcgi.h" #include "cart.h" #include "hui.h" #include "udc.h" #include "knetUdc.h" #include "genbank.h" #include "tablesTables.h" /* Global Variables */ struct cart *cart; /* CGI and other variables */ struct hash *oldVars = NULL; char *database = NULL; char *genome = NULL; -void doBody() +struct facetedTable +/* Help manage a faceted table */ { -struct sqlConnection *conn = sqlConnect(database); -struct hash *emptyHash = hashNew(0); + struct facetedTable *next; + char *name; /* Name of file or database table */ + char *varPrefix; /* Prefix used on variables */ + }; -/* Write out html to pull in the other files we use. */ +struct facetedTable *facetedTableNew(char *name, char *varPrefix) +{ +struct facetedTable *ft; +AllocVar(ft); +ft->name = cloneString(name); +ft->varPrefix = cloneString(varPrefix); +return ft; +} + +void facetedTableFree(struct facetedTable **pFt) +/* Free up resources associated with faceted table */ +{ +struct facetedTable *ft = *pFt; +if (ft != NULL) + { + freeMem(ft->name); + freeMem(ft->varPrefix); + freez(pFt); + } +} + + +void facetedTableWebInit(struct facetedTable *ft) +/* Print out scripts and css that we need. We should be in a page body or title. */ +{ webIncludeResourceFile("facets.css"); printf("\t\t"); printf("\t\t\n" "\n" "\t\t\n" "\t\t\n" "\n" "\t\t\n" "\t\t\n" ); +} -/* Working within a form we save context */ -printf("
\n"); hashFree(&emptyHash); sqlDisconnect(&conn);