diff --git a/swad_ID.c b/swad_ID.c index 34eb097e8..6b3348b06 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -376,7 +376,7 @@ void ID_PutLinkToChangeUsrIDs (const struct UsrData *UsrDat) } Act_LinkFormSubmit (Txt_Change_IDs,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("arroba",Txt_Change_IDs,Txt_Change_IDs); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); @@ -477,12 +477,12 @@ void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat,bool ItsMe) fprintf (Gbl.F.Out,"" "" - "", + " style=\"margin-right:2px;\" />", UsrDat->IDs.List[NumID].ID, Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } } @@ -531,16 +531,16 @@ void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat,bool ItsMe) Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); } fprintf (Gbl.F.Out,"" - "" - "" - "" - "" - "", + "", 16, ID_MAX_LENGTH_USR_ID, UsrDat->IDs.Num ? UsrDat->IDs.List[UsrDat->IDs.Num - 1].ID : "", // Show the most recent ID Txt_Add_this_ID); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + "" + ""); } /***** Write help text *****/ diff --git a/swad_QR.c b/swad_QR.c index f35a1c16c..ab5728c2d 100644 --- a/swad_QR.c +++ b/swad_QR.c @@ -98,8 +98,8 @@ void QR_PutLinkToPrintQRCode (QR_QRType_t QRType,struct UsrData *UsrDat,bool Pri Txt_QR_code); if (PrintText) fprintf (Gbl.F.Out," %s",Txt_QR_code); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_account.c b/swad_account.c index 9c3a58a86..6898dcc45 100644 --- a/swad_account.c +++ b/swad_account.c @@ -114,8 +114,8 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith Act_FormStart (ActFrmLogIn); Act_LinkFormSubmit (Txt_Log_in,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("login",Txt_Log_in,Txt_Log_in); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Form to enter some data of the new user *****/ fprintf (Gbl.F.Out,"
"); @@ -164,8 +164,8 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith "", Txt_Create_account); Lay_EndRoundFrameTable10 (); - fprintf (Gbl.F.Out,"" - "
"); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -236,7 +236,7 @@ static void Acc_PutLinkToRemoveMyAccount (void) Par_PutHiddenParamUnsigned ("RegRemAction",(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM); Act_LinkFormSubmit (Txt_Remove_account,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("delon",Txt_Remove_account,Txt_Remove_account); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -621,10 +621,10 @@ void Acc_AskIfCompletelyEliminateAccount (bool ItsMe) fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", ItsMe ? Txt_Completely_eliminate_me : Txt_Completely_eliminate_user); + Act_FormEnd (); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); diff --git a/swad_action.c b/swad_action.c index 4608d1729..12adf0395 100644 --- a/swad_action.c +++ b/swad_action.c @@ -4198,43 +4198,57 @@ static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLoca { extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES]; - fprintf (Gbl.F.Out,"
"); + + Gbl.InsideForm = true; + + if (NextAction != ActUnk) + Par_PutHiddenParamLong ("act",Act_Actions[NextAction].ActCod); + + if (Gbl.Session.Id[0]) + Par_PutHiddenParamString ("ses",Gbl.Session.Id); + else if (PutParameterLocationIfNoSesion) // Extra parameters necessary when there's no open session + { + /* If session is open, course code will be get from session data, + but if there is not an open session, and next action is known, it is necessary to send a parameter with course code */ + if (Gbl.CurrentCrs.Crs.CrsCod > 0) // If course selected... + Crs_PutParamCrsCod (Gbl.CurrentCrs.Crs.CrsCod); + else if (Gbl.CurrentDeg.Deg.DegCod > 0) // If no course selected, but degree selected... + Deg_PutParamDegCod (Gbl.CurrentDeg.Deg.DegCod); + else if (Gbl.CurrentCtr.Ctr.CtrCod > 0) // If no degree selected, but centre selected... + Ctr_PutParamCtrCod (Gbl.CurrentCtr.Ctr.CtrCod); + else if (Gbl.CurrentIns.Ins.InsCod > 0) // If no centre selected, but institution selected... + Ins_PutParamInsCod (Gbl.CurrentIns.Ins.InsCod); + else if (Gbl.CurrentCty.Cty.CtyCod > 0) // If no institution selected, but country selected... + Cty_PutParamCtyCod (Gbl.CurrentCty.Cty.CtyCod); + } } + } - if (Act_Actions[NextAction].ContentType == Act_CONTENT_DATA) - fprintf (Gbl.F.Out," enctype=\"multipart/form-data\""); - - fprintf (Gbl.F.Out,">"); - - if (NextAction != ActUnk) - Par_PutHiddenParamLong ("act",Act_Actions[NextAction].ActCod); - - if (Gbl.Session.Id[0]) - Par_PutHiddenParamString ("ses",Gbl.Session.Id); - else if (PutParameterLocationIfNoSesion) // Extra parameters necessary when there's no open session +void Act_FormEnd (void) + { + if (Gbl.InsideForm) { - /* If session is open, course code will be get from session data, - but if there is not an open session, and next action is known, it is necessary to send a parameter with course code */ - if (Gbl.CurrentCrs.Crs.CrsCod > 0) // If course selected... - Crs_PutParamCrsCod (Gbl.CurrentCrs.Crs.CrsCod); - else if (Gbl.CurrentDeg.Deg.DegCod > 0) // If no course selected, but degree selected... - Deg_PutParamDegCod (Gbl.CurrentDeg.Deg.DegCod); - else if (Gbl.CurrentCtr.Ctr.CtrCod > 0) // If no degree selected, but centre selected... - Ctr_PutParamCtrCod (Gbl.CurrentCtr.Ctr.CtrCod); - else if (Gbl.CurrentIns.Ins.InsCod > 0) // If no centre selected, but institution selected... - Ins_PutParamInsCod (Gbl.CurrentIns.Ins.InsCod); - else if (Gbl.CurrentCty.Cty.CtyCod > 0) // If no institution selected, but country selected... - Cty_PutParamCtyCod (Gbl.CurrentCty.Cty.CtyCod); + fprintf (Gbl.F.Out,"
"); + Gbl.InsideForm = false; } } @@ -4650,11 +4664,10 @@ void Act_WriteBigMFUActions (struct Act_ListMFUActions *ListMFUActions) Txt_TABS_FULL_TXT[Act_Actions[Action].Tab], Txt_MENU_TITLE[Act_Actions[Action].Tab][Act_Actions[Action].IndexInMenu]); Str_LimitLengthHTMLStr (ActionStr,40); - fprintf (Gbl.F.Out," %s" - "" - "" - "", - ActionStr); + fprintf (Gbl.F.Out," %s",ActionStr); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } } @@ -4679,9 +4692,9 @@ void Act_WriteSmallMFUActions (struct Act_ListMFUActions *ListMFUActions) Act_FormStart (ActMFUAct); Act_LinkFormSubmit (Txt_Frequent_actions,"MFU_ACT"); fprintf (Gbl.F.Out," %s" - "" - "", + "", Txt_Frequent_actions); + Act_FormEnd (); fprintf (Gbl.F.Out,"
" ""); @@ -4715,11 +4728,11 @@ void Act_WriteSmallMFUActions (struct Act_ListMFUActions *ListMFUActions) strcpy (ActionStr,Txt_MENU_TITLE[Act_Actions[Action].Tab][Act_Actions[Action].IndexInMenu]); Str_LimitLengthHTMLStr (ActionStr,12); - fprintf (Gbl.F.Out," %s" - "" - "" - "", + fprintf (Gbl.F.Out," %s", ActionStr); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } } diff --git a/swad_action.h b/swad_action.h index 90c706188..577efebe3 100644 --- a/swad_action.h +++ b/swad_action.h @@ -1333,6 +1333,7 @@ char *Act_GetActionTextFromDB (long ActCod,char *Txt); void Act_FormStart (Act_Action_t NextAction); void Act_FormGoToStart (Act_Action_t NextAction); void Act_FormStartId (Act_Action_t NextAction,const char *Id); +void Act_FormEnd (void); void Act_LinkFormSubmit (const char *Title,const char *LinkStyle); void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,const char *Id); void Act_AdjustActionWhenNoUsrLogged (void); diff --git a/swad_announcement.c b/swad_announcement.c index 1dfda34f7..4c7e88478 100644 --- a/swad_announcement.c +++ b/swad_announcement.c @@ -82,7 +82,7 @@ void Ann_ShowAllAnnouncements (void) Act_FormStart (ActWriAnn); Act_LinkFormSubmit (Txt_New_announcement,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("new",Txt_New_announcement,Txt_New_announcement); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /***** List announcements *****/ @@ -254,11 +254,11 @@ static void Ann_ShowAnnouncement (long AnnCod,const char *Subject,const char *Co Act_LinkFormSubmit (Txt_Remove,The_ClassFormul[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\"" - " %s" - "", + " %s", Gbl.Prefs.IconsURL, Txt_Remove, Txt_Remove); + Act_FormEnd (); } else { @@ -268,11 +268,11 @@ static void Ann_ShowAnnouncement (long AnnCod,const char *Subject,const char *Co Act_LinkFormSubmit (Txt_Do_not_show_again,The_ClassFormul[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\"" - " %s" - "", + " %s", Gbl.Prefs.IconsURL, Txt_Do_not_show_again, Txt_Do_not_show_again); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -369,7 +369,7 @@ void Ann_ShowFormAnnouncement (void) "
"); Lay_PutSendButton (Txt_Create_announcement); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_assignment.c b/swad_assignment.c index 16000d3ad..5913ade56 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -170,9 +170,9 @@ static void Asg_ShowAllAssignments (void) fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]); if (Order == Gbl.Asgs.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" "%s" @@ -215,7 +215,7 @@ static void Asg_PutFormToSelectWhichGroupsToShow (void) Asg_PutHiddenParamAsgOrderType (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Grp_ShowSelectorWhichGrps (); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -375,7 +375,7 @@ static void Asg_WriteAsgAuthor (struct Assignment *Asg) /***** Show photo *****/ Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO12x16",true); + "PHOTO12x16",Pho_ZOOM); /***** Write name *****/ strcpy (FirstName,UsrDat.FirstName); @@ -420,11 +420,11 @@ static void Asg_WriteAssignmentFolder (struct Assignment *Asg) Asg->Folder); fprintf (Gbl.F.Out,"" - "", + " title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } else // I can't send files to this assignment folder fprintf (Gbl.F.Out,"" - "
"); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -508,12 +508,12 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove, Txt_Remove); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Put form to hide/show assignment *****/ fprintf (Gbl.F.Out,""); @@ -535,8 +535,8 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) Gbl.Prefs.IconsURL, Txt_Hide, Txt_Hide); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Put form to edit assignment *****/ fprintf (Gbl.F.Out,""); @@ -546,12 +546,12 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Edit, Txt_Edit); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,"" ""); @@ -935,9 +935,10 @@ void Asg_AskRemAssignment (void) Asg.Title); Lay_ShowAlert (Lay_WARNING,Gbl.Message); fprintf (Gbl.F.Out,"
" - "
" - "", + "" + "", Txt_Remove_assignment); + Act_FormEnd (); /***** Show assignments again *****/ Asg_SeeAssignments (); @@ -1243,7 +1244,8 @@ void Asg_RequestCreatOrEditAsg (void) Txt_Modify_assignment); /***** Form end *****/ - fprintf (Gbl.F.Out,"
"); + Act_FormEnd (); + fprintf (Gbl.F.Out,"
"); /***** Show current assignments *****/ Asg_ShowAllAssignments (); diff --git a/swad_attendance.c b/swad_attendance.c index 432511824..7d8166c8f 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -200,9 +200,9 @@ static void Att_ShowAllAttEvents (void) fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]); if (Order == Gbl.AttEvents.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" "%s" @@ -241,7 +241,7 @@ static void Att_PutFormToSelectWhichGroupsToShow (void) Att_PutHiddenParamAttOrderType (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Grp_ShowSelectorWhichGrps (); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -307,8 +307,9 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt Att_PutParamsCodGrps (Att->AttCod); Act_LinkFormSubmit (Txt_View_event,Att->Hidden ? "ASG_TITLE_LIGHT" : "ASG_TITLE"); - fprintf (Gbl.F.Out,"%s", - Att->Title); + fprintf (Gbl.F.Out,"%s",Att->Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Number of students in this event *****/ fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -470,7 +471,7 @@ static void Att_PutFormToCreateNewAttEvent (void) Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Act_LinkFormSubmit (Txt_New_event,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("new",Txt_New_event,Txt_New_event); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -494,12 +495,12 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove, Txt_Remove); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Put form to hide/show attendance event *****/ fprintf (Gbl.F.Out,""); @@ -521,8 +522,8 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) Gbl.Prefs.IconsURL, Txt_Hide, Txt_Hide); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Put form to edit attendance event *****/ fprintf (Gbl.F.Out,""); @@ -532,14 +533,14 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); fprintf (Gbl.F.Out,"" - "" - "" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Edit, Txt_Edit); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + "" + ""); } /*****************************************************************************/ @@ -896,9 +897,9 @@ void Att_AskRemAttEvent (void) Lay_ShowAlert (Lay_WARNING,Gbl.Message); fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", Txt_Remove_event); + Act_FormEnd (); /***** Show attendance events again *****/ Att_SeeAttEvents (); @@ -1209,7 +1210,8 @@ void Att_RequestCreatOrEditAttEvent (void) Txt_Modify_event); /***** Form end *****/ - fprintf (Gbl.F.Out,"
"); + Act_FormEnd (); + fprintf (Gbl.F.Out,"
"); /***** Show current attendance events *****/ Att_ShowAllAttEvents (); @@ -1941,7 +1943,7 @@ static void Att_ListAttOnlyMeAsStudent (struct AttendanceEvent *Att) { /***** Send button *****/ Lay_PutSendButton (Txt_Save); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } } @@ -2020,8 +2022,8 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) /***** Send button *****/ Lay_PutSendButton (Txt_Save); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); @@ -2099,7 +2101,7 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO36x48",true); + "PHOTO36x48",Pho_ZOOM); fprintf (Gbl.F.Out,""); } @@ -2662,8 +2664,8 @@ void Usr_ReqListAttendanceStdsCrs (void) /* Send button */ Lay_PutSendButton (Txt_Show_list); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Free memory used for by the list of users *****/ Usr_FreeListsEncryptedUsrCods (); @@ -2926,8 +2928,8 @@ static void Att_PutFormToPrintListStds (bool ShowDetails,char *StrAttCodsSelecte Par_PutHiddenParamString ("AttCods",StrAttCodsSelected); Act_LinkFormSubmit (Txt_Print,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("print",Txt_Print,Txt_Print); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -2947,8 +2949,8 @@ static void Att_PutButtonToShowDetails (char *StrAttCodsSelected) if (StrAttCodsSelected[0]) Par_PutHiddenParamString ("AttCods",StrAttCodsSelected); Lay_PutSendButton (Txt_Show_more_details); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -3058,7 +3060,7 @@ static void Att_ListEventsToSelect (void) /***** End form *****/ if (Gbl.CurrentAct == ActSeeLstAttStd) - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3216,8 +3218,7 @@ static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *Usr ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_ZOOM); fprintf (Gbl.F.Out,""); } @@ -3354,8 +3355,7 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_ZOOM); fprintf (Gbl.F.Out,""); /***** Write user's ID ******/ diff --git a/swad_banner.c b/swad_banner.c index 428a44d00..51d50ef77 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -131,8 +131,8 @@ static void Ban_PutFormToEditBanners (void) Act_FormStart (ActEdiBan); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -324,12 +324,12 @@ static void Ban_ListBannersForEdition (void) Act_FormStart (ActRemBan); Ban_PutParamBanCod (Ban->BanCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_banner, Txt_Remove_banner); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Put icon to hide/show banner */ fprintf (Gbl.F.Out,""); @@ -337,9 +337,7 @@ static void Ban_ListBannersForEdition (void) ActHidBan); Ban_PutParamBanCod (Ban->BanCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Ban->IsHidden ? "hidden" : "visible", @@ -347,6 +345,8 @@ static void Ban_ListBannersForEdition (void) Txt_Hide, Ban->IsHidden ? Txt_Show : Txt_Hide); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Banner code */ fprintf (Gbl.F.Out,"" @@ -362,10 +362,10 @@ static void Ban_ListBannersForEdition (void) Act_FormStart (ActRenBanSho); Ban_PutParamBanCod (Ban->BanCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Ban_MAX_LENGTH_SHORT_NAME,Ban->ShortName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Banner full name */ fprintf (Gbl.F.Out,"BanCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Ban_MAX_LENGTH_FULL_NAME,Ban->FullName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Banner image */ fprintf (Gbl.F.Out,"BanCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Ban_MAX_LENGTH_IMAGE,Ban->Img,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Banner WWW */ fprintf (Gbl.F.Out,"BanCod); fprintf (Gbl.F.Out,"" - "" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_WWW,Ban->WWW,Gbl.FormId); - + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } Lay_EndRoundFrameTable10 (); @@ -790,7 +789,7 @@ static void Ban_PutFormToCreateBanner (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -931,15 +930,15 @@ void Ban_WriteMenuWithBanners (void) " title=\"%s\">" "\"%s\""" - "" - "" - "" - "", + "", Gbl.FormId, Gbl.Banners.Lst[NumBan].FullName, Cfg_HTTPS_URL_SWAD_PUBLIC,Cfg_FOLDER_BANNER, Gbl.Banners.Lst[NumBan].Img, Gbl.Banners.Lst[NumBan].ShortName); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } /***** Free list of banners *****/ diff --git a/swad_calendar.c b/swad_calendar.c index a25151610..5af029105 100644 --- a/swad_calendar.c +++ b/swad_calendar.c @@ -244,8 +244,10 @@ static void Cal_DrawMonth (unsigned RealYear,unsigned RealMonth, fprintf (Gbl.F.Out,"%s %u", Txt_MONTHS_CAPS[RealMonth-1],RealYear); if (PutLinkToCalendar) - fprintf (Gbl.F.Out,"" - ""); + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } fprintf (Gbl.F.Out,""); /***** Month head: first letter for each day of week *****/ @@ -378,11 +380,13 @@ static void Cal_DrawMonth (unsigned RealYear,unsigned RealMonth, /* If day has an exam announcement */ if (PutLinkToEvents && ThisDayHasEvent) + { fprintf (Gbl.F.Out,"" "" "" - "" - ""); + ""); + Act_FormEnd (); + } else fprintf (Gbl.F.Out,""); diff --git a/swad_centre.c b/swad_centre.c index 7df6efa8a..5762c9cb8 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -187,10 +187,10 @@ void Ctr_SeeCtrWithPendingDegs (void) sprintf (Gbl.Title,Txt_Go_to_X,Ctr.FullName); Act_LinkFormSubmit (Gbl.Title,"DAT"); fprintf (Gbl.F.Out,"%s" - "" - "" - "", + "", Ctr.FullName); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of pending degrees (row[1]) */ fprintf (Gbl.F.Out,""); + Act_FormEnd (); /* Link to print view */ Lay_PutLinkToPrintView1 (ActPrnCtrInf); @@ -345,9 +345,9 @@ static void Ctr_Configuration (bool PrintView) Gbl.FormId); if (PhotoAttribution) fprintf (Gbl.F.Out,"%s",PhotoAttribution); - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } else if (PhotoAttribution) @@ -649,10 +649,10 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr) Ctr_PutParamCtrCod (Ctr->CtrCod); sprintf (Gbl.Title,Txt_Go_to_X,Ctr->FullName); Act_LinkFormSubmit (Gbl.Title,TxtClass); - fprintf (Gbl.F.Out,"%s" - "" - "", + fprintf (Gbl.F.Out,"%s", Ctr->FullName); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Number of teachers *****/ fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1186,11 +1186,11 @@ static void Ctr_ListCentresForEdition (void) Act_FormStart (ActRemCtr); Ctr_PutParamOtherCtrCod (Ctr->CtrCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_centre, Txt_Remove_centre); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -1225,8 +1225,8 @@ static void Ctr_ListCentresForEdition (void) (Gbl.Inss.Lst[NumIns].InsCod == Ctr->InsCod) ? " selected=\"selected\"" : "", Gbl.Inss.Lst[NumIns].ShortName); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Gbl.CurrentIns.Ins.ShortName); @@ -1254,8 +1254,8 @@ static void Ctr_ListCentresForEdition (void) (Gbl.Plcs.Lst[NumPlc].PlcCod == Ctr->PlcCod) ? " selected=\"selected\"" : "", Gbl.Plcs.Lst[NumPlc].ShortName); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else for (NumPlc = 0; @@ -1273,10 +1273,10 @@ static void Ctr_ListCentresForEdition (void) Act_FormStart (ActRenCtrSho); Ctr_PutParamOtherCtrCod (Ctr->CtrCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Ctr_MAX_LENGTH_CENTRE_SHORT_NAME,Ctr->ShortName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } else fprintf (Gbl.F.Out,"%s",Ctr->ShortName); @@ -1290,10 +1290,10 @@ static void Ctr_ListCentresForEdition (void) Act_FormStart (ActRenCtrFul); Ctr_PutParamOtherCtrCod (Ctr->CtrCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Ctr_MAX_LENGTH_CENTRE_FULL_NAME,Ctr->FullName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } else fprintf (Gbl.F.Out,"%s",Ctr->FullName); @@ -1307,9 +1307,9 @@ static void Ctr_ListCentresForEdition (void) Act_FormStart (ActChgCtrWWW); Ctr_PutParamOtherCtrCod (Ctr->CtrCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_WWW,Ctr->WWW,Gbl.FormId); + Act_FormEnd (); } else { @@ -1347,13 +1347,13 @@ static void Ctr_ListCentresForEdition (void) " onchange=\"javascript:document.getElementById('%s').submit();\">" "" "" - "" - "", + "", Gbl.FormId, (unsigned) Ctr_GetStatusBitsFromStatusTxt (Ctr_STATUS_PENDING), Txt_CENTRE_STATUS[Ctr_STATUS_PENDING], (unsigned) Ctr_GetStatusBitsFromStatusTxt (Ctr_STATUS_ACTIVE), Txt_CENTRE_STATUS[Ctr_STATUS_ACTIVE]); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Txt_CENTRE_STATUS[StatusTxt]); @@ -1838,7 +1838,7 @@ static void Ctr_PutFormToChangeCtrPhoto (bool PhotoExists) Txt_Upload_photo; Act_LinkFormSubmit (Msg,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("photo",Msg,Msg); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1874,12 +1874,12 @@ void Ctr_RequestPhoto (void) "" "" "" - "" - "", + "", The_ClassFormul[Gbl.Prefs.Theme], Txt_File_with_the_photo, Fil_NAME_OF_PARAM_FILENAME_ORG, Txt_Upload_photo); + Act_FormEnd (); } /*****************************************************************************/ @@ -2100,7 +2100,7 @@ static void Ctr_PutFormToCreateCentre (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -2141,8 +2141,8 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable) { if (Order == Gbl.Ctrs.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); } diff --git a/swad_changelog.h b/swad_changelog.h index 089a7e3a5..e2a704ba1 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.88 (2015/03/12)" +#define Log_PLATFORM_VERSION "SWAD 14.89 (2015/03/13)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 14.89: Mar 13, 2015 Lots of changes related with forms and photos. (181769 lines) Version 14.88: Mar 12, 2015 Changes in layout of public user profile. (181718 lines) Version 14.87.4: Mar 11, 2015 Added indexes to usr_figures. (181629 lines) 2 changes necessary in database: diff --git a/swad_chat.c b/swad_chat.c index e48100598..3c7633e0b 100644 --- a/swad_chat.c +++ b/swad_chat.c @@ -327,9 +327,9 @@ static void Cht_WriteLinkToChat2 (const char *RoomCode,const char *RoomFullName) Txt_connected_SINGULAR); if (NumUsrsInRoom) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_connected.c b/swad_connected.c index d9ccd93d0..986c7b5a0 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -93,8 +93,8 @@ void Con_ShowConnectedUsrs (void) } Act_LinkFormSubmit (Txt_Update_connected_users,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("recycle",Txt_Update_connected_users,Txt_Update_connected_users); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Show connected users *****/ Gbl.Usrs.Connected.WhereToShow = Con_SHOW_ON_MAIN_ZONE; @@ -638,12 +638,13 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnRightColum Sco_PutParamScope (Sco_SCOPE_CRS); Act_LinkFormSubmitId (Txt_Connected_users,The_ClassConnected[Gbl.Prefs.Theme],Gbl.FormId); fprintf (Gbl.F.Out,"\"%s\"" - "" - "" - "", + " alt=\"%s\" class=\"ICON32x32\" />" + "", Gbl.Prefs.IconsURL, Txt_Connected_users); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } } @@ -953,6 +954,7 @@ static void Con_ShowConnectedUsrsCurrentCrsOneByOneOnRightColumn (Rol_Role_t Rol static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role) { + extern const char *Txt_View_record_card; const char *Color = Gbl.ColorRows[Gbl.RowEvenOdd]; bool ShowPhoto; char PhotoURL[PATH_MAX+1]; @@ -976,18 +978,16 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role) " vertical-align:middle; background-color:%s;\">", Color); sprintf (Gbl.FormId,"form_con_%d",++Gbl.NumFormConnectedUsrs); - Act_FormStartId ((Role == Rol_ROLE_STUDENT) ? ActSeeRecOneStd : - ActSeeRecOneTch, - Gbl.FormId); + Act_FormStartId (ActSeePubPrf,Gbl.FormId); Usr_PutParamOtherUsrCodEncrypted (UsrDat.EncryptedUsrCod); - Act_LinkFormSubmitId (NULL,NULL,Gbl.FormId); + Act_LinkFormSubmitId (UsrDat.FullName,NULL,Gbl.FormId); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL); Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24",true); - fprintf (Gbl.F.Out,"" - "" - ""); + "PHOTO18x24",Pho_ZOOM); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Write full name and link *****/ fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Write time from last access *****/ fprintf (Gbl.F.Out,"", Gbl.ColorRows[Gbl.RowEvenOdd]); - if (PutLinkToRecord) - { - Act_FormStart ((Role == Rol_ROLE_STUDENT) ? ActSeeRecOneStd : - ActSeeRecOneTch); - Usr_PutParamOtherUsrCodEncrypted (UsrDat.EncryptedUsrCod); - Act_LinkFormSubmit (NULL,NULL); - } ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL); Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24",true); - if (PutLinkToRecord) - fprintf (Gbl.F.Out,"" - ""); + "PHOTO18x24",Pho_ZOOM); fprintf (Gbl.F.Out,""); /***** Write full name and link *****/ @@ -1189,8 +1179,10 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R } Usr_RestrictLengthAndWriteName (&UsrDat,40); if (PutLinkToRecord) - fprintf (Gbl.F.Out,"" - ""); + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } fprintf (Gbl.F.Out,""); /***** Write time from last access *****/ diff --git a/swad_country.c b/swad_country.c index a81b2541b..05867bc8a 100644 --- a/swad_country.c +++ b/swad_country.c @@ -167,10 +167,10 @@ void Cty_SeeCtyWithPendingInss (void) Cty_PutParamCtyCod (Cty.CtyCod); sprintf (Gbl.Title,Txt_Go_to_X,Cty.Name[Gbl.Prefs.Language]); Act_LinkFormSubmit (Gbl.Title,"DAT"); - fprintf (Gbl.F.Out,"%s" - "" - "", + fprintf (Gbl.F.Out,"%s", Cty.Name[Gbl.Prefs.Language]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of pending institutions (row[1]) */ fprintf (Gbl.F.Out,""); + Act_FormEnd (); /* Link to print view */ if (!PrintView) @@ -299,9 +299,9 @@ static void Cty_Configuration (bool PrintView) Gbl.FormId); if (MapAttribution) fprintf (Gbl.F.Out,"%s",MapAttribution); - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } else if (MapAttribution) @@ -535,9 +535,9 @@ void Cty_ListCountries2 (void) fprintf (Gbl.F.Out,"%s",Txt_COUNTRIES_ORDER[Order]); if (Order == Gbl.Ctys.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" "%s" @@ -576,8 +576,8 @@ void Cty_ListCountries2 (void) Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); Act_LinkFormSubmit (Gbl.Title,NULL); Cty_DrawCountryMap (&Gbl.Ctys.Lst[NumCty],"COUNTRY_MAP_SMALL"); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -590,11 +590,11 @@ void Cty_ListCountries2 (void) sprintf (Gbl.Title,Txt_Go_to_X, Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); Act_LinkFormSubmit (Gbl.Title,"DAT"); - fprintf (Gbl.F.Out,"%s (%s)" - "" - "", + fprintf (Gbl.F.Out,"%s (%s)", Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language], Gbl.Ctys.Lst[NumCty].Alpha2); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Write stats of this country */ NumStds = Usr_GetNumUsrsInCountry (Rol_ROLE_STUDENT,Gbl.Ctys.Lst[NumCty].CtyCod); @@ -1049,8 +1049,8 @@ void Cty_WriteSelectorOfCountry (Act_Action_t NextAction) DB_FreeMySQLResult (&mysql_res); /***** End form *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1310,11 +1310,11 @@ static void Cty_ListCountriesForEdition (void) Act_FormStart (ActRemCty); Cty_PutParamOtherCtyCod (Cty->CtyCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_country, Txt_Remove_country); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -1371,11 +1371,11 @@ static void Cty_ListCountriesForEdition (void) Cty_PutParamOtherCtyCod (Cty->CtyCod); Par_PutHiddenParamUnsigned ("Lan",(unsigned) Lan); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cty_MAX_LENGTH_COUNTRY_NAME, Cty->Name[Lan],Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* WWW */ fprintf (Gbl.F.Out,"CtyCod); Par_PutHiddenParamUnsigned ("Lan",(unsigned) Lan); fprintf (Gbl.F.Out,"" - "" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cty_MAX_LENGTH_COUNTRY_WWW, Cty->WWW[Lan],Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } } @@ -1758,7 +1758,7 @@ static void Cty_PutFormToCreateCountry (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_course.c b/swad_course.c index fe6a4b3ee..f99466aae 100644 --- a/swad_course.c +++ b/swad_course.c @@ -442,7 +442,7 @@ static void Crs_Configuration (bool PrintView) if (IsForm) { Lay_PutSendButton (Txt_Save); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } } @@ -603,9 +603,9 @@ static void Crs_WriteListMyCoursesToSelectOne (void) fprintf (Gbl.F.Out," %s",Txt_System); if (Highlight) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Get my countries *****/ NumCtys = Usr_GetCtysFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,&mysql_resCty); @@ -645,9 +645,9 @@ static void Crs_WriteListMyCoursesToSelectOne (void) fprintf (Gbl.F.Out," %s",Cty.Name[Gbl.Prefs.Language]); if (Highlight) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Get my institutions in this country *****/ NumInss = (unsigned) Usr_GetInssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod, @@ -683,9 +683,9 @@ static void Crs_WriteListMyCoursesToSelectOne (void) fprintf (Gbl.F.Out," %s",InsFullName); if (Highlight) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Get my centres in this institution *****/ NumCtrs = (unsigned) Usr_GetCtrsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod, @@ -721,9 +721,9 @@ static void Crs_WriteListMyCoursesToSelectOne (void) fprintf (Gbl.F.Out," %s",CtrFullName); if (Highlight) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Get my degrees in this centre *****/ NumDegs = (unsigned) Usr_GetDegsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod, @@ -759,9 +759,9 @@ static void Crs_WriteListMyCoursesToSelectOne (void) fprintf (Gbl.F.Out," %s",DegFullName); if (Highlight) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Get my courses in this degree *****/ NumCrss = (unsigned) Usr_GetCrssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod, @@ -799,8 +799,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void) fprintf (Gbl.F.Out," %s",CrsFullName); if (Highlight) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** Write link to RSS file *****/ sprintf (PathRelRSSFile,"%s/%s/%ld/%s/%s", @@ -1156,8 +1156,8 @@ void Crs_WriteSelectorMyCourses (void) Txt_No_COURSE_SELECTED); /***** End form *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1287,10 +1287,10 @@ static void Crs_ListCoursesForSeeing (void) Crs_PutParamCrsCod (Crs->CrsCod); sprintf (Gbl.Title,Txt_Go_to_X,Crs->FullName); Act_LinkFormSubmit (Gbl.Title,TxtClass); - fprintf (Gbl.F.Out,"%s" - "" - "", + fprintf (Gbl.F.Out,"%s", Crs->FullName); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Current number of students in this course */ fprintf (Gbl.F.Out,"CrsCod); fprintf (Gbl.F.Out,"" - "", + " title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_course, Txt_Remove_course); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -1403,12 +1403,12 @@ static void Crs_ListCoursesForEdition (void) Act_FormStart (ActChgInsCrsCod); Crs_PutParamOtherCrsCod (Crs->CrsCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Crs_LENGTH_INSTITUTIONAL_CRS_COD, Crs_LENGTH_INSTITUTIONAL_CRS_COD, Crs->InstitutionalCrsCod, Gbl.FormId); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Crs->InstitutionalCrsCod); @@ -1432,8 +1432,8 @@ static void Crs_ListCoursesForEdition (void) Gbl.Usrs.Me.MyAdminDegs.Lst[NumDeg].DegCod == Gbl.CurrentDeg.Deg.DegCod ? " selected=\"selected\"" : "", Gbl.Usrs.Me.MyAdminDegs.Lst[NumDeg].ShortName); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Gbl.CurrentDeg.Deg.ShortName); @@ -1457,7 +1457,8 @@ static void Crs_ListCoursesForEdition (void) YearAux == Crs->Year ? " selected=\"selected\"" : "", Txt_YEAR_OF_DEGREE[YearAux]); - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Txt_YEAR_OF_DEGREE[Crs->Year]); @@ -1483,7 +1484,8 @@ static void Crs_ListCoursesForEdition (void) fprintf (Gbl.F.Out,">%s", Txt_SEMESTER_OF_YEAR[Semester]); } - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Txt_SEMESTER_OF_YEAR[Crs->Semester]); @@ -1497,10 +1499,10 @@ static void Crs_ListCoursesForEdition (void) Act_FormStart (ActRenCrsSho); Crs_PutParamOtherCrsCod (Crs->CrsCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Crs_MAX_LENGTH_COURSE_SHORT_NAME,Crs->ShortName, Gbl.FormId); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Crs->ShortName); @@ -1514,10 +1516,10 @@ static void Crs_ListCoursesForEdition (void) Act_FormStart (ActRenCrsFul); Crs_PutParamOtherCrsCod (Crs->CrsCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Crs_MAX_LENGTH_COURSE_FULL_NAME,Crs->FullName, Gbl.FormId); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Crs->FullName); @@ -1550,13 +1552,13 @@ static void Crs_ListCoursesForEdition (void) " onchange=\"javascript:document.getElementById('%s').submit();\">" "" "" - "" - "", + "", Gbl.FormId, (unsigned) Crs_GetStatusBitsFromStatusTxt (Crs_STATUS_PENDING), Txt_COURSE_STATUS[Crs_STATUS_PENDING], (unsigned) Crs_GetStatusBitsFromStatusTxt (Crs_STATUS_ACTIVE), Txt_COURSE_STATUS[Crs_STATUS_ACTIVE]); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Txt_COURSE_STATUS[StatusTxt]); @@ -1782,7 +1784,7 @@ static void Crs_PutFormToCreateCourse (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -2953,10 +2955,9 @@ static void Crs_PutLinkToGoToCrs (struct Course *Crs) Crs_PutParamCrsCod (Crs->CrsCod); sprintf (Gbl.Title,Txt_Go_to_X,Crs->ShortName); Act_LinkFormSubmit (Gbl.Title,The_ClassFormul[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,"%s" - "" - "", - Gbl.Title); + fprintf (Gbl.F.Out,"%s",Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -3010,7 +3011,7 @@ static void Crs_PutLinkToSearchCourses (void) Par_PutHiddenParamUnsigned ("WhatToSearch",(unsigned) Sch_SEARCH_COURSES); Act_LinkFormSubmit (Txt_Search_courses,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("search",Txt_Search_courses,Txt_Search_courses); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3026,7 +3027,7 @@ void Crs_PutFormToSelectMyCourses (void) Act_FormStart (ActMyCrs); Act_LinkFormSubmit (Txt_My_courses,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("hierarchy",Txt_My_courses,Txt_My_courses); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3326,10 +3327,10 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName, 16,"vertical-align:top;",true); fprintf (Gbl.F.Out," %s (%s)" - "" - "" - "", + "", row[2],row[7]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Write year (row[4]) *****/ fprintf (Gbl.F.Out,"" - "" - "", - row[6]); + fprintf (Gbl.F.Out,"%s",row[6]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Write number of students in course *****/ fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index 4e2640256..895572396 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -238,10 +238,10 @@ void Deg_SeeDegWithPendingCrss (void) sprintf (Gbl.Title,Txt_Go_to_X,Deg.FullName); Act_LinkFormSubmit (Gbl.Title,"DAT"); fprintf (Gbl.F.Out,"%s" - "" - "" - "", + "", Deg.FullName); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of pending courses (row[1]) */ fprintf (Gbl.F.Out,""); + Act_FormEnd (); /* Link to print view */ Lay_PutLinkToPrintView1 (ActPrnDegInf); @@ -634,8 +634,8 @@ static void Deg_WriteSelectorOfDegree (Act_Action_t NextAction) } /***** End form *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -653,9 +653,8 @@ void Deg_WriteCtyInsCtrDeg (void) Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) TabSys); Act_LinkFormSubmit (Txt_System, The_ClassDegree[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,"%s" - "", - Txt_System); + fprintf (Gbl.F.Out,"%s",Txt_System); + Act_FormEnd (); if (Gbl.CurrentCty.Cty.CtyCod > 0) // If country selected... { @@ -668,9 +667,9 @@ void Deg_WriteCtyInsCtrDeg (void) Cty_PutParamCtyCod (Gbl.CurrentCty.Cty.CtyCod); Act_LinkFormSubmit (Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language], The_ClassDegree[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,"%s" - "", + fprintf (Gbl.F.Out,"%s", Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]); + Act_FormEnd (); if (Gbl.CurrentIns.Ins.InsCod > 0) // If institution selected... { @@ -683,9 +682,9 @@ void Deg_WriteCtyInsCtrDeg (void) Ins_PutParamInsCod (Gbl.CurrentIns.Ins.InsCod); Act_LinkFormSubmit (Gbl.CurrentIns.Ins.FullName, The_ClassDegree[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,"%s" - "", + fprintf (Gbl.F.Out,"%s", Gbl.CurrentIns.Ins.ShortName); + Act_FormEnd (); if (Gbl.CurrentCtr.Ctr.CtrCod > 0) // If centre selected... { @@ -698,9 +697,9 @@ void Deg_WriteCtyInsCtrDeg (void) Ctr_PutParamCtrCod (Gbl.CurrentCtr.Ctr.CtrCod); Act_LinkFormSubmit (Gbl.CurrentCtr.Ctr.FullName, The_ClassDegree[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,"%s" - "", + fprintf (Gbl.F.Out,"%s", Gbl.CurrentCtr.Ctr.ShortName); + Act_FormEnd (); if (Gbl.CurrentDeg.Deg.DegCod > 0) // If degree selected... { @@ -716,9 +715,9 @@ void Deg_WriteCtyInsCtrDeg (void) strcpy (DegreeShortName,Gbl.CurrentDeg.Deg.ShortName); Str_LimitLengthHTMLStr (DegreeShortName, Deg_MAX_LENGTH_SHORT_NAME_DEGREE_ON_PAGE_HEAD); - fprintf (Gbl.F.Out,"%s" - "", + fprintf (Gbl.F.Out,"%s", DegreeShortName); + Act_FormEnd (); } } } @@ -1173,11 +1172,11 @@ static void Deg_ListDegreeTypesForEdition (void) Act_FormStart (ActRemDegTyp); Deg_PutParamOtherDegTypCod (Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_type_of_degree, Txt_Remove_type_of_degree); + Act_FormEnd (); } /* Degree type code */ @@ -1194,12 +1193,12 @@ static void Deg_ListDegreeTypesForEdition (void) Act_FormStart (ActRenDegTyp); Deg_PutParamOtherDegTypCod (Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Deg_MAX_LENGTH_DEGREE_TYPE_NAME, Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypName, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Direct log in is allowed for this degree type? */ fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Gbl.Degs.DegTypes.Lst[NumDegTyp].AllowDirectLogIn ? " checked=\"checked\"" : "", Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of degrees of this type */ fprintf (Gbl.F.Out,"DegCod); sprintf (Gbl.Title,Txt_Go_to_X,Deg->FullName); Act_LinkFormSubmit (Gbl.Title,TxtClass); - fprintf (Gbl.F.Out,"%s" - "" - "", - Deg->FullName); + fprintf (Gbl.F.Out,"%s",Deg->FullName); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Type of degree */ fprintf (Gbl.F.Out,"DegCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_degree, Txt_Remove_degree); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -1470,8 +1468,8 @@ static void Deg_ListDegreesForEdition (void) (Gbl.Ctrs.Lst[NumCtr].CtrCod == Deg->CtrCod) ? " selected=\"selected\"" : "", Gbl.Ctrs.Lst[NumCtr].ShortName); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Gbl.CurrentCtr.Ctr.ShortName); @@ -1485,9 +1483,9 @@ static void Deg_ListDegreesForEdition (void) Act_FormStart (ActRenDegSho); Deg_PutParamOtherDegCod (Deg->DegCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Deg_MAX_LENGTH_DEGREE_SHORT_NAME,Deg->ShortName,Gbl.FormId); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Deg->ShortName); @@ -1501,9 +1499,9 @@ static void Deg_ListDegreesForEdition (void) Act_FormStart (ActRenDegFul); Deg_PutParamOtherDegCod (Deg->DegCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Deg_MAX_LENGTH_DEGREE_FULL_NAME,Deg->FullName,Gbl.FormId); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Deg->FullName); @@ -1530,8 +1528,8 @@ static void Deg_ListDegreesForEdition (void) "", DegTyp->DegTypName); } - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else for (NumDegTyp = 0; @@ -1559,8 +1557,8 @@ static void Deg_ListDegreesForEdition (void) (Year == Deg->FirstYear) ? " selected=\"selected\"" : "", Year); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%u",Deg->FirstYear); @@ -1584,8 +1582,8 @@ static void Deg_ListDegreesForEdition (void) (Year == Deg->LastYear) ? " selected=\"selected\"" : "", Year); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%u",Deg->LastYear); @@ -1599,12 +1597,12 @@ static void Deg_ListDegreesForEdition (void) Act_FormStart (ActChgDegOptYea); Deg_PutParamOtherDegCod (Deg->DegCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Deg->OptYear ? " checked=\"checked\"" : "", Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } else /* Degree optional year */ @@ -1625,9 +1623,9 @@ static void Deg_ListDegreesForEdition (void) Act_FormStart (ActChgDegWWW); Deg_PutParamOtherDegCod (Deg->DegCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_WWW,Deg->WWW,Gbl.FormId); + Act_FormEnd (); } else { @@ -1661,13 +1659,13 @@ static void Deg_ListDegreesForEdition (void) " onchange=\"javascript:document.getElementById('%s').submit();\">" "" "" - "" - "", + "", Gbl.FormId, (unsigned) Deg_GetStatusBitsFromStatusTxt (Deg_STATUS_PENDING), Txt_DEGREE_STATUS[Deg_STATUS_PENDING], (unsigned) Deg_GetStatusBitsFromStatusTxt (Deg_STATUS_ACTIVE), Txt_DEGREE_STATUS[Deg_STATUS_ACTIVE]); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Txt_DEGREE_STATUS[StatusTxt]); @@ -1805,7 +1803,7 @@ static void Deg_PutFormToCreateDegType (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1974,7 +1972,7 @@ static void Deg_PutFormToCreateDegree (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -4017,9 +4015,8 @@ void Deg_GetAndWriteDegreesAdminBy (long UsrCod,unsigned ColSpan) Act_LinkFormSubmit (Gbl.Title,"DAT_SMALL_NOBR"); Log_DrawLogo (Sco_SCOPE_DEG,DegCod,row[1], 16,"vertical-align:top;",true); - fprintf (Gbl.F.Out," %s" - "", - row[2]); + fprintf (Gbl.F.Out," %s",row[2]); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"\"%s\"""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); @@ -218,8 +218,8 @@ static void Dpt_PutFormToEditDpts (void) Act_FormStart (ActEdiDpt); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -522,11 +522,11 @@ static void Dpt_ListDepartmentsForEdition (void) Act_FormStart (ActRemDpt); Dpt_PutParamDptCod (Dpt->DptCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_department, Txt_Remove_department); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -556,7 +556,9 @@ static void Dpt_ListDepartmentsForEdition (void) Gbl.Inss.Lst[NumIns].InsCod == Dpt->InsCod ? " selected=\"selected\"" : "", Gbl.Inss.Lst[NumIns].ShortName); - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Department short name */ fprintf (Gbl.F.Out,"DptCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", MAX_LENGTH_DEPARTMENT_SHORT_NAME,Dpt->ShortName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Department full name */ fprintf (Gbl.F.Out,""); Act_FormStart (ActRenDptFul); Dpt_PutParamDptCod (Dpt->DptCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", MAX_LENGTH_DEPARTMENT_FULL_NAME,Dpt->FullName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Department WWW */ fprintf (Gbl.F.Out,""); Act_FormStart (ActChgDptWWW); Dpt_PutParamDptCod (Dpt->DptCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_WWW,Dpt->WWW,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of teachers */ fprintf (Gbl.F.Out,"" @@ -955,7 +957,7 @@ static void Dpt_PutFormToCreateDepartment (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_enrollment.c b/swad_enrollment.c index 126f2ff5d..44b95e525 100644 --- a/swad_enrollment.c +++ b/swad_enrollment.c @@ -138,7 +138,7 @@ void Enr_PutLinkToRequestSignUp (void) Act_FormStart (ActReqSignUp); Act_LinkFormSubmit (Txt_Sign_up,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("signup",Txt_Sign_up,Txt_Sign_up); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -270,7 +270,7 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction) /***** Send button*****/ Lay_PutSendButton (Txt_Continue); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -294,14 +294,14 @@ void Enr_ReqAcceptRegisterInCrs (void) Act_FormStart (ActAccEnrCrs); Act_LinkFormSubmit (Txt_Confirm_my_enrollment,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("ok_green",Txt_Confirm_my_enrollment,Txt_Confirm_my_enrollment); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** Send button to refuse register in the current course *****/ Act_FormStart (ActRemMeCrs); Act_LinkFormSubmit (Txt_Remove_me_from_this_course,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("delon",Txt_Remove_me_from_this_course,Txt_Remove_me_from_this_course); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Mark possible notification as seen *****/ Ntf_SetNotifAsSeen (Ntf_EVENT_ENROLLMENT, @@ -619,7 +619,7 @@ static void Enr_ShowFormRegRemSeveralUsrs (void) Lay_PutSendButton (Txt_Confirm); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End frame *****/ fprintf (Gbl.F.Out,"" @@ -640,7 +640,7 @@ static void Enr_PutLinkToRemOldUsrs (void) Act_FormStart (ActReqRemOldUsr); Act_LinkFormSubmit (Txt_Remove_old_users,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("delon",Txt_Remove_old_users,Txt_Remove_old_users); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -681,8 +681,8 @@ void Enr_AskRemoveOldUsrs (void) /***** Send button*****/ Lay_PutSendButton (Txt_Eliminate); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1724,7 +1724,7 @@ static void Enr_PutLinkToRemAllStdsThisCrs (void) Act_FormStart (ActReqRemAllStdCrs); Act_LinkFormSubmit (Txt_Remove_all_students,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("delon",Txt_Remove_all_students,Txt_Remove_all_students); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1750,7 +1750,7 @@ void Enr_AskRemAllStdsThisCrs (void) Grp_PutParamAllGroups (); Pwd_AskForConfirmationOnDangerousAction (); Lay_PutSendButton (Txt_Remove_students); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else { @@ -2044,7 +2044,7 @@ void Enr_AskIfRejectSignUp (void) Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); Lay_PutSendButton (Txt_Reject); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else Lay_ShowErrorAndExit ("Wrong role."); @@ -2185,7 +2185,7 @@ void Enr_ShowEnrollmentRequests (void) /* Form end */ fprintf (Gbl.F.Out,""); Lay_PutSendButton (Txt_Update); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** Build query *****/ switch (Gbl.Scope.Current) @@ -2462,10 +2462,10 @@ void Enr_ShowEnrollmentRequests (void) sprintf (Gbl.Title,Txt_Go_to_X,Crs.FullName); Act_LinkFormSubmit (Gbl.Title,"DAT"); fprintf (Gbl.F.Out,"%s > %s" - "" - "" - "", + "", Deg.ShortName,Crs.ShortName); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Number of teachers in the course *****/ fprintf (Gbl.F.Out,""); /***** User name *****/ @@ -2506,8 +2506,8 @@ void Enr_ShowEnrollmentRequests (void) Crs_PutParamCrsCod (Crs.CrsCod); Usr_PutParamOtherUsrCodEncrypted (UsrDat.EncryptedUsrCod); Lay_PutSendButton (Txt_Register); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Button to reject the request *****/ fprintf (Gbl.F.Out,"" - "" + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); /***** Mark possible notification as seen *****/ @@ -2587,7 +2587,7 @@ static void Enr_PutLinkToAdminOneUsr (void) Act_FormStart (ActReqMdfOneUsr); Act_LinkFormSubmit (Txt_Admin_one_user,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("configtest",Txt_Admin_one_user,Txt_Admin_one_user); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -2602,7 +2602,7 @@ static void Enr_PutLinkToAdminSeveralUsrs (void) Act_FormStart (ActReqMdfSevUsr); Act_LinkFormSubmit (Txt_Admin_several_users,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("configtest",Txt_Admin_several_users,Txt_Admin_several_users); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -2879,8 +2879,8 @@ static void Enr_ShowFormToEditOtherUsr (void) if (Enr_PutActionsRegRemOneUsr (ItsMe)) Lay_PutSendButton (Txt_Confirm); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -3204,9 +3204,9 @@ static void Enr_ReqAddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName) Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", Txt_Register_user_IN_A_COURSE_OR_DEGREE); + Act_FormEnd (); } } else @@ -3471,8 +3471,8 @@ static void Enr_AskIfRemoveUsrFromCrs (struct UsrData *UsrDat,bool ItsMe) fprintf (Gbl.F.Out,"", ItsMe ? Txt_Remove_me_from_this_course : Txt_Remove_user_from_this_course); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); @@ -3570,10 +3570,10 @@ static void Enr_AskIfRemAdm (bool ItsMe,Sco_Scope_t Scope,const char *InsCtrDegN Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", ItsMe ? Txt_Remove_me_as_an_administrator : Txt_Remove_user_as_an_administrator); + Act_FormEnd (); } else Lay_ShowErrorAndExit ("User doesn't exist."); diff --git a/swad_exam.c b/swad_exam.c index 1ed6edce9..331e525e6 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -448,8 +448,8 @@ static void Exa_ListExamAnnouncements (Exa_tTypeViewExamAnnouncement_t TypeViewE Act_FormStart (ActEdiExaAnn); Act_LinkFormSubmit (Txt_New_announcement_of_exam,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("new",Txt_New_announcement_of_exam,Txt_New_announcement_of_exam); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); break; default: break; @@ -1209,8 +1209,8 @@ static void Exa_ShowExamAnnouncement (long ExaCod,Exa_tTypeViewExamAnnouncement_ " alt=\"%s\" class=\"ICON16x16\" />" \ " %s", Gbl.Prefs.IconsURL,Txt_Edit_announcement_of_exam,Txt_Edit); - fprintf (Gbl.F.Out,"" \ - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Create link to remove this exam announcement *****/ fprintf (Gbl.F.Out,""); @@ -1223,8 +1223,8 @@ static void Exa_ShowExamAnnouncement (long ExaCod,Exa_tTypeViewExamAnnouncement_ Gbl.Prefs.IconsURL, Txt_Remove_announcement_of_exam, Txt_Remove); - fprintf (Gbl.F.Out,"" \ - "" \ + Act_FormEnd (); + fprintf (Gbl.F.Out,"" \ ""); break; default: @@ -1264,7 +1264,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod,Exa_tTypeViewExamAnnouncement_ break; case Exa_FORM_VIEW: Lay_PutSendButton (Txt_Send_announcement_of_exam); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); break; } } diff --git a/swad_file_browser.c b/swad_file_browser.c index 3b3f0a01f..78384778a 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -2870,8 +2870,8 @@ void Brw_AskEditWorksCrs (void) /* Button to send the form */ Lay_PutSendButton (Txt_View_works); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } } else @@ -3098,8 +3098,8 @@ static void Brw_FormToChangeCrsGrpZone (void) } /***** End list and form *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3146,7 +3146,7 @@ static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO75x100",true); + "PHOTO75x100",Pho_ZOOM); fprintf (Gbl.F.Out,""); /***** Start form to send a message to this user *****/ @@ -3182,8 +3182,8 @@ static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat) Str_LimitLengthHTMLStr (UsrDat->Email,25); fprintf (Gbl.F.Out,"%s",UsrDat->Email); } - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -4293,8 +4293,8 @@ static void Brw_PutFormToShowOrAdmin (Brw_ShowOrAdmin_t ShowOrAdmin, Txt_Edit); break; } - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -4349,11 +4349,11 @@ static void Brw_WriteFormFullTree (void) if (Gbl.FileBrowser.FullTree) fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," onclick=\"javascript:document.getElementById('%s').submit();\" />" - " %s" - "" - "", + " %s", Gbl.FormId, Txt_Show_all_files); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -5017,11 +5017,11 @@ static void Brw_PutIconRemoveFile (Brw_FileType_t FileType, Brw_ParamListFiles (FileType,PathInTree,FileName); sprintf (Gbl.Title,Txt_Remove_FILE_OR_LINK_X,FileNameToShow); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"\"\""" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"\"\""" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"\"\""" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -5218,11 +5218,11 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,Brw_ExpandTree_ Brw_ParamListFiles (Brw_IS_FOLDER,PathInTree,FileName); sprintf (Gbl.Title,Txt_Expand_FOLDER_X,FileNameToShow); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); break; case Brw_EXPAND_TREE_MINUS: /***** Form to contract folder *****/ @@ -5247,11 +5247,11 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,Brw_ExpandTree_ Brw_ParamListFiles (Brw_IS_FOLDER,PathInTree,FileName); sprintf (Gbl.Title,Txt_Contract_FOLDER_X,FileNameToShow); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); break; } @@ -5302,14 +5302,14 @@ static void Brw_PutIconShow (unsigned Level,Brw_FileType_t FileType, Brw_ParamListFiles (FileType,PathInTree,FileName); sprintf (Gbl.Title,Txt_Show_FOLDER_FILE_OR_LINK_X,FileNameToShow); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Brw_CheckIfAnyUpperLevelIsHidden (Level) ? "off" : "on", Gbl.Title, Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -5335,14 +5335,14 @@ static void Brw_PutIconHide (unsigned Level,Brw_FileType_t FileType, Brw_ParamListFiles (FileType,PathInTree,FileName); sprintf (Gbl.Title,Txt_Hide_FOLDER_FILE_OR_LINK_X,FileNameToShow); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Brw_CheckIfAnyUpperLevelIsHidden (Level) ? "off" : "on", Gbl.Title, Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -5400,13 +5400,13 @@ static void Brw_PutIconFolder (unsigned Level,Brw_ExpandTree_t ExpandTree, sprintf (Gbl.Title,Txt_Upload_file_or_create_folder_in_FOLDER,FileNameToShow); fprintf (Gbl.F.Out,"" - "", + " title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, (ExpandTree == Brw_EXPAND_TREE_PLUS) ? "closed" : "open", Gbl.Title, Gbl.Title); + Act_FormEnd (); } else // I can't create a new file or folder fprintf (Gbl.F.Out,"\"\""" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -5571,15 +5571,17 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic,Brw_FileType_t FileT /***** Write name of the folder *****/ fprintf (Gbl.F.Out," "); if (Gbl.FileBrowser.ICanEditFileOrFolder) // Can I rename this folder? + { fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", FileName,Gbl.FileBrowser.InputStyle, Gbl.FileBrowser.Clipboard.IsThisFile ? LIGHT_GREEN : Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.FormId); + Act_FormEnd (); + } else { if ((Level == 1) && @@ -5634,11 +5636,11 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic,Brw_FileType_t FileT fprintf (Gbl.F.Out,"" "%s" - "" - "", + "", Gbl.FormId, Gbl.Title,Gbl.FileBrowser.TxtStyle, FileNameToShow); + Act_FormEnd (); /* Put icon to make public/private file */ if (IsPublic) @@ -5833,7 +5835,7 @@ static void Brw_WriteFileOrFolderPublisher (unsigned Level,unsigned long UsrCod) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL); Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO12x16B",true); + "PHOTO12x16B",Pho_ZOOM); } else fprintf (Gbl.F.Out,"\"\""" "" - "" - "", + "", Gbl.FileBrowser.FileType == Brw_IS_FILE ? Txt_Remove_file : Txt_Remove_link); + Act_FormEnd (); } else Lay_ShowErrorAndExit (Txt_You_can_not_remove_this_file_or_link); @@ -6045,9 +6047,9 @@ static void Brw_AskConfirmRemoveFolderNotEmpty (void) Lay_ShowAlert (Lay_WARNING,Gbl.Message); fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", Txt_Remove_folder); + Act_FormEnd (); } /*****************************************************************************/ @@ -7663,7 +7665,7 @@ static void Brw_PutFormToCreateAFolder (const char *FileNameToShow) /* Button to send */ Lay_PutSendButton (Txt_Create_folder); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End frame *****/ fprintf (Gbl.F.Out,"" @@ -7726,9 +7728,9 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow) fprintf (Gbl.F.Out,"
" "%s
" - "" - "", + "", Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here); + Act_FormEnd (); /***** Put button to refresh file browser after upload *****/ Act_FormStart (Brw_ActRefreshAfterUploadFiles[Gbl.FileBrowser.Type]); @@ -7752,7 +7754,7 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow) /* Button to send */ Lay_PutSendButton (Txt_FILE_UPLOAD_Done); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End frame *****/ fprintf (Gbl.F.Out,"" @@ -7802,7 +7804,7 @@ static void Brw_PutFormToUploadOneFileClassic (const char *FileNameToShow) /* Button to send */ Lay_PutSendButton (Txt_Upload_file); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End frame *****/ fprintf (Gbl.F.Out,"" @@ -7849,7 +7851,7 @@ static void Brw_PutFormToPasteAFileOrFolder (const char *FileNameToShow) /* Button to send */ Lay_PutSendButton (Txt_Paste); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End frame *****/ fprintf (Gbl.F.Out,"" @@ -7910,7 +7912,7 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow) /* Button to send */ Lay_PutSendButton (Txt_Create_link); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End frame *****/ fprintf (Gbl.F.Out,"" @@ -8902,7 +8904,7 @@ void Brw_ShowFileMetadata (void) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&PublisherUsrDat,PhotoURL); Pho_ShowUsrPhoto (&PublisherUsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO12x16",true); + "PHOTO12x16",Pho_ZOOM); /* Write name */ fprintf (Gbl.F.Out,"%s", @@ -9058,7 +9060,7 @@ void Brw_ShowFileMetadata (void) if (ICanEdit) // I can edit file properties { Lay_PutSendButton (Txt_Save_file_properties); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /***** End frame *****/ @@ -9377,9 +9379,10 @@ static void Brw_WriteBigLinkToDownloadFile (const char *URL,Brw_FileType_t FileT /* Name of the file of marks, link end and form end */ fprintf (Gbl.F.Out," %s " "\"%s\"" - "", + " class=\"ICON32x32\" />" + "", FileNameToShow,Gbl.Prefs.IconsURL,Gbl.Title,Gbl.Title); + Act_FormEnd (); } else { @@ -9436,9 +9439,8 @@ static void Brw_WriteSmallLinkToDownloadFile (const char *URL,Brw_FileType_t Fil Act_LinkFormSubmit (Gbl.Title,"DAT"); /* Name of the file of marks, link end and form end */ - fprintf (Gbl.F.Out,"%s" - "", - FileNameToShow); + fprintf (Gbl.F.Out,"%s",FileNameToShow); + Act_FormEnd (); } else /* Put anchor and filename */ @@ -10961,9 +10963,8 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row) Act_LinkFormSubmit (Gbl.Title,"DAT"); Log_DrawLogo (Sco_SCOPE_INS,InsCod,InsShortName, 16,"vertical-align:top;",true); - fprintf (Gbl.F.Out," %s" - "", - InsShortName); + fprintf (Gbl.F.Out," %s",InsShortName); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -10979,9 +10980,8 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row) Act_LinkFormSubmit (Gbl.Title,"DAT"); Log_DrawLogo (Sco_SCOPE_CTR,CtrCod,CtrShortName, 16,"vertical-align:top;",true); - fprintf (Gbl.F.Out," %s" - "", - CtrShortName); + fprintf (Gbl.F.Out," %s",CtrShortName); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -10997,9 +10997,8 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row) Act_LinkFormSubmit (Gbl.Title,"DAT"); Log_DrawLogo (Sco_SCOPE_DEG,DegCod,DegShortName, 16,"vertical-align:top;",true); - fprintf (Gbl.F.Out," %s" - "", - DegShortName); + fprintf (Gbl.F.Out," %s",DegShortName); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -11013,9 +11012,8 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row) Crs_PutParamCrsCod (CrsCod); sprintf (Gbl.Title,Txt_Go_to_X,CrsShortName); Act_LinkFormSubmit (Gbl.Title,"DAT"); - fprintf (Gbl.F.Out,"%s" - "", - CrsShortName); + fprintf (Gbl.F.Out,"%s",CrsShortName); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -11096,11 +11094,11 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row) /* File name and end of form */ fprintf (Gbl.F.Out,"%s" - "" - "" - "" - "", + "", FileNameToShow); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; } diff --git a/swad_forum.c b/swad_forum.c index 3cf43b0d8..9b9a5af6b 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1125,11 +1125,11 @@ static void For_ShowAForumPost (struct ForumThread *Thr,unsigned PstNum,long Pst For_PutAllHiddenParamsForum (); For_PutHiddenParamThrCod (Thr->ThrCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_post, Txt_Remove_post); + Act_FormEnd (); } /***** Form to ban/unban post *****/ @@ -1148,13 +1148,13 @@ static void For_ShowAForumPost (struct ForumThread *Thr,unsigned PstNum,long Pst Txt_Post_X_banned_Click_to_unban_it, PstNum); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Enabled ? "visible" : "hidden", Gbl.Title, Gbl.Title); + Act_FormEnd (); } else { @@ -1776,9 +1776,9 @@ static void For_PutFormWhichForums (void) "", Gbl.FormId,Txt_FORUM_WHICH_FORUM[WhichForums]); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } @@ -1799,13 +1799,13 @@ static void For_WriteLinkToTopLevelOfForums (void) " alt=\"%s\" title=\"%s\"" " class=\"ICON16x16\" style=\"vertical-align:middle;\" />" " %s" - "" - "" - "", + "", Gbl.Prefs.IconsURL, Txt_Forums, Txt_Forums, Txt_Forums); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -2147,11 +2147,11 @@ static void For_WriteLinkToForum (For_ForumType_t ForumType,Act_Action_t NextAct For_PutAllHiddenParamsForum (); For_PutHiddenParamThrCod (Gbl.Forum.ThreadToMove); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Paste_thread, Txt_Paste_thread); + Act_FormEnd (); } } @@ -2192,9 +2192,9 @@ static void For_WriteLinkToForum (For_ForumType_t ForumType,Act_Action_t NextAct if (NumThrs) For_WriteNumberOfThrs (NumThrs,NumThrsWithNewPosts); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -2526,9 +2526,9 @@ void For_ShowForumThrs (void) fprintf (Gbl.F.Out,"%s",Txt_FORUM_THREAD_ORDER[Order]); if (Order == Gbl.Forum.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" "%s" @@ -3299,11 +3299,11 @@ void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],struct Pagination *Pagi For_PutAllHiddenParamsForum (); For_PutHiddenParamThrCod (Thr.ThrCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_thread, Txt_Remove_thread); + Act_FormEnd (); } if (ICanMoveThreads) @@ -3315,11 +3315,11 @@ void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],struct Pagination *Pagi For_PutAllHiddenParamsForum (); For_PutHiddenParamThrCod (Thr.ThrCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Move_thread, Txt_Move_thread); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -3749,7 +3749,7 @@ void For_WriteFormForumPst (bool IsReply,long ThrCod,const char *Subject) Txt_MSG_Message); Lay_PutSendButton (Txt_Send_message); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3967,7 +3967,7 @@ void For_ReqDelThr (void) "" "", Txt_Remove_thread); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_global.c b/swad_global.c index e0f01abdb..ec75a7a40 100644 --- a/swad_global.c +++ b/swad_global.c @@ -107,6 +107,7 @@ void Gbl_InitializeGlobals (void) Gbl.F.Tmp = NULL; Gbl.F.XML = NULL; + Gbl.InsideForm = false; // Set to true inside a form to avoid nested forms Gbl.NumForm = -1; // Number of form. It's increased by 1 at the begin of each form Gbl.NumFormConnectedUsrs = -1; // Number of form in list of connected users. It's increased by 1 at the begin of each form diff --git a/swad_global.h b/swad_global.h index 10ce5e6fd..fc298157b 100644 --- a/swad_global.h +++ b/swad_global.h @@ -86,6 +86,7 @@ struct Globals struct Files F; MYSQL mysql; pid_t PID; // PID of current process + bool InsideForm; // Set to true inside a form to avoid nested forms int NumForm; // Number of form, used in form submit links int NumFormConnectedUsrs; // Number of form in list of connected users, used in form submit links char FormId[32]; // Identifier string used in forms diff --git a/swad_group.c b/swad_group.c index 6494ccdef..b81f5aafa 100644 --- a/swad_group.c +++ b/swad_group.c @@ -289,8 +289,8 @@ static void Grp_ShowFormSeveralGrps (Act_Action_t NextAction) Lay_EndRoundFrameTable10 (); /***** End form *****/ - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1141,24 +1141,24 @@ static void Grp_ListGroupTypesForEdition (void) Act_FormStart (ActReqRemGrpTyp); Grp_PutParamGrpTypCod (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_type_of_group, Txt_Remove_type_of_group); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Name of group type */ fprintf (Gbl.F.Out,""); Act_FormStart (ActRenGrpTyp); Grp_PutParamGrpTypCod (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", MAX_LENGTH_GROUP_TYPE_NAME, Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Is it mandatory to register in any group? */ fprintf (Gbl.F.Out,"%s" - "" - "" - "", + "", Txt_It_is_mandatory_to_choose_a_group); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Is it possible to register in multiple groups? */ fprintf (Gbl.F.Out,"%s" - "" - "" - "", + "", Txt_A_student_can_belong_to_several_groups); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Open time */ fprintf (Gbl.F.Out,"" "" - "" - "" - ""); + ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of groups of this type */ fprintf (Gbl.F.Out,"GrpCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_group, Txt_Remove_group); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Write icon to open/close group */ fprintf (Gbl.F.Out,""); @@ -1347,14 +1347,14 @@ static void Grp_ListGroupsForEdition (void) Txt_Group_X_closed_click_to_open_it, Grp->GrpName); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Grp->Open ? "open" : "closed", Gbl.Title, Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Write icon to activate file zones for this group */ fprintf (Gbl.F.Out,""); @@ -1366,14 +1366,14 @@ static void Grp_ListGroupsForEdition (void) Txt_File_zones_of_the_group_X_disabled_click_to_enable_them, Grp->GrpName); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Grp->FileZones ? "folder-yes" : "folder-no", Gbl.Title, Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Group type */ fprintf (Gbl.F.Out,"%s",GrpTypAux->GrpTypName); } - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Group name */ fprintf (Gbl.F.Out,"GrpCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", MAX_LENGTH_GROUP_NAME,Grp->GrpName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Maximum number of students of the group (row[3]) */ fprintf (Gbl.F.Out,"GrpCod); fprintf (Gbl.F.Out,"MaxStudents); - fprintf (Gbl.F.Out,"\" onchange=\"javascript:document.getElementById('%s').submit();\" />" - "" - "", + fprintf (Gbl.F.Out,"\" onchange=\"javascript:document.getElementById('%s').submit();\" />", Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Current number of students in this group */ fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else // This course has not groups { @@ -2154,7 +2156,7 @@ static void Grp_PutFormToCreateGroupType (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -2239,7 +2241,7 @@ static void Grp_PutFormToCreateGroup (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3307,8 +3309,8 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps) Act_FormStart (ActRemGrpTyp); Grp_PutParamGrpTypCod (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod); Lay_PutSendButton (Txt_Remove_type_of_group); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -3346,8 +3348,8 @@ static void Grp_AskConfirmRemGrp (void) Act_FormStart (ActRemGrp); Grp_PutParamGrpCod (GrpDat.GrpCod); Lay_PutSendButton (Txt_Remove_group); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_holiday.c b/swad_holiday.c index cdaeb6bc0..606ceaaaa 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -111,9 +111,9 @@ void Hld_SeeHolidays (void) fprintf (Gbl.F.Out,"%s",Txt_HOLIDAYS_ORDER[Order]); if (Order == Gbl.Hlds.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" " %s " @@ -202,8 +202,8 @@ static void Hld_PutFormToEditHlds (void) Act_FormStart (ActEdiHld); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -495,12 +495,12 @@ static void Hld_ListHolidaysForEdition (void) Act_FormStart (ActRemHld); Hld_PutParamHldCod (Hld->HldCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_holiday, Txt_Remove_holiday); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Holiday code */ fprintf (Gbl.F.Out,"" @@ -528,9 +528,9 @@ static void Hld_ListHolidaysForEdition (void) Gbl.Plcs.Lst[NumPlc].PlcCod == Hld->PlcCod ? " selected=\"selected\"" : "", Gbl.Plcs.Lst[NumPlc].ShortName); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Holiday type */ fprintf (Gbl.F.Out,"HldTyp ? " selected=\"selected\"" : "", Txt_HOLIDAY_TYPES[HolidayType]); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Holiday date / Non school period start date */ fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Non school period end date */ fprintf (Gbl.F.Out,"HldTyp == Hld_HOLIDAY)); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Holiday name */ fprintf (Gbl.F.Out,"HldCod); fprintf (Gbl.F.Out,"" - "" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Hld_MAX_LENGTH_HOLIDAY_NAME,Hld->Name,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } Lay_EndRoundFrameTable10 (); @@ -1021,7 +1021,7 @@ static void Hld_PutFormToCreateHoliday (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_icon.c b/swad_icon.c index 90c6aac57..69889415e 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -82,15 +82,15 @@ void Ico_PutIconsToSelectIconSet (void) Par_PutHiddenParamString ("IconSet",Ico_IconSetId[IconSet]); fprintf (Gbl.F.Out,"" - "" - "", + " style=\"margin:0 auto;\" />", Gbl.Prefs.IconsURL, Cfg_ICON_FOLDER_ICON_SETS, Ico_IconSetId[IconSet], Cfg_ICON_ACTION, Ico_IconSetNames[IconSet], Ico_IconSetNames[IconSet]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); Lay_EndRoundFrameTable10 (); diff --git a/swad_indicator.c b/swad_indicator.c index a6104a29f..809639077 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -169,7 +169,7 @@ void Ind_ReqIndicatorsCourses (void) fprintf (Gbl.F.Out,"" ""); Lay_PutSendButton (Txt_Update_indicators); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** Get courses from database *****/ NumCrss = Ind_GetTableOfCourses (&mysql_res); @@ -191,7 +191,7 @@ void Ind_ReqIndicatorsCourses (void) Par_PutHiddenParamLong ("DptCod",Gbl.Stat.DptCod); Par_PutHiddenParamLong ("Indicators",Gbl.Stat.NumIndicators); Lay_PutSendButton (Txt_Show_more_details); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /* End table */ fprintf (Gbl.F.Out,"" @@ -457,8 +457,8 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss) /***** Send button *****/ Lay_PutSendButton (Txt_Show_anyway); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_info.c b/swad_info.c index f49adcef9..8a46561bc 100644 --- a/swad_info.c +++ b/swad_info.c @@ -416,8 +416,8 @@ static void Inf_PutFormToEditInfo (Inf_InfoType_t InfoType) Act_FormStart (Inf_ActionsEditInfo[InfoType]); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -438,11 +438,11 @@ static void Inf_PutFormToForceStdsToReadInfo (Inf_InfoType_t InfoType,bool MustB fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," name=\"MustBeRead\" value=\"Y\"" " onchange=\"javascript:document.getElementById('%s').submit();\" />" - " %s" - "" - "", + " %s", Gbl.FormId, Txt_Force_students_to_read_this_information); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -463,10 +463,11 @@ static void Inf_PutFormToConfirmIHaveReadInfo (Inf_InfoType_t InfoType) fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," name=\"IHaveRead\" value=\"Y\"" " onchange=\"javascript:document.getElementById('%s').submit();\" />" - "%s" - "", + "%s", Gbl.FormId, Txt_I_have_read_this_information); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -560,10 +561,10 @@ void Inf_WriteMsgYouMustReadInfo (void) Act_FormStart (Inf_ActionsSeeInfo[InfoType]); Act_LinkFormSubmit (Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType]),The_ClassFormul[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"%s" - "" - "" - "", + "", Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType])); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" "" @@ -988,7 +989,7 @@ void Inf_FormsToSelSendInfo (void) /* End of table and form */ Lay_EndRoundFrameTable10 (); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1006,7 +1007,7 @@ void Inf_FormToEnterIntegratedEditor (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoT Lay_PutSendButton (Txt_Edit); /***** End form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1024,7 +1025,7 @@ void Inf_FormToEnterPlainTextEditor (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoTy Lay_PutSendButton (Txt_Edit_text); /***** End form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1042,7 +1043,7 @@ void Inf_FormToEnterRichTextEditor (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoTyp Lay_PutSendButton (Txt_Edit_text); /***** End form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1076,7 +1077,7 @@ void Inf_FormToSendPage (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoType) Lay_PutSendButton (Txt_Upload_file); /***** End form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1121,7 +1122,7 @@ void Inf_FormToSendURL (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoType) Lay_PutSendButton (Txt_Send_URL); /***** End form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1729,7 +1730,7 @@ void Inf_EditPlainTxtInfo (void) /***** Send and undo buttons *****/ Lay_PutSendButton (Txt_Send); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1789,7 +1790,7 @@ void Inf_EditRichTxtInfo (void) /***** Send and undo buttons *****/ Lay_PutSendButton (Txt_Send); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_institution.c b/swad_institution.c index 183f7c89a..d3268a43f 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -176,10 +176,10 @@ void Ins_SeeInsWithPendingCtrs (void) Ins_PutParamInsCod (Ins.InsCod); sprintf (Gbl.Title,Txt_Go_to_X,Ins.FullName); Act_LinkFormSubmit (Gbl.Title,"DAT"); - fprintf (Gbl.F.Out,"%s" - "" - "", + fprintf (Gbl.F.Out,"%s", Ins.FullName); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of pending centres (row[1]) */ fprintf (Gbl.F.Out,""); + Act_FormEnd (); /* Link to print view */ Lay_PutLinkToPrintView1 (ActPrnInsInf); @@ -573,10 +573,10 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu Ins_PutParamInsCod (Ins->InsCod); sprintf (Gbl.Title,Txt_Go_to_X,Ins->FullName); Act_LinkFormSubmit (Gbl.Title,TxtClass); - fprintf (Gbl.F.Out,"%s" - "" - "", + fprintf (Gbl.F.Out,"%s", Ins->FullName); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Stats *****/ fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); } @@ -1072,8 +1072,8 @@ void Ins_WriteSelectorOfInstitution (Act_Action_t NextAction) } /***** End form *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1130,11 +1130,11 @@ static void Ins_ListInstitutionsForEdition (void) Act_FormStart (ActRemIns); Ins_PutParamOtherInsCod (Ins->InsCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_institution, Txt_Remove_institution); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -1176,8 +1176,8 @@ static void Ins_ListInstitutionsForEdition (void) fprintf (Gbl.F.Out,">%s", Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); } - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]); @@ -1191,10 +1191,10 @@ static void Ins_ListInstitutionsForEdition (void) Act_FormStart (ActRenInsSho); Ins_PutParamOtherInsCod (Ins->InsCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Ins_MAX_LENGTH_INSTITUTION_SHORT_NAME,Ins->ShortName, Gbl.FormId); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Ins->ShortName); @@ -1208,10 +1208,10 @@ static void Ins_ListInstitutionsForEdition (void) Act_FormStart (ActRenInsFul); Ins_PutParamOtherInsCod (Ins->InsCod); fprintf (Gbl.F.Out,"" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Ins_MAX_LENGTH_INSTITUTION_FULL_NAME,Ins->FullName, Gbl.FormId); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Ins->FullName); @@ -1225,11 +1225,11 @@ static void Ins_ListInstitutionsForEdition (void) Act_FormStart (ActChgInsWWW); Ins_PutParamOtherInsCod (Ins->InsCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_WWW,Ins->WWW, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } else { @@ -1268,13 +1268,13 @@ static void Ins_ListInstitutionsForEdition (void) " onchange=\"javascript:document.getElementById('%s').submit();\">" "" "" - "" - "", + "", Gbl.FormId, (unsigned) Ins_GetStatusBitsFromStatusTxt (Ins_STATUS_PENDING), Txt_INSTITUTION_STATUS[Ins_STATUS_PENDING], (unsigned) Ins_GetStatusBitsFromStatusTxt (Ins_STATUS_ACTIVE), Txt_INSTITUTION_STATUS[Ins_STATUS_ACTIVE]); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s",Txt_INSTITUTION_STATUS[StatusTxt]); @@ -1861,7 +1861,7 @@ static void Ins_PutFormToCreateInstitution (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_layout.c b/swad_layout.c index 0eecff017..6fed93ac6 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -646,8 +646,8 @@ static void Lay_WritePageTopHeading (void) ActSysSch))))); Sco_PutParamScope (Sco_SCOPE_SYS); Sch_PutFormToSearch (Gbl.Prefs.PathTheme); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /* Logged user or language selection */ @@ -887,9 +887,8 @@ static void Lay_ShowRightColumn (void) ""); Act_FormStart (ActLstCon); Act_LinkFormSubmit (Txt_Connected_users,The_ClassConnected[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,"%s" - "", - Txt_Connected_PLURAL); + fprintf (Gbl.F.Out,"%s",Txt_Connected_PLURAL); + Act_FormEnd (); /***** Number of connected users in the whole platform *****/ fprintf (Gbl.F.Out,"
"); // Used for AJAX based refresh @@ -946,8 +945,8 @@ void Lay_PutFormToView (Act_Action_t Action) Act_FormStart (Action); Act_LinkFormSubmit (Txt_View,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("visible_on",Txt_View,Txt_View); - fprintf (Gbl.F.Out,"" - "
"); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -963,8 +962,8 @@ void Lay_PutFormToEdit (Act_Action_t Action) Act_FormStart (Action); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1416,13 +1415,13 @@ void Lay_PutIconsToSelectLayout (void) Par_PutHiddenParamUnsigned ("Layout",(unsigned) Layout); fprintf (Gbl.F.Out,"" - "" - "", + " style=\"margin:0 auto;\" />", Gbl.Prefs.IconsURL, Lay_LayoutIcons[Layout], Txt_LAYOUT_NAMES[Layout], Txt_LAYOUT_NAMES[Layout]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); Lay_EndRoundFrameTable10 (); @@ -1484,7 +1483,7 @@ void Lay_PutLinkToPrintView2 (void) Act_LinkFormSubmit (Txt_Print,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("print",Txt_Print,Txt_Print); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_link.c b/swad_link.c index 610006953..9069cdda2 100644 --- a/swad_link.c +++ b/swad_link.c @@ -125,8 +125,8 @@ static void Lnk_PutFormToEditLinks (void) Act_FormStart (ActEdiLnk); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -304,12 +304,12 @@ static void Lnk_ListLinksForEdition (void) Act_FormStart (ActRemLnk); Lnk_PutParamLnkCod (Lnk->LnkCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_link, Txt_Remove_link); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Link code */ fprintf (Gbl.F.Out,"" @@ -323,11 +323,11 @@ static void Lnk_ListLinksForEdition (void) Act_FormStart (ActRenLnkSho); Lnk_PutParamLnkCod (Lnk->LnkCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Lnk_MAX_LENGTH_LINK_SHORT_NAME,Lnk->ShortName, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Link full name */ fprintf (Gbl.F.Out,"LnkCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Lnk_MAX_LENGTH_LINK_FULL_NAME,Lnk->FullName, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Link WWW */ fprintf (Gbl.F.Out,"LnkCod); fprintf (Gbl.F.Out,"" - "" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_WWW,Lnk->WWW, Gbl.FormId); - + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } Lay_EndRoundFrameTable10 (); @@ -634,7 +633,7 @@ static void Lnk_PutFormToCreateLink (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_logo.c b/swad_logo.c index b253f5e87..682446418 100644 --- a/swad_logo.c +++ b/swad_logo.c @@ -223,7 +223,7 @@ void Log_PutFormToChangeLogo (Sco_Scope_t Scope) Txt_Upload_logo; Act_LinkFormSubmit (Msg,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon (Icon,Msg,Msg); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -302,12 +302,12 @@ void Log_RequestLogo (Sco_Scope_t Scope) "" "" "" - "" - "", + "", The_ClassFormul[Gbl.Prefs.Theme], Txt_File_with_the_logo, Fil_NAME_OF_PARAM_FILENAME_ORG, Txt_Upload_logo); + Act_FormEnd (); } /*****************************************************************************/ @@ -323,7 +323,7 @@ static void Log_PutLinkToRemoveLogo (Act_Action_t Action) Act_FormStart (Action); Act_LinkFormSubmit (Txt_Remove_logo,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("delon",Txt_Remove_logo,Txt_Remove_logo); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_mail.c b/swad_mail.c index 51327ddaf..a13dc0032 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -116,9 +116,9 @@ void Mai_SeeMailDomains (void) fprintf (Gbl.F.Out,"%s",Txt_MAIL_DOMAIN_ORDER[Order]); if (Order == Gbl.Mails.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); @@ -181,8 +181,8 @@ static void Mai_PutFormToEditMailDomains (void) Act_FormStart (ActEdiMai); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -412,11 +412,11 @@ static void Mai_ListMailDomainsForEdition (void) Act_FormStart (ActRemMai); Mai_PutParamMaiCod (Mai->MaiCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_mail_domain, Txt_Remove_mail_domain); + Act_FormEnd (); fprintf (Gbl.F.Out,""); /* Mail code */ @@ -431,11 +431,11 @@ static void Mai_ListMailDomainsForEdition (void) Act_FormStart (ActRenMaiSho); Mai_PutParamMaiCod (Mai->MaiCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Mai_MAX_LENGTH_MAIL_DOMAIN,Mai->Domain, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Mail domain info */ fprintf (Gbl.F.Out,"MaiCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Mai_MAX_LENGTH_MAIL_INFO,Mai->Info, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of users */ fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1078,12 +1078,12 @@ void Mai_ShowFormChangeUsrEmail (void) fprintf (Gbl.F.Out,"" "" - "", + " style=\"margin-right:2px;\" />", row[0], Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } /* E-mail */ @@ -1112,11 +1112,11 @@ void Mai_ShowFormChangeUsrEmail (void) { Act_FormStart (ActChgMai); fprintf (Gbl.F.Out," " - "" - "", + "", row[0], // E-mail NumEmail == 1 ? Txt_Confirm_email : Txt_Use_this_email); + Act_FormEnd (); } if (NumEmail == 1 || @@ -1138,14 +1138,14 @@ void Mai_ShowFormChangeUsrEmail (void) Txt_Email); // The first e-mail Act_FormStart (ActChgMai); fprintf (Gbl.F.Out,"" - "" - "" - "" - "", + "", Cns_MAX_BYTES_STRING, Gbl.Usrs.Me.UsrDat.Email, NumEmails ? Txt_Change_email : // I already have an e-mail address Txt_Save); // I have no e-mail address yet + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } /*****************************************************************************/ diff --git a/swad_mark.c b/swad_mark.c index 439d88d27..233458abe 100644 --- a/swad_mark.c +++ b/swad_mark.c @@ -145,8 +145,8 @@ void Mrk_GetAndWriteNumRowsHeaderAndFooter (Brw_FileType_t FileType, Gbl.ColorRows[Gbl.RowEvenOdd], Gbl.FormId); Brw_ParamListFiles (FileType,PathInTree,FileName); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Write the number of rows of footer *****/ fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } } diff --git a/swad_menu.c b/swad_menu.c index c14e5fd58..10a93800f 100644 --- a/swad_menu.c +++ b/swad_menu.c @@ -140,8 +140,8 @@ void Mnu_WriteVerticalMenuThisTabDesktop (void) /***** End of link and form *****/ fprintf (Gbl.F.Out,"" "" - "" - ""); + ""); + Act_FormEnd (); /***** End of container used to highlight this option *****/ if (!IsTheSelectedAction) @@ -211,12 +211,12 @@ void Mnu_WriteHorizontalMenuThisTabDesktop (void) " alt=\"%s\" class=\"ICON28x28\"" " style=\"margin:0;\" />" "
%s
" - "" - "", + "", Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Act_Actions[NumAct].Icon, Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu], Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu]); + Act_FormEnd (); /***** End of container used to highlight this option *****/ fprintf (Gbl.F.Out,""); @@ -276,14 +276,14 @@ void Mnu_WriteMenuThisTabMobile (void) " alt=\"%s\" class=\"ICON64x64\"" " style=\"margin:4px;\" />" "
%s
" - "" - "" - "" - "", + "", Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Act_Actions[NumAct].Icon, Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu], Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu]); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); if ((NumOptVisible % Cfg_LAYOUT_MOBILE_NUM_COLUMNS) == (Cfg_LAYOUT_MOBILE_NUM_COLUMNS - 1)) @@ -320,13 +320,13 @@ void Mnu_PutIconsToSelectMenu (void) Par_PutHiddenParamUnsigned ("Menu",(unsigned) Menu); fprintf (Gbl.F.Out,"" - "" - "", + " style=\"margin:0 auto;\" />", Gbl.Prefs.IconsURL, Mnu_MenuIcons[Menu], Txt_MENU_NAMES[Menu], Txt_MENU_NAMES[Menu]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); Lay_EndRoundFrameTable10 (); diff --git a/swad_message.c b/swad_message.c index 9a7f93efe..a35a00b2c 100644 --- a/swad_message.c +++ b/swad_message.c @@ -340,7 +340,7 @@ static void Msg_PutFormMsgUsrs (const char *Content) /***** Send and undo buttons *****/ Lay_PutSendButton (Txt_Send_message); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /***** Free memory used by the list of nicknames *****/ @@ -782,9 +782,9 @@ void Msg_ReqDelAllRecMsgs (void) Msg_PutHiddenParamsMsgsFilters (); fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", Txt_Delete_messages_received); + Act_FormEnd (); } /*****************************************************************************/ @@ -819,9 +819,9 @@ void Msg_ReqDelAllSntMsgs (void) Msg_PutHiddenParamsMsgsFilters (); fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", Txt_Delete_messages_sent); + Act_FormEnd (); } /*****************************************************************************/ @@ -1555,7 +1555,7 @@ static void Msg_ShowSentOrReceivedMessages (Msg_TypeOfMessages_t TypeOfMessages) Msg_ShowFormToShowOnlyUnreadMessages (); } Lay_PutSendButton (Txt_View_messages); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); if (TypeOfMessages == Msg_MESSAGES_RECEIVED) NumUnreadMsgs = Msg_GetNumUnreadMsgs (Gbl.Msg.FilterCrsCod,FilterFromToSubquery); @@ -1677,7 +1677,7 @@ static void Msg_PutLinkToViewBannedUsers(void) Act_FormStart (ActLstBanUsr); Act_LinkFormSubmit (Txt_Banned_users,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("stop",Txt_Banned_users,Txt_Banned_users); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -2197,10 +2197,10 @@ void Msg_ShowFormDelSentOrRecMsgs (Msg_TypeOfMessages_t TypeOfMessages,unsigned Act_LinkFormSubmit (Gbl.Title,The_ClassFormul[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\""" - " %s" - "" - "", + " %s", Gbl.Prefs.IconsURL,Gbl.Title,Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -2825,7 +2825,8 @@ static void Msg_WriteSentOrReceivedMsgSubject (Msg_TypeOfMessages_t TypeOfMessag fprintf (Gbl.F.Out,"[%s]",Txt_no_subject); /***** End form to expand the message *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End cell *****/ fprintf (Gbl.F.Out,""); @@ -2862,7 +2863,7 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,unsigned WidthOfNameColumn,unsig ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO24x32",true); + "PHOTO24x32",Pho_ZOOM); fprintf (Gbl.F.Out,""); /***** Second column with user name (if author has a web page, put a link to it) *****/ @@ -2929,9 +2930,9 @@ bool Msg_WriteCrsOrgMsg (long CrsCod) sprintf (Gbl.Title,Txt_Go_to_X,Crs.FullName); Act_LinkFormSubmit (Gbl.Title,"MSG_AUT"); fprintf (Gbl.F.Out,"%s)" - "" - "", + "", Crs.ShortName); + Act_FormEnd (); } } } @@ -2985,7 +2986,7 @@ static void Msg_WriteFormToReply (long MsgCod,long CrsCod,const char *Subject, Txt_Reply, Replied ? Txt_Reply_again : Txt_Reply); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3020,7 +3021,7 @@ static void Msg_WriteMsgFrom (struct UsrData *UsrDat,bool Deleted) ShowPhoto = (Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL)); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24",true); + "PHOTO18x24",Pho_ZOOM); /***** Write user's name *****/ fprintf (Gbl.F.Out,"" @@ -3165,7 +3166,7 @@ static void Msg_WriteMsgTo (Msg_TypeOfMessages_t TypeOfMessages,long MsgCod) false); Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24",true); + "PHOTO18x24",Pho_ZOOM); /* Write user's name */ fprintf (Gbl.F.Out,"" @@ -3210,9 +3211,9 @@ static void Msg_WriteMsgTo (Msg_TypeOfMessages_t TypeOfMessages,long MsgCod) Act_LinkFormSubmit (Txt_View_all_recipients,"MSG_AUT"); fprintf (Gbl.F.Out,Txt_and_X_other_recipients, NumRecipientsKnown - NumRecipientsToShow); - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } @@ -3261,12 +3262,12 @@ static void Msg_PutFormToDeleteMessage (long MsgCod,Msg_TypeOfMessages_t TypeOfM Msg_PutHiddenParamMsgCod (MsgCod); Msg_PutHiddenParamsMsgsFilters (); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Txt_Delete_message, Txt_Delete_message); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -3340,11 +3341,11 @@ static void Msg_PutFormToBanSender (struct UsrData *UsrDat) Msg_PutHiddenParamsMsgsFilters (); fprintf (Gbl.F.Out," " "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Sender_permitted_click_to_ban_him, Txt_Sender_permitted_click_to_ban_him); + Act_FormEnd (); } /*****************************************************************************/ @@ -3361,11 +3362,11 @@ static void Msg_PutFormToUnbanSender (struct UsrData *UsrDat) Msg_PutHiddenParamsMsgsFilters (); fprintf (Gbl.F.Out," " "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Sender_banned_click_to_unban_him, Txt_Sender_banned_click_to_unban_him); + Act_FormEnd (); } /*****************************************************************************/ @@ -3541,12 +3542,12 @@ void Msg_ListBannedUsrs (void) Usr_PutParamOtherUsrCodEncrypted (UsrDat.EncryptedUsrCod); fprintf (Gbl.F.Out,"" - "" - "", + " title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Sender_banned_click_to_unban_him, Txt_Sender_banned_click_to_unban_him); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Show photo */ fprintf (Gbl.F.Out,""); /* Write user's full name */ diff --git a/swad_network.c b/swad_network.c index 6838f06d1..46dce87ac 100644 --- a/swad_network.c +++ b/swad_network.c @@ -252,12 +252,12 @@ void Net_ShowFormMyWebsAndSocialNets (void) Par_PutHiddenParamUnsigned ("Web",(unsigned) NumURL); fprintf (Gbl.F.Out,"" - "" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_URL,URL, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } /***** End table *****/ diff --git a/swad_nickname.c b/swad_nickname.c index e473de512..2951d556d 100644 --- a/swad_nickname.c +++ b/swad_nickname.c @@ -239,12 +239,12 @@ void Nck_ShowFormChangeUsrNickname (void) fprintf (Gbl.F.Out,"" "" - "", + " style=\"margin-right:2px;\" />", row[0], Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } /* Nickname */ @@ -263,10 +263,10 @@ void Nck_ShowFormChangeUsrNickname (void) Act_FormStart (ActChgNic); fprintf (Gbl.F.Out," " "" - "" - "", + "", row[0], // Nickname Txt_Use_this_nickname); + Act_FormEnd (); } if (NumNick == 1 || @@ -288,14 +288,14 @@ void Nck_ShowFormChangeUsrNickname (void) Txt_Nickname); // The first nickname Act_FormStart (ActChgNic); fprintf (Gbl.F.Out,"" - "" - "" - "" - "", + "", 1 + Nck_MAX_LENGTH_NICKNAME_WITHOUT_ARROBA, Gbl.Usrs.Me.UsrDat.Nickname, NumNicks ? Txt_Change_nickname : // I already have a nickname Txt_Save); // I have no nickname yet + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } /*****************************************************************************/ diff --git a/swad_notice.c b/swad_notice.c index a1ead02bc..f6b1ffa0d 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -116,7 +116,7 @@ void Not_ShowFormNotice (void) The_ClassFormul[Gbl.Prefs.Theme], Txt_MSG_Message); Lay_PutSendButton (Txt_Create_notice); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -317,7 +317,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing) Act_FormStart (ActWriNot); Act_LinkFormSubmit (Txt_New_notice,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("new",Txt_New_notice,Txt_New_notice); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /***** Show highlighted notice *****/ @@ -501,22 +501,22 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, Not_PutHiddenParamNotCod (NotCod); fprintf (Gbl.F.Out,"" - "", + " title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_NOTICE_Active_Mark_as_obsolete, Txt_NOTICE_Active_Mark_as_obsolete); + Act_FormEnd (); break; case Not_OBSOLETE_NOTICE: Act_FormStart (ActRevNot); Not_PutHiddenParamNotCod (NotCod); fprintf (Gbl.F.Out,"" - "", + " title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_NOTICE_Obsolete_Mark_as_active, Txt_NOTICE_Obsolete_Mark_as_active); + Act_FormEnd (); break; } else // Don't put form to change the state of the notice @@ -556,8 +556,10 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, fprintf (Gbl.F.Out," "); Dat_WriteHourMinute (&DateTime[8]); if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) - fprintf (Gbl.F.Out,"" - ""); + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } fprintf (Gbl.F.Out,""); /***** Write the content of the notice *****/ @@ -571,11 +573,12 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, Not_PutHiddenParamNotCod (NotCod); Act_LinkFormSubmit (Txt_See_full_notice,The_ClassFormul[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\"" - "" - "", + " alt=\"%s\" class=\"ICON32x32\" />" + "", Gbl.Prefs.IconsURL, Txt_See_full_notice); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); @@ -600,11 +603,11 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, Act_LinkFormSubmit (Txt_Remove_notice,The_ClassFormul[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\"" - " %s" - "", + " %s", Gbl.Prefs.IconsURL, Txt_Remove_notice, Txt_Remove); + Act_FormEnd (); fprintf (Gbl.F.Out,""); } diff --git a/swad_notification.c b/swad_notification.c index ead18ecb4..c6ef3fa2e 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -417,12 +417,12 @@ void Ntf_ShowMyNotifications (void) { Ntf_StartFormGoToAction (NotifyEvent,Crs.CrsCod,Cod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Ntf_Icons[NotifyEvent], Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent], Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"\"%s\""" - "", + fprintf (Gbl.F.Out,"%s", Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"%s", @@ -467,9 +467,13 @@ void Ntf_ShowMyNotifications (void) else fprintf (Gbl.F.Out,"",ClassAnchor); fprintf (Gbl.F.Out,"%s: %s",Txt_Forum,ForumName); - fprintf (Gbl.F.Out,PutLink ? "" - "" : - ""); + if (PutLink) + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } + else + fprintf (Gbl.F.Out,""); } else if (Crs.CrsCod > 0) { @@ -481,9 +485,13 @@ void Ntf_ShowMyNotifications (void) else fprintf (Gbl.F.Out,"",ClassAnchor); fprintf (Gbl.F.Out,"%s: %s",Txt_Course,Crs.ShortName); - fprintf (Gbl.F.Out,PutLink ? "" - "" : - ""); + if (PutLink) + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } + else + fprintf (Gbl.F.Out,""); } else if (Deg.DegCod > 0) { @@ -578,11 +586,11 @@ static void Ntf_WriteFormAllNotifications (bool AllNotifications) if (AllNotifications) fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," onclick=\"javascript:document.getElementById('%s').submit();\" />" - " %s" - "" - "", + " %s", Gbl.FormId, Txt_Show_all_notifications); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1610,7 +1618,7 @@ static void Ntf_PutLinkToChangePrefs (void) Act_FormStart (ActEdiPrf); Act_LinkFormSubmit (Txt_Change_preferences,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("heart",Txt_Change_preferences,Txt_Change_preferences); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1625,7 +1633,7 @@ static void Ntf_PutLinkToMarkAllNotifAsSeen (void) Act_FormStart (ActMrkNtfSee); Act_LinkFormSubmit (Txt_Mark_all_notifications_as_read,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("visible_on",Txt_Mark_all_notifications_as_read,Txt_Mark_all_notifications_as_read); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1712,7 +1720,7 @@ void Ntf_PutFormChangeNotifSentByEMail (void) /***** End form *****/ fprintf (Gbl.F.Out,""); Lay_PutSendButton (Txt_Save_changes); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End table *****/ fprintf (Gbl.F.Out,"" @@ -1827,7 +1835,8 @@ void Ntf_WriteNumberOfNewNtfs (void) } /***** Form end *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_pagination.c b/swad_pagination.c index d0409806a..12fb7b393 100644 --- a/swad_pagination.c +++ b/swad_pagination.c @@ -176,10 +176,13 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P else fprintf (Gbl.F.Out,"[%s]", Txt_first_message_not_allowed); - fprintf (Gbl.F.Out,"%s", - LinkToPagCurrent ? "" - "" : - ""); + if (LinkToPagCurrent) + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } + else + fprintf (Gbl.F.Out,""); } if (Pagination->MoreThanOnePage) @@ -245,9 +248,9 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P sprintf (Gbl.Title,Txt_See_page_X_of_Y, 1,(unsigned) Pagination->NumPags); Act_LinkFormSubmit (Gbl.Title,Font); - fprintf (Gbl.F.Out,"1" - "" - ""); + fprintf (Gbl.F.Out,"1"); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); if (Pagination->LeftPage > 2) fprintf (Gbl.F.Out,"" "..." @@ -305,10 +308,10 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P sprintf (Gbl.Title,Txt_See_page_X_of_Y, (unsigned) Pagination->LeftPage,(unsigned) Pagination->NumPags); Act_LinkFormSubmit (Gbl.Title,Font); - fprintf (Gbl.F.Out,"%u" - "" - "", + fprintf (Gbl.F.Out,"%u", (unsigned) Pagination->LeftPage); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); if (Pagination->LeftPage < Pagination->StartPage-1) fprintf (Gbl.F.Out,"" "..." @@ -372,9 +375,9 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P sprintf (Gbl.Title,Txt_See_page_X_of_Y, (unsigned) NumPage,(unsigned) Pagination->NumPags); Act_LinkFormSubmit (Gbl.Title,Font); - fprintf (Gbl.F.Out,"%u" - "", + fprintf (Gbl.F.Out,"%u", (unsigned) NumPage); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); } @@ -434,10 +437,9 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P sprintf (Gbl.Title,Txt_See_page_X_of_Y, (unsigned) Pagination->RightPage,(unsigned) Pagination->NumPags); Act_LinkFormSubmit (Gbl.Title,Font); - fprintf (Gbl.F.Out,"%u" - "" - "", - (unsigned) Pagination->RightPage); + fprintf (Gbl.F.Out,"%u",(unsigned) Pagination->RightPage); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /***** Possible link to last page *****/ @@ -495,10 +497,9 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P sprintf (Gbl.Title,Txt_See_page_X_of_Y, (unsigned) Pagination->NumPags,(unsigned) Pagination->NumPags); Act_LinkFormSubmit (Gbl.Title,Font); - fprintf (Gbl.F.Out,"%u" - "" - "", - (unsigned) Pagination->NumPags); + fprintf (Gbl.F.Out,"%u",(unsigned) Pagination->NumPags); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" "]" diff --git a/swad_password.c b/swad_password.c index ebd6daa78..8203a9fc0 100644 --- a/swad_password.c +++ b/swad_password.c @@ -233,7 +233,7 @@ void Pwd_ShowFormSendNewPwd (void) /***** End form *****/ Lay_PutSendButton (Txt_Email_new_password); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -682,7 +682,7 @@ void Pwd_ShowFormChgPwd (void) "", Txt_Save); Lay_EndRoundFrameTable10 (); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -761,7 +761,7 @@ void Pwd_ShowFormOthPwd (void) /* End form */ Lay_PutSendButton (Txt_Save); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); @@ -792,7 +792,7 @@ void Pwd_PutLinkToChangeUsrPassword (const struct UsrData *UsrDat) } Act_LinkFormSubmit (Txt_Change_password,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("key",Txt_Change_password,Txt_Change_password); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); diff --git a/swad_photo.c b/swad_photo.c index d9bab6bfe..22b9379d0 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -52,6 +52,7 @@ /*****************************************************************************/ extern struct Globals Gbl; +extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; /*****************************************************************************/ /****************************** Public constants *****************************/ @@ -167,7 +168,7 @@ void Pho_PutLinkToChangeUsrPhoto (const struct UsrData *UsrDat) Txt_Upload_photo; Act_LinkFormSubmit (Msg,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("photo",Msg,Msg); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -190,7 +191,7 @@ static void Pho_PutLinkToRemoveUsrPhoto (const struct UsrData *UsrDat) Act_LinkFormSubmit (Txt_Remove_photo,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("delon",Txt_Remove_photo,Txt_Remove_photo); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -243,7 +244,7 @@ void Pho_ReqPhoto (const struct UsrData *UsrDat,bool PhotoExists,const char *Pho fprintf (Gbl.F.Out,""); /* Show photo */ - Pho_ShowUsrPhoto (UsrDat,PhotoURL,"PHOTO150x200",true); + Pho_ShowUsrPhoto (UsrDat,PhotoURL,"PHOTO150x200",Pho_ZOOM); } Lay_ShowAlert (Lay_INFO,Txt_You_can_send_a_file_with_an_image_in_jpg_format_); @@ -269,14 +270,14 @@ void Pho_ReqPhoto (const struct UsrData *UsrDat,bool PhotoExists,const char *Pho "" "" "" - "" - "" - "", + "", The_ClassFormul[Gbl.Prefs.Theme], Txt_File_with_the_photo, Fil_NAME_OF_PARAM_FILENAME_ORG, UsrDat->UsrCod, Txt_Upload_photo); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -507,7 +508,7 @@ void Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *UsrDat) if (!ItsMe) Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); Par_PutHiddenParamString ("FileName",StrFileName); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else NumFacesRed++; @@ -948,26 +949,44 @@ void Pho_UpdatePhotoName (struct UsrData *UsrDat) /*****************************************************************************/ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL, - const char *ClassPhoto,bool Zoom) + const char *ClassPhoto,Pho_Zoom_t Zoom) { char SpecialFullName [3*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+1]; char SpecialShortName[3*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+6]; char SpecialSurnames [2*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+1]; + bool PutLinkToPublicProfile = !Gbl.InsideForm && // Only if not inside another form + Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW; // Only in main window + bool PutZoomCode = PhotoURL && // Photo exists + Zoom == Pho_ZOOM && // Make zoom + Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW; // Only in main window - /* Replace tildes, ñ, etc. in full name by codes, - because some browsers (i.e., IE5) don't show correctly tildes with AJAX */ + /***** Replace tildes, ñ, etc. in full name by codes, + because some browsers (i.e., IE5) + don't show correctly tildes with AJAX *****/ strcpy (SpecialFullName,UsrDat->FullName); Str_ReplaceSpecialCharByCodes (SpecialFullName,sizeof (SpecialFullName)-1); + /***** Start form to go to public profile *****/ + if (PutLinkToPublicProfile) + { + Act_FormStart (ActSeePubPrf); + Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); + Act_LinkFormSubmit (NULL,NULL); + } + + /***** Start image *****/ fprintf (Gbl.F.Out,"FirstName); Str_LimitLengthHTMLStr (SpecialShortName,23); @@ -987,7 +1006,16 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL, fprintf (Gbl.F.Out," onmouseover=\"zoom(this,'%s','%s')\" onmouseout=\"noZoom(this);\"", PhotoURL,SpecialShortName); } + + /***** End image *****/ fprintf (Gbl.F.Out," />"); + + /***** End form to go to public profile *****/ + if (PutLinkToPublicProfile) + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } } /*****************************************************************************/ @@ -1462,9 +1490,9 @@ static void Pho_PutSelectorForTypeOfAvg (void) fprintf (Gbl.F.Out," selected=\"selected\""); fprintf (Gbl.F.Out,">%s",Txt_AVERAGE_PHOTO_TYPES[TypeOfAvg]); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } @@ -1532,9 +1560,9 @@ static void Pho_PutSelectorForHowComputePhotoSize (void) fprintf (Gbl.F.Out," selected=\"selected\""); fprintf (Gbl.F.Out,">%s",Txt_STAT_DEGREE_PHOTO_SIZE[PhoSi]); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } @@ -1602,9 +1630,9 @@ static void Pho_PutSelectorForHowOrderDegrees (void) fprintf (Gbl.F.Out," selected=\"selected\""); fprintf (Gbl.F.Out,">%s",Txt_STAT_DEGREE_PHOTO_ORDER[Order]); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } @@ -1719,9 +1747,9 @@ static void Pho_PutLinkToCalculateDegreeStats (void) } /***** End selector, form, table and div *****/ - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Free list of all the degrees *****/ Deg_FreeListAllDegs (); diff --git a/swad_photo.h b/swad_photo.h index 9ff46f8f2..af7a516ec 100644 --- a/swad_photo.h +++ b/swad_photo.h @@ -34,6 +34,13 @@ #define Pho_PHOTO_REAL_WIDTH 150 #define Pho_PHOTO_REAL_HEIGHT 200 +/***** Zoom? *****/ +typedef enum + { + Pho_ZOOM, + Pho_NO_ZOOM, + } Pho_Zoom_t; + /***** Average photos of students in degrees ******/ typedef enum @@ -99,7 +106,7 @@ bool Pho_CheckIfPrivPhotoExists (long UsrCod,char *PathPrivRelPhoto); bool Pho_RemovePhoto (struct UsrData *UsrDat); void Pho_UpdatePhotoName (struct UsrData *UsrDat); void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL, - const char *ClassPhoto,bool Zoom); + const char *ClassPhoto,Pho_Zoom_t Zoom); void Pho_ChangePhotoVisibility (void); diff --git a/swad_place.c b/swad_place.c index 31d0f4d1d..803aa3813 100644 --- a/swad_place.c +++ b/swad_place.c @@ -113,9 +113,9 @@ void Plc_SeePlaces (void) fprintf (Gbl.F.Out,"%s",Txt_PLACES_ORDER[Order]); if (Order == Gbl.Plcs.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); @@ -207,8 +207,8 @@ static void Plc_PutFormToEditPlcs (void) Act_FormStart (ActEdiPlc); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -440,11 +440,11 @@ static void Plc_ListPlacesForEdition (void) Act_FormStart (ActRemPlc); Plc_PutParamPlcCod (Plc->PlcCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_place, Txt_Remove_place); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -460,10 +460,10 @@ static void Plc_ListPlacesForEdition (void) Act_FormStart (ActRenPlcSho); Plc_PutParamPlcCod (Plc->PlcCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Plc_MAX_LENGTH_PLACE_SHORT_NAME,Plc->ShortName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Place full name */ fprintf (Gbl.F.Out,"PlcCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Plc_MAX_LENGTH_PLACE_FULL_NAME,Plc->FullName,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of centres */ fprintf (Gbl.F.Out,"" @@ -730,7 +730,7 @@ static void Plc_PutFormToCreatePlace (void) Lay_EndRoundFrameTable10 (); /***** End of formn *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_plugin.c b/swad_plugin.c index d7c277c5a..2ae93474f 100644 --- a/swad_plugin.c +++ b/swad_plugin.c @@ -157,8 +157,8 @@ static void Plg_PutFormToEditPlugins (void) Act_FormStart (ActEdiPlg); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -375,12 +375,12 @@ static void Plg_ListPluginsForEdition (void) Act_FormStart (ActRemPlg); Plg_PutParamPlgCod (Plg->PlgCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_plugin, Txt_Remove_plugin); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Plugin code */ fprintf (Gbl.F.Out,"" @@ -402,10 +402,10 @@ static void Plg_ListPluginsForEdition (void) Act_FormStart (ActRenPlg); Plg_PutParamPlgCod (Plg->PlgCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Plg_MAX_LENGTH_PLUGIN_NAME,Plg->Name,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Plugin description */ fprintf (Gbl.F.Out,"PlgCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Plg_MAX_LENGTH_PLUGIN_DESCRIPTION,Plg->Description,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Plugin logo */ fprintf (Gbl.F.Out,"PlgCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Plg_MAX_LENGTH_PLUGIN_LOGO,Plg->Logo,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Plugin application key */ fprintf (Gbl.F.Out,"PlgCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Plg_MAX_LENGTH_PLUGIN_APP_KEY,Plg->AppKey,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Plugin URL */ fprintf (Gbl.F.Out,"PlgCod); fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_WWW,Plg->URL,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Plugin IP */ fprintf (Gbl.F.Out,"PlgCod); fprintf (Gbl.F.Out,"" - "" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_IP,Plg->IP,Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } Lay_EndRoundFrameTable10 (); @@ -924,7 +924,7 @@ static void Plg_PutFormToCreatePlugin (void) Lay_EndRoundFrameTable10 (); /***** End of form *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_preference.c b/swad_preference.c index d584f041a..25c6b726c 100644 --- a/swad_preference.c +++ b/swad_preference.c @@ -246,8 +246,8 @@ void Prf_PutSelectorToSelectLanguage (void) fprintf (Gbl.F.Out," selected=\"selected\""); fprintf (Gbl.F.Out,">%s",Txt_STR_LANG_NAME[Lan]); } - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -274,7 +274,7 @@ void Prf_AskChangeLanguage (void) Act_FormStart (ActChgLan); Par_PutHiddenParamUnsigned ("Lan",(unsigned) Gbl.Prefs.Language); Lay_PutSendButton (Txt_Switch_to_LANGUAGE[Gbl.Prefs.Language]); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); Gbl.Prefs.Language = CurrentLanguage; // Restore current language } @@ -355,13 +355,13 @@ static void Prf_PutIconsToSelectSideCols (void) Par_PutHiddenParamUnsigned ("SideCols",SideCols); fprintf (Gbl.F.Out,"" - "" - "", + " width:32px; height:20px; margin:0 auto;\" />", Gbl.Prefs.IconsURL, SideCols >> 1,SideCols & 1, Txt_LAYOUT_SIDE_COLUMNS[SideCols], Txt_LAYOUT_SIDE_COLUMNS[SideCols]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); Lay_EndRoundFrameTable10 (); @@ -396,7 +396,7 @@ void Prf_PutLeftIconToHideShowCols (void) Txt_Show_left_column, Txt_Show_left_column); } - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -428,7 +428,7 @@ void Prf_PutRigthIconToHideShowCols (void) Txt_Show_right_column, Txt_Show_right_column); } - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_record.c b/swad_record.c index 2a9e6da91..6635c7689 100644 --- a/swad_record.c +++ b/swad_record.c @@ -208,12 +208,12 @@ void Rec_ListFieldsRecordsForEdition (void) Act_FormStart (ActReqRemFie); Par_PutHiddenParamLong ("FieldCod",Gbl.CurrentCrs.Records.LstFields.Lst[NumField].FieldCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_record_field, Txt_Remove_record_field); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Name of the field */ fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Rec_MAX_LENGTH_NAME_FIELD, Gbl.CurrentCrs.Records.LstFields.Lst[NumField].Name, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Number of lines in the form */ fprintf (Gbl.F.Out,"" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Gbl.CurrentCrs.Records.LstFields.Lst[NumField].NumLines, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Visibility of a field */ fprintf (Gbl.F.Out,"%s", Txt_RECORD_FIELD_VISIBILITY_MENU[Vis]); } - fprintf (Gbl.F.Out,"" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } } @@ -341,7 +342,7 @@ void Rec_ShowFormCreateRecordField (void) /***** Send button *****/ Lay_PutSendButton (Txt_Create_record_field); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -592,7 +593,7 @@ void Rec_AskConfirmRemFieldWithRecords (unsigned NumRecords) "" "", Txt_Remove_record_field); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -887,7 +888,7 @@ void Rec_PutLinkToEditRecordFields (void) Act_FormStart (ActEdiRecFie); Act_LinkFormSubmit (Txt_Edit_record_fields,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit_record_fields,Txt_Edit_record_fields); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -929,8 +930,8 @@ void Rec_ListRecordsInvs (void) Act_FormStart (ActPrnRecSevInv); Usr_PutHiddenParUsrCodAll (ActPrnRecSevInv,Gbl.Usrs.Select.All); Rec_ShowLinkToPrintPreviewOfRecords (); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /***** Initialize structure with user's data *****/ @@ -1015,8 +1016,8 @@ static void Rec_ShowRecordOneStdCrs (void) Act_FormStart (ActPrnRecSevStd); Usr_PutHiddenParUsrCodAll (ActPrnRecSevStd,Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); Rec_ShowLinkToPrintPreviewOfRecords (); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Show the record *****/ fprintf (Gbl.F.Out,"
" - "
"); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /***** Initialize structure with user's data *****/ @@ -1171,8 +1172,8 @@ static void Rec_ShowRecordOneTchCrs (void) Par_PutHiddenParamChar ("ParamOfficeHours",'Y'); Par_PutHiddenParamChar ("ShowOfficeHours",'Y'); Rec_ShowLinkToPrintPreviewOfRecords (); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,"
"); @@ -1243,8 +1244,8 @@ void Rec_ListRecordsTchsCrs (void) ShowOfficeHours ? 'Y' : 'N'); Rec_ShowLinkToPrintPreviewOfRecords (); - fprintf (Gbl.F.Out,"" - "
"); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /***** Initialize structure with user's data *****/ @@ -1362,13 +1363,13 @@ static void Rec_WriteFormShowOfficeHours (bool ShowOfficeHours,const char *ListU " onclick=\"javascript:document.getElementById('%s').submit();\" />" "\"%s\"" - " %s" - "", + " %s", Gbl.FormId, Gbl.Prefs.IconsURL, Txt_Show_office_hours, The_ClassFormul[Gbl.Prefs.Theme], Txt_Show_office_hours); + Act_FormEnd (); } /*****************************************************************************/ @@ -1644,7 +1645,7 @@ void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat) if (DataForm) { Lay_PutSendButton (Txt_Send); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } } @@ -1872,8 +1873,8 @@ void Rec_ShowFormSignUpWithMyCommonRecord (void) Act_FormStart (ActSignUp); Rec_ShowSharedUsrRecord (Rec_FORM_SIGN_UP,&Gbl.Usrs.Me.UsrDat); Lay_PutSendButton (Txt_Sign_up); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1908,8 +1909,8 @@ void Rec_ShowFormMyCommRecord (void) Rec_ShowSharedUsrRecord (Rec_FORM_MY_COMMON_RECORD,&Gbl.Usrs.Me.UsrDat); Lay_PutSendButton (Txt_Save_changes); Rec_WriteLinkToDataProtectionClause (); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1925,7 +1926,7 @@ static void Rec_PutFormToMyCommonRecord (void) Act_FormStart (ActReqEdiRecCom); Act_LinkFormSubmit (Txt_Edit_my_personal_data,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit_my_personal_data,Txt_Edit_my_personal_data); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1944,7 +1945,7 @@ static void Rec_PutLinkToMyCrsRecord (void) Act_FormStart (ActSeeRecCrs); Act_LinkFormSubmit (Txt_View_my_record_for_this_course,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("card",Txt_View_my_record_for_this_course,Txt_View_my_record_for_this_course); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } } @@ -1964,8 +1965,8 @@ void Rec_ShowFormOtherNewCommonRecord (struct UsrData *UsrDat) Grp_ShowLstGrpsToChgOtherUsrsGrps (UsrDat->UsrCod); Lay_PutSendButton (Txt_Register); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -2010,6 +2011,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, struct UsrData *UsrDat) { extern const char *The_ClassFormul[The_NUM_THEMES]; + extern const char *Txt_View_record_card; extern const char *Txt_Admin_user; extern const char *Txt_ID; extern const char *Txt_Nickname; @@ -2017,6 +2019,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, extern const char *Txt_View_works; extern const char *Txt_See_exams; extern const char *Txt_Attendance; + extern const char *Txt_View_public_profile; extern const char *Txt_Email; extern const char *Txt_Sex; extern const char *Txt_Role; @@ -2050,10 +2053,11 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, const char *ClassHead,*ClassForm,*ClassData; char PhotoURL[PATH_MAX+1]; bool ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod); - bool IAmTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER); // My current role is teacher - bool IAmDegAdmin = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM); // My current role is degree administrator - bool IAmSuperuser = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM); // My current role is superuser - bool HeIsTeacher = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)); // He/she already is a teacher in any course + bool IAmLoggedAsStudent = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_STUDENT); // My current role is student + bool IAmLoggedAsTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER); // My current role is teacher + bool IAmLoggedAsDegAdm = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM); // My current role is degree administrator + bool IAmLoggedAsSysAdm = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM); // My current role is superuser + bool HeIsTeacherInAnyCourse = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)); // He/she already is a teacher in any course bool HeBelongsToCurrentCrs = (UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT || UsrDat->RoleInCurrentCrsDB == Rol_ROLE_TEACHER); bool RoleForm = (TypeOfView == Rec_FORM_SIGN_UP || @@ -2063,12 +2067,13 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, bool DataForm = (TypeOfView == Rec_FORM_MY_COMMON_RECORD || TypeOfView == Rec_FORM_NEW_RECORD_OTHER_NEW_USR || (TypeOfView == Rec_FORM_MODIFY_RECORD_OTHER_EXISTING_USR && - !(IAmTeacher && HeIsTeacher))); // A teacher can not modify another teacher's data + !(IAmLoggedAsTeacher && HeIsTeacherInAnyCourse))); // A teacher can not modify another teacher's data bool GoToPublicProfileForm = (TypeOfView == Rec_RECORD_LIST || TypeOfView == Rec_RECORD_PUBLIC || + TypeOfView == Rec_MY_COMMON_RECORD_CHECK || TypeOfView == Rec_OTHER_USR_COMMON_RECORD_CHECK); bool CommandForms = GoToPublicProfileForm && Gbl.Usrs.Me.Logged; - bool ShowEmail = (IAmDegAdmin || IAmSuperuser || DataForm || + bool ShowEmail = (IAmLoggedAsDegAdm || IAmLoggedAsSysAdm || DataForm || TypeOfView == Rec_FORM_MY_COMMON_RECORD || TypeOfView == Rec_MY_COMMON_RECORD_CHECK || TypeOfView == Rec_FORM_MY_COURSE_RECORD || @@ -2077,19 +2082,19 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, (TypeOfView == Rec_OTHER_USR_COMMON_RECORD_CHECK || ((TypeOfView == Rec_RECORD_LIST || TypeOfView == Rec_RECORD_PRINT) && - (IAmTeacher || Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_TEACHERS))))); - bool ShowID = (IAmDegAdmin || IAmSuperuser || DataForm || + (IAmLoggedAsTeacher || Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_TEACHERS))))); + bool ShowID = (IAmLoggedAsDegAdm || IAmLoggedAsSysAdm || DataForm || TypeOfView == Rec_FORM_MY_COMMON_RECORD || TypeOfView == Rec_MY_COMMON_RECORD_CHECK || TypeOfView == Rec_FORM_MY_COURSE_RECORD || TypeOfView == Rec_MY_COURSE_RECORD_CHECK || (UsrDat->Accepted && ((TypeOfView == Rec_OTHER_USR_COMMON_RECORD_CHECK && - !(IAmTeacher && HeIsTeacher)) || // A teacher can not see another teacher's ID + !(IAmLoggedAsTeacher && HeIsTeacherInAnyCourse)) || // A teacher can not see another teacher's ID ((TypeOfView == Rec_RECORD_LIST || TypeOfView == Rec_RECORD_PRINT) && - IAmTeacher && Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_STUDENTS)))); - bool ShowData = ItsMe || UsrDat->Accepted || IAmDegAdmin || IAmSuperuser; + IAmLoggedAsTeacher && Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_STUDENTS)))); + bool ShowData = ItsMe || UsrDat->Accepted || IAmLoggedAsDegAdm || IAmLoggedAsSysAdm; bool ShowIDRows = (TypeOfView != Rec_RECORD_PUBLIC); bool ShowAddressRows = (TypeOfView == Rec_FORM_MY_COMMON_RECORD || TypeOfView == Rec_MY_COMMON_RECORD_CHECK || @@ -2097,7 +2102,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, TypeOfView == Rec_MY_COURSE_RECORD_CHECK || ((TypeOfView == Rec_RECORD_LIST || TypeOfView == Rec_RECORD_PRINT) && - (IAmTeacher || IAmSuperuser) && + (IAmLoggedAsTeacher || IAmLoggedAsSysAdm) && UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT)); bool ShowTeacherRows = (((TypeOfView == Rec_FORM_MY_COMMON_RECORD || TypeOfView == Rec_MY_COMMON_RECORD_CHECK || @@ -2126,7 +2131,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, case Rec_FORM_MY_COMMON_RECORD: RecordWidth = Rec_WIDTH_SHARE_RECORD_BIG; FrameWidth = 10; - Col3Width = 160; + // Col3Width = 160; ClassHead = "HEAD_REC"; ClassForm = The_ClassFormul[Gbl.Prefs.Theme]; ClassData = "DAT_REC"; @@ -2145,7 +2150,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, } RecordWidth = Rec_WIDTH_SHARE_RECORD_BIG; FrameWidth = 10; - Col3Width = 160; + // Col3Width = 160; ClassHead = "HEAD_REC"; ClassForm = The_ClassFormul[Gbl.Prefs.Theme]; ClassData = "DAT_REC"; @@ -2156,7 +2161,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, case Rec_RECORD_PUBLIC: RecordWidth = Rec_WIDTH_SHARE_RECORD_SMALL; FrameWidth = 10; - Col3Width = 160; + // Col3Width = 160; ClassHead = "HEAD_REC_SMALL"; ClassForm = "DAT_REC_SMALL"; ClassData = "DAT_REC_SMALL_BOLD"; @@ -2164,7 +2169,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, case Rec_RECORD_PRINT: RecordWidth = Rec_WIDTH_SHARE_RECORD_PRINT; FrameWidth = 1; - Col3Width = 160; + // Col3Width = 160; ClassHead = "HEAD_REC_SMALL"; ClassForm = "DAT_REC_SMALL"; ClassData = "DAT_REC_SMALL_BOLD"; @@ -2217,6 +2222,31 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, { fprintf (Gbl.F.Out,"
"); + /***** Button to view user's record card when: + - viewing public profile && + - a course is selected && + - the user belongs to it && + - I belong to it or I am system admin *****/ + if (TypeOfView == Rec_RECORD_PUBLIC && + HeBelongsToCurrentCrs && + (IAmLoggedAsStudent || + IAmLoggedAsTeacher || + IAmLoggedAsSysAdm)) + { + Act_FormStart ((UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT) ? ActSeeRecOneStd : + ActSeeRecOneTch); + Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); + Act_LinkFormSubmit (Txt_View_record_card,NULL); + fprintf (Gbl.F.Out,"
" + "\"%s\"" + "
" + "", + Gbl.Prefs.IconsURL, + Txt_View_record_card); + Act_FormEnd (); + } + /***** Button to admin user *****/ if (ItsMe || (Gbl.CurrentCrs.Crs.CrsCod > 0 && Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER) || @@ -2232,15 +2262,15 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "\"%s\"" "
" - "" - "", + "", Gbl.Prefs.IconsURL, Txt_Admin_user); + Act_FormEnd (); } if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // A course is selected UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT && // He/she is a student in the current course - (ItsMe || IAmTeacher || IAmSuperuser)) // I can view + (ItsMe || IAmLoggedAsTeacher || IAmLoggedAsSysAdm)) // I can view { /***** Button to view user's assignments and works *****/ if (ItsMe) // I am a student @@ -2257,10 +2287,10 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "\"%s\"" "" - "" - "", + "", Gbl.Prefs.IconsURL, Txt_View_works); + Act_FormEnd (); /***** Button to view user's test exams *****/ if (ItsMe) @@ -2276,14 +2306,14 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "\"%s\"" "" - "" - "", + "", Gbl.Prefs.IconsURL, Txt_See_exams); + Act_FormEnd (); /***** Button to view user's attendance *****/ // TODO: A student should see her/his attendance - if (IAmTeacher || IAmSuperuser) + if (IAmLoggedAsTeacher || IAmLoggedAsSysAdm) { Act_FormStart (ActSeeLstAttStd); Par_PutHiddenParamString ("UsrCodStd",UsrDat->EncryptedUsrCod); @@ -2293,10 +2323,10 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "\"%s\"" "" - "" - "", + "", Gbl.Prefs.IconsURL, Txt_Attendance); + Act_FormEnd (); } } @@ -2313,10 +2343,10 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "\"%s\"" "" - "" - "", + "", Gbl.Prefs.IconsURL, Gbl.Title); + Act_FormEnd (); fprintf (Gbl.F.Out,""); } @@ -2343,8 +2373,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, Col3Width); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO150x200", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO150x200",Pho_NO_ZOOM); fprintf (Gbl.F.Out,"" ""); @@ -2365,13 +2394,14 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, /* Put form to go to public profile */ Act_FormStart (ActSeePubPrf); Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); - sprintf (Gbl.Title,Txt_Write_a_message_to_X,UsrDat->FullName); - Act_LinkFormSubmit (Gbl.Title,"HEAD_REC_BIG"); + Act_LinkFormSubmit (Txt_View_public_profile,"HEAD_REC_BIG"); } fprintf (Gbl.F.Out,"@%s",UsrDat->Nickname); if (GoToPublicProfileForm) - fprintf (Gbl.F.Out,"" - ""); + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } /* Link to QR code */ if (!DataForm) @@ -3135,7 +3165,7 @@ static void Rec_PutLinkToChangeMyInsCtrDpt (void) Act_FormStart (ActReqEdiMyIns); Act_LinkFormSubmit (Txt_Edit_my_institution,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("institution",Txt_Edit_my_institution,Txt_Edit_my_institution); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3151,7 +3181,7 @@ static void Rec_PutLinkToChangeMySocialNetworks (void) Act_FormStart (ActReqEdiMyNet); Act_LinkFormSubmit (Txt_Edit_my_webs_networks,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("earth",Txt_Edit_my_webs_networks,Txt_Edit_my_webs_networks); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -3232,9 +3262,9 @@ void Rec_ShowFormMyInsCtrDpt (void) fprintf (Gbl.F.Out,">%s", Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); /***** Institution *****/ @@ -3276,9 +3306,9 @@ void Rec_ShowFormMyInsCtrDpt (void) fprintf (Gbl.F.Out,">%s", Gbl.Inss.Lst[NumIns].FullName); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); if (IAmTeacher) @@ -3323,9 +3353,9 @@ void Rec_ShowFormMyInsCtrDpt (void) fprintf (Gbl.F.Out,">%s", Gbl.Ctrs.Lst[NumCtr].FullName); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); /***** Department *****/ @@ -3368,9 +3398,9 @@ void Rec_ShowFormMyInsCtrDpt (void) fprintf (Gbl.F.Out,">%s", Gbl.Dpts.Lst[NumDpt].FullName); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); /***** Office *****/ @@ -3385,13 +3415,13 @@ void Rec_ShowFormMyInsCtrDpt (void) Act_FormGoToStart (ActChgMyOff); fprintf (Gbl.F.Out,"" - "" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Cns_MAX_LENGTH_STRING, Gbl.Usrs.Me.UsrDat.Tch.Office, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); /***** Phone *****/ fprintf (Gbl.F.Out,"" @@ -3404,13 +3434,13 @@ void Rec_ShowFormMyInsCtrDpt (void) Act_FormGoToStart (ActChgMyOffPho); fprintf (Gbl.F.Out,"" - "" - "" - "", + " onchange=\"javascript:document.getElementById('%s').submit();\" />", Usr_MAX_LENGTH_PHONE, Gbl.Usrs.Me.UsrDat.Tch.OfficePhone, Gbl.FormId); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); } /***** End table *****/ diff --git a/swad_role.c b/swad_role.c index cb6f36963..23f486c38 100644 --- a/swad_role.c +++ b/swad_role.c @@ -312,8 +312,8 @@ void Rol_PutFormToChangeMyRole (bool FormInHead) fprintf (Gbl.F.Out,">%s", Txt_ROLES_SINGUL_Abc[Role][Gbl.Usrs.Me.UsrDat.Sex]); } - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_search.c b/swad_search.c index 53de0f960..f0b9f1ef9 100644 --- a/swad_search.c +++ b/swad_search.c @@ -279,8 +279,8 @@ static void Sch_PutFormToSearchWithWhatToSearchAndScope (Act_Action_t Action,Sco fprintf (Gbl.F.Out,"" ""); Lay_EndRoundFrameTable10 (); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_statistic.c b/swad_statistic.c index 551905ec3..7588bc325 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -375,7 +375,7 @@ static void Sta_PutFormToRequestAccessesCrs (void) Act_FormStart (ActReqAccCrs); Act_LinkFormSubmit (Txt_Visits_to_course,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("stats",Txt_Visits_to_course,Txt_Visits_to_course); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -508,8 +508,8 @@ void Sta_AskSeeCrsAccesses (void) Sta_PutSeeAccessesButton (); /***** Form end *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); /* Free the memory used by the list of users */ Usr_FreeListsEncryptedUsrCods (); @@ -636,8 +636,8 @@ void Sta_AskSeeGblAccesses (void) Sta_PutSeeAccessesButton (); /***** Form end *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1528,7 +1528,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql } fprintf (Gbl.F.Out,""); if (FirstRow > 1) - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /* Write number of current page */ fprintf (Gbl.F.Out,"" @@ -1563,7 +1563,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql } fprintf (Gbl.F.Out,""); if (LastRow < NumRows) - fprintf (Gbl.F.Out,""); + Act_FormEnd (); fprintf (Gbl.F.Out,"" "" @@ -1806,7 +1806,7 @@ static void Sta_ShowNumAccessesPerUsr (unsigned long NumRows,MYSQL_RES *mysql_re ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL); Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO12x16",true); + "PHOTO12x16",Pho_ZOOM); fprintf (Gbl.F.Out,""); /* Write the user's ID if user is a student in current course */ @@ -2070,9 +2070,9 @@ static void Sta_ShowDistrAccessesPerDaysAndHour (unsigned long NumRows,MYSQL_RES fprintf (Gbl.F.Out," selected=\"selected\""); fprintf (Gbl.F.Out,">%s",Txt_STAT_COLOR_TYPES[ColorType]); } - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); /***** Compute maximum number of pages generated per day-hour *****/ @@ -3467,7 +3467,7 @@ static void Sta_ShowNumAccessesPerCourse (unsigned long NumRows,MYSQL_RES *mysql fprintf (Gbl.F.Out,"-"); fprintf (Gbl.F.Out," "); if (CrsOK) - fprintf (Gbl.F.Out,""); + Act_FormEnd (); fprintf (Gbl.F.Out,""); /* Draw bar proportional to number of pages generated */ @@ -3644,8 +3644,8 @@ void Sta_ReqUseOfPlatform (void) Txt_Show_statistic); /***** Form end *****/ - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_survey.c b/swad_survey.c index 8c0344013..21f12dd30 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -224,9 +224,9 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst) fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]); if (Order == Gbl.Svys.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" "%s" @@ -285,7 +285,7 @@ static void Svy_PutFormToSelectWhichGroupsToShow (void) Svy_PutHiddenParamSvyOrderType (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Grp_ShowSelectorWhichGrps (); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -393,9 +393,9 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh Act_LinkFormSubmit (Txt_View_survey, Svy.Status.Visible ? "ASG_TITLE" : "ASG_TITLE_LIGHT"); - fprintf (Gbl.F.Out,"%s" - "", + fprintf (Gbl.F.Out,"%s", Svy.Title); + Act_FormEnd (); /* Number of questions and number of distinct users who have already answered this survey */ fprintf (Gbl.F.Out,"

%s: %u; %s: %u

", @@ -426,7 +426,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Lay_PutSendButton (Txt_Answer_survey); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /* Possible button to see the result of the survey */ else if (Svy.Status.ICanViewResults) @@ -437,7 +437,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool Sh Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Lay_PutSendButton (Txt_View_survey_results); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } } @@ -562,7 +562,7 @@ static void Svy_WriteAuthor (struct Survey *Svy) /***** Show photo *****/ Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO12x16",true); + "PHOTO12x16",Pho_ZOOM); /***** Write name *****/ strcpy (FirstName,UsrDat.FirstName); @@ -704,8 +704,8 @@ static void Svy_PutFormToCreateNewSvy (void) Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Act_LinkFormSubmit (Txt_New_survey,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("new",Txt_New_survey,Txt_New_survey); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -731,12 +731,12 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove, Txt_Remove); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Put form to reset survey *****/ fprintf (Gbl.F.Out,""); @@ -746,12 +746,12 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Reset, Txt_Reset); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Put form to hide/show survey *****/ fprintf (Gbl.F.Out,""); @@ -771,8 +771,8 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible) " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Show,Txt_Show); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Put form to edit survey *****/ fprintf (Gbl.F.Out,""); @@ -782,12 +782,12 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Edit, Txt_Edit); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,"" ""); @@ -1272,9 +1272,9 @@ void Svy_AskRemSurvey (void) Lay_ShowAlert (Lay_WARNING,Gbl.Message); fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", Txt_Remove_survey); + Act_FormEnd (); /***** Show surveys again *****/ Svy_ListAllSurveys (&SvyQst); @@ -1375,9 +1375,9 @@ void Svy_AskResetSurvey (void) Lay_ShowAlert (Lay_WARNING,Gbl.Message); fprintf (Gbl.F.Out,"
" "" - "
" - "", + "", Txt_Reset_survey); + Act_FormEnd (); /***** Show surveys again *****/ Svy_ListAllSurveys (&SvyQst); @@ -1707,7 +1707,7 @@ void Svy_RequestCreatOrEditSvy (void) Txt_Modify_survey); /***** Form end *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** Show questions of the survey ready to be edited *****/ if (!ItsANewSurvey) @@ -2536,9 +2536,12 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch } /***** Send and undo buttons *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"" + "" + "" + ""); Lay_PutSendButton (Txt_Send); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); Svy_FreeTextChoiceAnswers (SvyQst,NumAnswers); } @@ -3028,12 +3031,12 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ Sta_WriteParamsDatesSeeAccesses (); Svy_WriteParamEditQst (SvyQst); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_question, Txt_Remove_question); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Write icon to edit the question */ fprintf (Gbl.F.Out,"", @@ -3042,12 +3045,12 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ Svy_PutParamSvyCod (Svy->SvyCod); Svy_PutParamQstCod (SvyQst->QstCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Edit_question, Txt_Edit_question); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /* Write index of question inside survey (row[1]) */ @@ -3100,7 +3103,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ Lay_PutSendButton (Txt_Send_survey); /***** Form end *****/ - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } else { @@ -3116,8 +3119,8 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Act_LinkFormSubmit (Txt_New_question,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("new",Txt_New_question,Txt_New_question); - fprintf (Gbl.F.Out,"" - "" + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } diff --git a/swad_syllabus.c b/swad_syllabus.c index 1ca1b71b4..f9e7881ad 100644 --- a/swad_syllabus.c +++ b/swad_syllabus.c @@ -155,9 +155,9 @@ void Syl_PutFormWhichSyllabus (void) "", Gbl.FormId,Txt_SYLLABUS_WHICH_SYLLABUS[WhichSyllabus]); } - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -563,11 +563,11 @@ static void Syl_ShowRowSyllabus (Inf_InfoType_t InfoType,unsigned NumItem,int Le sprintf (Gbl.Title,"%s %s", Txt_Remove,StrItemCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -584,11 +584,11 @@ static void Syl_ShowRowSyllabus (Inf_InfoType_t InfoType,unsigned NumItem,int Le Txt_Move_up_X, StrItemCod); fprintf (Gbl.F.Out,"" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"\"%s\""" - "", + " title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"\"%s\""" - "", + " title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"\"%s\""" - "", + " title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"" - "" - "", + " onfocus=\"javascript:if(this.value=='%s') this.value='';\" />", Syl_MAX_LENGTH_TEXT_ITEM,Text,Gbl.FormId, Txt_Enter_a_new_item_here); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_tab.c b/swad_tab.c index 866b20593..c106374b7 100644 --- a/swad_tab.c +++ b/swad_tab.c @@ -166,13 +166,13 @@ static void Tab_DrawTabsDeskTop (void) " alt=\"%s\" title=\"%s\"" " class=\"ICON32x32\" style=\"margin:4px;\" />" "
%s
" - "" - "", + "", Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Tab_TabIcons[NumTab], Txt_TABS_FULL_TXT[NumTab], Txt_TABS_FULL_TXT[NumTab], Txt_TABS_SHORT_TXT[NumTab]); + Act_FormEnd (); } else fprintf (Gbl.F.Out,"
" @@ -236,14 +236,14 @@ void Tab_DrawTabsMobile (void) " alt=\"%s\" title=\"%s\" class=\"ICON64x64\"" " style=\"margin:4px;\" />" "
%s
" - "" - "" - "
", + "", Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Tab_TabIcons[NumTab], Txt_TABS_FULL_TXT[NumTab], Txt_TABS_FULL_TXT[NumTab], Txt_TABS_FULL_TXT[NumTab]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } else fprintf (Gbl.F.Out,"
" @@ -353,9 +353,9 @@ static void Tab_WriteBreadcrumbHome (void) Act_FormStart (ActHom); Act_LinkFormSubmit (Txt_Home_PAGE,The_ClassTabOn[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,"%s" - "", + fprintf (Gbl.F.Out,"%s", Txt_Home_PAGE); + Act_FormEnd (); } /*****************************************************************************/ @@ -373,9 +373,9 @@ static void Tab_WriteBreadcrumbTab (void) Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.CurrentTab],The_ClassTabOn[Gbl.Prefs.Theme]); /***** Title and end of form *****/ - fprintf (Gbl.F.Out,"%s" - "", + fprintf (Gbl.F.Out,"%s", Txt_TABS_FULL_TXT[Gbl.CurrentTab]); + Act_FormEnd (); } /*****************************************************************************/ @@ -392,9 +392,9 @@ static void Tab_WriteBreadcrumbAction (void) Act_LinkFormSubmit (Title,The_ClassTabOn[Gbl.Prefs.Theme]); /***** Title and end of form *****/ - fprintf (Gbl.F.Out,"%s" - "", + fprintf (Gbl.F.Out,"%s", Title); + Act_FormEnd (); } /*****************************************************************************/ diff --git a/swad_test.c b/swad_test.c index 9533e5d62..d2bac1be3 100644 --- a/swad_test.c +++ b/swad_test.c @@ -291,9 +291,9 @@ void Tst_ShowFormAskTst (void) /***** Send button *****/ fprintf (Gbl.F.Out,"" - "
" - "", + "", Txt_Generate_exam); + Act_FormEnd (); } } else @@ -320,7 +320,7 @@ static void Tst_PutFormToSeeResultsOfUsersTests (void) ActReqSeeUsrTstExa); Act_LinkFormSubmit (Txt_Results_tests,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("file",Txt_Results_tests,Txt_Results_tests); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -335,7 +335,7 @@ static void Tst_PutFormToEdit (void) Act_FormStart (ActEdiTstQst); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -351,7 +351,7 @@ static void Tst_PutFormToConfigure (void) Act_FormStart (ActCfgTst); Act_LinkFormSubmit (Txt_Configure_tests,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("configtest",Txt_Configure,Txt_Configure); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -418,7 +418,7 @@ void Tst_ShowNewTestExam (void) /* End form */ Lay_PutSendButton (Txt_Done_assess_exam); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** Set test status *****/ Tst_SetTstStatus (NumAccessesTst,Tst_STATUS_SHOWN_BUT_NOT_ASSESSED); @@ -1145,9 +1145,9 @@ void Tst_ShowFormAskEditTsts (void) /***** Send button *****/ fprintf (Gbl.F.Out,"" - "" - "", + "", Txt_Show_questions); + Act_FormEnd (); } /* Free structure that stores the query result */ @@ -1167,7 +1167,7 @@ static void Tst_PutFormToCreateNewTstQst (void) Act_FormStart (ActEdiOneTstQst); Act_LinkFormSubmit (Txt_New_question,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("new",Txt_New_question,Txt_New_question); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -1528,8 +1528,8 @@ static void Tst_ShowFormEditTags (void) " size=\"36\" maxlength=\"%u\" value=\"%s\"" " onchange=\"javascript:document.getElementById('%s').submit();\" />", Tst_MAX_TAG_LENGTH,row[1],Gbl.FormId); - fprintf (Gbl.F.Out,"" - "" + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } @@ -1555,12 +1555,12 @@ static void Tst_PutIconEnable (long TagCod,const char *TagTxt) Par_PutHiddenParamLong ("TagCod",TagCod); sprintf (Gbl.Title,Txt_Tag_X_not_allowed_Click_to_allow_it,TagTxt); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1576,12 +1576,12 @@ static void Tst_PutIconDisable (long TagCod,const char *TagTxt) Par_PutHiddenParamLong ("TagCod",TagCod); sprintf (Gbl.Title,Txt_Tag_X_allowed_Click_to_disable_it,TagTxt); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Gbl.Title, Gbl.Title); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1717,7 +1717,7 @@ static void Tst_ShowFormConfigTst (void) fprintf (Gbl.F.Out,""); Lay_EndRoundFrameTable10 (); Lay_PutSendButton (Txt_Save); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -2485,8 +2485,8 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m { if (Order == Gbl.Test.SelectedOrderType) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); } @@ -2518,12 +2518,12 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m NumRows == 1 ? 'Y' : 'N'); // If there are only one row, don't list again after removing fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Remove_question, Txt_Remove_question); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Write icon to edit the question */ fprintf (Gbl.F.Out,"", @@ -2531,12 +2531,12 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m Act_FormStart (ActEdiOneTstQst); Par_PutHiddenParamLong ("QstCod",QstCod); fprintf (Gbl.F.Out,"" - "" - "", + " alt=\"%s\" title=\"%s\" class=\"ICON16x16\" />", Gbl.Prefs.IconsURL, Txt_Edit_question, Txt_Edit_question); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /* Write number of question */ fprintf (Gbl.F.Out,"" - "", + fprintf (Gbl.F.Out," onclick=\"javascript:document.getElementById('%s').submit();\" />", Gbl.FormId); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -4522,7 +4522,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback) "" ""); Lay_PutSendButton (Txt_Save); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); Tst_FreeTextChoiceAnswers (); } @@ -5995,7 +5995,7 @@ void Tst_SelUsrsToSeeUsrsTstExams (void) fprintf (Gbl.F.Out,"" ""); Lay_PutSendButton (Txt_See_exams); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } } else @@ -6030,7 +6030,7 @@ void Tst_SelDatesToSeeMyTstExams (void) /***** Button to send the form *****/ Lay_PutSendButton (Txt_See_exams); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -6363,11 +6363,11 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat) Tst_PutParamTstCod (TstCod); fprintf (Gbl.F.Out,"" - "", + " class=\"ICON16x16B\" />", Gbl.Prefs.IconsURL, Txt_See_exam, Txt_See_exam); + Act_FormEnd (); } fprintf (Gbl.F.Out,"" ""); @@ -6491,7 +6491,7 @@ static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumExams) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO36x48",true); + "PHOTO36x48",Pho_ZOOM); fprintf (Gbl.F.Out,""); /***** Start form to go to user's record card *****/ @@ -6519,8 +6519,8 @@ static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumExams) fprintf (Gbl.F.Out,",
%s",UsrDat->FirstName); /***** End form *****/ - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -6629,7 +6629,7 @@ void Tst_ShowOneTestExam (void) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Other.UsrDat,PhotoURL); Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO36x48",true); + "PHOTO36x48",Pho_ZOOM); fprintf (Gbl.F.Out,"" ""); diff --git a/swad_test_import.c b/swad_test_import.c index fc984b852..576c15fb0 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -98,7 +98,7 @@ void TsI_PutFormToExportQuestions (void) /***** Put a link to create a file with questions *****/ Act_LinkFormSubmit (Txt_Export_questions_to_XML_file,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("export",Txt_Export_questions_to_XML_file,Txt_Export_questions); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -117,7 +117,7 @@ void TsI_PutFormToImportQuestions (void) /***** Put a link to create a file with questions *****/ Act_LinkFormSubmit (Txt_Import_questions_from_XML_file,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("import",Txt_Import_questions_from_XML_file,Txt_Import_questions); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } /*****************************************************************************/ @@ -152,13 +152,13 @@ void TsI_ShowFormImportQstsFromXML (void) "" "" "" - "" - "" - "", + "", The_ClassFormul[Gbl.Prefs.Theme], Txt_XML_file, Fil_NAME_OF_PARAM_FILENAME_ORG, Txt_Upload_file); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_text.c b/swad_text.c index e3cfb447f..02469a042 100644 --- a/swad_text.c +++ b/swad_text.c @@ -5589,28 +5589,7 @@ const char *Txt_courses = #elif L==8 "disciplinas"; #endif -/* -const char *Txt_Courses_as_a_ROLE = // Warning: it is very important to include %s in the following sentences -#if L==0 - "Assignatures com %s"; -#elif L==1 - "Kurse als %s"; -#elif L==2 - "Courses as %s"; -#elif L==3 - "Asignaturas como %s"; -#elif L==4 - "Matières comme %s"; -#elif L==5 - "Asignaturas como %s"; // Okoteve traducción -#elif L==6 - "Corsi come %s"; -#elif L==7 - "Kursy jako %s"; -#elif L==8 - "Disciplinas como %s"; -#endif -*/ + const char *Txt_X_courses_have_been_eliminated = // Warning: it is very important to include %u in the following sentences #if L==0 "Se ha(n) eliminado %u asignatura(s)."; // Necessita traduccio @@ -11546,28 +11525,7 @@ const char *Txt_Files_works = #elif L==8 "Arquivos trabalhos"; #endif -/* -const char *Txt_First_access = -#if L==0 - "Primer accés"; -#elif L==1 - "Erster Zugang"; -#elif L==2 - "First access"; -#elif L==3 - "Primer acceso"; -#elif L==4 - "Premier accès"; -#elif L==5 - "Primer acceso"; // Okoteve traducción -#elif L==6 - "Primo accesso"; -#elif L==7 - "Pierwszy dostęp"; -#elif L==8 - "Primeiro acesso"; -#endif -*/ + const char *Txt_first_message_not_allowed = #if L==0 "primer mensaje no permitido"; // Necessita traduccio @@ -46905,27 +46863,6 @@ const char *Txt_View = "Ver"; #endif -const char *Txt_View_a_user_public_profile = -#if L==0 - "Veure el perfil públic d'un usuari"; -#elif L==1 - "Öffentliches Benutzer-Profile anzeigen"; -#elif L==2 - "View a user's public profile"; -#elif L==3 - "Ver el perfil público de un usuario"; -#elif L==4 - "Voir le profil public d'un utilisateur"; -#elif L==5 - "Ver el perfil público de un usuario"; // Okoteve traducción -#elif L==6 - "Mostra il profilo pubblico di un utente"; -#elif L==7 - "Zobacz profil publiczny użytkownika"; -#elif L==8 - "Ver o perfil público de um utilizador"; -#endif - const char *Txt_View_all_recipients = #if L==0 "Ver todos los destinatarios"; // Necessita traduccio @@ -47073,6 +47010,48 @@ const char *Txt_View_my_record_for_this_course = "Meu cartão em disciplina"; #endif +const char *Txt_View_public_profile = +#if L==0 + "Veure perfil públic"; +#elif L==1 + "Öffentliches Profile anzeigen"; +#elif L==2 + "View public profile"; +#elif L==3 + "Ver perfil público"; +#elif L==4 + "Voir profil public"; +#elif L==5 + "Ver perfil público"; // Okoteve traducción +#elif L==6 + "Mostra profilo pubblico"; +#elif L==7 + "Zobacz profil publiczny"; +#elif L==8 + "Ver perfil público"; +#endif + +const char *Txt_View_record_card = +#if L==0 + "Ver ficha"; // Necessita traduccio +#elif L==1 + "View record card"; // Need Übersetzung +#elif L==2 + "View record card"; +#elif L==3 + "Ver ficha"; +#elif L==4 + "View record card"; // Besoin de traduction +#elif L==5 + "Ver ficha"; // Okoteve traducción +#elif L==6 + "Vedi scheda"; +#elif L==7 + "Zobacz rekord"; +#elif L==8 + "View record card"; // Necessita de tradução +#endif + const char *Txt_View_survey = #if L==0 "Veure enquesta"; diff --git a/swad_theme.c b/swad_theme.c index 2e9bda3a7..652943e99 100644 --- a/swad_theme.c +++ b/swad_theme.c @@ -247,14 +247,14 @@ void The_PutIconsToSelectTheme (void) fprintf (Gbl.F.Out,"" - "" - "", + " width:32px; height:20px; margin:0 auto;\" />", Gbl.Prefs.IconsURL, Cfg_ICON_FOLDER_THEMES, The_ThemeId[Theme], The_ThemeNames[Theme], The_ThemeNames[Theme]); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,""); Lay_EndRoundFrameTable10 (); diff --git a/swad_timetable.c b/swad_timetable.c index 4e3f68797..51bf14b23 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -257,7 +257,7 @@ void TT_ShowClassTimeTable (void) Grp_PutParamWhichGrps (); Act_LinkFormSubmit (Txt_Edit,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } if (PutEditOfficeHours) @@ -265,7 +265,7 @@ void TT_ShowClassTimeTable (void) Act_FormStart (ActEdiTut); Act_LinkFormSubmit (Txt_Edit_office_hours,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("edit",Txt_Edit_office_hours,Txt_Edit_office_hours); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } if (!PrintView) @@ -296,8 +296,8 @@ void TT_ShowClassTimeTable (void) ""); Act_FormStart (Gbl.CurrentAct); Grp_ShowSelectorWhichGrps (); - fprintf (Gbl.F.Out,"" - "" + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); } @@ -326,8 +326,8 @@ void TT_EditCrsTimeTable (void) Act_FormStart (ActSeeCrsTimTbl); Act_LinkFormSubmit (Txt_Show_timetable,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("clock",Txt_Show_timetable,Txt_Show_timetable); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Start of table *****/ Lay_StartRoundFrameTable10 ("98%",0,NULL); @@ -358,8 +358,8 @@ void TT_ShowMyTutTimeTable (void) Act_FormStart (ActSeeMyTimTbl); Act_LinkFormSubmit (Txt_Show_timetable,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("clock",Txt_Show_timetable,Txt_Show_timetable); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Time table *****/ Lay_StartRoundFrameTable10 (NULL,0,Txt_TIMETABLE_TYPES[TT_TUTOR_TIMETABLE]); @@ -1301,7 +1301,7 @@ static void TT_TimeTableDrawCell (unsigned Day,unsigned Hour,unsigned Column,uns /***** End of form *****/ if (TimeTableView == TT_CRS_EDIT || TimeTableView == TT_TUT_EDIT) - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End of cell *****/ fprintf (Gbl.F.Out,""); diff --git a/swad_user.c b/swad_user.c index 35fe29475..a875a3dcb 100644 --- a/swad_user.c +++ b/swad_user.c @@ -136,7 +136,7 @@ static void Usr_SetUsrRoleAndPrefs (void); static void Usr_InsertMyLastData (void); static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat); -static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutCheckboxToSelectUsr); +static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutCheckBoxToSelectUsr); static void Usr_WriteRowGstAllData (struct UsrData *UsrDat); static void Usr_WriteMainUsrDataExceptUsrID (struct UsrData *UsrDat,const char *BgColor,bool ShowEmail, const char *MailLink, @@ -1350,7 +1350,7 @@ void Usr_WriteFormLogin (void) sprintf (Gbl.Title,Txt_New_on_PLATFORM_Sign_up,Cfg_PLATFORM_SHORT_NAME); Act_LinkFormSubmit (Gbl.Title,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("arroba",Txt_Create_account,Gbl.Title); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** Link to enter from external site *****/ if (Cfg_EXTERNAL_LOGIN_URL[0] && @@ -1407,15 +1407,15 @@ void Usr_WriteFormLogin (void) "", Txt_Log_in); Lay_EndRoundFrameTable10 (); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** Link used for sending a new password *****/ Act_FormStart (ActReqSndNewPwd); Par_PutHiddenParamString ("UsrId",Gbl.Usrs.Me.UsrIdLogin); Act_LinkFormSubmit (Txt_I_forgot_my_password,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("key",Txt_I_forgot_my_password,Txt_I_forgot_my_password); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -1526,9 +1526,9 @@ void Usr_PutFormLogIn (void) Act_LinkFormSubmit (Txt_Log_in,The_ClassHead[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\"" - " %s" - "", + " %s", Gbl.Prefs.PathTheme,Txt_Log_in,Txt_Log_in); + Act_FormEnd (); } /*****************************************************************************/ @@ -1565,7 +1565,7 @@ void Usr_WriteLoggedUsrHead (void) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Me.UsrDat,PhotoURL); Pho_ShowUsrPhoto (&Gbl.Usrs.Me.UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO15x20",true); + "PHOTO15x20",Pho_ZOOM); /***** User's name *****/ fprintf (Gbl.F.Out," ", @@ -1595,9 +1595,9 @@ void Usr_PutFormLogOut (void) Act_LinkFormSubmit (Txt_Log_out,The_ClassHead[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\""" - " %s" - "", + " %s", Gbl.Prefs.PathTheme,Txt_Log_out,Txt_Log_out); + Act_FormEnd (); } /*****************************************************************************/ @@ -2453,8 +2453,8 @@ void Usr_ShowFormsRoleAndLogout (void) Act_FormStart (ActLogOut); Act_LinkFormSubmit (Txt_Log_out,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("logout",Txt_Log_out,Txt_Log_out); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Write message with my new logged role *****/ sprintf (Gbl.Message,Txt_You_are_LOGGED_as_X, @@ -2616,8 +2616,7 @@ static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_ZOOM); fprintf (Gbl.F.Out,""); } @@ -2653,7 +2652,7 @@ static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat) /************ Write a row of a table with the data of a student **************/ /*****************************************************************************/ -void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutCheckboxToSelectUsr) +void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutCheckBoxToSelectUsr) { extern const char *Txt_Enrollment_confirmed; extern const char *Txt_Enrollment_not_confirmed; @@ -2671,12 +2670,12 @@ void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutChe fprintf (Gbl.F.Out,""); /***** Checkbox to select user *****/ - if (PutCheckboxToSelectUsr) + if (PutCheckBoxToSelectUsr) UsrIsTheMsgSender = (UsrDat->UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod); // Two colors are used alternatively to better distinguish the rows BgColor = UsrIsTheMsgSender ? LIGHT_GREEN : Gbl.ColorRows[Gbl.RowEvenOdd]; - if (PutCheckboxToSelectUsr) + if (PutCheckBoxToSelectUsr) { fprintf (Gbl.F.Out,"", @@ -2719,8 +2718,7 @@ void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutChe ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_ZOOM); fprintf (Gbl.F.Out,""); } @@ -2777,8 +2775,7 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_NO_ZOOM); fprintf (Gbl.F.Out,""); } @@ -2882,8 +2879,7 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_NO_ZOOM); fprintf (Gbl.F.Out,""); } @@ -2977,7 +2973,7 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames) /************* Write a row of a table with the data of a teacher *************/ /*****************************************************************************/ -static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutCheckboxToSelectUsr) +static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutCheckBoxToSelectUsr) { extern const char *Txt_Enrollment_confirmed; extern const char *Txt_Enrollment_not_confirmed; @@ -2995,11 +2991,11 @@ static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool fprintf (Gbl.F.Out,""); /***** Checkbox to select user *****/ - if (PutCheckboxToSelectUsr) + if (PutCheckBoxToSelectUsr) UsrIsTheMsgSender = (UsrDat->UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod); BgColor = UsrIsTheMsgSender ? LIGHT_GREEN : Gbl.ColorRows[Gbl.RowEvenOdd]; // Two colors are used alternatively to better distinguish the rows - if (PutCheckboxToSelectUsr) + if (PutCheckBoxToSelectUsr) { fprintf (Gbl.F.Out,"", @@ -3039,8 +3035,7 @@ static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_ZOOM); fprintf (Gbl.F.Out,""); } @@ -3099,8 +3094,7 @@ void Usr_WriteRowTchAllData (struct UsrData *UsrDat) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_NO_ZOOM); fprintf (Gbl.F.Out,""); } @@ -3182,8 +3176,7 @@ void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat) ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - "PHOTO18x24", - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + "PHOTO18x24",Pho_ZOOM); fprintf (Gbl.F.Out,""); } @@ -4328,8 +4321,8 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs) /***** Send button *****/ Lay_PutSendButton (Txt_Show_anyway); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -4734,8 +4727,8 @@ void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction) Usr_PutParamListWithPhotos (); Usr_PutExtraParamsUsrList (NextAction); Usr_PutSelectorNumColsClassPhoto (); - fprintf (Gbl.F.Out,"" - "" + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); /***** 2nd row *****/ @@ -4753,8 +4746,8 @@ void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction) Usr_PutParamUsrListType (Usr_LIST); Usr_PutExtraParamsUsrList (NextAction); Usr_PutCheckboxListWithPhotos (); - fprintf (Gbl.F.Out,"" - "" + Act_FormEnd (); + fprintf (Gbl.F.Out,"" ""); /***** End of table *****/ @@ -4778,12 +4771,12 @@ static void Usr_FormToSelectUsrListType (Act_Action_t NextAction,Usr_ShowUsrsTyp Act_LinkFormSubmit (Txt_USR_LIST_TYPES[ListType],The_ClassFormulNB[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\"" - " %s " - "", + " %s ", Gbl.Prefs.IconsURL, Usr_IconsClassPhotoOrList[ListType], Txt_USR_LIST_TYPES[ListType], Txt_USR_LIST_TYPES[ListType]); + Act_FormEnd (); } /*****************************************************************************/ @@ -5883,8 +5876,8 @@ void Usr_ListDataAdms (void) Act_FormStart (ActLstAdm); Sco_PutSelectorScope (true); Usr_PutParamListWithPhotos (); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Get and order list of administrators *****/ Usr_GetAdmsLst (Gbl.Scope.Current); @@ -5896,8 +5889,8 @@ void Usr_ListDataAdms (void) Act_FormStart (ActLstAdm); Sco_PutParamScope (Gbl.Scope.Current); Usr_PutCheckboxListWithPhotos (); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Initialize number of columns *****/ NumColumns = Usr_NUM_MAIN_FIELDS_DATA_ADM; @@ -6313,8 +6306,8 @@ void Usr_SeeGuests (void) Usr_PutParamListWithPhotos (); fprintf (Gbl.F.Out,"%s: ",Txt_Scope); Sco_PutSelectorScope (true); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); break; default: break; @@ -6350,8 +6343,8 @@ void Usr_SeeGuests (void) Usr_PutExtraParamsUsrList (ActLstInvAll); Act_LinkFormSubmit (Txt_Show_all_data,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("table",Txt_Show_all_data,Txt_Show_all_data); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); break; } @@ -6392,8 +6385,8 @@ void Usr_SeeGuests (void) /* Send button */ Lay_PutSendButton (Txt_Show_records); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } } else @@ -6458,8 +6451,8 @@ void Usr_SeeStudents (void) Usr_PutParamListWithPhotos (); fprintf (Gbl.F.Out,"%s: ",Txt_Scope); Sco_PutSelectorScope (true); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); break; default: break; @@ -6503,8 +6496,8 @@ void Usr_SeeStudents (void) Usr_PutExtraParamsUsrList (ActLstStdAll); Act_LinkFormSubmit (Txt_Show_all_data,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("table",Txt_Show_all_data,Txt_Show_all_data); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } break; } @@ -6558,7 +6551,7 @@ void Usr_SeeStudents (void) if (ICanViewRecords) { Lay_PutSendButton (Txt_Show_records); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -6612,8 +6605,8 @@ void Usr_SeeTeachers (void) Usr_PutParamListWithPhotos (); fprintf (Gbl.F.Out,"%s: ",Txt_Scope); Sco_PutSelectorScope (true); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); /***** Form to select type of list of users *****/ Usr_ShowFormsToSelectUsrListType (ActLstTch); @@ -6645,8 +6638,8 @@ void Usr_SeeTeachers (void) Usr_PutParamListWithPhotos (); Act_LinkFormSubmit (Txt_Show_all_data,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("table",Txt_Show_all_data,Txt_Show_all_data); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } break; } @@ -6697,7 +6690,7 @@ void Usr_SeeTeachers (void) { /* Send button */ Lay_PutSendButton (Txt_Show_records); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,""); @@ -6729,7 +6722,7 @@ static void Usr_PutLinkToListOfficialStudents (void) Act_FormStart (ActGetExtLstStd); Act_LinkFormSubmit (Txt_Official_students,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("list",Txt_Official_students,Txt_Official_students); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } } @@ -6972,8 +6965,7 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType, ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL); Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - ClassPhoto, - Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW); + ClassPhoto,Pho_ZOOM); /***** Photo foot *****/ fprintf (Gbl.F.Out,"
"); @@ -7446,13 +7438,13 @@ static float Usr_GetNumUsrsPerCrs (Rol_Role_t Role) void Usr_RequestUserProfile (void) { - extern const char *Txt_View_a_user_public_profile; + extern const char *Txt_View_public_profile; extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Nickname; extern const char *Txt_Continue; /***** Start frame *****/ - Lay_StartRoundFrameTable10 (NULL,2,Txt_View_a_user_public_profile); + Lay_StartRoundFrameTable10 (NULL,2,Txt_View_public_profile); fprintf (Gbl.F.Out,"" ""); @@ -7469,7 +7461,7 @@ void Usr_RequestUserProfile (void) /***** Send button*****/ Lay_PutSendButton (Txt_Continue); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); /***** End frame *****/ fprintf (Gbl.F.Out,"" @@ -7603,14 +7595,12 @@ void Usr_ShowDetailsUserProfile (const struct UsrData *UsrDat) extern const char *Txt_course; extern const char *Txt_courses; extern const char *Txt_From_TIME; - // extern const char *Txt_First_access; extern const char *Txt_day; extern const char *Txt_days; extern const char *Txt_Calculate; extern const char *Txt_Clicks; extern const char *Txt_of_PART_OF_A_TOTAL; extern const char *Txt_clicks; - // extern const char *Txt_Courses_as_a_ROLE; extern const char *Txt_Forums; extern const char *Txt_post; extern const char *Txt_posts; @@ -7629,8 +7619,6 @@ void Usr_ShowDetailsUserProfile (const struct UsrData *UsrDat) unsigned NumPublicFiles; /***** Start table *****/ - // Lay_StartRoundFrameTable10 (NULL,2,Txt_Figures); - // Lay_StartRoundFrameTable10 (NULL,2,NULL); fprintf (Gbl.F.Out,""); /***** Number of courses in which the user is teacher or student *****/ @@ -7722,7 +7710,7 @@ void Usr_ShowDetailsUserProfile (const struct UsrData *UsrDat) Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); Act_LinkFormSubmit (Txt_Calculate,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("recycle",Txt_Calculate,Txt_Calculate); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,"" ""); @@ -7767,7 +7755,7 @@ void Usr_ShowDetailsUserProfile (const struct UsrData *UsrDat) Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); Act_LinkFormSubmit (Txt_Calculate,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("recycle",Txt_Calculate,Txt_Calculate); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,"" ""); @@ -7803,7 +7791,7 @@ void Usr_ShowDetailsUserProfile (const struct UsrData *UsrDat) Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); Act_LinkFormSubmit (Txt_Calculate,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("recycle",Txt_Calculate,Txt_Calculate); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,"" ""); @@ -7839,7 +7827,7 @@ void Usr_ShowDetailsUserProfile (const struct UsrData *UsrDat) Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); Act_LinkFormSubmit (Txt_Calculate,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("recycle",Txt_Calculate,Txt_Calculate); - fprintf (Gbl.F.Out,""); + Act_FormEnd (); } fprintf (Gbl.F.Out,"" ""); @@ -7868,7 +7856,6 @@ void Usr_ShowDetailsUserProfile (const struct UsrData *UsrDat) /***** End of table *****/ fprintf (Gbl.F.Out,"
"); - // Lay_EndRoundFrameTable10 (); } /*****************************************************************************/ diff --git a/swad_zip.c b/swad_zip.c index a99e424fd..4f0b1256c 100644 --- a/swad_zip.c +++ b/swad_zip.c @@ -122,8 +122,8 @@ void ZIP_PutButtonToCreateZIPAsgWrk (void) Par_PutHiddenParamChar ("CreateZIP",'Y'); Act_LinkFormSubmit (Txt_Create_ZIP_file,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("download",Txt_Create_ZIP_file,Txt_Create_ZIP_file); - fprintf (Gbl.F.Out,"" - ""); + Act_FormEnd (); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -308,9 +308,9 @@ void ZIP_PutButtonToDownloadZIPOfAFolder (const char *PathInTree,const char *Fil Act_LinkFormSubmit (Txt_Create_ZIP_file,The_ClassFormul[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\""" - "" - "", + "", Gbl.Prefs.IconsURL,Txt_Create_ZIP_file,Txt_Create_ZIP_file); + Act_FormEnd (); } /*****************************************************************************/