diff --git a/swad_ID.c b/swad_ID.c index ebc5f848f..affaad002 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -497,7 +497,7 @@ static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID, Frm_LinkFormSubmit (Txt_Confirm_ID,The_ClassFormOutBoxBold[Gbl.Prefs.Theme],NULL); Ico_PutIconTextLink ("check.svg", Txt_Confirm_ID); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); /***** End form *****/ Frm_EndForm (); diff --git a/swad_agenda.c b/swad_agenda.c index 98ce44dc7..0adf4ba7e 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -588,13 +588,15 @@ static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType) break; } Par_PutHiddenParamUnsigned ("Order",(unsigned) Order); + Frm_LinkFormSubmit (Txt_START_END_TIME_HELP[Order],"TIT_TBL",NULL); if (Order == Gbl.Agenda.SelectedOrder) fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,"%s",Txt_START_END_TIME[Order]); if (Order == Gbl.Agenda.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); + Frm_EndForm (); HTM_TH_End (); } diff --git a/swad_assignment.c b/swad_assignment.c index f23c4b11f..733e62724 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -226,7 +226,7 @@ static void Asg_PutHeadForSeeing (bool PrintView) { if (Order == Gbl.Asgs.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } diff --git a/swad_attendance.c b/swad_attendance.c index a7b94eb68..3ebb492d8 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -257,7 +257,7 @@ static void Att_ShowAllAttEvents (void) fprintf (Gbl.F.Out,"%s",Txt_START_END_TIME[Order]); if (Order == Gbl.AttEvents.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TH_End (); @@ -2183,7 +2183,8 @@ static void Att_PutLinkAttEvent (struct AttendanceEvent *AttEvent, Att_PutParamAttCod (AttEvent->AttCod); Att_PutParamsCodGrps (AttEvent->AttCod); Frm_LinkFormSubmit (Title,LinkStyle,NULL); - fprintf (Gbl.F.Out,"%s",Txt); + fprintf (Gbl.F.Out,"%s",Txt); + Frm_LinkFormEnd (); Frm_EndForm (); } @@ -3165,6 +3166,7 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView) The_ClassFormInBoxBold[Gbl.Prefs.Theme], NULL); Ico_PutCalculateIconWithText (Txt_Update_attendance); + Frm_LinkFormEnd (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_banner.c b/swad_banner.c index be6b5ab9e..e8392d854 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -1054,12 +1054,12 @@ void Ban_WriteMenuWithBanners (void) Frm_LinkFormSubmit (Gbl.Banners.Lst[NumBan].FullName,"BANNER",NULL); fprintf (Gbl.F.Out,"\"%s\"" - "", + " class=\"BANNER\" />", Cfg_URL_BANNER_PUBLIC, Gbl.Banners.Lst[NumBan].Img, Gbl.Banners.Lst[NumBan].ShrtName, Gbl.Banners.Lst[NumBan].FullName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); } diff --git a/swad_centre.c b/swad_centre.c index 629f345bd..a7fdcc9bc 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -249,11 +249,12 @@ void Ctr_DrawCentreLogoAndNameWithLink (struct Centre *Ctr,Act_Action_t Action, Ctr->FullName); Frm_LinkFormSubmit (Gbl.Title,ClassLink,NULL); - /***** Draw centre logo *****/ + /***** Centre logo and name *****/ Log_DrawLogo (Hie_CTR,Ctr->CtrCod,Ctr->ShrtName,16,ClassLogo,true); + fprintf (Gbl.F.Out," %s",Ctr->FullName); /***** End link *****/ - fprintf (Gbl.F.Out," %s",Ctr->FullName); + Frm_LinkFormEnd (); /***** End form *****/ Frm_EndForm (); @@ -664,8 +665,8 @@ static void Ctr_Configuration (bool PrintView) Txt_Degrees_of_CENTRE_X, Gbl.Hierarchy.Ctr.ShrtName); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); - fprintf (Gbl.F.Out,"%u", - Deg_GetNumDegsInCtr (Gbl.Hierarchy.Ctr.CtrCod)); + fprintf (Gbl.F.Out,"%u",Deg_GetNumDegsInCtr (Gbl.Hierarchy.Ctr.CtrCod)); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); @@ -2642,7 +2643,7 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable) { if (Order == Gbl.Hierarchy.Ins.Ctrs.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_TH_End (); diff --git a/swad_changelog.h b/swad_changelog.h index 0c28261ed..4dc632b6d 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -487,13 +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.45 (2019-10-26)" +#define Log_PLATFORM_VERSION "SWAD 19.45.1 (2019-10-27)" #define CSS_FILE "swad19.45.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: Cambiar por Frm_LinkFormEnd (); a partir de swad_layout incluido. + Version 19.45.1: Oct 27, 2019 Code refactoring in HTML forms. (246481 lines) Version 19.45: Oct 26, 2019 Code refactoring in HTML lists. (246444 lines) Version 19.44.4: Oct 26, 2019 Fixed bug in HTML divs. (246370 lines) Version 19.44.3: Oct 26, 2019 Code refactoring in HTML lists. (246369 lines) diff --git a/swad_chat.c b/swad_chat.c index 8fedbed56..bbc57e338 100644 --- a/swad_chat.c +++ b/swad_chat.c @@ -352,7 +352,7 @@ static void Cht_WriteLinkToChat2 (const char *RoomCode,const char *RoomFullName) Txt_connected_SINGULAR); if (NumUsrsInRoom) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_LI_End (); } diff --git a/swad_classroom.c b/swad_classroom.c index 89af1ec56..bab19a391 100644 --- a/swad_classroom.c +++ b/swad_classroom.c @@ -129,7 +129,7 @@ void Cla_SeeClassrooms (void) fprintf (Gbl.F.Out,"%s",Txt_CLASSROOMS_ORDER[Order]); if (Order == Gbl.Classrooms.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TH_End (); } diff --git a/swad_connected.c b/swad_connected.c index 0d0c938c5..dce77ca8b 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -133,6 +133,7 @@ static void Con_PutIconToUpdateConnected (void) Sco_PutParamScope ("ScopeCon",Gbl.Scope.Current); Frm_LinkFormSubmitAnimated (Txt_Update,NULL,NULL); Ico_PutCalculateIcon (Txt_Update); + Frm_LinkFormEnd (); Frm_EndForm (); } @@ -176,7 +177,7 @@ void Con_ShowGlobalConnectedUsrs (void) (Gbl.Session.NumSessions == 1) ? Txt_session : Txt_sessions); /* End link to view more details about connected users */ - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); if (NumUsrsTotal) @@ -321,9 +322,8 @@ void Con_ShowConnectedUsrsBelongingToCurrentCrs (void) Str_Copy (CourseName,Gbl.Hierarchy.Crs.ShrtName, Hie_MAX_BYTES_SHRT_NAME); Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_UNK,&Usrs); - fprintf (Gbl.F.Out,"%u %s %s" - "", - Usrs.NumUsrs,Txt_from,CourseName); + fprintf (Gbl.F.Out,"%u %s %s",Usrs.NumUsrs,Txt_from,CourseName); + Frm_LinkFormEnd (); Frm_EndForm (); /***** Number of teachers and students *****/ @@ -414,10 +414,10 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Ro Sco_PutParamScope ("ScopeCon",Hie_CRS); Frm_LinkFormSubmitUnique (Txt_Connected_users,"CONNECTED_TXT"); fprintf (Gbl.F.Out,"\"%s\"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICO40x40\" />", Cfg_URL_ICON_PUBLIC, Txt_Connected_users,Txt_Connected_users); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); @@ -851,7 +851,7 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role) HTM_DIV_Begin ("class=\"CON_NAME_NARROW\""); // Limited width Frm_LinkFormSubmitUnique (Txt_View_record_for_this_course,Font); Usr_WriteFirstNameBRSurnames (UsrDat); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); HTM_DIV_End (); Frm_EndForm (); @@ -1069,7 +1069,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R Frm_LinkFormSubmit (UsrDat.FullName,Font,NULL); Usr_WriteFirstNameBRSurnames (&UsrDat); if (PutLinkToRecord) - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); HTM_DIV_End (); if (PutLinkToRecord) diff --git a/swad_country.c b/swad_country.c index 52a41c8fa..f8bc1adcc 100644 --- a/swad_country.c +++ b/swad_country.c @@ -404,8 +404,8 @@ static void Cty_Configuration (bool PrintView) Txt_Institutions_of_COUNTRY_X, Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); - fprintf (Gbl.F.Out,"%u", - Ins_GetNumInssInCty (Gbl.Hierarchy.Cty.CtyCod)); + fprintf (Gbl.F.Out,"%u",Ins_GetNumInssInCty (Gbl.Hierarchy.Cty.CtyCod)); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); @@ -677,7 +677,7 @@ static void Cty_PutHeadCountriesForSeeing (bool OrderSelectable) { if (Order == Gbl.Hierarchy.Sys.Ctys.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_TH_End (); @@ -1291,7 +1291,8 @@ void Cty_WriteCountryName (long CtyCod,const char *ClassLink) Cty_PutParamCtyCod (CtyCod); Frm_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt), ClassLink,NULL); - fprintf (Gbl.F.Out,"%s",CtyName); + fprintf (Gbl.F.Out,"%s",CtyName); + Frm_LinkFormEnd (); Frm_EndForm (); } else diff --git a/swad_course.c b/swad_course.c index ba88acacd..fc5e45adf 100644 --- a/swad_course.c +++ b/swad_course.c @@ -597,11 +597,12 @@ static void Crs_WriteListMyCoursesToSelectOne (void) NULL); fprintf (Gbl.F.Out,"\"%s\" %s", + " class=\"ICO16x16\" /> %s", Cfg_URL_ICON_PUBLIC, Txt_System, Txt_System, Txt_System); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_LI_End (); @@ -634,13 +635,14 @@ static void Crs_WriteListMyCoursesToSelectOne (void) /* Country map */ fprintf (Gbl.F.Out,"\"%s\" %s", + " class=\"ICO16x16\" /> %s", Cfg_URL_ICON_COUNTRIES_PUBLIC, Cty.Alpha2, Cty.Alpha2, Cty.Alpha2, Cty.Name[Gbl.Prefs.Language], Cty.Name[Gbl.Prefs.Language]); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_LI_End (); @@ -672,7 +674,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Highlight ? ClassHighlight : ClassNormal,NULL); Log_DrawLogo (Hie_INS,Ins.InsCod,Ins.ShrtName,16,NULL,true); - fprintf (Gbl.F.Out," %s",Ins.FullName); + fprintf (Gbl.F.Out," %s",Ins.FullName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_LI_End (); @@ -704,7 +707,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Highlight ? ClassHighlight : ClassNormal,NULL); Log_DrawLogo (Hie_CTR,Ctr.CtrCod,Ctr.ShrtName,16,NULL,true); - fprintf (Gbl.F.Out," %s",Ctr.FullName); + fprintf (Gbl.F.Out," %s",Ctr.FullName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_LI_End (); @@ -736,7 +740,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Highlight ? ClassHighlight : ClassNormal,NULL); Log_DrawLogo (Hie_DEG,Deg.DegCod,Deg.ShrtName,16,NULL,true); - fprintf (Gbl.F.Out," %s",Deg.FullName); + fprintf (Gbl.F.Out," %s",Deg.FullName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_LI_End (); @@ -773,12 +778,12 @@ static void Crs_WriteListMyCoursesToSelectOne (void) fprintf (Gbl.F.Out,"\"%s\"" - " %s" - "", + " %s", Cfg_URL_ICON_PUBLIC, Crs.ShrtName, Crs.FullName, Crs.FullName); + Frm_LinkFormEnd (); Frm_EndForm (); /***** Put link to register students *****/ @@ -1312,8 +1317,8 @@ static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year) Txt_Go_to_X, Crs->FullName); Frm_LinkFormSubmit (Gbl.Title,TxtClassStrong,NULL); - fprintf (Gbl.F.Out,"%s", - Crs->FullName); + fprintf (Gbl.F.Out,"%s",Crs->FullName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); @@ -2950,10 +2955,10 @@ void Crs_PutIconToSelectMyCoursesInBreadcrumb (void) Frm_LinkFormSubmit (Txt_My_courses,NULL,NULL); fprintf (Gbl.F.Out,"\"%s\"" - "", + " class=\"BC_ICON ICO_HIGHLIGHT\" />", Gbl.Prefs.URLTheme, Txt_My_courses,Txt_My_courses); + Frm_LinkFormEnd (); /***** End form *****/ Frm_EndForm (); @@ -3254,9 +3259,8 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA row[2]); Frm_LinkFormSubmit (Gbl.Title,StyleNoBR,NULL); Log_DrawLogo (Hie_DEG,Deg.DegCod,Deg.ShrtName,20,"CT",true); - fprintf (Gbl.F.Out," %s (%s)" - "", - row[2],row[6]); + fprintf (Gbl.F.Out," %s (%s)",row[2],row[6]); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); @@ -3273,7 +3277,8 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA Txt_Go_to_X, row[6]); Frm_LinkFormSubmit (Gbl.Title,Style,NULL); - fprintf (Gbl.F.Out,"%s",row[5]); + fprintf (Gbl.F.Out,"%s",row[5]); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); diff --git a/swad_date.c b/swad_date.c index 901721083..066465639 100644 --- a/swad_date.c +++ b/swad_date.c @@ -316,8 +316,8 @@ void Dat_ShowClientLocalTime (void) Frm_StartForm (ActSeeCal); Frm_LinkFormSubmit (Txt_Show_calendar,"CURRENT_MONTH",NULL); fprintf (Gbl.F.Out,"" // JavaScript will write HTML here - "" - ""); + ""); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -332,7 +332,7 @@ void Dat_ShowClientLocalTime (void) ""); if (Gbl.Usrs.Me.Logged) { - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_DIV_End (); diff --git a/swad_degree.c b/swad_degree.c index 3170dbfda..52bc162e7 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -255,11 +255,12 @@ void Deg_DrawDegreeLogoAndNameWithLink (struct Degree *Deg,Act_Action_t Action, Deg->FullName); Frm_LinkFormSubmit (Gbl.Title,ClassLink,NULL); - /***** Draw degree logo *****/ + /***** Degree logo and name *****/ Log_DrawLogo (Hie_DEG,Deg->DegCod,Deg->ShrtName,16,ClassLogo,true); + fprintf (Gbl.F.Out," %s",Deg->FullName); /***** End link *****/ - fprintf (Gbl.F.Out," %s",Deg->FullName); + Frm_LinkFormEnd (); /***** End form *****/ Frm_EndForm (); @@ -535,8 +536,8 @@ static void Deg_Configuration (bool PrintView) Txt_Courses_of_DEGREE_X, Gbl.Hierarchy.Deg.ShrtName); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); - fprintf (Gbl.F.Out,"%u", - Crs_GetNumCrssInDeg (Gbl.Hierarchy.Deg.DegCod)); + fprintf (Gbl.F.Out,"%u",Crs_GetNumCrssInDeg (Gbl.Hierarchy.Deg.DegCod)); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); diff --git a/swad_degree_type.c b/swad_degree_type.c index 7e3978d5a..e73b4f6d3 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -536,7 +536,7 @@ static void DT_PutHeadDegreeTypesForSeeing (Act_Action_t NextAction,DT_Order_t S fprintf (Gbl.F.Out,"%s",Txt_DEGREE_TYPES_ORDER[Order]); if (Order == SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); /* End form */ Frm_EndForm (); diff --git a/swad_department.c b/swad_department.c index b968976f3..68b86a532 100644 --- a/swad_department.c +++ b/swad_department.c @@ -135,7 +135,7 @@ void Dpt_SeeDepts (void) fprintf (Gbl.F.Out,"%s",Txt_DEPARTMENTS_ORDER[Order]); if (Order == Gbl.Dpts.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TH_End (); diff --git a/swad_enrolment.c b/swad_enrolment.c index e4e429ed4..ae6231477 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -2873,9 +2873,8 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) Txt_Go_to_X, Crs.FullName); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); - fprintf (Gbl.F.Out,"%s > %s" - "", - Deg.ShrtName,Crs.ShrtName); + fprintf (Gbl.F.Out,"%s > %s",Deg.ShrtName,Crs.ShrtName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); diff --git a/swad_figure.c b/swad_figure.c index 88cb7dcbf..63ce82284 100644 --- a/swad_figure.c +++ b/swad_figure.c @@ -1497,7 +1497,8 @@ static void Fig_ShowInss (MYSQL_RES **mysql_res,unsigned NumInss, 40,NULL,true); fprintf (Gbl.F.Out," "); } - fprintf (Gbl.F.Out,"%s",Ins.FullName); + fprintf (Gbl.F.Out,"%s",Ins.FullName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); diff --git a/swad_file_browser.c b/swad_file_browser.c index 0b4168b45..18372ba79 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -3395,13 +3395,14 @@ static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat) /***** Show user's name *****/ fprintf (Gbl.F.Out,"
"); + Frm_LinkFormSubmit (Txt_View_record_for_this_course,"AUTHOR_TXT",NULL); fprintf (Gbl.F.Out,"%s",UsrDat->Surname1); if (UsrDat->Surname2[0]) fprintf (Gbl.F.Out," %s",UsrDat->Surname2); if (UsrDat->FirstName[0]) fprintf (Gbl.F.Out,", %s",UsrDat->FirstName); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); /***** Show user's email *****/ if (UsrDat->Email[0]) @@ -6164,7 +6165,7 @@ static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size, Brw_PutIconFile (Size,FileMetadata->FilFolLnk.Type,FileMetadata->FilFolLnk.Name); /***** End link and form *****/ - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } @@ -6314,8 +6315,8 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic) Gbl.FileBrowser.Type == Brw_SHOW_MRK_GRP) ? Txt_Check_marks_in_the_file : Txt_Download, Gbl.FileBrowser.TxtStyle,NULL); - fprintf (Gbl.F.Out,"%s", - FileNameToShow); + fprintf (Gbl.F.Out,"%s",FileNameToShow); + Frm_LinkFormEnd (); Frm_EndForm (); /* Put icon to make public/private file */ @@ -10049,10 +10050,10 @@ static void Brw_WriteBigLinkToDownloadFile (const char *URL, fprintf (Gbl.F.Out," %s " "\"%s\"" - "", + " class=\"ICO40x40\" />", FileNameToShow,Cfg_URL_ICON_PUBLIC, Txt_Check_marks_in_the_file,Txt_Check_marks_in_the_file); + Frm_LinkFormEnd (); Frm_EndForm (); } else @@ -10103,13 +10104,18 @@ static void Brw_WriteSmallLinkToDownloadFile (const char *URL, /* Link begin */ Frm_LinkFormSubmit (Txt_Check_marks_in_the_file,"DAT",NULL); - /* Name of the file of marks, link end and form end */ - fprintf (Gbl.F.Out,"%s",FileNameToShow); + /* Name of the file of marks */ + fprintf (Gbl.F.Out,"%s",FileNameToShow); + + /* Link end and form end */ + Frm_LinkFormEnd (); Frm_EndForm (); } else /* Put anchor and filename */ - fprintf (Gbl.F.Out,"%s", + fprintf (Gbl.F.Out,"" + "%s" + "", URL,FileNameToShow,FileNameToShow); } @@ -11952,7 +11958,8 @@ static void Brw_WriteRowDocData (unsigned long *NumDocsNotHidden,MYSQL_ROW row) InsShortName); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); Log_DrawLogo (Hie_INS,InsCod,InsShortName,20,"CT",true); - fprintf (Gbl.F.Out," %s",InsShortName); + fprintf (Gbl.F.Out," %s",InsShortName); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_TD_End (); @@ -11968,7 +11975,8 @@ static void Brw_WriteRowDocData (unsigned long *NumDocsNotHidden,MYSQL_ROW row) CtrShortName); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); Log_DrawLogo (Hie_CTR,CtrCod,CtrShortName,20,"CT",true); - fprintf (Gbl.F.Out," %s",CtrShortName); + fprintf (Gbl.F.Out," %s",CtrShortName); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_TD_End (); @@ -11984,7 +11992,8 @@ static void Brw_WriteRowDocData (unsigned long *NumDocsNotHidden,MYSQL_ROW row) DegShortName); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); Log_DrawLogo (Hie_DEG,DegCod,DegShortName,20,"CT",true); - fprintf (Gbl.F.Out," %s",DegShortName); + fprintf (Gbl.F.Out," %s",DegShortName); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_TD_End (); @@ -11999,7 +12008,8 @@ static void Brw_WriteRowDocData (unsigned long *NumDocsNotHidden,MYSQL_ROW row) Txt_Go_to_X, CrsShortName); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); - fprintf (Gbl.F.Out,"%s",CrsShortName); + fprintf (Gbl.F.Out,"%s",CrsShortName); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_TD_End (); @@ -12110,9 +12120,8 @@ static void Brw_WriteRowDocData (unsigned long *NumDocsNotHidden,MYSQL_ROW row) else /* Icon with file type or link */ Brw_PutIconFile (16,FileMetadata.FilFolLnk.Type,FileMetadata.FilFolLnk.Name); - fprintf (Gbl.F.Out," %s" - "", - FileNameToShow); + fprintf (Gbl.F.Out," %s",FileNameToShow); + Frm_LinkFormEnd (); /* End form */ Frm_EndForm (); diff --git a/swad_follow.c b/swad_follow.c index d03d50fe3..666750200 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -213,7 +213,8 @@ void Fol_SuggestUsrsToFollowMainZoneOnRightColumn (void) /***** Title with link to suggest more users to follow *****/ Frm_StartForm (ActSeeSocPrf); Frm_LinkFormSubmit (Txt_Who_to_follow,"CONNECTED_TXT",NULL); - fprintf (Gbl.F.Out,"%s",Txt_Who_to_follow); + fprintf (Gbl.F.Out,"%s",Txt_Who_to_follow); + Frm_LinkFormEnd (); Frm_EndForm (); /***** Begin table *****/ @@ -436,6 +437,7 @@ static void Fol_PutIconToUpdateWhoToFollow (void) Frm_StartForm (ActSeeSocPrf); Frm_LinkFormSubmitAnimated (Txt_Update,NULL,NULL); Ico_PutCalculateIcon (Txt_Update); + Frm_LinkFormEnd (); Frm_EndForm (); } @@ -562,7 +564,7 @@ void Fol_ShowFollowingAndFollowers (const struct UsrData *UsrDat, Cfg_URL_ICON_PUBLIC, Txt_Unfollow,Txt_Following_unfollow); HTM_DIV_End (); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } else // I do not follow this user @@ -577,7 +579,7 @@ void Fol_ShowFollowingAndFollowers (const struct UsrData *UsrDat, Cfg_URL_ICON_PUBLIC, Txt_Follow,Txt_Follow); HTM_DIV_End (); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } } @@ -623,7 +625,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat, fprintf (Gbl.F.Out,"%u",NumUsrs); if (NumUsrs) { - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } else @@ -646,7 +648,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat, fprintf (Gbl.F.Out,"%s",Title); if (NumUsrs) { - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_DIV_End (); @@ -860,7 +862,7 @@ static void Fol_ShowFollowedOrFollower (struct UsrData *UsrDat) HTM_DIV_Begin ("class=\"FOLLOW_USR_NAME\""); // Limited width Frm_LinkFormSubmit (Txt_Another_user_s_profile,"DAT",NULL); Usr_WriteFirstNameBRSurnames (UsrDat); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); HTM_DIV_End (); Frm_EndForm (); } @@ -917,7 +919,7 @@ static void Fol_WriteRowUsrToFollowOnRightColumn (struct UsrData *UsrDat) HTM_DIV_Begin ("class=\"CON_NAME_FOLLOW\""); // Limited width Frm_LinkFormSubmit (Txt_Another_user_s_profile,"CON_CRS",NULL); Usr_WriteFirstNameBRSurnames (UsrDat); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); HTM_DIV_End (); Frm_EndForm (); } @@ -976,7 +978,7 @@ static void Fol_PutIconToFollow (struct UsrData *UsrDat) Cfg_URL_ICON_PUBLIC, Txt_Follow,Txt_Follow); HTM_DIV_End (); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } @@ -998,7 +1000,7 @@ static void Fol_PutIconToUnfollow (struct UsrData *UsrDat) Cfg_URL_ICON_PUBLIC, Txt_Unfollow,Txt_Unfollow); HTM_DIV_End (); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } diff --git a/swad_form.c b/swad_form.c index 1a427e09f..76f819646 100644 --- a/swad_form.c +++ b/swad_form.c @@ -233,7 +233,6 @@ void Frm_EndForm (void) /*****************************************************************************/ /******************* Anchor directive used to send a form ********************/ /*****************************************************************************/ -// Requires an extern void Frm_LinkFormSubmit (const char *Title,const char *LinkClass, const char *OnSubmit) @@ -293,6 +292,11 @@ void Frm_LinkFormSubmitAnimated (const char *Title,const char *LinkClass, Gbl.Form.Id); } +void Frm_LinkFormEnd (void) + { + fprintf (Gbl.F.Out,""); + } + /*****************************************************************************/ /***************************** Get unique Id *********************************/ /*****************************************************************************/ diff --git a/swad_form.h b/swad_form.h index 0e4802543..68ce4a829 100644 --- a/swad_form.h +++ b/swad_form.h @@ -69,6 +69,7 @@ void Frm_LinkFormSubmitId (const char *Title,const char *LinkClass, const char *Id,const char *OnSubmit); void Frm_LinkFormSubmitAnimated (const char *Title,const char *LinkClass, const char *OnSubmit); +void Frm_LinkFormEnd (void); void Frm_SetUniqueId (char UniqueId[Frm_MAX_BYTES_ID + 1]); diff --git a/swad_forum.c b/swad_forum.c index 79322b5c9..993b1aa5d 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -2142,7 +2142,7 @@ static void For_WriteLinkToForum (struct Forum *Forum, For_WriteNumberOfThrs (NumThrs,NumThrsWithNewPosts); /***** End row *****/ - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); /***** Put link to register students *****/ @@ -2584,7 +2584,7 @@ static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted, fprintf (Gbl.F.Out,"%s",Txt_FORUM_THREAD_ORDER[Order]); if (Order == Gbl.Forum.ThreadsOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TH_End (); diff --git a/swad_game.c b/swad_game.c index 9330e797f..168000fdd 100644 --- a/swad_game.c +++ b/swad_game.c @@ -230,7 +230,7 @@ static void Gam_ListAllGames (void) fprintf (Gbl.F.Out,"%s",Txt_GAMES_ORDER[Order]); if (Order == Gbl.Games.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TH_End (); @@ -455,8 +455,8 @@ void Gam_ShowOneGame (long GamCod, Frm_LinkFormSubmit (Txt_View_game, Game.Hidden ? "ASG_TITLE_LIGHT": "ASG_TITLE",NULL); - fprintf (Gbl.F.Out,"%s", - Game.Title); + fprintf (Gbl.F.Out,"%s",Game.Title); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_ARTICLE_End (); @@ -482,7 +482,8 @@ void Gam_ShowOneGame (long GamCod, "ASG_TITLE",NULL); if (ShowOnlyThisGame) fprintf (Gbl.F.Out,"%s: ",Txt_Matches); - fprintf (Gbl.F.Out,"%u",Game.NumMchs); + fprintf (Gbl.F.Out,"%u",Game.NumMchs); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); diff --git a/swad_group.c b/swad_group.c index d911517c3..c19add8f9 100644 --- a/swad_group.c +++ b/swad_group.c @@ -415,6 +415,7 @@ void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void), The_ClassFormInBoxBold[Gbl.Prefs.Theme], "CopyMessageToHiddenFields();"); Ico_PutCalculateIconWithText (Txt_Update_users); + Frm_LinkFormEnd (); HTM_DIV_End (); /***** End form *****/ diff --git a/swad_hierarchy.c b/swad_hierarchy.c index 1281bb953..2e8994065 100644 --- a/swad_hierarchy.c +++ b/swad_hierarchy.c @@ -210,7 +210,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) Frm_StartFormGoTo (ActMnu); Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) TabSys); Frm_LinkFormSubmit (Txt_System,ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Txt_System); + fprintf (Gbl.F.Out,"%s",Txt_System); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -226,7 +227,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) Frm_StartFormGoTo (ActSeeIns); Cty_PutParamCtyCod (Gbl.Hierarchy.Cty.CtyCod); Frm_LinkFormSubmit (Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language],ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]); + fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -241,7 +243,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) /***** Form to go to select countries *****/ Frm_StartFormGoTo (ActSeeCty); Frm_LinkFormSubmit (Txt_Country,ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Txt_Country); + fprintf (Gbl.F.Out,"%s",Txt_Country); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -258,7 +261,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) Frm_StartFormGoTo (ActSeeCtr); Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod); Frm_LinkFormSubmit (Gbl.Hierarchy.Ins.FullName,ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Ins.ShrtName); + fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Ins.ShrtName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -273,7 +277,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) /***** Form to go to select institutions *****/ Frm_StartFormGoTo (ActSeeIns); Frm_LinkFormSubmit (Txt_Institution,ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Txt_Institution); + fprintf (Gbl.F.Out,"%s",Txt_Institution); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -302,7 +307,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) Frm_StartFormGoTo (ActSeeDeg); Ctr_PutParamCtrCod (Gbl.Hierarchy.Ctr.CtrCod); Frm_LinkFormSubmit (Gbl.Hierarchy.Ctr.FullName,ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Ctr.ShrtName); + fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Ctr.ShrtName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -317,7 +323,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) /***** Form to go to select centres *****/ Frm_StartFormGoTo (ActSeeCtr); Frm_LinkFormSubmit (Txt_Centre,ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Txt_Centre); + fprintf (Gbl.F.Out,"%s",Txt_Centre); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -346,7 +353,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) Frm_StartFormGoTo (ActSeeCrs); Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod); Frm_LinkFormSubmit (Gbl.Hierarchy.Deg.FullName,ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Deg.ShrtName); + fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Deg.ShrtName); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); @@ -361,7 +369,8 @@ void Hie_WriteHierarchyInBreadcrumb (void) /***** Form to go to select degrees *****/ Frm_StartFormGoTo (ActSeeDeg); Frm_LinkFormSubmit (Txt_Degree,ClassTxt,NULL); - fprintf (Gbl.F.Out,"%s",Txt_Degree); + fprintf (Gbl.F.Out,"%s",Txt_Degree); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_DIV_End (); diff --git a/swad_holiday.c b/swad_holiday.c index b1b083eb5..8737e9242 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -131,7 +131,7 @@ void Hld_SeeHolidays (void) fprintf (Gbl.F.Out,"%s",Txt_HOLIDAYS_ORDER[Order]); if (Order == Gbl.Hlds.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TH_End (); diff --git a/swad_icon.c b/swad_icon.c index 1a2eb0bfa..f51720c11 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -430,8 +430,6 @@ void Ico_PutCalculateIcon (const char *Title) Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Title,Title, Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Title,Title); HTM_DIV_End (); - - fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -453,8 +451,6 @@ void Ico_PutCalculateIconWithText (const char *Text) Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Text,Text, Text); HTM_DIV_End (); - - fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_info.c b/swad_info.c index 1cf9b811b..632a7d5d3 100644 --- a/swad_info.c +++ b/swad_info.c @@ -613,9 +613,8 @@ void Inf_WriteMsgYouMustReadInfo (void) Frm_StartForm (Inf_ActionsSeeInfo[InfoType]); Frm_LinkFormSubmit (Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType]), The_ClassFormInBox[Gbl.Prefs.Theme],NULL); - fprintf (Gbl.F.Out,"%s" - "", - Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType])); + fprintf (Gbl.F.Out,"%s",Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType])); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_LI_End (); } diff --git a/swad_institution.c b/swad_institution.c index 1f33b987d..a7e5443ed 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -241,7 +241,7 @@ void Ins_DrawInstitutionLogoWithLink (struct Instit *Ins,unsigned Size) Size,NULL,true); if (PutLink) { - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } } @@ -265,11 +265,12 @@ void Ins_DrawInstitutionLogoAndNameWithLink (struct Instit *Ins,Act_Action_t Act Ins->FullName); Frm_LinkFormSubmit (Gbl.Title,ClassLink,NULL); - /***** Draw institution logo *****/ + /***** Institution logo and name *****/ Log_DrawLogo (Hie_INS,Ins->InsCod,Ins->ShrtName,16,ClassLogo,true); + fprintf (Gbl.F.Out," %s",Ins->FullName); /***** End link *****/ - fprintf (Gbl.F.Out," %s",Ins->FullName); + Frm_LinkFormEnd (); /***** End form *****/ Frm_EndForm (); @@ -562,8 +563,8 @@ static void Ins_Configuration (bool PrintView) Txt_Centres_of_INSTITUTION_X, Gbl.Hierarchy.Ins.ShrtName); Frm_LinkFormSubmit (Gbl.Title,"DAT",NULL); - fprintf (Gbl.F.Out,"%u", - Ctr_GetNumCtrsInIns (Gbl.Hierarchy.Ins.InsCod)); + fprintf (Gbl.F.Out,"%u",Ctr_GetNumCtrsInIns (Gbl.Hierarchy.Ins.InsCod)); + Frm_LinkFormEnd (); Frm_EndForm (); HTM_TD_End (); @@ -889,7 +890,7 @@ static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable) { if (Order == Gbl.Hierarchy.Cty.Inss.SelectedOrder) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Frm_LinkFormEnd (); Frm_EndForm (); } HTM_TH_End (); diff --git a/swad_message.c b/swad_message.c index dc11327e9..a0092f7a8 100644 --- a/swad_message.c +++ b/swad_message.c @@ -1773,6 +1773,7 @@ static void Msg_ShowSentOrReceivedMessages (void) The_ClassFormInBoxBold[Gbl.Prefs.Theme], NULL); Ico_PutCalculateIconWithText (Txt_Update_messages); // Animated icon to update messages + Frm_LinkFormEnd (); Mnu_ContextMenuEnd (); Frm_EndForm (); diff --git a/swad_photo.c b/swad_photo.c index 087c34d44..bdbc36751 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -2023,6 +2023,7 @@ static void Pho_PutLinkToCalculateDegreeStats (void) The_ClassFormInBoxBold[Gbl.Prefs.Theme], NULL); Ico_PutCalculateIconWithText (Txt_Calculate_average_photo_of_THE_DEGREE_X); + Frm_LinkFormEnd (); /* Selector with all the degrees with students */ fprintf (Gbl.F.Out,"