Ejemplo n.º 1
0
static void showBedTableFields(char *db, char *table, int fieldCount, boolean withGetButton)
/* Put up html table with a check box for each field of custom
 * track. */
{
struct slName *field, *fieldList = getBedFields(fieldCount);

hTableStart();
for (field = fieldList; field != NULL; field = field->next)
    {
    char *var = checkVarName(db, table, field->name);
    hPrintf("<TR><TD>");
    cgiMakeCheckBox(var, varOn(var));
    hPrintf("</TD><TD>");
    hPrintf(" %s<BR>\n", field->name);
    hPrintf("</TD></TR>");
    }
hTableEnd();
showTableButtons(db, table, withGetButton);
}
static void makeCtOrderedCommaFieldList(struct joinerDtf *dtfList,
                                        struct dyString *dy)
/* Make comma-separated field list in same order as fields are in
 * custom track. */
{
    char *track = dtfList->table;
    struct customTrack *ct = ctLookupName(track);
    char *type = ct->dbTrackType;
    struct slName *fieldList = NULL;
    if (startsWithWord("makeItems", type) || sameWord("bedDetail", type) || sameWord("pgSnp", type))
    {
        struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH);
        fieldList = sqlListFields(conn, ct->dbTableName);
        hFreeConn(&conn);
    }
    else
    {
        fieldList = getBedFields(15);
    }
    makeOrderedCommaFieldList(fieldList, dtfList, dy);
    slFreeList(&fieldList);
}