a2e61e016375032eb6250cf4d931979100808b80
galt
  Tue Aug 5 12:45:32 2014 -0700
Adding more flexibility so that if genomeSpace is not configured in hg.conf (or set to blank values), then it will be ignored, and GS will not appear in hgTables pages: mainPage, usage, etc.
diff --git src/hg/hgTables/mainPage.c src/hg/hgTables/mainPage.c
index 2441874..d66fddd 100644
--- src/hg/hgTables/mainPage.c
+++ src/hg/hgTables/mainPage.c
@@ -457,47 +457,56 @@
 for (ot = otList; ot != NULL; ot = ot->next)
     {
     hPrintf(" <OPTION VALUE=%s", ot->name);
     if (sameString(ot->name, outputType))
 	hPrintf(" SELECTED");
     if (sameString(ot->name, outBed) || sameString(ot->name, outWigBed))
         hPrintf(" id=\"outBed\"");
     hPrintf(">%s\n", ot->label);
     }
 hPrintf("</SELECT>\n");
 hPrintf(" ");
 
 if (!cfgOptionBooleanDefault("hgta.disableSendOutput", FALSE))
     {
     hPrintf(" Send output to ");
+    struct dyString *dy = dyStringNew(256);
+    dyStringAppend(dy, 
+	"onclick=\"document.getElementById('checkboxGreat').checked=false;");
+    if (isGenomeSpaceEnabled())
+	dyStringAppend(dy, 
+	      	  "document.getElementById('checkboxGenomeSpace').checked=false;\"");
+    dyStringAppend(dy, 
+	      	  "return true;\"");
     cgiMakeCheckBoxIdAndJS("sendToGalaxy", doGalaxy(),
-        "checkboxGalaxy",
-	"onclick=\"document.getElementById('checkboxGreat').checked=false;"
-	      	  "document.getElementById('checkboxGenomeSpace').checked=false; return true;\"");
+        "checkboxGalaxy", dy->string);
     hPrintf("<A HREF=\""GALAXY_URL_BASE"\" target=_BLANK>Galaxy</A>\n");
     nbSpaces(2);
     cgiMakeCheckBoxIdAndJS("sendToGreat", doGreat(),
         "checkboxGreat",
         "onclick=\"return onSelectGreat();\"");
     hPrintf(" <A HREF=\"http://great.stanford.edu\" target=_BLANK>GREAT</A>");
+    if (isGenomeSpaceEnabled())
+	{
 	nbSpaces(2);
 	cgiMakeCheckBoxIdAndJS("sendToGenomeSpace", doGenomeSpace(),
 	    "checkboxGenomeSpace",
 	    "onclick=\"document.getElementById('checkboxGreat').checked=false;"
 		      "document.getElementById('checkboxGalaxy').checked=false; return true;\"");
 	hPrintf(" <A HREF=\"http://www.genomespace.org\" target=_BLANK>GenomeSpace</A>");
 	}
+    }
 
 hPrintf("</TD></TR>\n");
 }
 
 struct outputType otAllFields = { NULL,	outPrimaryTable,"all fields from selected table", };
 struct outputType otSelected =  { NULL, outSelectedFields,
                                   "selected fields from primary and related tables",  };
 struct outputType otSequence =  { NULL, outSequence,    "sequence", };
 struct outputType otPal =       { NULL, outPalOptions,
                                   "CDS FASTA alignment from multiple alignment", };
 struct outputType otGff =         { NULL, outGff,         "GTF - gene transfer format", };
 struct outputType otBed =         { NULL, outBed,         "BED - browser extensible data", };
 struct outputType otCustomTrack = { NULL, outCustomTrack, "custom track", };
 struct outputType otHyperlinks =  { NULL, outHyperlinks,  "hyperlinks to Genome Browser", };
 struct outputType otWigData =     { NULL, outWigData,     "data points", };
@@ -935,65 +944,81 @@
 	hPrintf(" ");
 	}
 
 #ifdef SOMETIMES
     hPrintf(" ");
     cgiMakeButton(hgtaDoTest, "test");
 #endif /* SOMETIMES */
     }
 hPrintf("<P>"
 	"To reset <B>all</B> user cart settings (including custom tracks), \n"
 	"<A HREF=\"/cgi-bin/cartReset?destination=%s\">click here</A>.\n",
 	getScriptName());
 
 }
 
+static char *getGenomeSpaceText()
+/* fetch GenomeSpace text if enabled */
+{
+if (isGenomeSpaceEnabled())
+    {
+    return 
+  "Send data to "
+  "<A HREF=\"http://www.genomespace.org\" target=_BLANK>GenomeSpace</A> for use with diverse computational tools. ";
+    }
+else
+    {
+    return "";
+    }
+}
+
 void mainPageAfterOpen(struct sqlConnection *conn)
 /* Put up main page assuming htmlOpen()/htmlClose()
  * will happen in calling routine. */
 {
-hPrintf("%s",
+hPrintf(
   "Use this program to retrieve the data associated with a track in text "
   "format, to calculate intersections between tracks, and to retrieve "
   "DNA sequence covered by a track. For help in using this application "
   "see <A HREF=\"#Help\">Using the Table Browser</A> for a description "
   "of the controls in this form, the "
   "<A HREF=\"../goldenPath/help/hgTablesHelp.html\">User's Guide</A> for "
   "general information and sample queries, and the OpenHelix Table Browser "
   "<A HREF=\"http://www.openhelix.com/cgi/tutorialInfo.cgi?id=28\" "
   "TARGET=_blank>tutorial</A> for a narrated presentation of the software "
   "features and usage. "
   "For more complex queries, you may want to use "
   "<A HREF=\""GALAXY_URL_BASE"\" target=_BLANK>Galaxy</A> or "
   "our <A HREF=\"../goldenPath/help/mysql.html\">public "
   "MySQL server</A>. "
   "To examine the biological function of your set through annotation "
   "enrichments, send the data to "
   "<A HREF=\"http://great.stanford.edu\" target=_BLANK>GREAT</A>. "
-  "Send data to "
-  "<A HREF=\"http://www.genomespace.org\" target=_BLANK>GenomeSpace</A> for use with diverse computational tools. "
+  "%s"
   "Refer to the "
   "<A HREF=\"../goldenPath/credits.html\">Credits</A> page for the list of "
   "contributors and usage restrictions associated with these data. "
   "All tables can be downloaded in their entirety from the "
   "<A HREF=\"http://hgdownload.cse.ucsc.edu/downloads.html\""
   ">Sequence and Annotation Downloads</A> page."
+   , getGenomeSpaceText()
    );
 
 hPrintf("<script type=\"text/javascript\">\n");
 hPrintf("function onSelectGreat() {\n");
 hPrintf("document.getElementById('checkboxGalaxy').checked=false;\n");
+if (isGenomeSpaceEnabled())
     hPrintf("document.getElementById('checkboxGenomeSpace').checked=false;\n");
 hPrintf("document.getElementById('outBed').selected=true;\n");
 hPrintf("return true;\n");
 hPrintf("}\n");
 hPrintf("</script>\n");
 
 
 /* Main form. */
 hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=%s>\n",
 	getScriptName(), cartUsualString(cart, "formMethod", "POST"));
 cartSaveSession(cart);
 jsInit();
 showMainControlTable(conn);
 hPrintf("</FORM>\n");