4aa211ce6d56df70ecd7f54a08a1dcab7ee539a3 kate Thu Nov 2 12:06:22 2017 -0700 Add database to page title (appears in tab). diff --git src/hg/lib/cart.c src/hg/lib/cart.c index f7d158c..0d2a628 100644 --- src/hg/lib/cart.c +++ src/hg/lib/cart.c @@ -1887,51 +1887,43 @@ } } } void cartHtmlShellWithHead(char *head, char *title, void (*doMiddle)(struct cart *cart), char *cookieName, char **exclude, struct hash *oldVars) /* Load cart from cookie and session cgi variable. Write web-page * preamble including head and title, call doMiddle with cart, and write end of web-page. * Exclude may be NULL. If it exists it's a comma-separated list of * variables that you don't want to save in the cart between * invocations of the cgi-script. */ { struct cart *cart; char *db, *org, *pos; char titlePlus[2048]; -char extra[2048]; pushWarnHandler(cartEarlyWarningHandler); cart = cartAndCookie(cookieName, exclude, oldVars); getDbAndGenome(cart, &db, &org, oldVars); pos = cartGetPosition(cart, db, NULL); pos = addCommasToPos(db, stripCommas(pos)); if (pos != NULL && oldVars != NULL) { - struct hashEl *oldpos = hashLookup(oldVars, positionCgiName); - if(oldpos != NULL && differentString(pos,oldpos->val)) - cartSetString(cart,"lastPosition",oldpos->val); - } -*extra = 0; -if (pos == NULL && org != NULL) - safef(titlePlus,sizeof(titlePlus), "%s%s - %s",trackHubSkipHubName(org), extra, title ); -else if (pos != NULL && org == NULL) - safef(titlePlus,sizeof(titlePlus), "%s - %s",pos, title ); -else if (pos == NULL && org == NULL) - safef(titlePlus,sizeof(titlePlus), "%s", title ); -else - safef(titlePlus,sizeof(titlePlus), "%s%s %s - %s",trackHubSkipHubName(org), extra,pos, title ); + struct hashEl *oldPos = hashLookup(oldVars, positionCgiName); + if (oldPos != NULL && differentString(pos, oldPos->val)) + cartSetString(cart, "lastPosition", oldPos->val); + } +safef(titlePlus, sizeof(titlePlus), "%s %s %s %s", + org ? trackHubSkipHubName(org) : "", db ? db : "", pos ? pos : "", title); popWarnHandler(); setThemeFromCart(cart); htmStartWithHead(stdout, head, titlePlus); cartWarnCatcher(doMiddle, cart, htmlVaWarn); cartCheckout(&cart); cartFooter(); } static void cartEmptyShellMaybeContent(void (*doMiddle)(struct cart *cart), char *cookieName, char **exclude, struct hash *oldVars, boolean doContentType) /* Get cart and cookies and set up error handling. * If doContentType, print out Content-type:text/html * but don't start writing any html yet. * The doMiddleFunction has to call cartHtmlStart(title), and * cartHtmlEnd(), as well as writing the body of the HTML.