e70152e44cc66cc599ff6b699eb8adc07f3e656a
kent
Sat May 24 21:09:34 2014 -0700
Adding Copyright NNNN Regents of the University of California to all files I believe with reasonable certainty were developed under UCSC employ or as part of Genome Browser copyright assignment.
diff --git src/hg/hgc/wikiTrack.c src/hg/hgc/wikiTrack.c
index 9987c24..fd632d8 100644
--- src/hg/hgc/wikiTrack.c
+++ src/hg/hgc/wikiTrack.c
@@ -1,585 +1,588 @@
/* Handle details pages for wiggle tracks. */
+/* Copyright (C) 2013 The Regents of the University of California
+ * See README in this or parent directory for licensing information. */
+
#include "common.h"
#include "cart.h"
#include "hgc.h"
#include "hCommon.h"
#include "hgColors.h"
#include "hgConfig.h"
#include "obscure.h"
#include "binRange.h"
#include "web.h"
#include "net.h"
#include "grp.h"
#include "hui.h"
#include "htmlPage.h"
#include "wikiLink.h"
#include "wikiTrack.h"
#define ITEM_SCORE_DEFAULT "1000"
#define ADD_ITEM_COMMENT_DEFAULT "add comments"
static char *colorMenuJS = "onchange=\"updateColorSelectBox();\" style=\"width:8em;\"";
static void colorMenuOutput()
/* the item color pull-down menu in the create item form */
{
hPrintf("\n");
hPrintf("\n");
}
static char *encodedHgcReturnUrl(int id, char *table)
/* Return a CGI-encoded hgc URL with hgsid and given id. Free when done. */
{
char retBuf[1024];
int o = cartUsualInt(cart, "o", winStart);
safef(retBuf, sizeof(retBuf), "http://%s/cgi-bin/hgc?%s&g=%s&c=%s&o=%d&l=%d&r=%d&db=%s&i=%d",
cgiServerNamePort(), cartSidUrlString(cart), table, seqName,
o, winStart, winEnd, database, id);
return cgiEncode(retBuf);
}
static char *wikiTrackUserLoginUrl(int id, char *table)
/* Return the URL for the wiki user login page. */
{
char *retEnc = encodedHgcReturnUrl(id, table);
char buf[2048];
if (! wikiLinkEnabled())
errAbort("wikiLinkUserLoginUrl called when wiki is not enabled (specified "
"in hg.conf).");
safef(buf, sizeof(buf),
"%s/index.php?title=Special:UserloginUCSC&returnto=%s",
cfgOptionDefault(CFG_WIKI_URL, NULL), retEnc);
freez(&retEnc);
return(cloneString(buf));
}
void offerLogin(int id, char *loginType, char *table)
/* display login prompts to the wiki when user isn't already logged in */
{
char *wikiHost = wikiLinkHost();
char *loginUrl = wikiTrackUserLoginUrl(id, table);
printf("
Please login to %s the annotation track.
\n", loginType);
printf("
The login page is handled by our "
"wiki system:\n", wikiHost);
printf("click here to login. \n", loginUrl);
printf("The wiki also serves as a forum for users "
"to share knowledge and ideas.\n
\n");
freeMem(loginUrl);
freeMem(wikiHost);
webIncludeHelpFile("wikiTrackAddCommentHelp", TRUE);
webIncludeHelpFile("wikiTrack", TRUE);
}
static void startForm(char *name, char *actionType)
{
hPrintf("\n");
}
hPrintf("View the wiki article "
"%s: to see "
"existing comments. \n",
url, item->descriptionKey, item->descriptionKey);
if (NULL != userName)
hPrintf("Mark this wiki article as "
"watched"
" to receive email notices of any comment additions. \n",
url, item->descriptionKey);
hPrintf("\n");
if (NULL == userName)
{
if (! wikiTrackReadOnly() ) /* read-only option 2012-06-25 */
offerLogin(item->id, "add comments to items on", WIKI_TRACK_TABLE);
}
else if (emailVerified(TRUE)) /* do print message when not verified */
{
startForm("addComments", G_ADD_WIKI_COMMENTS);
char idString[128];
safef(idString, ArraySize(idString), "%d", item->id);
cgiMakeHiddenVar("i", idString);
hPrintf("\n");
webPrintLinkTableStart();
/* first row is a title line */
char label[256];
safef(label, ArraySize(label),
"'%s' quick add comments to item '%s'\n", userName, item->name);
webPrintWideLabelCell(label, 2);
webPrintLinkTableNewRow();
/* second row is initial comment/description text entry */
webPrintWideCellStart(2, HG_COL_TABLE);
cgiMakeTextArea(NEW_ITEM_COMMENT, ADD_ITEM_COMMENT_DEFAULT, 3, 70);
webPrintLinkCellEnd();
webPrintLinkTableNewRow();
/*webPrintLinkCellStart(); more careful explicit alignment */
hPrintf("