/* configure - Do configuration page. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "cheapcgi.h" #include "obscure.h" #include "jksql.h" #include "htmshell.h" #include "hdb.h" #include "cart.h" #include "web.h" #include "hgExp.h" #include "hgColors.h" #include "hgNear.h" char *configVarName(struct column *col, char *varName) /* Return variable name for configuration. */ { static char name[64]; safef(name, sizeof(name), "%s%s.%s", colConfigPrefix, col->name, varName); return name; } char *configVarVal(struct column *col, char *varName) /* Return value for configuration variable. Return NULL if it * doesn't exist or if it is "" */ { char *name = configVarName(col, varName); return cartNonemptyString(cart, name); } static void configTable(struct column *colList, struct sqlConnection *conn) /* Write out configuration table */ { struct column *col; char varName[128]; boolean isVis; hPrintf("
Name | "); hPrintf("On | "); hPrintf("Position | "); hPrintf("Description | "); hPrintf("Configuration | "); /* Print out configuration controls. */ hPrintf("
---|---|---|---|---|
%s | ", col->shortLabel); /* Do on/off dropdown. */ hPrintf(""); safef(varName, sizeof(varName), "%s%s.vis", colConfigPrefix, col->name); isVis = cartUsualBoolean(cart, varName, col->on); cgiMakeCheckBox(varName, isVis); hPrintf(" | "); /* Do left/right button */ hPrintf(""); safef(varName, sizeof(varName), "near.do.up.%s", col->name); if (col != colList) { hPrintf(""); } safef(varName, sizeof(varName), "near.do.down.%s", col->name); if (col->next != NULL) { hPrintf(""); } hPrintf(" | "); /* Do long label. */ hPrintf("%s | ", col->longLabel); /* Do configuration controls. */ if (col->configControls != NULL) col->configControls(col); else hPrintf("n/a | "); hPrintf("
"); cgiMakeButton("submit", "submit"); hPrintf(" | "); hPrintf(" | "); hPrintf(" | "); hPrintf("Columns:"); hPrintf(" | "); cgiMakeButton(hideAllConfName, "hide all"); hPrintf(" | "); cgiMakeButton(showAllConfName, "show all"); hPrintf(" | "); cgiMakeButton(defaultConfName, "default"); hPrintf(" | "); hPrintf("Settings:"); hPrintf(" | "); cgiMakeButton(saveCurrentConfName, "save"); hPrintf(" | "); cgiMakeOptionalButton(useSavedConfName, "load", !userSettingsAnySaved(us)); hPrintf(" |
"); hPrintf("Expression ratio colors: "); hgExpColorDropDown(cart, expRatioColorVarName); hPrintf(" | "); hPrintf("Show all splicing variants: "); cgiMakeCheckBox(showAllSpliceVarName, cartUsualBoolean(cart, showAllSpliceVarName, FALSE)); hPrintf(" | "); cgiMakeButton(customPageDoName, "custom columns"); hPrintf(" |