9663375b93c2684fa84209ae6a663d9c540a9574
tdreszer
  Mon Feb 7 12:28:48 2011 -0800
Refinements of link to full track list as suggested by QA
diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c
index bcb8805..d1509c9 100644
--- src/hg/hgTrackUi/hgTrackUi.c
+++ src/hg/hgTrackUi/hgTrackUi.c
@@ -10,30 +10,31 @@
 #include "hdb.h"
 #include "hCommon.h"
 #include "hui.h"
 #include "fileUi.h"
 #include "ldUi.h"
 #include "snpUi.h"
 #include "snp125Ui.h"
 #include "snp125.h"
 #include "sample.h"
 #include "wiggle.h"
 #include "hgMaf.h"
 #include "obscure.h"
 #include "chainCart.h"
 #include "chainDb.h"
 #include "gvUi.h"
+#include "grp.h"
 #include "oregannoUi.h"
 #include "chromGraph.h"
 #include "hgConfig.h"
 #include "customTrack.h"
 #include "dbRIP.h"
 #include "tfbsConsSites.h"
 #include "hapmapSnps.h"
 #include "nonCodingUi.h"
 #include "expRecord.h"
 #include "wikiTrack.h"
 #include "hubConnect.h"
 #include "trackHub.h"
 #include "pcrResult.h"
 #include "dgv.h"
 #include "transMapStuff.h"
@@ -2562,32 +2563,41 @@
 printf("<B style='font-family:serif; font-size:200%%;'>%s%s</B>\n", tdb->longLabel, tdbIsSuper(tdb) ? " Tracks" : "");
 
 /* Print link for parent track */
 if (!ajax)
     {
     if (tdb->parent)
         {
         char *encodedMapName = cgiEncode(tdb->parent->track);
         printf("&nbsp;&nbsp;<B style='font-family:serif; font-size:100%%;'>(<A HREF=\"%s?%s=%u&c=%s&g=%s\" title='Link to parent track'><IMG height=12 src='../images/ab_up.gif'>%s</A>)</B>",
                     hgTrackUiName(), cartSessionVarName(), cartSessionId(cart),
                     chromosome, encodedMapName, tdb->parent->shortLabel);
         freeMem(encodedMapName);
         }
     else
         {
-        printf("&nbsp;&nbsp;<B style='font-family:serif; font-size:100%%;'>(<A HREF=\"%s?%s=%u&c=%s&hgTracksConfigPage=configure\" title='Full track configuration page'><IMG height=12 src='../images/ab_up.gif'>Full track list</A>)</B>",
-                    hgTracksName(), cartSessionVarName(), cartSessionId(cart),chromosome);
+        struct grp *grp, *grps = hLoadGrps(database);
+        for (grp = grps; grp != NULL; grp = grp->next)
+            {
+            if (sameString(grp->name,tdb->grp))
+                {
+                printf("&nbsp;&nbsp;<B style='font-family:serif; font-size:100%%;'>(<A HREF=\"%s?%s=%u&c=%s&hgTracksConfigPage=configure&hgtgroup_%s_close=0#%sGroup\" title='%s tracks in track configuration page'><IMG height=12 src='../images/ab_up.gif'>All %s%s</A>)</B>",
+                        hgTracksName(), cartSessionVarName(), cartSessionId(cart),chromosome,tdb->grp,tdb->grp,grp->label,grp->label,endsWith(grp->label," Tracks")?"":" tracks");
+                break;
+                }
+            }
+        grpFreeList(&grps);
         }
     }
     puts("<BR><BR>");
 
 if (ct && sameString(tdb->type, "maf"))
     tdb->canPack = TRUE;
 else if (sameString(tdb->track, WIKI_TRACK_TABLE))
     // special case wikiTrack (there's no trackDb entry); fixes redmine 2395
     tdb->canPack = TRUE;
 
 // Don't bother with vis controls for downloadsOnly
 if (!tdbIsDownloadsOnly(tdb))
     {
     /* Display visibility menu */
         if (tdbIsComposite(tdb) && multViewCount(tdb) > 0)