diff --git a/swad_HTML.c b/swad_HTML.c index 52225232..ffad7726 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -792,7 +792,7 @@ void HTM_LABEL_End (void) } /*****************************************************************************/ -/******************************** Input text *********************************/ +/************************* Input text, email, url ****************************/ /*****************************************************************************/ void HTM_INPUT_TEXT (const char *Name,unsigned MaxLength,const char *Value, @@ -829,6 +829,74 @@ void HTM_INPUT_TEXT (const char *Name,unsigned MaxLength,const char *Value, fprintf (Gbl.F.Out," />"); } +void HTM_INPUT_EMAIL (const char *Name,unsigned MaxLength,const char *Value, + const char *fmt,...) + { + va_list ap; + int NumBytesPrinted; + char *Attr; + + fprintf (Gbl.F.Out,""); + } + +void HTM_INPUT_URL (const char *Name,const char *Value, + const char *fmt,...) + { + va_list ap; + int NumBytesPrinted; + char *Attr; + + fprintf (Gbl.F.Out,""); + } + /*****************************************************************************/ /********************************* Text areas ********************************/ /*****************************************************************************/ diff --git a/swad_HTML.h b/swad_HTML.h index c4f1fec0..112dfac7 100644 --- a/swad_HTML.h +++ b/swad_HTML.h @@ -91,6 +91,10 @@ void HTM_LABEL_End (void); void HTM_INPUT_TEXT (const char *Name,unsigned MaxLength,const char *Value, const char *fmt,...); +void HTM_INPUT_EMAIL (const char *Name,unsigned MaxLength,const char *Value, + const char *fmt,...); +void HTM_INPUT_URL (const char *Name,const char *Value, + const char *fmt,...); void HTM_TEXTAREA_Begin (const char *fmt,...); void HTM_TEXTAREA_End (void); diff --git a/swad_ID.c b/swad_ID.c index 200e5ed4..9009f59d 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -716,7 +716,7 @@ static void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat, HTM_INPUT_TEXT ("NewID",ID_MAX_BYTES_USR_ID, UsrDat->IDs.Num ? UsrDat->IDs.List[UsrDat->IDs.Num - 1].ID : "", // Show the most recent ID - " size=\"18\""); + "size=\"18\""); fprintf (Gbl.F.Out,"
"); Btn_PutCreateButtonInline (Txt_Add_this_ID); Frm_EndForm (); diff --git a/swad_account.c b/swad_account.c index 43b7b0ec..82b85d93 100644 --- a/swad_account.c +++ b/swad_account.c @@ -389,13 +389,9 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith HTM_TD_End (); HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_EMAIL_ADDRESS, - Txt_HELP_email, - NewEmail); + HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,NewEmail, + "size=\"18\" placeholder=\"%s\" required=\"required\"", + Txt_HELP_email); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_banner.c b/swad_banner.c index 6d2e158c..3956d094 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -478,11 +478,10 @@ static void Ban_ListBannersForEdition (void) HTM_TD_Begin ("class=\"CM\""); Frm_StartForm (ActChgBanWWW); Ban_PutParamBanCodToEdit (); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Ban->WWW,Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Ban->WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); HTM_TD_End (); @@ -891,11 +890,8 @@ static void Ban_PutFormToCreateBanner (void) /***** Banner WWW *****/ HTM_TD_Begin ("class=\"CM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Ban_EditingBan->WWW); + HTM_INPUT_URL ("WWW",Ban_EditingBan->WWW, + "class=\"INPUT_WWW\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_centre.c b/swad_centre.c index 7f4cf0ee..ccbeecf4 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -573,13 +573,10 @@ static void Ctr_Configuration (bool PrintView) { /* Form to change centre WWW */ Frm_StartForm (ActChgCtrWWWCfg); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW, - Gbl.Hierarchy.Ctr.WWW, - Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Gbl.Hierarchy.Ctr.WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); } else // I can not change centre WWW @@ -1589,11 +1586,10 @@ static void Ctr_ListCentresForEdition (void) { Frm_StartForm (ActChgCtrWWW); Ctr_PutParamOtherCtrCod (Ctr->CtrCod); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Ctr->WWW,Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Ctr->WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); } else @@ -2551,11 +2547,8 @@ static void Ctr_PutFormToCreateCentre (void) /***** Centre WWW *****/ HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Ctr_EditingCtr->WWW); + HTM_INPUT_URL ("WWW",Ctr_EditingCtr->WWW, + "class=\"INPUT_WWW\" required=\"required\""); HTM_TD_End (); /***** Number of users who claim to belong to this centre *****/ diff --git a/swad_changelog.h b/swad_changelog.h index a95c8bc8..21639539 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -487,14 +487,15 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.51.8 (2019-11-04)" +#define Log_PLATFORM_VERSION "SWAD 19.51.9 (2019-11-04)" #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.51.9: Nov 04, 2019 Code refactoring in HTML inputs. (245974 lines) Version 19.51.8: Nov 04, 2019 Code refactoring in HTML inputs. (245968 lines) Version 19.51.7: Nov 03, 2019 Code refactoring in HTML inputs. (246051 lines) Version 19.51.6: Nov 03, 2019 Code refactoring in HTML inputs. (246125 lines) diff --git a/swad_country.c b/swad_country.c index 2912d0eb..e4a611c6 100644 --- a/swad_country.c +++ b/swad_country.c @@ -1685,12 +1685,10 @@ static void Cty_ListCountriesForEdition (void) Frm_StartForm (ActChgCtyWWW); Cty_PutParamOtherCtyCod (Cty->CtyCod); Par_PutHiddenParamUnsigned (NULL,"Lan",(unsigned) Lan); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW, - Cty->WWW[Lan],Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Cty->WWW[Lan], + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); HTM_TD_End (); @@ -2111,12 +2109,11 @@ static void Cty_PutFormToCreateCountry (void) /* WWW */ HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,"", - Lan_STR_LANG_ID[Lan], - Cns_MAX_CHARS_WWW, - Cty_EditingCty->WWW[Lan]); + snprintf (StrName,sizeof (StrName), + "WWW_%s", + Lan_STR_LANG_ID[Lan]); + HTM_INPUT_URL (StrName,Cty_EditingCty->WWW[Lan], + "class=\"INPUT_WWW\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_course.c b/swad_course.c index b1bc762a..e227173a 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1474,7 +1474,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year) Frm_StartForm (ActChgInsCrsCod); Crs_PutParamOtherCrsCod (Crs->CrsCod); HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD,Crs->InstitutionalCrsCod, - " class=\"INPUT_INS_CODE\"" + "class=\"INPUT_INS_CODE\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -1514,7 +1514,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year) Frm_StartForm (ActRenCrsSho); Crs_PutParamOtherCrsCod (Crs->CrsCod); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Crs->ShrtName, - " class=\"INPUT_SHORT_NAME\"" + "class=\"INPUT_SHORT_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -1530,7 +1530,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year) Frm_StartForm (ActRenCrsFul); Crs_PutParamOtherCrsCod (Crs->CrsCod); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Crs->FullName, - " class=\"INPUT_FULL_NAME\"" + "class=\"INPUT_FULL_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -1681,7 +1681,7 @@ static void Crs_PutFormToCreateCourse (void) /***** Institutional code of the course *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD,Crs_EditingCrs->InstitutionalCrsCod, - " class=\"INPUT_INS_CODE\""); + "class=\"INPUT_INS_CODE\""); HTM_TD_End (); /***** Year *****/ @@ -1701,13 +1701,13 @@ static void Crs_PutFormToCreateCourse (void) /***** Course short name *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Crs_EditingCrs->ShrtName, - " class=\"INPUT_SHORT_NAME\" required=\"required\""); + "class=\"INPUT_SHORT_NAME\" required=\"required\""); HTM_TD_End (); /***** Course full name *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Crs_EditingCrs->FullName, - " class=\"INPUT_FULL_NAME\" required=\"required\""); + "class=\"INPUT_FULL_NAME\" required=\"required\""); HTM_TD_End (); /***** Current number of teachers in this course *****/ diff --git a/swad_degree.c b/swad_degree.c index f3545170..a60f8cec 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -398,7 +398,7 @@ static void Deg_Configuration (bool PrintView) /* Form to change degree full name */ Frm_StartForm (ActRenDegFulCfg); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Gbl.Hierarchy.Deg.FullName, - " class=\"INPUT_FULL_NAME\"" + "class=\"INPUT_FULL_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -426,7 +426,7 @@ static void Deg_Configuration (bool PrintView) /* Form to change degree short name */ Frm_StartForm (ActRenDegShoCfg); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Gbl.Hierarchy.Deg.ShrtName, - " class=\"INPUT_SHORT_NAME\"" + "class=\"INPUT_SHORT_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -453,13 +453,10 @@ static void Deg_Configuration (bool PrintView) { /* Form to change degree WWW */ Frm_StartForm (ActChgDegWWWCfg); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW, - Gbl.Hierarchy.Deg.WWW, - Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Gbl.Hierarchy.Deg.WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); } else // I can not change degree WWW @@ -751,7 +748,7 @@ static void Deg_ListDegreesForEdition (void) Frm_StartForm (ActRenDegSho); Deg_PutParamOtherDegCod (Deg->DegCod); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Deg->ShrtName, - " class=\"INPUT_SHORT_NAME\"" + "class=\"INPUT_SHORT_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -767,7 +764,7 @@ static void Deg_ListDegreesForEdition (void) Frm_StartForm (ActRenDegFul); Deg_PutParamOtherDegCod (Deg->DegCod); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Deg->FullName, - " class=\"INPUT_FULL_NAME\"" + "class=\"INPUT_FULL_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -813,11 +810,10 @@ static void Deg_ListDegreesForEdition (void) { Frm_StartForm (ActChgDegWWW); Deg_PutParamOtherDegCod (Deg->DegCod); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Deg->WWW,Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Deg->WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); } else @@ -975,13 +971,13 @@ static void Deg_PutFormToCreateDegree (void) /***** Degree short name *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Deg_EditingDeg->ShrtName, - " class=\"INPUT_SHORT_NAME\" required=\"required\""); + "class=\"INPUT_SHORT_NAME\" required=\"required\""); HTM_TD_End (); /***** Degree full name *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Deg_EditingDeg->FullName, - " class=\"INPUT_FULL_NAME\" required=\"required\""); + "class=\"INPUT_FULL_NAME\" required=\"required\""); HTM_TD_End (); /***** Degree type *****/ @@ -1003,11 +999,8 @@ static void Deg_PutFormToCreateDegree (void) /***** Degree WWW *****/ HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Deg_EditingDeg->WWW); + HTM_INPUT_URL ("WWW",Deg_EditingDeg->WWW, + "class=\"INPUT_WWW\" required=\"required\""); HTM_TD_End (); /***** Current number of courses in this degree *****/ diff --git a/swad_degree_type.c b/swad_degree_type.c index fe6cb4f7..18dc5507 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -423,7 +423,7 @@ static void DT_ListDegreeTypesForEdition (void) Frm_StartForm (ActRenDegTyp); DT_PutParamOtherDegTypCod (Gbl.DegTypes.Lst[NumDegTyp].DegTypCod); HTM_INPUT_TEXT ("DegTypName",Deg_MAX_CHARS_DEGREE_TYPE_NAME,Gbl.DegTypes.Lst[NumDegTyp].DegTypName, - " size=\"25\" required=\"required\"" + "size=\"25\" required=\"required\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -482,7 +482,7 @@ static void DT_PutFormToCreateDegreeType (void) /***** Degree type name *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("DegTypName",Deg_MAX_CHARS_DEGREE_TYPE_NAME,DT_EditingDegTyp->DegTypName, - " size=\"25\" required=\"required\"", + "size=\"25\" required=\"required\"", Gbl.Form.Id); HTM_TD_End (); diff --git a/swad_department.c b/swad_department.c index ece2849e..02379cb2 100644 --- a/swad_department.c +++ b/swad_department.c @@ -563,7 +563,7 @@ static void Dpt_ListDepartmentsForEdition (void) Frm_StartForm (ActRenDptSho); Dpt_PutParamDptCod (Dpt->DptCod); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Dpt->ShrtName, - " class=\"INPUT_SHORT_NAME\"" + "class=\"INPUT_SHORT_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -574,7 +574,7 @@ static void Dpt_ListDepartmentsForEdition (void) Frm_StartForm (ActRenDptFul); Dpt_PutParamDptCod (Dpt->DptCod); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Dpt->FullName, - " class=\"INPUT_FULL_NAME\"" + "class=\"INPUT_FULL_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -584,11 +584,10 @@ static void Dpt_ListDepartmentsForEdition (void) HTM_TD_Begin ("class=\"CM\""); Frm_StartForm (ActChgDptWWW); Dpt_PutParamDptCod (Dpt->DptCod); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Dpt->WWW,Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Dpt->WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); HTM_TD_End (); @@ -944,22 +943,19 @@ static void Dpt_PutFormToCreateDepartment (void) /***** Department short name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Dpt_EditingDpt->ShrtName, - " class=\"INPUT_SHORT_NAME\" required=\"required\""); + "class=\"INPUT_SHORT_NAME\" required=\"required\""); HTM_TD_End (); /***** Department full name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Dpt_EditingDpt->FullName, - " class=\"INPUT_FULL_NAME\" required=\"required\""); + "class=\"INPUT_FULL_NAME\" required=\"required\""); HTM_TD_End (); /***** Department WWW *****/ HTM_TD_Begin ("class=\"CM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Dpt_EditingDpt->WWW); + HTM_INPUT_URL ("WWW",Dpt_EditingDpt->WWW, + "class=\"INPUT_WWW\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_enrolment.c b/swad_enrolment.c index b1a93439..acf02659 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -382,7 +382,7 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncParams) fprintf (Gbl.F.Out,"%s: ",Txt_nick_email_or_ID); HTM_LABEL_End (); HTM_INPUT_TEXT ("OtherUsrIDNickOrEMail",Cns_MAX_CHARS_EMAIL_ADDRESS,"", - " size=\"18\" required=\"required\""); + "size=\"18\" required=\"required\""); /***** Send button*****/ Btn_PutConfirmButton (Txt_Continue); diff --git a/swad_exam.c b/swad_exam.c index 13f83d03..4d284799 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -1100,7 +1100,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) HTM_INPUT_TEXT ("CrsName",Hie_MAX_CHARS_FULL_NAME,Gbl.ExamAnns.ExaDat.CrsFullName, - " size=\"30\""); + "size=\"30\""); else fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.CrsFullName); HTM_TD_End (); @@ -1153,7 +1153,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod, HTM_TD_Begin ("class=\"%s LT\"",StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) HTM_INPUT_TEXT ("ExamSession",Exa_MAX_CHARS_SESSION,Gbl.ExamAnns.ExaDat.Session, - " size=\"30\""); + "size=\"30\""); else fprintf (Gbl.F.Out,"%s",Gbl.ExamAnns.ExaDat.Session); HTM_TD_End (); diff --git a/swad_file_browser.c b/swad_file_browser.c index a9bd3781..8e8d453b 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -6263,7 +6263,7 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic) if (Gbl.FileBrowser.ICanEditFileOrFolder) // Can I rename this folder? { HTM_INPUT_TEXT ("NewFolderName",Brw_MAX_CHARS_FOLDER,Gbl.FileBrowser.FilFolLnk.Name, - " class=\"%s %s\"" + "class=\"%s %s\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.FileBrowser.InputStyle, Gbl.FileBrowser.Clipboard.IsThisFile ? "LIGHT_GREEN" : @@ -8343,7 +8343,7 @@ static void Brw_PutFormToCreateAFolder (const char FileNameToShow[NAME_MAX + 1]) HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"%s: ",Txt_Folder); HTM_INPUT_TEXT ("NewFolderName",Brw_MAX_CHARS_FOLDER,"", - " size=\"30\" required=\"required\""); + "size=\"30\" required=\"required\""); HTM_LABEL_End (); /***** Send button and end box *****/ @@ -8511,11 +8511,8 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow) HTM_TD_End (); HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,"", - PATH_MAX); + HTM_INPUT_URL ("NewLinkURL","", + "size=\"30\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); @@ -8531,7 +8528,7 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow) HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("NewLinkName",Brw_MAX_CHARS_FOLDER,"", - " size=\"30\""); + "size=\"30\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_forum.c b/swad_forum.c index 13af7c95..4808714b 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -3913,7 +3913,7 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject) HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("Subject",Cns_MAX_CHARS_SUBJECT,IsReply ? Subject : "", - " class=\"MSG_SUBJECT\" required=\"required\""); + "class=\"MSG_SUBJECT\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_game.c b/swad_game.c index ec4c306c..67e94d5d 100644 --- a/swad_game.c +++ b/swad_game.c @@ -1146,7 +1146,7 @@ static void Gam_PutFormsEditionGame (struct Game *Game,bool ItsANewGame) HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("Title",Gam_MAX_CHARS_TITLE,Game->Title, - " size=\"45\" required=\"required\""); + "size=\"45\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_group.c b/swad_group.c index de06dd45..91bdf139 100644 --- a/swad_group.c +++ b/swad_group.c @@ -1319,7 +1319,7 @@ static void Grp_ListGroupTypesForEdition (void) Frm_StartFormAnchor (ActRenGrpTyp,Grp_GROUP_TYPES_SECTION_ID); Grp_PutParamGrpTypCod (Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); HTM_INPUT_TEXT ("GrpTypName",Grp_MAX_CHARS_GROUP_TYPE_NAME,Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName, - " size=\"12\"" + "size=\"12\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -1580,7 +1580,7 @@ static void Grp_ListGroupsForEdition (void) Frm_StartFormAnchor (ActRenGrp,Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (Grp->GrpCod); HTM_INPUT_TEXT ("GrpName",Grp_MAX_CHARS_GROUP_NAME,Grp->GrpName, - " size=\"20\"" + "size=\"20\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -1643,7 +1643,7 @@ static void Grp_ListGroupsForEdition (void) Grp_PutParamGrpCod (Grp->GrpCod); Grp_WriteMaxStds (StrMaxStudents,Grp->MaxStudents); HTM_INPUT_TEXT ("MaxStudents",10,StrMaxStudents, - " size=\"3\"" + "size=\"3\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -2494,7 +2494,7 @@ static void Grp_PutFormToCreateGroupType (void) /***** Name of group type *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("GrpTypName",Grp_MAX_CHARS_GROUP_TYPE_NAME,Gbl.Crs.Grps.GrpTyp.GrpTypName, - " size=\"12\" required=\"required\""); + "size=\"12\" required=\"required\""); HTM_TD_End (); /***** Is it mandatory to register in any groups of this type? *****/ @@ -2644,7 +2644,7 @@ static void Grp_PutFormToCreateGroup (void) /***** Group name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("GrpName",Grp_MAX_CHARS_GROUP_NAME,Gbl.Crs.Grps.GrpName, - " size=\"20\" required=\"required\""); + "size=\"20\" required=\"required\""); HTM_TD_End (); /***** Classroom *****/ @@ -2697,7 +2697,7 @@ static void Grp_PutFormToCreateGroup (void) HTM_TD_Begin ("class=\"CM\""); Grp_WriteMaxStds (StrMaxStudents,Gbl.Crs.Grps.MaxStudents); HTM_INPUT_TEXT ("MaxStudents",10,StrMaxStudents, - " size=\"3\""); + "size=\"3\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_holiday.c b/swad_holiday.c index ababae5b..eb51086b 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -652,7 +652,7 @@ static void Hld_ListHolidaysForEdition (void) Frm_StartForm (ActRenHld); Hld_PutParamHldCod (Hld->HldCod); HTM_INPUT_TEXT ("Name",Hld_MAX_CHARS_HOLIDAY_NAME,Hld->Name, - " size=\"20\"" + "size=\"20\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -1039,7 +1039,7 @@ static void Hld_PutFormToCreateHoliday (void) /***** Holiday name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("Name",Hld_MAX_CHARS_HOLIDAY_NAME,Hld_EditingHld->Name, - " size=\"20\" required=\"required\""); + "size=\"20\" required=\"required\""); HTM_TD_End (); HTM_TD_Empty (1); diff --git a/swad_info.c b/swad_info.c index e8439ef6..4fc31a68 100644 --- a/swad_info.c +++ b/swad_info.c @@ -1308,22 +1308,21 @@ void Inf_FormToSendURL (Inf_InfoSrc_t InfoSrc) Frm_StartForm (Inf_ActionsInfo[InfoSrc][Gbl.Crs.Info.Type]); /***** Link *****/ - HTM_DIV_Begin ("class=\"CM\""); - HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,"%s: ",Txt_URL); - fprintf (Gbl.F.Out,""); + else + Gbl.Crs.Info.URL[0] = '\0'; + + HTM_DIV_Begin ("class=\"CM\""); + HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + fprintf (Gbl.F.Out,"%s: ",Txt_URL); + HTM_INPUT_URL ("InfoSrcURL",Gbl.Crs.Info.URL, + "size=\"50\""); HTM_LABEL_End (); HTM_DIV_End (); diff --git a/swad_institution.c b/swad_institution.c index 5377461b..98e992d4 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -410,7 +410,7 @@ static void Ins_Configuration (bool PrintView) /* Form to change institution full name */ Frm_StartForm (ActRenInsFulCfg); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Gbl.Hierarchy.Ins.FullName, - " class=\"INPUT_FULL_NAME\"" + "class=\"INPUT_FULL_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -438,7 +438,7 @@ static void Ins_Configuration (bool PrintView) /* Form to change institution short name */ Frm_StartForm (ActRenInsShoCfg); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Gbl.Hierarchy.Ins.ShrtName, - " class=\"INPUT_SHORT_NAME\"" + "class=\"INPUT_SHORT_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -466,13 +466,10 @@ static void Ins_Configuration (bool PrintView) { /* Form to change institution WWW */ Frm_StartForm (ActChgInsWWWCfg); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW, - Gbl.Hierarchy.Ins.WWW, - Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Gbl.Hierarchy.Ins.WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); } else // I can not change institution WWW @@ -1496,7 +1493,7 @@ static void Ins_ListInstitutionsForEdition (void) Frm_StartForm (ActRenInsSho); Ins_PutParamOtherInsCod (Ins->InsCod); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Ins->ShrtName, - " class=\"INPUT_SHORT_NAME\"" + "class=\"INPUT_SHORT_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -1512,7 +1509,7 @@ static void Ins_ListInstitutionsForEdition (void) Frm_StartForm (ActRenInsFul); Ins_PutParamOtherInsCod (Ins->InsCod); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Ins->FullName, - " class=\"INPUT_FULL_NAME\"" + "class=\"INPUT_FULL_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -1527,13 +1524,10 @@ static void Ins_ListInstitutionsForEdition (void) { Frm_StartForm (ActChgInsWWW); Ins_PutParamOtherInsCod (Ins->InsCod); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW, - Ins->WWW, - Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Ins->WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); HTM_TD_End (); } @@ -2225,22 +2219,19 @@ static void Ins_PutFormToCreateInstitution (void) /***** Institution short name *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,Ins_EditingIns->ShrtName, - " class=\"INPUT_SHORT_NAME\" required=\"required\""); + "class=\"INPUT_SHORT_NAME\" required=\"required\""); HTM_TD_End (); /***** Institution full name *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,Ins_EditingIns->FullName, - " class=\"INPUT_FULL_NAME\" required=\"required\""); + "class=\"INPUT_FULL_NAME\" required=\"required\""); HTM_TD_End (); /***** Institution WWW *****/ HTM_TD_Begin ("class=\"LM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Ins_EditingIns->WWW); + HTM_INPUT_URL ("WWW",Ins_EditingIns->WWW, + "class=\"INPUT_WWW\" required=\"required\""); HTM_TD_End (); /***** Number of users who claim to belong to this institution ****/ diff --git a/swad_link.c b/swad_link.c index 81ad2bdc..2a976a15 100644 --- a/swad_link.c +++ b/swad_link.c @@ -441,7 +441,7 @@ static void Lnk_ListLinksForEdition (void) Frm_StartForm (ActRenLnkSho); Lnk_PutParamLnkCod (Lnk->LnkCod); HTM_INPUT_TEXT ("ShortName",Lnk_MAX_CHARS_LINK_SHRT_NAME,Lnk->ShrtName, - " class=\"INPUT_SHORT_NAME\"" + "class=\"INPUT_SHORT_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -452,7 +452,7 @@ static void Lnk_ListLinksForEdition (void) Frm_StartForm (ActRenLnkFul); Lnk_PutParamLnkCod (Lnk->LnkCod); HTM_INPUT_TEXT ("FullName",Lnk_MAX_CHARS_LINK_FULL_NAME,Lnk->FullName, - " class=\"INPUT_FULL_NAME\"" + "class=\"INPUT_FULL_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -462,12 +462,10 @@ static void Lnk_ListLinksForEdition (void) HTM_TD_Begin ("class=\"CM\""); Frm_StartForm (ActChgLnkWWW); Lnk_PutParamLnkCod (Lnk->LnkCod); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Lnk->WWW, - Gbl.Form.Id); + HTM_INPUT_URL ("WWW",Lnk->WWW, + "class=\"INPUT_WWW\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); HTM_TD_End (); @@ -752,22 +750,19 @@ static void Lnk_PutFormToCreateLink (void) /***** Link short name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("ShortName",Lnk_MAX_CHARS_LINK_SHRT_NAME,Lnk_EditingLnk->ShrtName, - " class=\"INPUT_SHORT_NAME\" required=\"required\""); + "class=\"INPUT_SHORT_NAME\" required=\"required\""); HTM_TD_End (); /***** Link full name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("FullName",Lnk_MAX_CHARS_LINK_FULL_NAME,Lnk_EditingLnk->FullName, - " class=\"INPUT_FULL_NAME\" required=\"required\""); + "class=\"INPUT_FULL_NAME\" required=\"required\""); HTM_TD_End (); /***** Link WWW *****/ HTM_TD_Begin ("class=\"CM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Lnk_EditingLnk->WWW); + HTM_INPUT_URL ("WWW",Lnk_EditingLnk->WWW, + "class=\"INPUT_WWW\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_mail.c b/swad_mail.c index ff86b987..1b5808b9 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -507,7 +507,7 @@ static void Mai_ListMailDomainsForEdition (void) Frm_StartForm (ActRenMaiSho); Mai_PutParamMaiCod (Mai->MaiCod); HTM_INPUT_TEXT ("Domain",Cns_MAX_CHARS_EMAIL_ADDRESS,Mai->Domain, - " size=\"15\"" + "size=\"15\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -518,7 +518,7 @@ static void Mai_ListMailDomainsForEdition (void) Frm_StartForm (ActRenMaiFul); Mai_PutParamMaiCod (Mai->MaiCod); HTM_INPUT_TEXT ("Info",Mai_MAX_CHARS_MAIL_INFO,Mai->Info, - " size=\"40\"" + "size=\"40\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -764,13 +764,13 @@ static void Mai_PutFormToCreateMailDomain (void) /***** Mail domain *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("Domain",Cns_MAX_CHARS_EMAIL_ADDRESS,Mai_EditingMai->Domain, - " size=\"15\" required=\"required\""); + "size=\"15\" required=\"required\""); HTM_TD_End (); /***** Mail domain info *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("Info",Mai_MAX_CHARS_MAIL_INFO,Mai_EditingMai->Info, - " size=\"40\" required=\"required\""); + "size=\"40\" required=\"required\""); HTM_TD_End (); HTM_TD_Empty (1); @@ -1394,10 +1394,8 @@ static void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe, Frm_StartFormAnchor (NextAction,Mai_EMAIL_SECTION_ID); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); } - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_EMAIL_ADDRESS, - Gbl.Usrs.Me.UsrDat.Email); + HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrDat.Email, + "size=\"18\""); fprintf (Gbl.F.Out,"
"); Btn_PutCreateButtonInline (NumEmails ? Txt_Change_email : // User already has an email address Txt_Save_changes); // User has no email address yet diff --git a/swad_mark.c b/swad_mark.c index b78c1990..38739733 100644 --- a/swad_mark.c +++ b/swad_mark.c @@ -134,7 +134,7 @@ void Mrk_GetAndWriteNumRowsHeaderAndFooter (void) "%u", Marks.Header); HTM_INPUT_TEXT (Mrk_HeadOrFootStr[Brw_HEADER],5,StrHeadOrFoot, - " size=\"1\" class=\"LST_EDIT_ROWS COLOR%u\"" + "size=\"1\" class=\"LST_EDIT_ROWS COLOR%u\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.RowEvenOdd, Gbl.Form.Id); @@ -155,7 +155,7 @@ void Mrk_GetAndWriteNumRowsHeaderAndFooter (void) "%u", Marks.Footer); HTM_INPUT_TEXT (Mrk_HeadOrFootStr[Brw_FOOTER],5,StrHeadOrFoot, - " size=\"1\" class=\"LST_EDIT_ROWS COLOR%u\"" + "size=\"1\" class=\"LST_EDIT_ROWS COLOR%u\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.RowEvenOdd, Gbl.Form.Id); diff --git a/swad_match.c b/swad_match.c index 8bdd023e..522f3d45 100644 --- a/swad_match.c +++ b/swad_match.c @@ -1206,7 +1206,7 @@ static void Mch_PutFormNewMatch (struct Game *Game) HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("Title",Gam_MAX_CHARS_TITLE,Game->Title, - " size=\"45\" required=\"required\""); + "size=\"45\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_network.c b/swad_network.c index 850ab8ae..97050667 100644 --- a/swad_network.c +++ b/swad_network.c @@ -273,6 +273,7 @@ void Net_ShowFormMyWebsAndSocialNets (void) Net_WebsAndSocialNetworks_t NumURL; char URL[Cns_MAX_BYTES_WWW + 1]; char StrRecordWidth[10 + 1]; + char StrName[32]; /***** Start section *****/ HTM_SECTION_Begin (Net_MY_WEBS_ID); @@ -330,11 +331,11 @@ void Net_ShowFormMyWebsAndSocialNets (void) HTM_TD_End (); HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); - fprintf (Gbl.F.Out,"", - (unsigned) NumURL,(unsigned) NumURL, - Cns_MAX_CHARS_WWW,URL); + snprintf (StrName,sizeof (StrName), + "URL%u", + (unsigned) NumURL); + HTM_INPUT_URL ("WWW",StrName, + "class=\"REC_C2_BOT_INPUT\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_nickname.c b/swad_nickname.c index 02d9afee..e994d521 100644 --- a/swad_nickname.c +++ b/swad_nickname.c @@ -402,7 +402,7 @@ static void Nck_ShowFormChangeUsrNickname (const struct UsrData *UsrDat,bool Its "@%s", Gbl.Usrs.Me.UsrDat.Nickname); HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA,NicknameWithArroba, - " size=\"18\""); + "size=\"18\""); fprintf (Gbl.F.Out,"
"); Btn_PutCreateButtonInline (NumNicks ? Txt_Change_nickname : // I already have a nickname Txt_Save_changes); // I have no nickname yet); diff --git a/swad_password.c b/swad_password.c index 1806c9b1..07bc8be1 100644 --- a/swad_password.c +++ b/swad_password.c @@ -285,7 +285,7 @@ void Pwd_ShowFormSendNewPwd (void) HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"%s: ",Txt_nick_email_or_ID); HTM_INPUT_TEXT ("UsrId",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrIdLogin, - " size=\"8\" required=\"required\""); + "size=\"8\" required=\"required\""); HTM_LABEL_End (); /***** Send button and end box *****/ diff --git a/swad_place.c b/swad_place.c index 3ee88ab1..78f63e70 100644 --- a/swad_place.c +++ b/swad_place.c @@ -553,7 +553,7 @@ static void Plc_ListPlacesForEdition (void) Frm_StartForm (ActRenPlcSho); Plc_PutParamPlcCod (Plc->PlcCod); HTM_INPUT_TEXT ("ShortName",Plc_MAX_CHARS_PLACE_SHRT_NAME,Plc->ShrtName, - " class=\"INPUT_SHORT_NAME\"" + "class=\"INPUT_SHORT_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -564,7 +564,7 @@ static void Plc_ListPlacesForEdition (void) Frm_StartForm (ActRenPlcFul); Plc_PutParamPlcCod (Plc->PlcCod); HTM_INPUT_TEXT ("FullName",Plc_MAX_CHARS_PLACE_FULL_NAME,Plc->FullName, - " class=\"INPUT_FULL_NAME\"" + "class=\"INPUT_FULL_NAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -821,13 +821,13 @@ static void Plc_PutFormToCreatePlace (void) /***** Place short name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("ShortName",Plc_MAX_CHARS_PLACE_SHRT_NAME,Plc_EditingPlc->ShrtName, - " class=\"INPUT_SHORT_NAME\" required=\"required\""); + "class=\"INPUT_SHORT_NAME\" required=\"required\""); HTM_TD_End (); /***** Place full name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("FullName",Plc_MAX_CHARS_PLACE_FULL_NAME,Plc_EditingPlc->FullName, - " class=\"INPUT_FULL_NAME\" required=\"required\""); + "class=\"INPUT_FULL_NAME\" required=\"required\""); HTM_TD_End (); /***** Number of centres *****/ diff --git a/swad_plugin.c b/swad_plugin.c index 789c0e2b..8f091ca3 100644 --- a/swad_plugin.c +++ b/swad_plugin.c @@ -427,7 +427,7 @@ static void Plg_ListPluginsForEdition (void) Frm_StartForm (ActRenPlg); Plg_PutParamPlgCod (Plg->PlgCod); HTM_INPUT_TEXT ("Name",Plg_MAX_CHARS_PLUGIN_NAME,Plg->Name, - " size=\"10\"" + "size=\"10\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -438,7 +438,7 @@ static void Plg_ListPluginsForEdition (void) Frm_StartForm (ActChgPlgDes); Plg_PutParamPlgCod (Plg->PlgCod); HTM_INPUT_TEXT ("Description",Plg_MAX_CHARS_PLUGIN_DESCRIPTION,Plg->Description, - " size=\"30\"" + "size=\"30\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -449,7 +449,7 @@ static void Plg_ListPluginsForEdition (void) Frm_StartForm (ActChgPlgLog); Plg_PutParamPlgCod (Plg->PlgCod); HTM_INPUT_TEXT ("Logo",Plg_MAX_CHARS_PLUGIN_LOGO,Plg->Logo, - " size=\"4\"" + "size=\"4\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -460,7 +460,7 @@ static void Plg_ListPluginsForEdition (void) Frm_StartForm (ActChgPlgAppKey); Plg_PutParamPlgCod (Plg->PlgCod); HTM_INPUT_TEXT ("AppKey",Plg_MAX_CHARS_PLUGIN_APP_KEY,Plg->AppKey, - " size=\"16\"" + "size=\"16\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -470,10 +470,10 @@ static void Plg_ListPluginsForEdition (void) HTM_TD_Begin ("class=\"CM\""); Frm_StartForm (ActChgPlgURL); Plg_PutParamPlgCod (Plg->PlgCod); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Plg->URL,Gbl.Form.Id); + HTM_INPUT_URL ("URL",Plg->URL, + "size=\"15\"" + " onchange=\"document.getElementById('%s').submit();\"", + Gbl.Form.Id); Frm_EndForm (); HTM_TD_End (); @@ -482,7 +482,7 @@ static void Plg_ListPluginsForEdition (void) Frm_StartForm (ActChgPlgIP); Plg_PutParamPlgCod (Plg->PlgCod); HTM_INPUT_TEXT ("IP",Cns_MAX_CHARS_IP,Plg->IP, - " size=\"10\"" + "size=\"10\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -905,39 +905,37 @@ static void Plg_PutFormToCreatePlugin (void) /***** Plugin name *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("Name",Plg_MAX_CHARS_PLUGIN_NAME,Plg_EditingPlg->Name, - " size=\"10\" required=\"required\""); + "size=\"10\" required=\"required\""); HTM_TD_End (); /***** Plugin description *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("Description",Plg_MAX_CHARS_PLUGIN_DESCRIPTION,Plg_EditingPlg->Description, - " size=\"30\" required=\"required\""); + "size=\"30\" required=\"required\""); HTM_TD_End (); /***** Plugin logo *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("Logo",Plg_MAX_CHARS_PLUGIN_LOGO,Plg_EditingPlg->Logo, - " size=\"4\" required=\"required\""); + "size=\"4\" required=\"required\""); HTM_TD_End (); /***** Plugin application key *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("AppKey",Plg_MAX_CHARS_PLUGIN_APP_KEY,Plg_EditingPlg->AppKey, - " size=\"16\" required=\"required\""); + "size=\"16\" required=\"required\""); HTM_TD_End (); /***** Plugin URL *****/ HTM_TD_Begin ("class=\"CM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Plg_EditingPlg->URL); + HTM_INPUT_URL ("URL",Plg_EditingPlg->URL, + "size=\"15\" required=\"required\""); HTM_TD_End (); /***** Plugin IP address *****/ HTM_TD_Begin ("class=\"CM\""); HTM_INPUT_TEXT ("IP",Cns_MAX_CHARS_IP,Plg_EditingPlg->IP, - " size=\"10\" required=\"required\""); + "size=\"10\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_profile.c b/swad_profile.c index caafbbe8..d2b5a93a 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -212,7 +212,7 @@ void Prf_RequestUserProfile (void) "@%s", Gbl.Usrs.Me.UsrDat.Nickname); HTM_INPUT_TEXT ("usr",Nck_MAX_BYTES_NICKNAME_FROM_FORM,NicknameWithArroba, - " size=\"18\""); + "size=\"18\""); HTM_LABEL_End (); /***** Send button and end box *****/ diff --git a/swad_project.c b/swad_project.c index edfbf421..7bc46131 100644 --- a/swad_project.c +++ b/swad_project.c @@ -3306,7 +3306,7 @@ static void Prj_PutFormProject (struct Project *Prj,bool ItsANewProject) HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("Title",Prj_MAX_CHARS_PROJECT_TITLE,Prj->Title, - " size=\"45\" required=\"required\""); + "size=\"45\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); @@ -3422,9 +3422,8 @@ static void Prj_PutFormProject (struct Project *Prj,bool ItsANewProject) HTM_TD_End (); HTM_TD_Begin ("class=\"DAT LM\""); - fprintf (Gbl.F.Out,"", - Cns_MAX_CHARS_WWW,Prj->URL); + HTM_INPUT_URL ("URL",Prj->URL, + "size=\"45\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_record.c b/swad_record.c index a4b9a2cd..03dc8bf4 100644 --- a/swad_record.c +++ b/swad_record.c @@ -311,7 +311,7 @@ void Rec_ListFieldsRecordsForEdition (void) Frm_StartForm (ActRenFie); Par_PutHiddenParamLong (NULL,"FieldCod",Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod); HTM_INPUT_TEXT ("FieldName",Rec_MAX_CHARS_NAME_FIELD,Gbl.Crs.Records.LstFields.Lst[NumField].Name, - " class=\"REC_FIELDNAME\"" + "class=\"REC_FIELDNAME\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -325,7 +325,7 @@ void Rec_ListFieldsRecordsForEdition (void) "%u", Gbl.Crs.Records.LstFields.Lst[NumField].NumLines); HTM_INPUT_TEXT ("NumLines",2,StrNumLines, - " size=\"2\"" + "size=\"2\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); @@ -387,7 +387,7 @@ void Rec_ShowFormCreateRecordField (void) /***** Field name *****/ HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("FieldName",Rec_MAX_CHARS_NAME_FIELD,Gbl.Crs.Records.Field.Name, - " class=\"REC_FIELDNAME\" required=\"required\""); + "class=\"REC_FIELDNAME\" required=\"required\""); HTM_TD_End (); /***** Number of lines in form ******/ @@ -396,7 +396,7 @@ void Rec_ShowFormCreateRecordField (void) "%u", Gbl.Crs.Records.Field.NumLines); HTM_INPUT_TEXT ("NumLines",2,StrNumLines, - " size=\"2\" required=\"required\""); + "size=\"2\" required=\"required\""); HTM_TD_End (); /***** Visibility to students *****/ @@ -3174,7 +3174,7 @@ static void Rec_ShowSurname1 (struct UsrData *UsrDat, HTM_TD_Begin ("class=\"REC_C2_BOT REC_DAT_BOLD LM\""); if (ICanEdit) HTM_INPUT_TEXT ("Surname1",Usr_MAX_CHARS_FIRSTNAME_OR_SURNAME,UsrDat->Surname1, - " class=\"REC_C2_BOT_INPUT\"%s", + "class=\"REC_C2_BOT_INPUT\"%s", TypeOfView == Rec_SHA_MY_RECORD_FORM ? " required=\"required\"" : ""); else if (UsrDat->Surname1[0]) @@ -3205,7 +3205,7 @@ static void Rec_ShowSurname2 (struct UsrData *UsrDat, HTM_TD_Begin ("class=\"REC_C2_BOT REC_DAT_BOLD LM\""); if (ICanEdit) HTM_INPUT_TEXT ("Surname2",Usr_MAX_CHARS_FIRSTNAME_OR_SURNAME,UsrDat->Surname2, - " class=\"REC_C2_BOT_INPUT\""); + "class=\"REC_C2_BOT_INPUT\""); else if (UsrDat->Surname2[0]) fprintf (Gbl.F.Out,"%s",UsrDat->Surname2); HTM_TD_End (); @@ -3238,7 +3238,7 @@ static void Rec_ShowFirstName (struct UsrData *UsrDat, HTM_TD_Begin ("colspan=\"2\" class=\"REC_C2_BOT REC_DAT_BOLD LM\""); if (ICanEdit) HTM_INPUT_TEXT ("FirstName",Usr_MAX_CHARS_FIRSTNAME_OR_SURNAME,UsrDat->FirstName, - " class=\"REC_C2_BOT_INPUT\"%s", + "class=\"REC_C2_BOT_INPUT\"%s", TypeOfView == Rec_SHA_MY_RECORD_FORM ? " required=\"required\"" : ""); else if (UsrDat->FirstName[0]) @@ -3329,7 +3329,7 @@ static void Rec_ShowOriginPlace (struct UsrData *UsrDat, { if (ICanEdit) HTM_INPUT_TEXT ("OriginPlace",Usr_MAX_CHARS_ADDRESS,UsrDat->OriginPlace, - " class=\"REC_C2_BOT_INPUT\""); + "class=\"REC_C2_BOT_INPUT\""); else if (UsrDat->OriginPlace[0]) fprintf (Gbl.F.Out,"%s",UsrDat->OriginPlace); } @@ -3394,7 +3394,7 @@ static void Rec_ShowLocalAddress (struct UsrData *UsrDat, { if (ICanEdit) HTM_INPUT_TEXT ("LocalAddress",Usr_MAX_CHARS_ADDRESS,UsrDat->LocalAddress, - " class=\"REC_C2_BOT_INPUT\""); + "class=\"REC_C2_BOT_INPUT\""); else if (UsrDat->LocalAddress[0]) fprintf (Gbl.F.Out,"%s",UsrDat->LocalAddress); } @@ -3466,7 +3466,7 @@ static void Rec_ShowFamilyAddress (struct UsrData *UsrDat, { if (ICanEdit) HTM_INPUT_TEXT ("FamilyAddress",Usr_MAX_CHARS_ADDRESS,UsrDat->FamilyAddress, - " class=\"REC_C2_BOT_INPUT\""); + "class=\"REC_C2_BOT_INPUT\""); else if (UsrDat->FamilyAddress[0]) fprintf (Gbl.F.Out,"%s",UsrDat->FamilyAddress); } @@ -4181,7 +4181,7 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher) HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); Frm_StartFormAnchor (ActChgMyOff,Rec_MY_INS_CTR_DPT_ID); HTM_INPUT_TEXT ("Office",Usr_MAX_CHARS_ADDRESS,Gbl.Usrs.Me.UsrDat.Tch.Office, - " class=\"REC_C2_BOT_INPUT\"" + "class=\"REC_C2_BOT_INPUT\"" " onchange=\"document.getElementById('%s').submit();\"", Gbl.Form.Id); Frm_EndForm (); diff --git a/swad_survey.c b/swad_survey.c index 22893af2..7e25d135 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -1917,7 +1917,7 @@ void Svy_RequestCreatOrEditSvy (void) HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_TEXT ("Title",Svy_MAX_CHARS_SURVEY_TITLE,Svy.Title, - " size=\"45\" required=\"required\""); + "size=\"45\" required=\"required\""); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_syllabus.c b/swad_syllabus.c index a9dfe6cc..bfe559d9 100644 --- a/swad_syllabus.c +++ b/swad_syllabus.c @@ -918,7 +918,7 @@ static void Syl_PutFormItemSyllabus (bool NewItem,unsigned NumItem,int Level,int Gbl.Syllabus.ParamNumItem = NumItem; Syl_PutParamNumItem (); HTM_INPUT_TEXT ("Txt",Syl_MAX_CHARS_TEXT_ITEM,Text, - " size=\"60\" placeholder=\"%s\"", + "size=\"60\" placeholder=\"%s\"", Txt_Enter_a_new_item_here); if (NewItem) fprintf (Gbl.F.Out," autofocus=\"autofocus\""); diff --git a/swad_user.c b/swad_user.c index 8add97da..77597b6f 100644 --- a/swad_user.c +++ b/swad_user.c @@ -2611,7 +2611,7 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) (void)) Ico_PutIcon ("user.svg",Txt_User[Usr_SEX_UNKNOWN],"CONTEXT_ICO_16x16"); HTM_LABEL_End (); HTM_INPUT_TEXT ("UsrId",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrIdLogin, - " size=\"18\" placeholder=\"%s\"" + "size=\"18\" placeholder=\"%s\"" " autofocus=\"autofocus\" required=\"required\"", Txt_nick_email_or_ID); HTM_DIV_End ();