From 09f96e842d6b400de33bc5c58a67a3ee4b461d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 13 Dec 2015 18:32:37 +0100 Subject: [PATCH] Version 15.64.6 --- swad_ID.c | 4 ++-- swad_QR.c | 1 + swad_account.c | 4 ++-- swad_action.c | 28 ---------------------------- swad_action.h | 4 ---- swad_announcement.c | 2 +- swad_assignment.c | 13 ++++++++----- swad_attendance.c | 21 ++++++++++++--------- swad_banner.c | 2 +- swad_calendar.c | 2 +- swad_centre.c | 4 ++-- swad_changelog.h | 3 ++- swad_connected.c | 2 +- swad_country.c | 2 +- swad_course.c | 6 +++--- swad_degree.c | 2 +- swad_department.c | 2 +- swad_enrollment.c | 14 +++++++------- swad_exam.c | 11 +++++++---- swad_file_browser.c | 4 ++-- swad_holiday.c | 2 +- swad_info.c | 5 +++-- swad_institution.c | 2 +- swad_layout.c | 39 +++++++++++++++++++++++++++++++++++---- swad_layout.h | 4 ++++ swad_link.c | 2 +- swad_logo.c | 3 ++- swad_mail.c | 6 +++--- swad_message.c | 8 +++++--- swad_notice.c | 2 +- swad_notification.c | 3 ++- swad_password.c | 6 +++--- swad_photo.c | 10 +++++----- swad_place.c | 2 +- swad_plugin.c | 2 +- swad_privacy.c | 2 +- swad_record.c | 9 +++++---- swad_statistic.c | 1 + swad_survey.c | 17 +++++++++++------ swad_syllabus.c | 2 +- swad_test.c | 7 ++++--- swad_test_import.c | 3 +++ swad_timetable.c | 10 +++++----- swad_user.c | 23 ++++++++++++----------- swad_zip.c | 2 +- 45 files changed, 167 insertions(+), 136 deletions(-) diff --git a/swad_ID.c b/swad_ID.c index e5cb7dfa1..6277c3c5d 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -377,10 +377,10 @@ void ID_PutLinkToChangeUsrIDs (void) /***** Link for changing the password *****/ if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me - Act_PutContextualLink (ActFrmUsrAcc,NULL, + Lay_PutContextualLink (ActFrmUsrAcc,NULL, "arroba64x64.gif",Txt_Change_IDs); else // Not me - Act_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActFrmIDsStd : + Lay_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActFrmIDsStd : (Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER ? ActFrmIDsTch : ActFrmIDsOth), // Guest, visitor or admin Usr_PutParamOtherUsrCodEncrypted, diff --git a/swad_QR.c b/swad_QR.c index 7f6e3059d..bff56d8ce 100644 --- a/swad_QR.c +++ b/swad_QR.c @@ -82,6 +82,7 @@ void QR_PutLinkToPrintQRCode (struct UsrData *UsrDat,bool PrintText) Act_LinkFormSubmit (Txt_QR_code,The_ClassFormBold[Gbl.Prefs.Theme]); Lay_PutIconWithText ("qr64x64.gif",Txt_QR_code,PrintText ? Txt_QR_code : NULL); + fprintf (Gbl.F.Out,""); Act_FormEnd (); } diff --git a/swad_account.c b/swad_account.c index e1b8f39b1..98007227e 100644 --- a/swad_account.c +++ b/swad_account.c @@ -128,7 +128,7 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith /***** Link to log in *****/ fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActFrmLogIn,NULL,"login64x64.png",Txt_Log_in); + Lay_PutContextualLink (ActFrmLogIn,NULL,"login64x64.png",Txt_Log_in); fprintf (Gbl.F.Out,"
"); /***** Form to enter some data of the new user *****/ @@ -243,7 +243,7 @@ static void Acc_PutLinkToRemoveMyAccount (void) { extern const char *Txt_Remove_account; - Act_PutContextualLink (ActReqRemMyAcc,Acc_PutLinkToRemoveMyAccountParams, + Lay_PutContextualLink (ActReqRemMyAcc,Acc_PutLinkToRemoveMyAccountParams, "remove-on64x64.png",Txt_Remove_account); } diff --git a/swad_action.c b/swad_action.c index c91f44af8..c59a2bcb1 100644 --- a/swad_action.c +++ b/swad_action.c @@ -4400,34 +4400,6 @@ void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle) Gbl.FormId); } -/*****************************************************************************/ -/***************** Show an icon with a link in contextual menu ***************/ -/*****************************************************************************/ - -void Act_PutContextualLink (Act_Action_t NextAction,void (*FuncParams) (), - const char *Icon,const char *Title) - { - extern const char *The_ClassFormBold[The_NUM_THEMES]; - - Act_FormStart (NextAction); - if (FuncParams) - FuncParams (); - Act_LinkFormSubmit (Title,The_ClassFormBold[Gbl.Prefs.Theme]); - Lay_PutIconWithText (Icon,Title,Title); - Act_FormEnd (); - } - -/*****************************************************************************/ -/****************** Show an icon with a link (without text) ******************/ -/*****************************************************************************/ - -void Act_PutIconLink (const char *Icon,const char *Title) - { - Act_LinkFormSubmit (Title,NULL); - Lay_PutIconWithText (Icon,Title,NULL); - Act_FormEnd (); - } - /*****************************************************************************/ /***************** Adjust current action when no user's logged ***************/ /*****************************************************************************/ diff --git a/swad_action.h b/swad_action.h index e267fcc09..78068fe69 100644 --- a/swad_action.h +++ b/swad_action.h @@ -1403,10 +1403,6 @@ void Act_LinkFormSubmit (const char *Title,const char *LinkStyle); void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,const char *Id); void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle); -void Act_PutContextualLink (Act_Action_t NextAction,void (*FuncParams) (), - const char *Icon,const char *Title); -void Act_PutIconLink (const char *Icon,const char *Title); - void Act_AdjustActionWhenNoUsrLogged (void); void Act_AdjustCurrentAction (void); diff --git a/swad_announcement.c b/swad_announcement.c index d6f59b2e2..d87ed4e0d 100644 --- a/swad_announcement.c +++ b/swad_announcement.c @@ -93,7 +93,7 @@ void Ann_ShowAllAnnouncements (void) if (ICanEditAnnouncements) { fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActWriAnn,NULL,"plus64x64.png",Txt_New_announcement); + Lay_PutContextualLink (ActWriAnn,NULL,"plus64x64.png",Txt_New_announcement); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_assignment.c b/swad_assignment.c index 697a3dc7a..a0cac6abc 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -469,7 +469,7 @@ static void Asg_PutFormToCreateNewAsg (void) /***** Put form to create a new assignment *****/ fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActFrmNewAsg,Asg_PutFormToCreateNewAsgParams, + Lay_PutContextualLink (ActFrmNewAsg,Asg_PutFormToCreateNewAsgParams, "plus64x64.png",Txt_New_assignment); fprintf (Gbl.F.Out,"
"); } @@ -500,7 +500,8 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Act_PutIconLink ("remove-on64x64.png",Txt_Remove); + Lay_PutIconLink ("remove-on64x64.png",Txt_Remove,NULL,NULL); + Act_FormEnd (); /***** Put form to hide/show assignment *****/ Act_FormStart (Hidden ? ActShoAsg : @@ -510,9 +511,10 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); if (Hidden) - Act_PutIconLink ("eye-slash-on64x64.png",Txt_Show); + Lay_PutIconLink ("eye-slash-on64x64.png",Txt_Show,NULL,NULL); else - Act_PutIconLink ("eye-on64x64.png",Txt_Hide); + Lay_PutIconLink ("eye-on64x64.png",Txt_Hide,NULL,NULL); + Act_FormEnd (); /***** Put form to edit assignment *****/ Act_FormStart (ActEdiOneAsg); @@ -520,7 +522,8 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Act_PutIconLink ("edit64x64.png",Txt_Edit); + Lay_PutIconLink ("edit64x64.png",Txt_Edit,NULL,NULL); + Act_FormEnd (); fprintf (Gbl.F.Out,""); } diff --git a/swad_attendance.c b/swad_attendance.c index 694e0de4d..fdce8ae73 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -466,7 +466,7 @@ static void Att_PutFormToListMyAttendance (void) { extern const char *Txt_Attendance_list; - Act_PutContextualLink (ActSeeLstMyAtt,NULL, + Lay_PutContextualLink (ActSeeLstMyAtt,NULL, "list16x16.gif",Txt_Attendance_list); } @@ -478,7 +478,7 @@ static void Att_PutFormToListStdsAttendance (void) { extern const char *Txt_Attendance_list; - Act_PutContextualLink (ActReqLstStdAtt,Att_PutFormToListStdsParams, + Lay_PutContextualLink (ActReqLstStdAtt,Att_PutFormToListStdsParams, "list16x16.gif",Txt_Attendance_list); } @@ -498,7 +498,7 @@ static void Att_PutFormToCreateNewAttEvent (void) extern const char *Txt_New_event; /***** Put form to create a new attendance event *****/ - Act_PutContextualLink (ActFrmNewAtt,Att_PutFormToCreateNewAttEventParams, + Lay_PutContextualLink (ActFrmNewAtt,Att_PutFormToCreateNewAttEventParams, "plus64x64.png",Txt_New_event); } @@ -528,7 +528,8 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) Att_PutHiddenParamAttOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Act_PutIconLink ("remove-on64x64.png",Txt_Remove); + Lay_PutIconLink ("remove-on64x64.png",Txt_Remove,NULL,NULL); + Act_FormEnd (); /***** Put form to hide/show attendance event *****/ Act_FormStart (Hidden ? ActShoAtt : @@ -538,9 +539,10 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); if (Hidden) - Act_PutIconLink ("eye-slash-on64x64.png",Txt_Show); + Lay_PutIconLink ("eye-slash-on64x64.png",Txt_Show,NULL,NULL); else - Act_PutIconLink ("eye-on64x64.png",Txt_Hide); + Lay_PutIconLink ("eye-on64x64.png",Txt_Hide,NULL,NULL); + Act_FormEnd (); /***** Put form to edit attendance event *****/ Act_FormStart (ActEdiOneAtt); @@ -548,7 +550,8 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) Att_PutHiddenParamAttOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Act_PutIconLink ("edit64x64.png",Txt_Edit); + Lay_PutIconLink ("edit64x64.png",Txt_Edit,NULL,NULL); + Act_FormEnd (); fprintf (Gbl.F.Out,""); } @@ -2860,7 +2863,7 @@ static void Att_PutFormToPrintMyList (void) /***** Link to print view *****/ fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActPrnLstMyAtt,Att_PutFormToPrintMyListParams, + Lay_PutContextualLink (ActPrnLstMyAtt,Att_PutFormToPrintMyListParams, "print64x64.png",Txt_Print); fprintf (Gbl.F.Out,"
"); } @@ -2883,7 +2886,7 @@ static void Att_PutFormToPrintStdsList (void) /***** Link to print view *****/ fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActPrnLstStdAtt,Att_PutFormToPrintStdsListParams, + Lay_PutContextualLink (ActPrnLstStdAtt,Att_PutFormToPrintStdsListParams, "print64x64.png",Txt_Print); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_banner.c b/swad_banner.c index 82360719e..d8549b75e 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -130,7 +130,7 @@ static void Ban_PutFormToEditBanners (void) /***** Link to edit banners *****/ fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiBan,NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (ActEdiBan,NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_calendar.c b/swad_calendar.c index 27eaefc63..9bbbd7395 100644 --- a/swad_calendar.c +++ b/swad_calendar.c @@ -251,7 +251,7 @@ void Cal_DrawCalendar (void) { /* Link to print view */ fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActPrnCal,NULL,"print64x64.png",Txt_Print); + Lay_PutContextualLink (ActPrnCal,NULL,"print64x64.png",Txt_Print); fprintf (Gbl.F.Out,"
"); } Lay_StartRoundFrameTable (NULL,0,NULL); diff --git a/swad_centre.c b/swad_centre.c index 4136b4925..25bd25557 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -283,7 +283,7 @@ static void Ctr_Configuration (bool PrintView) fprintf (Gbl.F.Out,"
"); /* Link to print view */ - Act_PutContextualLink (ActPrnCtrInf,NULL,"print64x64.png",Txt_Print); + Lay_PutContextualLink (ActPrnCtrInf,NULL,"print64x64.png",Txt_Print); /* Links to upload logo and photo */ if (Gbl.Usrs.Me.LoggedRole >= Rol_CTR_ADM) @@ -1904,7 +1904,7 @@ static void Ctr_PutFormToChangeCtrPhoto (bool PhotoExists) extern const char *Txt_Upload_photo; /***** Link for changing / uploading the photo *****/ - Act_PutContextualLink (ActReqCtrPho,NULL, + Lay_PutContextualLink (ActReqCtrPho,NULL, "photo64x64.gif",PhotoExists ? Txt_Change_photo : Txt_Upload_photo); } diff --git a/swad_changelog.h b/swad_changelog.h index 9bdc06617..d04d6e22d 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -117,12 +117,13 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.64.5 (2015/12/13)" +#define Log_PLATFORM_VERSION "SWAD 15.64.6 (2015/12/13)" #define CSS_FILE "swad15.64.5.css" // 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 15.64.6: Dec 13, 2015 Code refactoring in contextual links. (186974 lines) Version 15.64.5: Dec 13, 2015 Code refactoring in record card. (186944 lines) Version 15.64.4: Dec 13, 2015 Links to web / social networks are not displayed when printing record card. (186986 lines) Version 15.64.3: Dec 13, 2015 Changes in layout of records. (186979 lines) diff --git a/swad_connected.c b/swad_connected.c index f47c25d34..de6be6156 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -141,7 +141,7 @@ void Con_PutLinkToLastClicks (void) { extern const char *Txt_Last_clicks; - Act_PutContextualLink (ActLstClk,NULL, + Lay_PutContextualLink (ActLstClk,NULL, "mouse-pointer64x64.png",Txt_Last_clicks); } diff --git a/swad_country.c b/swad_country.c index ac7191c12..d7b65ad05 100644 --- a/swad_country.c +++ b/swad_country.c @@ -224,7 +224,7 @@ static void Cty_Configuration (bool PrintView) fprintf (Gbl.F.Out,"
"); /* Link to print view */ - Act_PutContextualLink (ActPrnCtyInf,NULL,"print64x64.png",Txt_Print); + Lay_PutContextualLink (ActPrnCtyInf,NULL,"print64x64.png",Txt_Print); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_course.c b/swad_course.c index 68d2330de..61ec249a8 100644 --- a/swad_course.c +++ b/swad_course.c @@ -192,7 +192,7 @@ static void Crs_Configuration (bool PrintView) fprintf (Gbl.F.Out,"
"); /* Link to print view */ - Act_PutContextualLink (ActPrnCrsInf,NULL,"print64x64.png",Txt_Print); + Lay_PutContextualLink (ActPrnCrsInf,NULL,"print64x64.png",Txt_Print); /* Link to request enrollment in the current course */ if (Gbl.Usrs.Me.LoggedRole == Rol__GUEST_ || @@ -2889,7 +2889,7 @@ static void Crs_PutLinkToSearchCourses (void) extern const char *Txt_Search_courses; /***** Put form to search / select courses *****/ - Act_PutContextualLink ( Gbl.CurrentCrs.Crs.CrsCod > 0 ? ActCrsReqSch : + Lay_PutContextualLink ( Gbl.CurrentCrs.Crs.CrsCod > 0 ? ActCrsReqSch : (Gbl.CurrentDeg.Deg.DegCod > 0 ? ActDegReqSch : (Gbl.CurrentCtr.Ctr.CtrCod > 0 ? ActCtrReqSch : (Gbl.CurrentIns.Ins.InsCod > 0 ? ActInsReqSch : @@ -2914,7 +2914,7 @@ void Crs_PutFormToSelectMyCourses (void) extern const char *Txt_My_courses; /***** Put form to search / select courses *****/ - Act_PutContextualLink (ActMyCrs,NULL,"hierarchy64x64.gif",Txt_My_courses); + Lay_PutContextualLink (ActMyCrs,NULL,"hierarchy64x64.gif",Txt_My_courses); } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index 5e3c78fe7..92fd258be 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -317,7 +317,7 @@ static void Deg_Configuration (bool PrintView) fprintf (Gbl.F.Out,"
"); /* Link to print view */ - Act_PutContextualLink (ActPrnDegInf,NULL,"print64x64.png",Txt_Print); + Lay_PutContextualLink (ActPrnDegInf,NULL,"print64x64.png",Txt_Print); /* Link to upload logo */ if (Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM) diff --git a/swad_department.c b/swad_department.c index 66fe0dada..8695f1414 100644 --- a/swad_department.c +++ b/swad_department.c @@ -212,7 +212,7 @@ static void Dpt_PutFormToEditDpts (void) extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiDpt,NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (ActEdiDpt,NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_enrollment.c b/swad_enrollment.c index 2da79a802..459671438 100644 --- a/swad_enrollment.c +++ b/swad_enrollment.c @@ -152,7 +152,7 @@ void Enr_PutLinkToRequestSignUp (void) extern const char *Txt_Sign_up; /***** Show the form *****/ - Act_PutContextualLink (ActReqSignUp,NULL,"signup16x16.gif",Txt_Sign_up); + Lay_PutContextualLink (ActReqSignUp,NULL,"signup16x16.gif",Txt_Sign_up); } /*****************************************************************************/ @@ -350,12 +350,12 @@ void Enr_ReqAcceptRegisterInCrs (void) fprintf (Gbl.F.Out,"
"); /***** Send button to accept register in the current course *****/ - Act_PutContextualLink (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActAccEnrStd : + Lay_PutContextualLink (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActAccEnrStd : ActAccEnrTch, NULL,"ok_green16x16.gif",Txt_Confirm_my_enrollment); /***** Send button to refuse register in the current course *****/ - Act_PutContextualLink (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActRemMe_Std : + Lay_PutContextualLink (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActRemMe_Std : ActRemMe_Tch, NULL,"remove-on64x64.png",Txt_Remove_me_from_this_course); @@ -682,7 +682,7 @@ void Enr_PutLinkToRemOldUsrs (void) extern const char *Txt_Eliminate_old_users; /***** Put form to remove old users *****/ - Act_PutContextualLink (ActReqRemOldUsr,NULL,"remove-on64x64.png",Txt_Eliminate_old_users); + Lay_PutContextualLink (ActReqRemOldUsr,NULL,"remove-on64x64.png",Txt_Eliminate_old_users); } /*****************************************************************************/ @@ -1772,7 +1772,7 @@ static void Enr_PutLinkToRemAllStdsThisCrs (void) extern const char *Txt_Remove_all_students; /***** Put form to remove all the students in the current course *****/ - Act_PutContextualLink (ActReqRemAllStdCrs,NULL, + Lay_PutContextualLink (ActReqRemAllStdCrs,NULL, "remove-on64x64.png",Txt_Remove_all_students); } @@ -2749,7 +2749,7 @@ void Enr_PutLinkToAdminOneUsr (Act_Action_t NextAction) extern const char *Txt_Admin_me; extern const char *Txt_Admin_one_user; - Act_PutContextualLink (NextAction,NULL,"configtest16x16.gif", + Lay_PutContextualLink (NextAction,NULL,"configtest16x16.gif", Enr_CheckIfICanAdminOtherUsrs () ? Txt_Admin_one_user : Txt_Admin_me); } @@ -2763,7 +2763,7 @@ void Enr_PutLinkToAdminSeveralUsrs (Rol_Role_t Role) extern const char *Txt_Admin_several_students; extern const char *Txt_Admin_several_teachers; - Act_PutContextualLink (Role == Rol_STUDENT ? ActReqEnrSevStd : + Lay_PutContextualLink (Role == Rol_STUDENT ? ActReqEnrSevStd : ActReqEnrSevTch, NULL,"configtest16x16.gif", Role == Rol_STUDENT ? Txt_Admin_several_students : diff --git a/swad_exam.c b/swad_exam.c index 313d862e7..536eaef77 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -443,7 +443,7 @@ static void Exa_ListExamAnnouncements (Exa_TypeViewExamAnnouncement_t TypeViewEx case Rol_TEACHER: case Rol_SYS_ADM: fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiExaAnn,NULL, + Lay_PutContextualLink (ActEdiExaAnn,NULL, "plus64x64.png",Txt_New_announcement_OF_EXAM); fprintf (Gbl.F.Out,"
"); break; @@ -775,18 +775,21 @@ static void Exa_ShowExamAnnouncement (long ExaCod,Exa_TypeViewExamAnnouncement_t /***** Link to remove this exam announcement *****/ Act_FormStart (ActRemExaAnn); Par_PutHiddenParamLong ("ExaCod",ExaCod); - Act_PutIconLink ("remove-on64x64.png",Txt_Remove); + Lay_PutIconLink ("remove-on64x64.png",Txt_Remove,NULL,NULL); + Act_FormEnd (); /***** Link to edit this exam announcement *****/ Act_FormStart (ActEdiExaAnn); Par_PutHiddenParamLong ("ExaCod",ExaCod); - Act_PutIconLink ("edit64x64.png",Txt_Edit); + Lay_PutIconLink ("edit64x64.png",Txt_Edit,NULL,NULL); + Act_FormEnd (); } /***** Link to print view *****/ Act_FormStart (ActPrnExaAnn); Par_PutHiddenParamLong ("ExaCod",ExaCod); - Act_PutIconLink ("print64x64.png",Txt_Print); + Lay_PutIconLink ("print64x64.png",Txt_Print,NULL,NULL); + Act_FormEnd (); fprintf (Gbl.F.Out,"" ""); diff --git a/swad_file_browser.c b/swad_file_browser.c index fa9e04195..8e7cd3d1b 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -4301,11 +4301,11 @@ static void Brw_PutFormToShowOrAdmin (Brw_ShowOrAdmin_t ShowOrAdmin, switch (ShowOrAdmin) { case Brw_SHOW: - Act_PutContextualLink (Action,Brw_PutFormToShowOrAdminParams, + Lay_PutContextualLink (Action,Brw_PutFormToShowOrAdminParams, "eye-on64x64.png",Txt_View); break; case Brw_ADMIN: - Act_PutContextualLink (Action,Brw_PutFormToShowOrAdminParams, + Lay_PutContextualLink (Action,Brw_PutFormToShowOrAdminParams, "edit64x64.png",Txt_Edit); break; } diff --git a/swad_holiday.c b/swad_holiday.c index 1ce8f748f..ab00fa22d 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -199,7 +199,7 @@ static void Hld_PutFormToEditHlds (void) extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiHld,NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (ActEdiHld,NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_info.c b/swad_info.c index f60504a90..0b801ae3f 100644 --- a/swad_info.c +++ b/swad_info.c @@ -417,7 +417,7 @@ static void Inf_PutFormToEditInfo (Inf_InfoType_t InfoType) extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (Inf_ActionsEditInfo[InfoType],NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (Inf_ActionsEditInfo[InfoType],NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } @@ -884,6 +884,7 @@ static void Inf_ShowPage (Inf_InfoType_t InfoType,const char *URL) Lay_PutIconWithText ("fullscreen16x16.gif", Txt_View_in_a_new_window, Txt_View_in_a_new_window); + fprintf (Gbl.F.Out,""); /***** End of frame *****/ Lay_EndRoundFrame (); @@ -921,7 +922,7 @@ void Inf_FormsToSelSendInfo (void) /***** Put link to view *****/ fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (Inf_ActionsSeeInfo[InfoType],NULL, + Lay_PutContextualLink (Inf_ActionsSeeInfo[InfoType],NULL, "eye-on64x64.png",Txt_View); fprintf (Gbl.F.Out,"
"); diff --git a/swad_institution.c b/swad_institution.c index 36ba03299..2d3575e89 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -261,7 +261,7 @@ static void Ins_Configuration (bool PrintView) fprintf (Gbl.F.Out,"
"); /* Link to print view */ - Act_PutContextualLink (ActPrnInsInf,NULL,"print64x64.png",Txt_Print); + Lay_PutContextualLink (ActPrnInsInf,NULL,"print64x64.png",Txt_Print); /* Link to upload logo */ if (Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM) diff --git a/swad_layout.c b/swad_layout.c index a4a8ae173..986caf034 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -922,7 +922,7 @@ void Lay_PutFormToView (Act_Action_t Action) extern const char *Txt_View; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (Action,NULL,"eye-on64x64.png",Txt_View); + Lay_PutContextualLink (Action,NULL,"eye-on64x64.png",Txt_View); fprintf (Gbl.F.Out,"
"); } @@ -935,10 +935,42 @@ void Lay_PutFormToEdit (Act_Action_t Action) extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (Action,NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (Action,NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } +/*****************************************************************************/ +/***************** Show an icon with a link in contextual menu ***************/ +/*****************************************************************************/ + +void Lay_PutContextualLink (Act_Action_t NextAction,void (*FuncParams) (), + const char *Icon,const char *Title) + { + extern const char *The_ClassFormBold[The_NUM_THEMES]; + + // fprintf (Gbl.F.Out,"
"); + + Act_FormStart (NextAction); + if (FuncParams) + FuncParams (); + Lay_PutIconLink (Icon,Title,The_ClassFormBold[Gbl.Prefs.Theme],Title); + Act_FormEnd (); + + // fprintf (Gbl.F.Out,"
"); + } + +/*****************************************************************************/ +/****************** Show an icon with a link (without text) ******************/ +/*****************************************************************************/ + +void Lay_PutIconLink (const char *Icon,const char *Title, + const char *LinkStyle,const char *Text) + { + Act_LinkFormSubmit (Title,LinkStyle); + Lay_PutIconWithText (Icon,Title,Text); + fprintf (Gbl.F.Out,""); + } + /*****************************************************************************/ /**************** Put a icon with a text to submit a form ********************/ /*****************************************************************************/ @@ -956,8 +988,7 @@ void Lay_PutIconWithText (const char *Icon,const char *Alt,const char *Text) if (Text[0]) fprintf (Gbl.F.Out," %s", Text); - fprintf (Gbl.F.Out,"
" - ""); + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ diff --git a/swad_layout.h b/swad_layout.h index 52db03a32..12f638a1c 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -73,6 +73,10 @@ void Lay_WriteTitle (const char *Title); void Lay_PutFormToView (Act_Action_t Action); void Lay_PutFormToEdit (Act_Action_t Action); +void Lay_PutContextualLink (Act_Action_t NextAction,void (*FuncParams) (), + const char *Icon,const char *Title); +void Lay_PutIconLink (const char *Icon,const char *Title, + const char *LinkStyle,const char *Text); void Lay_PutIconWithText (const char *Icon,const char *Alt,const char *Text); void Lay_PutCalculateIconWithText (const char *Alt,const char *Text); diff --git a/swad_link.c b/swad_link.c index 788df8399..13113955a 100644 --- a/swad_link.c +++ b/swad_link.c @@ -159,7 +159,7 @@ static void Lnk_PutFormToEditLinks (void) extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiLnk,NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (ActEdiLnk,NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_logo.c b/swad_logo.c index cbf583b4c..e4ba7a23f 100644 --- a/swad_logo.c +++ b/swad_logo.c @@ -219,7 +219,7 @@ void Log_PutFormToChangeLogo (Sco_Scope_t Scope) LogoExists = Fil_CheckIfPathExists (PathLogo); /***** Link for changing / uploading the logo *****/ - Act_PutContextualLink (Action,NULL,Icon,LogoExists ? Txt_Change_logo : + Lay_PutContextualLink (Action,NULL,Icon,LogoExists ? Txt_Change_logo : Txt_Upload_logo); } @@ -320,6 +320,7 @@ static void Log_PutLinkToRemoveLogo (Act_Action_t Action) Act_FormStart (Action); Act_LinkFormSubmit (Txt_Remove_logo,The_ClassFormBold[Gbl.Prefs.Theme]); Lay_PutIconWithText ("remove-on64x64.png",Txt_Remove_logo,Txt_Remove_logo); + fprintf (Gbl.F.Out,""); Act_FormEnd (); } diff --git a/swad_mail.c b/swad_mail.c index 8342c361e..1d76f2511 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -176,7 +176,7 @@ static void Mai_PutFormToEditMailDomains (void) extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiMai,NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (ActEdiMai,NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } @@ -919,10 +919,10 @@ void Mai_PutLinkToChangeOtherUsrEmail (void) /***** Link for changing the password *****/ if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me - Act_PutContextualLink (ActFrmUsrAcc,NULL, + Lay_PutContextualLink (ActFrmUsrAcc,NULL, "msg64x64.gif",Txt_Change_email); else // Not me - Act_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActFrmMaiStd : + Lay_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActFrmMaiStd : (Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER ? ActFrmMaiTch : ActFrmMaiOth), Usr_PutParamOtherUsrCodEncrypted, diff --git a/swad_message.c b/swad_message.c index ea43edaf0..e327eb58e 100644 --- a/swad_message.c +++ b/swad_message.c @@ -226,7 +226,8 @@ void Msg_ListEMails (void) Txt_Create_e_mail_message, The_ClassFormBold[Gbl.Prefs.Theme]); Lay_PutIconWithText ("editnewmsg16x16.gif",Txt_Create_e_mail_message,Txt_Create_e_mail_message); - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"" + "
"); } } else @@ -1697,7 +1698,7 @@ static void Msg_PutLinkToViewBannedUsers(void) { extern const char *Txt_Banned_users; - Act_PutContextualLink (ActLstBanUsr,NULL,"stop16x16.gif",Txt_Banned_users); + Lay_PutContextualLink (ActLstBanUsr,NULL,"stop16x16.gif",Txt_Banned_users); } /*****************************************************************************/ @@ -2224,7 +2225,7 @@ void Msg_ShowFormDelSentOrRecMsgs (Msg_TypeOfMessages_t TypeOfMessages,unsigned Txt_from_A_COURSE, Gbl.Msg.FilterCrsShortName, StrFilterContent); - Act_PutContextualLink ((TypeOfMessages == Msg_MESSAGES_RECEIVED) ? ActReqDelAllRcvMsg : + Lay_PutContextualLink ((TypeOfMessages == Msg_MESSAGES_RECEIVED) ? ActReqDelAllRcvMsg : ActReqDelAllSntMsg, Msg_PutHiddenParamsMsgsFilters, "remove-on64x64.png",Gbl.Title); @@ -3008,6 +3009,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 (); } diff --git a/swad_notice.c b/swad_notice.c index 451bff266..b43415fe2 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -213,7 +213,7 @@ void Not_ListFullNotices (void) if (ICanEditNotices) { fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActWriNot,NULL,"plus64x64.png",Txt_New_notice); + Lay_PutContextualLink (ActWriNot,NULL,"plus64x64.png",Txt_New_notice); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_notification.c b/swad_notification.c index e5add6446..aeb6f25e1 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -1642,7 +1642,7 @@ static void Ntf_PutLinkToChangePrefs (void) { extern const char *Txt_Change_preferences; - Act_PutContextualLink (ActEdiPrf,NULL,"heart16x16.gif",Txt_Change_preferences); + Lay_PutContextualLink (ActEdiPrf,NULL,"heart16x16.gif",Txt_Change_preferences); } /*****************************************************************************/ @@ -1659,6 +1659,7 @@ static void Ntf_PutLinkToMarkAllNotifAsSeen (void) Lay_PutIconWithText ("eye-on64x64.png", Txt_Mark_all_notifications_as_read, Txt_Mark_all_notifications_as_read); + fprintf (Gbl.F.Out,""); Act_FormEnd (); } diff --git a/swad_password.c b/swad_password.c index ed45b95a9..8c45dded1 100644 --- a/swad_password.c +++ b/swad_password.c @@ -217,7 +217,7 @@ void Pwd_PutLinkToSendNewPasswd (void) { extern const char *Txt_Forgotten_password; - Act_PutContextualLink (ActReqSndNewPwd,Pwd_PutLinkToSendNewPasswdParams, + Lay_PutContextualLink (ActReqSndNewPwd,Pwd_PutLinkToSendNewPasswdParams, "key64x64.gif",Txt_Forgotten_password); } @@ -842,7 +842,7 @@ void Pwd_PutLinkToChangeMyPassword (void) extern const char *Txt_Change_password; /***** Link for changing the password *****/ - Act_PutContextualLink (ActFrmChgMyPwd,NULL,"key64x64.gif",Txt_Change_password); + Lay_PutContextualLink (ActFrmChgMyPwd,NULL,"key64x64.gif",Txt_Change_password); } /*****************************************************************************/ @@ -857,7 +857,7 @@ void Pwd_PutLinkToChangeOtherUsrPassword (void) if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me Pwd_PutLinkToChangeMyPassword (); else // Not me - Act_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActFrmPwdStd : + Lay_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActFrmPwdStd : (Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER ? ActFrmPwdTch : ActFrmPwdOth), Usr_PutParamOtherUsrCodEncrypted, diff --git a/swad_photo.c b/swad_photo.c index 2e76fdfba..1c7a0cc92 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -173,7 +173,7 @@ void Pho_PutLinkToChangeMyPhoto (void) extern const char *Txt_Upload_photo; /***** Link for changing / uploading the photo *****/ - Act_PutContextualLink (ActReqMyPho,NULL,"photo64x64.gif", + Lay_PutContextualLink (ActReqMyPho,NULL,"photo64x64.gif", Gbl.Usrs.Me.MyPhotoExists ? Txt_Change_photo : Txt_Upload_photo); } @@ -196,7 +196,7 @@ void Pho_PutLinkToChangeOtherUsrPhoto (void) if (Pho_CheckIfICanChangeOtherUsrPhoto (&Gbl.Usrs.Other.UsrDat)) { PhotoExists = Pho_BuildLinkToPhoto (&Gbl.Usrs.Other.UsrDat,PhotoURL,true); - Act_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActReqStdPho : + Lay_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActReqStdPho : (Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER ? ActReqTchPho : ActReqOthPho), // Guest, visitor or admin Usr_PutParamOtherUsrCodEncrypted, @@ -214,7 +214,7 @@ static void Pho_PutLinkToRemoveMyPhoto (void) extern const char *Txt_Remove_photo; /***** Link for removing the photo *****/ - Act_PutContextualLink (ActRemMyPho,NULL,"remove-on64x64.png",Txt_Remove_photo); + Lay_PutContextualLink (ActRemMyPho,NULL,"remove-on64x64.png",Txt_Remove_photo); } /*****************************************************************************/ @@ -226,7 +226,7 @@ static void Pho_PutLinkToRemoveOtherUsrPhoto (const struct UsrData *UsrDat) extern const char *Txt_Remove_photo; /***** Link for removing the photo *****/ - Act_PutContextualLink ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActRemStdPho : + Lay_PutContextualLink ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActRemStdPho : (UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ActRemTchPho : ActRemOthPho), // Guest, visitor or admin Usr_PutParamOtherUsrCodEncrypted, @@ -1749,7 +1749,7 @@ static void Pho_PutLinkToPrintViewOfDegreeStats (void) extern const char *Txt_Print; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActPrnPhoDeg,Pho_PutLinkToPrintViewOfDegreeStatsParams, + Lay_PutContextualLink (ActPrnPhoDeg,Pho_PutLinkToPrintViewOfDegreeStatsParams, "print64x64.png",Txt_Print); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_place.c b/swad_place.c index 5e3a7f922..8387b6c0e 100644 --- a/swad_place.c +++ b/swad_place.c @@ -203,7 +203,7 @@ static void Plc_PutFormToEditPlcs (void) extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiPlc,NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (ActEdiPlc,NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_plugin.c b/swad_plugin.c index 492bb2a44..f314454be 100644 --- a/swad_plugin.c +++ b/swad_plugin.c @@ -155,7 +155,7 @@ static void Plg_PutFormToEditPlugins (void) extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiPlg,NULL,"edit64x64.png",Txt_Edit); + Lay_PutContextualLink (ActEdiPlg,NULL,"edit64x64.png",Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_privacy.c b/swad_privacy.c index 3375b9893..96ec1dc10 100644 --- a/swad_privacy.c +++ b/swad_privacy.c @@ -72,7 +72,7 @@ void Pri_PutLinkToChangeMyPrivacy (void) extern const char *Txt_Privacy; /***** Link to edit my privacy *****/ - Act_PutContextualLink (ActEdiPri,NULL,"lock64x64.png",Txt_Privacy); + Lay_PutContextualLink (ActEdiPri,NULL,"lock64x64.png",Txt_Privacy); } /*****************************************************************************/ diff --git a/swad_record.c b/swad_record.c index 3e2021989..fefd143a1 100644 --- a/swad_record.c +++ b/swad_record.c @@ -859,7 +859,7 @@ void Rec_PutLinkToEditRecordFields (void) extern const char *Txt_Edit_record_fields; /***** Link to edit record fields *****/ - Act_PutContextualLink (ActEdiRecFie,NULL,"edit64x64.png",Txt_Edit_record_fields); + Lay_PutContextualLink (ActEdiRecFie,NULL,"edit64x64.png",Txt_Edit_record_fields); } /*****************************************************************************/ @@ -1321,7 +1321,8 @@ static void Rec_ShowLinkToPrintPreviewOfRecords (void) Act_LinkFormSubmit (Txt_Print,The_ClassFormBold[Gbl.Prefs.Theme]); Lay_PutIconWithText ("print64x64.png",Txt_Print,Txt_Print); - fprintf (Gbl.F.Out,"(" + fprintf (Gbl.F.Out,"" + "(" "