mirror of https://github.com/acanas/swad-core.git
Version19.48
This commit is contained in:
parent
353dc63f92
commit
2f0d018c6b
55
swad_HTML.c
55
swad_HTML.c
|
@ -63,6 +63,7 @@ static unsigned HTM_DIV_NestingLevel = 0;
|
|||
static unsigned HTM_UL_NestingLevel = 0;
|
||||
static unsigned HTM_LI_NestingLevel = 0;
|
||||
static unsigned HTM_A_NestingLevel = 0;
|
||||
static unsigned HTM_TEXTAREA_NestingLevel = 0;
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Private prototypes ****************************/
|
||||
|
@ -84,6 +85,8 @@ static void HTM_LI_BeginWithoutAttr (void);
|
|||
|
||||
static void HTM_A_BeginWithoutAttr (void);
|
||||
|
||||
static void HTM_TEXTAREA_BeginWithoutAttr (void);
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************* Start/end table *****************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -704,6 +707,58 @@ void HTM_A_End (void)
|
|||
HTM_A_NestingLevel--;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************************* Text areas ********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void HTM_TEXTAREA_Begin (const char *fmt,...)
|
||||
{
|
||||
va_list ap;
|
||||
int NumBytesPrinted;
|
||||
char *Attr;
|
||||
|
||||
if (fmt)
|
||||
{
|
||||
if (fmt[0])
|
||||
{
|
||||
va_start (ap,fmt);
|
||||
NumBytesPrinted = vasprintf (&Attr,fmt,ap);
|
||||
va_end (ap);
|
||||
|
||||
if (NumBytesPrinted < 0) // If memory allocation wasn't possible,
|
||||
// or some other error occurs,
|
||||
// vasprintf will return -1
|
||||
Lay_NotEnoughMemoryExit ();
|
||||
|
||||
/***** Print HTML *****/
|
||||
fprintf (Gbl.F.Out,"<textarea %s>",Attr);
|
||||
|
||||
free ((void *) Attr);
|
||||
}
|
||||
else
|
||||
HTM_TEXTAREA_BeginWithoutAttr ();
|
||||
}
|
||||
else
|
||||
HTM_TEXTAREA_BeginWithoutAttr ();
|
||||
|
||||
HTM_TEXTAREA_NestingLevel++;
|
||||
}
|
||||
|
||||
static void HTM_TEXTAREA_BeginWithoutAttr (void)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<textarea>");
|
||||
}
|
||||
|
||||
void HTM_TEXTAREA_End (void)
|
||||
{
|
||||
if (HTM_TEXTAREA_NestingLevel == 0) // No TEXTAREA open
|
||||
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened TEXTAREA.");
|
||||
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
|
||||
HTM_TEXTAREA_NestingLevel--;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************************** Images ***********************************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -83,6 +83,9 @@ void HTM_LI_End (void);
|
|||
void HTM_A_Begin (const char *fmt,...);
|
||||
void HTM_A_End (void);
|
||||
|
||||
void HTM_TEXTAREA_Begin (const char *fmt,...);
|
||||
void HTM_TEXTAREA_End (void);
|
||||
|
||||
void HTM_IMG (const char *URL,const char *Icon,const char *Title,
|
||||
const char *fmt,...);
|
||||
|
||||
|
|
|
@ -1547,11 +1547,10 @@ void Agd_RequestCreatOrEditEvent (void)
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Txt\" name=\"Txt\""
|
||||
" cols=\"60\" rows=\"10\">");
|
||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" cols=\"60\" rows=\"10\"");
|
||||
if (!ItsANewEvent)
|
||||
fprintf (Gbl.F.Out,"%s",Txt);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
|
@ -459,10 +459,9 @@ static void Ann_PutSubjectMessage (const char *Field,const char *Label,
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"%s\" name=\"%s\""
|
||||
" cols=\"75\" rows=\"%u\">"
|
||||
"</textarea>",
|
||||
HTM_TEXTAREA_Begin ("id=\"%s\" name=\"%s\" cols=\"75\" rows=\"%u\"",
|
||||
Field,Field,Rows);
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
|
@ -1208,11 +1208,10 @@ void Asg_RequestCreatOrEditAsg (void)
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Txt\" name=\"Txt\""
|
||||
" cols=\"60\" rows=\"10\">");
|
||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" cols=\"60\" rows=\"10\"");
|
||||
if (!ItsANewAssignment)
|
||||
fprintf (Gbl.F.Out,"%s",Txt);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
|
@ -1154,11 +1154,10 @@ void Att_RequestCreatOrEditAttEvent (void)
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Txt\" name=\"Txt\""
|
||||
" cols=\"60\" rows=\"5\">");
|
||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" cols=\"60\" rows=\"5\"");
|
||||
if (!ItsANewAttEvent)
|
||||
fprintf (Gbl.F.Out,"%s",Description);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -2138,11 +2137,12 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr,
|
|||
/***** Student's comment: write form or text */
|
||||
HTM_TD_Begin ("class=\"DAT_SMALL LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
if (ICanEditStdComment) // Show with form
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"CommentStd%ld\""
|
||||
" cols=\"40\" rows=\"3\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
UsrDat->UsrCod,CommentStd);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("name=\"CommentStd%ld\" cols=\"40\" rows=\"3\"",
|
||||
UsrDat->UsrCod);
|
||||
fprintf (Gbl.F.Out,"%s",CommentStd);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else // Show without form
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
@ -2154,11 +2154,12 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr,
|
|||
/***** Teacher's comment: write form, text or nothing */
|
||||
HTM_TD_Begin ("class=\"DAT_SMALL LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
if (ICanEditTchComment) // Show with form
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"CommentTch%ld\""
|
||||
" cols=\"40\" rows=\"3\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
UsrDat->UsrCod,CommentTch);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("name=\"CommentTch%ld\" cols=\"40\" rows=\"3\"",
|
||||
UsrDat->UsrCod);
|
||||
fprintf (Gbl.F.Out,"%s",CommentTch);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else if (Att->CommentTchVisible) // Show without form
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
|
|
@ -386,13 +386,12 @@ static void Ctr_Configuration (bool PrintView)
|
|||
{
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
Frm_StartForm (ActChgCtrPhoAtt);
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"AttributionArea\""
|
||||
" name=\"Attribution\" rows=\"2\""
|
||||
" onchange=\"document.getElementById('%s').submit();\">",
|
||||
HTM_TEXTAREA_Begin ("id=\"AttributionArea\" name=\"Attribution\" rows=\"2\""
|
||||
" onchange=\"document.getElementById('%s').submit();\"",
|
||||
Gbl.Form.Id);
|
||||
if (PhotoAttribution)
|
||||
fprintf (Gbl.F.Out,"%s",PhotoAttribution);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
Frm_EndForm ();
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
|
|
@ -487,15 +487,18 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
|||
En OpenSWAD:
|
||||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.47.1 (2019-10-31)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.48 (2019-10-31)"
|
||||
#define CSS_FILE "swad19.47.css"
|
||||
#define JS_FILE "swad19.39.js"
|
||||
/*
|
||||
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
||||
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
||||
// TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia)
|
||||
|
||||
Version 19.48: Oct 31, 2019 Code refactoring in HTML textarea. (246038 lines)
|
||||
Version 19.47.2: Oct 31, 2019 Removed obsolete function to activate results in match questions. (246009 lines)
|
||||
Version 19.47.1: Oct 31, 2019 Removed obsolete messages. (246033 lines)
|
||||
Version 19.47: Oct 31, 2019 Return to old way to activate showing of results in match question. (246230 lines)
|
||||
Version 19.47: Oct 31, 2019 Return to old way to activate results in match questions. (246230 lines)
|
||||
Version 19.46.10: Oct 31, 2019 Code refactoring in HTML images. (246196 lines)
|
||||
Version 19.46.9: Oct 30, 2019 Code refactoring in HTML images. (246241 lines)
|
||||
Version 19.46.8: Oct 30, 2019 Code refactoring in HTML images. (246244 lines)
|
||||
|
|
|
@ -296,13 +296,12 @@ static void Cty_Configuration (bool PrintView)
|
|||
{
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
Frm_StartForm (ActChgCtyMapAtt);
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"Attribution\""
|
||||
" cols=\"50\" rows=\"2\""
|
||||
" onchange=\"document.getElementById('%s').submit();\">",
|
||||
HTM_TEXTAREA_Begin ("name=\"Attribution\" cols=\"50\" rows=\"2\""
|
||||
" onchange=\"document.getElementById('%s').submit();\"",
|
||||
Gbl.Form.Id);
|
||||
if (MapAttribution)
|
||||
fprintf (Gbl.F.Out,"%s",MapAttribution);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
Frm_EndForm ();
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
|
|
@ -929,9 +929,8 @@ static void Enr_PutAreaToEnterUsrsIDs (void)
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"UsrsIDs\" name=\"UsrsIDs\""
|
||||
" cols=\"60\" rows=\"10\">"
|
||||
"</textarea>");
|
||||
HTM_TEXTAREA_Begin ("id=\"UsrsIDs\" name=\"UsrsIDs\" cols=\"60\" rows=\"10\"");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
69
swad_exam.c
69
swad_exam.c
|
@ -1312,11 +1312,12 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
|
||||
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
|
||||
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Place\" name=\"Place\""
|
||||
" cols=\"40\" rows=\"4\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("id=\"Place\" name=\"Place\" cols=\"40\" rows=\"4\"");
|
||||
fprintf (Gbl.F.Out,"%s",
|
||||
Gbl.ExamAnns.ExaDat.Place);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
@ -1338,11 +1339,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
|
||||
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
|
||||
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"ExamMode\" name=\"ExamMode\""
|
||||
" cols=\"40\" rows=\"2\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
Gbl.ExamAnns.ExaDat.Mode);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("id=\"ExamMode\" name=\"ExamMode\" cols=\"40\" rows=\"2\"");
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.Mode);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
@ -1364,11 +1365,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
|
||||
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
|
||||
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Structure\" name=\"Structure\""
|
||||
" cols=\"40\" rows=\"8\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
Gbl.ExamAnns.ExaDat.Structure);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("id=\"Structure\" name=\"Structure\" cols=\"40\" rows=\"8\"");
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.Structure);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
@ -1390,11 +1391,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
|
||||
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
|
||||
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"DocRequired\" name=\"DocRequired\""
|
||||
" cols=\"40\" rows=\"2\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
Gbl.ExamAnns.ExaDat.DocRequired);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("id=\"DocRequired\" name=\"DocRequired\" cols=\"40\" rows=\"2\"");
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.DocRequired);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
@ -1416,11 +1417,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
|
||||
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
|
||||
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"MatRequired\" name=\"MatRequired\""
|
||||
" cols=\"40\" rows=\"4\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
Gbl.ExamAnns.ExaDat.MatRequired);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("id=\"MatRequired\" name=\"MatRequired\" cols=\"40\" rows=\"4\"");
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.MatRequired);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
@ -1442,11 +1443,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
|
||||
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
|
||||
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"MatAllowed\" name=\"MatAllowed\""
|
||||
" cols=\"40\" rows=\"4\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
Gbl.ExamAnns.ExaDat.MatAllowed);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("id=\"MatAllowed\" name=\"MatAllowed\" cols=\"40\" rows=\"4\"");
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.MatAllowed);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
@ -1468,11 +1469,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
|
|||
|
||||
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
|
||||
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"OtherInfo\" name=\"OtherInfo\""
|
||||
" cols=\"40\" rows=\"5\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
Gbl.ExamAnns.ExaDat.OtherInfo);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("id=\"OtherInfo\" name=\"OtherInfo\" cols=\"40\" rows=\"5\"");
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.OtherInfo);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
|
|
@ -3931,10 +3931,8 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject)
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Content\" name=\"Content\""
|
||||
" class=\"MSG_CONTENT\""
|
||||
" rows=\"10\">"
|
||||
"</textarea>");
|
||||
HTM_TEXTAREA_Begin ("id=\"Content\" name=\"Content\" class=\"MSG_CONTENT\" rows=\"10\"");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
|
@ -1166,11 +1166,10 @@ static void Gam_PutFormsEditionGame (struct Game *Game,bool ItsANewGame)
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Txt\" name=\"Txt\""
|
||||
" cols=\"60\" rows=\"10\">");
|
||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" cols=\"60\" rows=\"10\"");
|
||||
if (!ItsANewGame)
|
||||
fprintf (Gbl.F.Out,"%s",Txt);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
14
swad_info.c
14
swad_info.c
|
@ -2081,10 +2081,9 @@ void Inf_EditPlainTxtInfo (void)
|
|||
/***** Edition area *****/
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
Lay_HelpPlainEditor ();
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"Txt\" cols=\"80\" rows=\"20\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
TxtHTML);
|
||||
HTM_TEXTAREA_Begin ("name=\"Txt\" cols=\"80\" rows=\"20\"");
|
||||
fprintf (Gbl.F.Out,"%s",TxtHTML);
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Send button and end box *****/
|
||||
|
@ -2132,10 +2131,9 @@ void Inf_EditRichTxtInfo (void)
|
|||
/***** Edition area *****/
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
Lay_HelpRichEditor ();
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"Txt\" cols=\"80\" rows=\"20\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
TxtHTML);
|
||||
HTM_TEXTAREA_Begin ("name=\"Txt\" cols=\"80\" rows=\"20\"");
|
||||
fprintf (Gbl.F.Out,"%s",TxtHTML);
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Send button and end box *****/
|
||||
|
|
30
swad_match.c
30
swad_match.c
|
@ -163,7 +163,6 @@ static void Mch_ShowFormColumns (struct Match *Match);
|
|||
static void Mch_PutParamNumCols (unsigned NumCols);
|
||||
|
||||
static void Mch_ShowMatchTitle (struct Match *Match);
|
||||
// static void Mch_ShowFormViewResult (struct Match *Match);
|
||||
static void Mch_PutCheckboxResult (struct Match *Match);
|
||||
static void Mch_ShowQuestionAndAnswersTch (struct Match *Match);
|
||||
static void Mch_WriteAnswersMatchResult (struct Match *Match,
|
||||
|
@ -2118,10 +2117,8 @@ static void Mch_ShowLeftColumnTch (struct Match *Match)
|
|||
Mch_PutMatchControlButtons (Match);
|
||||
|
||||
/***** Put forms to choice which projects to show *****/
|
||||
/* 1st. row */
|
||||
Set_StartSettingsHead ();
|
||||
Mch_ShowFormColumns (Match);
|
||||
// Mch_ShowFormViewResult (Match);
|
||||
Set_EndSettingsHead ();
|
||||
|
||||
/***** Write button to request viewing results *****/
|
||||
|
@ -2404,33 +2401,6 @@ static void Mch_PutParamNumCols (unsigned NumCols) // Number of columns
|
|||
Par_PutHiddenParamUnsigned ("NumCols",NumCols);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Put form to select if show results **********************/
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
static void Mch_ShowFormViewResult (struct Match *Match)
|
||||
{
|
||||
extern const char *Txt_View_results;
|
||||
|
||||
***** Begin selector *****
|
||||
Set_StartOneSettingSelector ();
|
||||
HTM_DIV_Begin ("class=\"%s\"",(Match->Status.ShowQstResults) ? "PREF_ON" :
|
||||
"PREF_OFF");
|
||||
|
||||
***** Begin form *****
|
||||
Frm_StartForm (ActChgVisResMchQst);
|
||||
Mch_PutParamMchCod (Match->MchCod); // Current match being played
|
||||
|
||||
Ico_PutSettingIconLink ("poll-h.svg",Txt_View_results);
|
||||
|
||||
***** End form *****
|
||||
Frm_EndForm ();
|
||||
|
||||
***** End selector *****
|
||||
HTM_DIV_End ();
|
||||
Set_EndOneSettingSelector ();
|
||||
}
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/***************** Put checkbox to select if show results ********************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -496,9 +496,8 @@ static void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
HTM_TD_Begin ("colspan=\"%u\" class=\"LM\"",ColSpan);
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"OtherRecipients\" name=\"OtherRecipients\""
|
||||
" class=\"MSG_RECIPIENTS\" rows=\"2\""
|
||||
" placeholder=\"%s\">",
|
||||
HTM_TEXTAREA_Begin ("id=\"OtherRecipients\" name=\"OtherRecipients\""
|
||||
" class=\"MSG_RECIPIENTS\" rows=\"2\" placeholder=\"%s\"",
|
||||
Txt_nicks_emails_or_IDs_separated_by_commas);
|
||||
if (Gbl.Usrs.ListOtherRecipients[0])
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.Usrs.ListOtherRecipients);
|
||||
|
@ -507,7 +506,7 @@ static void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (void)
|
|||
// write @nickname of original sender
|
||||
if (Nck_GetNicknameFromUsrCod (Gbl.Usrs.Other.UsrDat.UsrCod,Nickname))
|
||||
fprintf (Gbl.F.Out,"@%s",Nickname);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -544,8 +543,8 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"MsgSubject\" name=\"Subject\""
|
||||
" class=\"MSG_SUBJECT\" rows=\"2\">");
|
||||
HTM_TEXTAREA_Begin ("id=\"MsgSubject\" name=\"Subject\""
|
||||
" class=\"MSG_SUBJECT\" rows=\"2\"");
|
||||
|
||||
/* If message is a reply ==> get original message */
|
||||
if (MsgCod > 0) // It's a reply
|
||||
|
@ -578,7 +577,9 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_
|
|||
/* Write subject */
|
||||
if (!SubjectAndContentComeFromForm)
|
||||
fprintf (Gbl.F.Out,"Re: ");
|
||||
fprintf (Gbl.F.Out,"%s</textarea>",Gbl.Msg.Subject);
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.Msg.Subject);
|
||||
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -594,8 +595,8 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"MsgContent\" name=\"Content\""
|
||||
" class=\"MSG_CONTENT\" rows=\"20\">");
|
||||
HTM_TEXTAREA_Begin ("id=\"MsgContent\" name=\"Content\""
|
||||
" class=\"MSG_CONTENT\" rows=\"20\"");
|
||||
|
||||
/* Start textarea with a '\n', that will be not visible in textarea.
|
||||
When Content is "\nLorem ipsum" (a white line before "Lorem ipsum"),
|
||||
|
@ -612,7 +613,9 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_
|
|||
else // It's not a reply
|
||||
{
|
||||
/* End message subject */
|
||||
fprintf (Gbl.F.Out,"%s</textarea>",Gbl.Msg.Subject);
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.Msg.Subject);
|
||||
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -629,8 +632,8 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"MsgContent\" name=\"Content\""
|
||||
" class=\"MSG_CONTENT\" rows=\"20\">");
|
||||
HTM_TEXTAREA_Begin ("id=\"MsgContent\" name=\"Content\""
|
||||
" class=\"MSG_CONTENT\" rows=\"20\"");
|
||||
|
||||
/* Start textarea with a '\n', that will be not visible in textarea.
|
||||
When Content is "\nLorem ipsum" (a white line before "Lorem ipsum"),
|
||||
|
@ -638,7 +641,8 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_
|
|||
by "Lorem", without the white line */
|
||||
fprintf (Gbl.F.Out,"\n%s",Content);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
|
@ -113,9 +113,9 @@ void Not_ShowFormNotice (void)
|
|||
Hlp_MESSAGES_Notices,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Message body *****/
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"Content\" cols=\"30\" rows=\"10\""
|
||||
" autofocus=\"autofocus\" required=\"required\">"
|
||||
"</textarea>");
|
||||
HTM_TEXTAREA_Begin ("name=\"Content\" cols=\"30\" rows=\"10\""
|
||||
" autofocus=\"autofocus\" required=\"required\"");
|
||||
HTM_TEXTAREA_End ();
|
||||
|
||||
/***** Send button and end box *****/
|
||||
Box_EndBoxWithButton (Btn_CREATE_BUTTON,Txt_Create_notice);
|
||||
|
|
|
@ -3459,11 +3459,11 @@ static void Prj_EditOneProjectTxtArea (const char *Id,
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"%s\" name=\"%s\" cols=\"60\" rows=\"%u\"",
|
||||
Id,Id,NumRows);
|
||||
if (Required)
|
||||
fprintf (Gbl.F.Out," required=\"required\"");
|
||||
fprintf (Gbl.F.Out,">%s</textarea>",TxtField);
|
||||
HTM_TEXTAREA_Begin ("id=\"%s\" name=\"%s\" cols=\"60\" rows=\"%u\"%s",
|
||||
Id,Id,NumRows,Required ? " required=\"required\"" :
|
||||
"");
|
||||
fprintf (Gbl.F.Out,"%s",TxtField);
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
|
@ -1826,13 +1826,13 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView,
|
|||
HTM_TD_Begin ("class=\"REC_C2_BOT REC_DAT_BOLD LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||
if (ICanEditThisField) // Show with form
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"Field%ld\" rows=\"%u\""
|
||||
" class=\"REC_C2_BOT_INPUT\">",
|
||||
HTM_TEXTAREA_Begin ("name=\"Field%ld\" rows=\"%u\""
|
||||
" class=\"REC_C2_BOT_INPUT\"",
|
||||
Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod,
|
||||
Gbl.Crs.Records.LstFields.Lst[NumField].NumLines);
|
||||
if (ThisFieldHasText)
|
||||
fprintf (Gbl.F.Out,"%s",row[0]);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else // Show without form
|
||||
{
|
||||
|
@ -3573,11 +3573,12 @@ static void Rec_ShowComments (struct UsrData *UsrDat,
|
|||
if (ShowData)
|
||||
{
|
||||
if (ICanEdit)
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Comments\" name=\"Comments\""
|
||||
" rows=\"4\" class=\"REC_C2_BOT_INPUT\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
UsrDat->Comments);
|
||||
{
|
||||
HTM_TEXTAREA_Begin ("id=\"Comments\" name=\"Comments\""
|
||||
" rows=\"4\" class=\"REC_C2_BOT_INPUT\"");
|
||||
fprintf (Gbl.F.Out,"%s",UsrDat->Comments);
|
||||
HTM_TEXTAREA_End ();
|
||||
}
|
||||
else if (UsrDat->Comments[0])
|
||||
{
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, // Convert from HTML to rigorous HTML
|
||||
|
|
|
@ -1937,11 +1937,10 @@ void Svy_RequestCreatOrEditSvy (void)
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Txt\" name=\"Txt\""
|
||||
" cols=\"60\" rows=\"10\">");
|
||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" cols=\"60\" rows=\"10\"");
|
||||
if (!ItsANewSurvey)
|
||||
fprintf (Gbl.F.Out,"%s",Txt);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -2731,10 +2730,9 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Txt\" name=\"Txt\" cols=\"60\" rows=\"4\">"
|
||||
"%s"
|
||||
"</textarea>",
|
||||
Txt);
|
||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" cols=\"60\" rows=\"4\"");
|
||||
fprintf (Gbl.F.Out,"%s",Txt);
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -2788,12 +2786,11 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,
|
|||
|
||||
/* Answer text */
|
||||
HTM_TD_Begin ("class=\"RT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"AnsStr%u\" name=\"AnsStr%u\""
|
||||
" cols=\"50\" rows=\"1\">",
|
||||
HTM_TEXTAREA_Begin ("id=\"AnsStr%u\" name=\"AnsStr%u\" cols=\"50\" rows=\"1\"",
|
||||
NumAns,NumAns);
|
||||
if (SvyQst->AnsChoice[NumAns].Text)
|
||||
fprintf (Gbl.F.Out,"%s",SvyQst->AnsChoice[NumAns].Text);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
47
swad_test.c
47
swad_test.c
|
@ -5157,26 +5157,25 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
|
|||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea id=\"Stem\" name=\"Stem\""
|
||||
" class=\"STEM_TEXTAREA\" rows=\"5\" required=\"required\">"
|
||||
"%s"
|
||||
"</textarea><br />",
|
||||
Stem);
|
||||
HTM_TEXTAREA_Begin ("id=\"Stem\" name=\"Stem\" class=\"STEM_TEXTAREA\""
|
||||
" rows=\"5\" required=\"required\"");
|
||||
fprintf (Gbl.F.Out,"%s",Stem);
|
||||
HTM_TEXTAREA_End ();
|
||||
fprintf (Gbl.F.Out,"<br />");
|
||||
Tst_PutFormToEditQstMedia (&Gbl.Test.Media,-1,
|
||||
false);
|
||||
|
||||
/***** Feedback *****/
|
||||
fprintf (Gbl.F.Out,"<label class=\"%s\">"
|
||||
"%s (%s):<br />"
|
||||
"<textarea name=\"Feedback\""
|
||||
" class=\"STEM_TEXTAREA\" rows=\"2\">",
|
||||
"%s (%s):<br />",
|
||||
The_ClassFormInBox[Gbl.Prefs.Theme],
|
||||
Txt_Feedback,Txt_optional);
|
||||
HTM_TEXTAREA_Begin ("name=\"Feedback\" class=\"STEM_TEXTAREA\" rows=\"2\"");
|
||||
if (Feedback)
|
||||
if (Feedback[0])
|
||||
fprintf (Gbl.F.Out,"%s",Feedback);
|
||||
fprintf (Gbl.F.Out,"</textarea>"
|
||||
"</label>");
|
||||
HTM_TEXTAREA_End ();
|
||||
fprintf (Gbl.F.Out,"</label>");
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -5363,15 +5362,12 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
|
|||
" style=\"display:none;\""); // Answer does not have content ==> Hide column
|
||||
|
||||
/* Answer text */
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"AnsStr%u\""
|
||||
" class=\"ANSWER_TEXTAREA\" rows=\"5\"",
|
||||
NumOpt);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out,">");
|
||||
HTM_TEXTAREA_Begin ("name=\"AnsStr%u\" class=\"ANSWER_TEXTAREA\" rows=\"5\"%s",
|
||||
NumOpt,OptionsDisabled ? " disabled=\"disabled\"" :
|
||||
"");
|
||||
if (AnswerHasContent)
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.Test.Answer.Options[NumOpt].Text);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
|
||||
/* Media */
|
||||
Tst_PutFormToEditQstMedia (&Gbl.Test.Answer.Options[NumOpt].Media,
|
||||
|
@ -5379,19 +5375,16 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
|
|||
OptionsDisabled);
|
||||
|
||||
/* Feedback */
|
||||
fprintf (Gbl.F.Out,"<label class=\"%s\">%s (%s):<br />"
|
||||
"<textarea name=\"FbStr%u\""
|
||||
" class=\"ANSWER_TEXTAREA\" rows=\"2\"",
|
||||
The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Feedback,Txt_optional,
|
||||
NumOpt);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out,">");
|
||||
fprintf (Gbl.F.Out,"<label class=\"%s\">%s (%s):<br />",
|
||||
The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Feedback,Txt_optional);
|
||||
HTM_TEXTAREA_Begin ("name=\"FbStr%u\" class=\"ANSWER_TEXTAREA\" rows=\"2\"%s",
|
||||
NumOpt,OptionsDisabled ? " disabled=\"disabled\"" :
|
||||
"");
|
||||
if (Gbl.Test.Answer.Options[NumOpt].Feedback)
|
||||
if (Gbl.Test.Answer.Options[NumOpt].Feedback[0])
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.Test.Answer.Options[NumOpt].Feedback);
|
||||
fprintf (Gbl.F.Out,"</textarea>"
|
||||
"</label>");
|
||||
HTM_TEXTAREA_End ();
|
||||
fprintf (Gbl.F.Out,"</label>");
|
||||
|
||||
/* End of right column */
|
||||
HTM_DIV_End ();
|
||||
|
|
|
@ -509,11 +509,11 @@ static void TsI_ImportQuestionsFromXMLBuffer (const char *XMLBuffer)
|
|||
|
||||
/***** Print XML tree *****/
|
||||
HTM_DIV_Begin ("class=\"TEST_FILE_CONTENT\"");
|
||||
fprintf (Gbl.F.Out,"<textarea title=\"%s\" cols=\"60\" rows=\"5\""
|
||||
" spellcheck=\"false\" readonly>",
|
||||
HTM_TEXTAREA_Begin ("title=\"%s\" cols=\"60\" rows=\"5\""
|
||||
" spellcheck=\"false\" readonly",
|
||||
Txt_XML_file_content);
|
||||
XML_PrintTree (RootElem);
|
||||
fprintf (Gbl.F.Out,"</textarea>");
|
||||
HTM_TEXTAREA_End ();
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Get questions from XML tree and print them *****/
|
||||
|
|
|
@ -2366,14 +2366,13 @@ static void TL_PutTextarea (const char *Placeholder,const char *ClassTextArea)
|
|||
Frm_SetUniqueId (IdDivImgButton);
|
||||
|
||||
/***** Textarea to write the content *****/
|
||||
fprintf (Gbl.F.Out,"<textarea name=\"Content\" rows=\"1\" maxlength=\"%u\""
|
||||
" placeholder=\"%s…\""
|
||||
" class=\"%s\""
|
||||
" onfocus=\"expandTextarea(this,'%s','6');\">"
|
||||
"</textarea>",
|
||||
HTM_TEXTAREA_Begin ("name=\"Content\" rows=\"1\" maxlength=\"%u\""
|
||||
" placeholder=\"%s…\" class=\"%s\""
|
||||
" onfocus=\"expandTextarea(this,'%s','6');\"",
|
||||
TL_MAX_CHARS_IN_POST,
|
||||
Placeholder,ClassTextArea,
|
||||
IdDivImgButton);
|
||||
HTM_TEXTAREA_End ();
|
||||
|
||||
/***** Start concealable div *****/
|
||||
HTM_DIV_Begin ("id=\"%s\" style=\"display:none;\"",IdDivImgButton);
|
||||
|
|
Loading…
Reference in New Issue