diff --git a/swad_ID.c b/swad_ID.c index 621b87517..a8a39482d 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -360,7 +360,6 @@ void ID_WriteUsrIDs (struct UsrData *UsrDat,bool ICanSeeUsrID) void ID_PutLinkToChangeUsrIDs (const struct UsrData *UsrDat) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Change_IDs; extern const char *Txt_User_not_found_or_you_do_not_have_permission_; @@ -374,9 +373,7 @@ void ID_PutLinkToChangeUsrIDs (const struct UsrData *UsrDat) Act_FormStart (ActFrmIDsOthUsr); Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); } - Act_LinkFormSubmit (Txt_Change_IDs,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("arroba",Txt_Change_IDs,Txt_Change_IDs); - Act_FormEnd (); + Act_PutContextualLink ("arroba",Txt_Change_IDs,Txt_Change_IDs,Txt_Change_IDs); } else Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_); diff --git a/swad_QR.c b/swad_QR.c index 72c6e8647..98d997c95 100644 --- a/swad_QR.c +++ b/swad_QR.c @@ -72,7 +72,6 @@ static void QR_ImageQRCode (const char *QRString); void QR_PutLinkToPrintQRCode (QR_QRType_t QRType,struct UsrData *UsrDat,bool PrintText) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_QR_code; char NicknameWithArroba[Nck_MAX_BYTES_NICKNAME_WITH_ARROBA+1]; @@ -91,11 +90,8 @@ void QR_PutLinkToPrintQRCode (QR_QRType_t QRType,struct UsrData *UsrDat,bool Pri Par_PutHiddenParamString ("QRString",UsrDat->Email); break; } - Act_LinkFormSubmit (Txt_QR_code,PrintText ? The_ClassFormulB[Gbl.Prefs.Theme] : - NULL); - Lay_PutSendIcon ("qr",Txt_QR_code,PrintText ? Txt_QR_code : - NULL); - Act_FormEnd (); + Act_PutContextualLink ("qr",Txt_QR_code,Txt_QR_code,PrintText ? Txt_QR_code : + NULL); } /*****************************************************************************/ diff --git a/swad_account.c b/swad_account.c index f2e9fad4b..209fedd93 100644 --- a/swad_account.c +++ b/swad_account.c @@ -103,7 +103,6 @@ void Acc_ShowFormAccount (void) static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWithoutArroba, const char *NewEmail) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Log_in; extern const char *Txt_Nickname; @@ -117,9 +116,7 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith /***** Link to log in *****/ fprintf (Gbl.F.Out,"
"); Act_FormStart (ActFrmLogIn); - Act_LinkFormSubmit (Txt_Log_in,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("login",Txt_Log_in,Txt_Log_in); - Act_FormEnd (); + Act_PutContextualLink ("login",Txt_Log_in,Txt_Log_in,Txt_Log_in); fprintf (Gbl.F.Out,"
"); /***** Form to enter some data of the new user *****/ @@ -243,15 +240,12 @@ void Acc_ShowFormChangeMyAccount (void) static void Acc_PutLinkToRemoveMyAccount (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Remove_account; Act_FormStart (ActUpdOthUsrDat); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Me.UsrDat.EncryptedUsrCod); Par_PutHiddenParamUnsigned ("RegRemAction",(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM); - Act_LinkFormSubmit (Txt_Remove_account,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("delon",Txt_Remove_account,Txt_Remove_account); - Act_FormEnd (); + Act_PutContextualLink ("delon",Txt_Remove_account,Txt_Remove_account,Txt_Remove_account); } /*****************************************************************************/ diff --git a/swad_action.c b/swad_action.c index b40bf7ec7..6111f6043 100644 --- a/swad_action.c +++ b/swad_action.c @@ -4315,6 +4315,22 @@ void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle) Gbl.FormId); } +/*****************************************************************************/ +/***************** Show an icon with a link in contextual menu ***************/ +/*****************************************************************************/ + +void Act_PutContextualLink (const char *Icon, + const char *Title, + const char *Alt, + const char *Text) + { + extern const char *The_ClassFormulB[The_NUM_THEMES]; + + Act_LinkFormSubmit (Title,The_ClassFormulB[Gbl.Prefs.Theme]); + Lay_PutSendIcon (Icon,Alt,Text); + Act_FormEnd (); + } + /*****************************************************************************/ /***************** Adjust current action when no user's logged ***************/ /*****************************************************************************/ diff --git a/swad_action.h b/swad_action.h index 9d8fd2332..f746044aa 100644 --- a/swad_action.h +++ b/swad_action.h @@ -1342,6 +1342,12 @@ 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_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle); + +void Act_PutContextualLink (const char *Icon, + const char *Title, + const char *Alt, + const char *Text); + void Act_AdjustActionWhenNoUsrLogged (void); void Act_AdjustCurrentAction (void); Act_Action_t Act_GetFirstActionAvailableInCurrentTab (void); diff --git a/swad_announcement.c b/swad_announcement.c index bef4eb606..b6340faa4 100644 --- a/swad_announcement.c +++ b/swad_announcement.c @@ -71,7 +71,6 @@ static void Ann_CreateAnnouncement (unsigned Roles,const char *Subject,const cha void Ann_ShowAllAnnouncements (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_New_announcement; /***** Put link (form) to create a new announcement *****/ @@ -79,15 +78,12 @@ void Ann_ShowAllAnnouncements (void) { fprintf (Gbl.F.Out,"
"); Act_FormStart (ActWriAnn); - Act_LinkFormSubmit (Txt_New_announcement,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("new",Txt_New_announcement,Txt_New_announcement); - Act_FormEnd (); + Act_PutContextualLink ("new",Txt_New_announcement,Txt_New_announcement,Txt_New_announcement); fprintf (Gbl.F.Out,"
"); } /***** List announcements *****/ Ann_ListAnnouncements (); - } /*****************************************************************************/ diff --git a/swad_assignment.c b/swad_assignment.c index 33bfbcf31..eaa4c3377 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -471,7 +471,6 @@ void Asg_PutHiddenParamAsgOrderType (void) static void Asg_PutFormToCreateNewAsg (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_New_assignment; /***** Put form to create a new assignment *****/ @@ -480,9 +479,7 @@ static void Asg_PutFormToCreateNewAsg (void) Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Act_LinkFormSubmit (Txt_New_assignment,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("new",Txt_New_assignment,Txt_New_assignment); - Act_FormEnd (); + Act_PutContextualLink ("new",Txt_New_assignment,Txt_New_assignment,Txt_New_assignment); fprintf (Gbl.F.Out,""); } diff --git a/swad_attendance.c b/swad_attendance.c index 8e392067a..e67bbc1e0 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -443,7 +443,6 @@ void Att_PutHiddenParamAttOrderType (void) static void Att_PutFormToListStds (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Attendance_list; /***** Put form to create a new attendance event *****/ @@ -451,9 +450,7 @@ static void Att_PutFormToListStds (void) Att_PutHiddenParamAttOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Act_LinkFormSubmit (Txt_Attendance_list,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("list",Txt_Attendance_list,Txt_Attendance_list); - Act_FormEnd (); + Act_PutContextualLink ("list",Txt_Attendance_list,Txt_Attendance_list,Txt_Attendance_list); } /*****************************************************************************/ @@ -462,7 +459,6 @@ static void Att_PutFormToListStds (void) static void Att_PutFormToCreateNewAttEvent (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_New_event; /***** Put form to create a new attendance event *****/ @@ -470,9 +466,7 @@ static void Att_PutFormToCreateNewAttEvent (void) Att_PutHiddenParamAttOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Act_LinkFormSubmit (Txt_New_event,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("new",Txt_New_event,Txt_New_event); - Act_FormEnd (); + Act_PutContextualLink ("new",Txt_New_event,Txt_New_event,Txt_New_event); } /*****************************************************************************/ @@ -2912,7 +2906,6 @@ static void Att_GetListSelectedAttCods (char **StrAttCodsSelected) static void Att_PutFormToPrintListStds (bool ShowDetails,char *StrAttCodsSelected) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Print; /***** Link to print view *****/ @@ -2924,9 +2917,7 @@ static void Att_PutFormToPrintListStds (bool ShowDetails,char *StrAttCodsSelecte Usr_PutHiddenParUsrCodAll (ActPrnLstAttStd,Gbl.Usrs.Select.All); if (StrAttCodsSelected[0]) Par_PutHiddenParamString ("AttCods",StrAttCodsSelected); - Act_LinkFormSubmit (Txt_Print,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("print",Txt_Print,Txt_Print); - Act_FormEnd (); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); fprintf (Gbl.F.Out,""); } diff --git a/swad_banner.c b/swad_banner.c index 5bf515f12..47125bbbf 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -124,15 +124,12 @@ void Ban_SeeBanners (void) static void Ban_PutFormToEditBanners (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; /***** Link to edit banners *****/ fprintf (Gbl.F.Out,"
"); Act_FormStart (ActEdiBan); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_calendar.c b/swad_calendar.c index b04c75ddb..e90405c8b 100644 --- a/swad_calendar.c +++ b/swad_calendar.c @@ -92,6 +92,7 @@ void Cal_DrawCurrentMonth (void) */ void Cal_DrawCalendar (void) { + extern const char *Txt_Print; static unsigned StartingMonth[1+12] = // Calendar starts one row before current month { 0, // Not used @@ -126,8 +127,8 @@ void Cal_DrawCalendar (void) { /* Link to print view */ fprintf (Gbl.F.Out,"
"); - Lay_PutLinkToPrintView1 (ActPrnCal); - Lay_PutLinkToPrintView2 (); + Act_FormStart (ActPrnCal); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); fprintf (Gbl.F.Out,"
"); } Lay_StartRoundFrameTable10 (NULL,0,NULL); diff --git a/swad_centre.c b/swad_centre.c index 3084855c6..9ad5ff459 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -236,9 +236,9 @@ void Ctr_PrintConfiguration (void) static void Ctr_Configuration (bool PrintView) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Degrees; + extern const char *Txt_Print; extern const char *Txt_Centre; extern const char *Txt_Short_name; extern const char *Txt_Web; @@ -270,13 +270,11 @@ static void Ctr_Configuration (bool PrintView) /* Link to show degrees */ Act_FormStart (ActSeeDeg); - Act_LinkFormSubmit (Txt_Degrees,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("deg",Txt_Degrees,Txt_Degrees); - Act_FormEnd (); + Act_PutContextualLink ("deg",Txt_Degrees,Txt_Degrees,Txt_Degrees); /* Link to print view */ - Lay_PutLinkToPrintView1 (ActPrnCtrInf); - Lay_PutLinkToPrintView2 (); + Act_FormStart (ActPrnCtrInf); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); /* Links to upload logo and photo */ if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM) @@ -1827,7 +1825,6 @@ void Ctr_RemoveLogo (void) static void Ctr_PutFormToChangeCtrPhoto (bool PhotoExists) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Change_photo; extern const char *Txt_Upload_photo; const char *Msg; @@ -1836,9 +1833,7 @@ static void Ctr_PutFormToChangeCtrPhoto (bool PhotoExists) Act_FormStart (ActReqCtrPho); Msg = PhotoExists ? Txt_Change_photo : Txt_Upload_photo; - Act_LinkFormSubmit (Msg,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("photo",Msg,Msg); - Act_FormEnd (); + Act_PutContextualLink ("photo",Msg,Msg,Msg); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index a983d4cc9..519696a2d 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.106.1 (2015/04/02)" +#define Log_PLATFORM_VERSION "SWAD 14.106.2 (2015/04/02)" // 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.106.2: Apr 02, 2015 Refactoring some contextual menus. (183747 lines) Version 14.106.1: Apr 02, 2015 Changes in layout of icon with links. (183925 lines) Version 14.106: Apr 02, 2015 Lot of changes in layout of icon with links. (183909 lines) Version 14.105.3: Apr 01, 2015 Changes in layout of course configuration and exam announcements. (183912 lines) diff --git a/swad_country.c b/swad_country.c index 550e84f75..817d59c15 100644 --- a/swad_country.c +++ b/swad_country.c @@ -216,9 +216,9 @@ void Cty_PrintConfiguration (void) static void Cty_Configuration (bool PrintView) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Institutions; + extern const char *Txt_Print; extern const char *Txt_Country; extern const char *Txt_Shortcut; extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES]; @@ -237,15 +237,13 @@ static void Cty_Configuration (bool PrintView) /* Link to show institutions */ Act_FormStart (ActSeeIns); - Act_LinkFormSubmit (Txt_Institutions,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("ins",Txt_Institutions,Txt_Institutions); - Act_FormEnd (); + Act_PutContextualLink ("ins",Txt_Institutions,Txt_Institutions,Txt_Institutions); /* Link to print view */ if (!PrintView) { - Lay_PutLinkToPrintView1 (ActPrnCtyInf); - Lay_PutLinkToPrintView2 (); + Act_FormStart (ActPrnCtyInf); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); } fprintf (Gbl.F.Out,""); diff --git a/swad_course.c b/swad_course.c index 2200df1e7..d3fb95dea 100644 --- a/swad_course.c +++ b/swad_course.c @@ -139,6 +139,7 @@ static void Crs_Configuration (bool PrintView) extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; extern const char *Txt_Show_more_details; extern const char *Txt_NO; + extern const char *Txt_Print; extern const char *Txt_Course; extern const char *Txt_Short_name; extern const char *Txt_Year_OF_A_DEGREE; @@ -186,8 +187,8 @@ static void Crs_Configuration (bool PrintView) fprintf (Gbl.F.Out,"
"); /* Link to print view */ - Lay_PutLinkToPrintView1 (ActPrnCrsInf); - Lay_PutLinkToPrintView2 (); + Act_FormStart (ActPrnCrsInf); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); /* Link to request enrollment in the current course */ if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_GUEST__ || @@ -3002,7 +3003,6 @@ void Crs_ReqSelectOneOfMyCourses (void) static void Crs_PutLinkToSearchCourses (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Search_courses; /***** Put form to search / select courses *****/ @@ -3014,9 +3014,7 @@ static void Crs_PutLinkToSearchCourses (void) ActSysReqSch))))); Sco_PutParamScope (Sco_SCOPE_SYS); Par_PutHiddenParamUnsigned ("WhatToSearch",(unsigned) Sch_SEARCH_COURSES); - Act_LinkFormSubmit (Txt_Search_courses,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("search",Txt_Search_courses,Txt_Search_courses); - Act_FormEnd (); + Act_PutContextualLink ("search",Txt_Search_courses,Txt_Search_courses,Txt_Search_courses); } /*****************************************************************************/ @@ -3025,14 +3023,11 @@ static void Crs_PutLinkToSearchCourses (void) void Crs_PutFormToSelectMyCourses (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_My_courses; /***** Put form to search / select courses *****/ Act_FormStart (ActMyCrs); - Act_LinkFormSubmit (Txt_My_courses,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("hierarchy",Txt_My_courses,Txt_My_courses); - Act_FormEnd (); + Act_PutContextualLink ("hierarchy",Txt_My_courses,Txt_My_courses,Txt_My_courses); } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index 1549d9a95..b6f7ba30d 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -287,9 +287,9 @@ void Deg_PrintConfiguration (void) static void Deg_Configuration (bool PrintView) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Courses; + extern const char *Txt_Print; extern const char *Txt_Degree; extern const char *Txt_Short_name; extern const char *Txt_Web; @@ -308,13 +308,11 @@ static void Deg_Configuration (bool PrintView) /* Link to show courses */ Act_FormStart (ActSeeCrs); - Act_LinkFormSubmit (Txt_Courses,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("crs",Txt_Courses,Txt_Courses); - Act_FormEnd (); + Act_PutContextualLink ("crs",Txt_Courses,Txt_Courses,Txt_Courses); /* Link to print view */ - Lay_PutLinkToPrintView1 (ActPrnDegInf); - Lay_PutLinkToPrintView2 (); + Act_FormStart (ActPrnDegInf); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); /* Link to upload logo */ if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM) diff --git a/swad_department.c b/swad_department.c index 55f8e6a88..8c31cec64 100644 --- a/swad_department.c +++ b/swad_department.c @@ -211,14 +211,11 @@ static void Dpt_GetParamDptOrderType (void) static void Dpt_PutFormToEditDpts (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); Act_FormStart (ActEdiDpt); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_enrollment.c b/swad_enrollment.c index 59cf8d3a6..278c6f3d8 100644 --- a/swad_enrollment.c +++ b/swad_enrollment.c @@ -130,14 +130,11 @@ static void Enr_EffectivelyRemAdm (struct UsrData *UsrDat,Sco_Scope_t Scope, void Enr_PutLinkToRequestSignUp (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Sign_up; /***** Show the form *****/ Act_FormStart (ActReqSignUp); - Act_LinkFormSubmit (Txt_Sign_up,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("signup",Txt_Sign_up,Txt_Sign_up); - Act_FormEnd (); + Act_PutContextualLink ("signup",Txt_Sign_up,Txt_Sign_up,Txt_Sign_up); } /*****************************************************************************/ @@ -278,7 +275,6 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction) void Enr_ReqAcceptRegisterInCrs (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_A_teacher_or_administrator_has_enrolled_you_into_the_course_; extern const char *Txt_Confirm_my_enrollment; extern const char *Txt_Remove_me_from_this_course; @@ -292,15 +288,11 @@ void Enr_ReqAcceptRegisterInCrs (void) /***** Send button to accept register in the current course *****/ Act_FormStart (ActAccEnrCrs); - Act_LinkFormSubmit (Txt_Confirm_my_enrollment,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("ok_green",Txt_Confirm_my_enrollment,Txt_Confirm_my_enrollment); - Act_FormEnd (); + Act_PutContextualLink ("ok_green",Txt_Confirm_my_enrollment,Txt_Confirm_my_enrollment,Txt_Confirm_my_enrollment); /***** Send button to refuse register in the current course *****/ Act_FormStart (ActRemMeCrs); - Act_LinkFormSubmit (Txt_Remove_me_from_this_course,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("delon",Txt_Remove_me_from_this_course,Txt_Remove_me_from_this_course); - Act_FormEnd (); + Act_PutContextualLink ("delon",Txt_Remove_me_from_this_course,Txt_Remove_me_from_this_course,Txt_Remove_me_from_this_course); fprintf (Gbl.F.Out,"
"); @@ -634,14 +626,11 @@ static void Enr_ShowFormRegRemSeveralUsrs (void) static void Enr_PutLinkToRemOldUsrs (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Remove_old_users; /***** Put form to remove old users *****/ Act_FormStart (ActReqRemOldUsr); - Act_LinkFormSubmit (Txt_Remove_old_users,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("delon",Txt_Remove_old_users,Txt_Remove_old_users); - Act_FormEnd (); + Act_PutContextualLink ("delon",Txt_Remove_old_users,Txt_Remove_old_users,Txt_Remove_old_users); } /*****************************************************************************/ @@ -1718,14 +1707,11 @@ static void Enr_MarkOfficialStdsAsRemovable (long ImpGrpCod,bool RemoveSpecified static void Enr_PutLinkToRemAllStdsThisCrs (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Remove_all_students; /***** Put form to remove all the students in the current course *****/ Act_FormStart (ActReqRemAllStdCrs); - Act_LinkFormSubmit (Txt_Remove_all_students,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("delon",Txt_Remove_all_students,Txt_Remove_all_students); - Act_FormEnd (); + Act_PutContextualLink ("delon",Txt_Remove_all_students,Txt_Remove_all_students,Txt_Remove_all_students); } /*****************************************************************************/ @@ -2587,13 +2573,10 @@ static void Enr_RemoveEnrollmentRequest (long CrsCod,long UsrCod) static void Enr_PutLinkToAdminOneUsr (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Admin_one_user; Act_FormStart (ActReqMdfOneUsr); - Act_LinkFormSubmit (Txt_Admin_one_user,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("configtest",Txt_Admin_one_user,Txt_Admin_one_user); - Act_FormEnd (); + Act_PutContextualLink ("configtest",Txt_Admin_one_user,Txt_Admin_one_user,Txt_Admin_one_user); } /*****************************************************************************/ @@ -2602,13 +2585,10 @@ static void Enr_PutLinkToAdminOneUsr (void) static void Enr_PutLinkToAdminSeveralUsrs (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Admin_several_users; Act_FormStart (ActReqMdfSevUsr); - Act_LinkFormSubmit (Txt_Admin_several_users,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("configtest",Txt_Admin_several_users,Txt_Admin_several_users); - Act_FormEnd (); + Act_PutContextualLink ("configtest",Txt_Admin_several_users,Txt_Admin_several_users,Txt_Admin_several_users); } /*****************************************************************************/ diff --git a/swad_exam.c b/swad_exam.c index b7590a889..aca9fe556 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -415,7 +415,6 @@ static void Exa_ListExamAnnouncementsEdit (void) static void Exa_ListExamAnnouncements (Exa_tTypeViewExamAnnouncement_t TypeViewExamAnnouncement) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_No_announcements_of_exams_of_X; extern const char *Txt_New_announcement_OF_EXAM; char Query[512]; @@ -445,9 +444,7 @@ static void Exa_ListExamAnnouncements (Exa_tTypeViewExamAnnouncement_t TypeViewE case Rol_ROLE_SYS_ADM: fprintf (Gbl.F.Out,"
"); Act_FormStart (ActEdiExaAnn); - Act_LinkFormSubmit (Txt_New_announcement_OF_EXAM,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("new",Txt_New_announcement_OF_EXAM,Txt_New_announcement_OF_EXAM); - Act_FormEnd (); + Act_PutContextualLink ("new",Txt_New_announcement_OF_EXAM,Txt_New_announcement_OF_EXAM,Txt_New_announcement_OF_EXAM); fprintf (Gbl.F.Out,"
"); break; default: diff --git a/swad_file_browser.c b/swad_file_browser.c index 41c769452..5d4d9fa57 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -4269,7 +4269,6 @@ void Brw_RemoveUsrFilesFromDB (long UsrCod) static void Brw_PutFormToShowOrAdmin (Brw_ShowOrAdmin_t ShowOrAdmin, Act_Action_t Action) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_View; extern const char *Txt_Edit; @@ -4282,15 +4281,12 @@ static void Brw_PutFormToShowOrAdmin (Brw_ShowOrAdmin_t ShowOrAdmin, switch (ShowOrAdmin) { case Brw_SHOW: - Act_LinkFormSubmit (Txt_View,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("visible_on",Txt_View,Txt_View); + Act_PutContextualLink ("visible_on",Txt_View,Txt_View,Txt_View); break; case Brw_ADMIN: - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); break; } - Act_FormEnd (); fprintf (Gbl.F.Out,""); } diff --git a/swad_holiday.c b/swad_holiday.c index 64c4cbfe6..d49ff87c0 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -195,14 +195,11 @@ static void Hld_GetParamHldOrderType (void) static void Hld_PutFormToEditHlds (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); Act_FormStart (ActEdiHld); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_info.c b/swad_info.c index d6d36f3e1..a4f381403 100644 --- a/swad_info.c +++ b/swad_info.c @@ -409,14 +409,11 @@ void Inf_ShowInfo (void) static void Inf_PutFormToEditInfo (Inf_InfoType_t InfoType) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); Act_FormStart (Inf_ActionsEditInfo[InfoType]); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_institution.c b/swad_institution.c index 4451020bd..a1219a7df 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -225,9 +225,9 @@ void Ins_PrintConfiguration (void) static void Ins_Configuration (bool PrintView) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Centres; + extern const char *Txt_Print; extern const char *Txt_Institution; extern const char *Txt_Short_name; extern const char *Txt_Web; @@ -249,13 +249,11 @@ static void Ins_Configuration (bool PrintView) /* Link to show centres */ Act_FormStart (ActSeeCtr); - Act_LinkFormSubmit (Txt_Centres,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("ctr",Txt_Centres,Txt_Centres); - Act_FormEnd (); + Act_PutContextualLink ("ctr",Txt_Centres,Txt_Centres,Txt_Centres); /* Link to print view */ - Lay_PutLinkToPrintView1 (ActPrnInsInf); - Lay_PutLinkToPrintView2 (); + Act_FormStart (ActPrnInsInf); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); /* Link to upload logo */ if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM) diff --git a/swad_layout.c b/swad_layout.c index 30a81eff4..9343e9faf 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -938,14 +938,11 @@ static void Lay_ShowRightColumn (void) void Lay_PutFormToView (Act_Action_t Action) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_View; fprintf (Gbl.F.Out,"
"); Act_FormStart (Action); - Act_LinkFormSubmit (Txt_View,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("visible_on",Txt_View,Txt_View); - Act_FormEnd (); + Act_PutContextualLink ("visible_on",Txt_View,Txt_View,Txt_View); fprintf (Gbl.F.Out,"
"); } @@ -955,14 +952,11 @@ void Lay_PutFormToView (Act_Action_t Action) void Lay_PutFormToEdit (Act_Action_t Action) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); Act_FormStart (Action); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } @@ -1533,25 +1527,6 @@ Lay_Layout_t Lay_GetParamLayout (void) return Lay_LAYOUT_UNKNOWN; } -/*****************************************************************************/ -/************************* Put link to print view ****************************/ -/*****************************************************************************/ - -void Lay_PutLinkToPrintView1 (Act_Action_t NextAction) - { - Act_FormStart (NextAction); - } - -void Lay_PutLinkToPrintView2 (void) - { - extern const char *The_ClassFormulB[The_NUM_THEMES]; - extern const char *Txt_Print; - - Act_LinkFormSubmit (Txt_Print,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("print",Txt_Print,Txt_Print); - Act_FormEnd (); - } - /*****************************************************************************/ /**************** Show advertisement about mobile version ********************/ /*****************************************************************************/ diff --git a/swad_layout.h b/swad_layout.h index 6f921b8b2..5b7617f98 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -114,9 +114,6 @@ void Lay_ChangeLayout (void); Lay_Layout_t Lay_GetParamLayout (void); Lay_Layout_t Lay_GetLayoutFromStr (const char *Str); -void Lay_PutLinkToPrintView1 (Act_Action_t NextAction); -void Lay_PutLinkToPrintView2 (void); - void Lay_AdvertisementMobile (void); void Lay_IndentDependingOnLevel (unsigned Level,bool IsLastItemInLevel[]); diff --git a/swad_link.c b/swad_link.c index 65f632c70..8c1659b74 100644 --- a/swad_link.c +++ b/swad_link.c @@ -118,14 +118,11 @@ void Lnk_SeeLinks (void) static void Lnk_PutFormToEditLinks (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); Act_FormStart (ActEdiLnk); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_logo.c b/swad_logo.c index 4ef369366..26e6945d5 100644 --- a/swad_logo.c +++ b/swad_logo.c @@ -173,7 +173,6 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText, void Log_PutFormToChangeLogo (Sco_Scope_t Scope) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Change_logo; extern const char *Txt_Upload_logo; Act_Action_t Action; @@ -221,9 +220,7 @@ void Log_PutFormToChangeLogo (Sco_Scope_t Scope) Act_FormStart (Action); Msg = LogoExists ? Txt_Change_logo : Txt_Upload_logo; - Act_LinkFormSubmit (Msg,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon (Icon,Msg,Msg); - Act_FormEnd (); + Act_PutContextualLink (Icon,Msg,Msg,Msg); } /*****************************************************************************/ diff --git a/swad_mail.c b/swad_mail.c index b9ae6df4a..035acf352 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -174,14 +174,11 @@ static void Mai_GetParamMaiOrderType (void) static void Mai_PutFormToEditMailDomains (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); Act_FormStart (ActEdiMai); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_message.c b/swad_message.c index 5eb57487f..13c2994f6 100644 --- a/swad_message.c +++ b/swad_message.c @@ -1665,13 +1665,10 @@ static unsigned long Msg_GetNumUsrsBannedByMe (void) static void Msg_PutLinkToViewBannedUsers(void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Banned_users; Act_FormStart (ActLstBanUsr); - Act_LinkFormSubmit (Txt_Banned_users,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("stop",Txt_Banned_users,Txt_Banned_users); - Act_FormEnd (); + Act_PutContextualLink ("stop",Txt_Banned_users,Txt_Banned_users,Txt_Banned_users); } /*****************************************************************************/ @@ -2139,7 +2136,6 @@ void Msg_WriteNumMsgs (unsigned NumMsgs,unsigned NumUnreadMsgs) void Msg_ShowFormDelSentOrRecMsgs (Msg_TypeOfMessages_t TypeOfMessages,unsigned NumMsgs) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_MSG_containing_the_text; extern const char *Txt_MSGS_containing_the_text; extern const char *Txt_Remove_the_MESSAGE; @@ -2151,7 +2147,6 @@ void Msg_ShowFormDelSentOrRecMsgs (Msg_TypeOfMessages_t TypeOfMessages,unsigned extern const char *Txt_messages_received_from_A_USER; extern const char *Txt_messages_sent_to_A_USER; extern const char *Txt_from_A_COURSE; - extern const char *Txt_Remove; char StrFilterContent[256+Msg_MAX_LENGTH_FILTER_CONTENT+1]; /***** Put link to request deletion of all sent or received messages *****/ @@ -2189,9 +2184,7 @@ void Msg_ShowFormDelSentOrRecMsgs (Msg_TypeOfMessages_t TypeOfMessages,unsigned Txt_from_A_COURSE, Gbl.Msg.FilterCrsShortName, StrFilterContent); - Act_LinkFormSubmit (Gbl.Title,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("delon",Txt_Remove,Gbl.Title); - Act_FormEnd (); + Act_PutContextualLink ("delon",Gbl.Title,Gbl.Title,Gbl.Title); fprintf (Gbl.F.Out,""); } diff --git a/swad_notice.c b/swad_notice.c index 58fe03c31..b6ec329eb 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -291,7 +291,6 @@ void Not_ShowANotice (void) void Not_ShowNotices (Not_Listing_t TypeNoticesListing) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_No_notices; extern const char *Txt_New_notice; extern const char *Txt_All_notices; @@ -322,9 +321,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing) { fprintf (Gbl.F.Out,"
"); Act_FormStart (ActWriNot); - Act_LinkFormSubmit (Txt_New_notice,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("new",Txt_New_notice,Txt_New_notice); - Act_FormEnd (); + Act_PutContextualLink ("new",Txt_New_notice,Txt_New_notice,Txt_New_notice); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_notification.c b/swad_notification.c index 7847f42cf..19e10fa3d 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -1634,13 +1634,10 @@ static void Ntf_UpdateNumNotifSent (long DegCod,long CrsCod, static void Ntf_PutLinkToChangePrefs (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Change_preferences; Act_FormStart (ActEdiPrf); - Act_LinkFormSubmit (Txt_Change_preferences,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("heart",Txt_Change_preferences,Txt_Change_preferences); - Act_FormEnd (); + Act_PutContextualLink ("heart",Txt_Change_preferences,Txt_Change_preferences,Txt_Change_preferences); } /*****************************************************************************/ diff --git a/swad_password.c b/swad_password.c index 2de29ae30..025ad867e 100644 --- a/swad_password.c +++ b/swad_password.c @@ -782,7 +782,6 @@ void Pwd_ShowFormOthPwd (void) void Pwd_PutLinkToChangeUsrPassword (const struct UsrData *UsrDat) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Change_password; extern const char *Txt_User_not_found_or_you_do_not_have_permission_; @@ -796,9 +795,7 @@ void Pwd_PutLinkToChangeUsrPassword (const struct UsrData *UsrDat) Act_FormStart (ActFrmPwdOthUsr); Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); } - Act_LinkFormSubmit (Txt_Change_password,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("key",Txt_Change_password,Txt_Change_password); - Act_FormEnd (); + Act_PutContextualLink ("key",Txt_Change_password,Txt_Change_password,Txt_Change_password); } 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 53d6acd86..a6d460980 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -145,7 +145,6 @@ bool Pho_CheckIfICanChangeOtherUsrPhoto (long UsrCod) void Pho_PutLinkToChangeUsrPhoto (const struct UsrData *UsrDat) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Change_photo; extern const char *Txt_Upload_photo; bool PhotoExists; @@ -166,9 +165,7 @@ void Pho_PutLinkToChangeUsrPhoto (const struct UsrData *UsrDat) } Msg = PhotoExists ? Txt_Change_photo : Txt_Upload_photo; - Act_LinkFormSubmit (Msg,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("photo",Msg,Msg); - Act_FormEnd (); + Act_PutContextualLink ("photo",Msg,Msg,Msg); } /*****************************************************************************/ @@ -177,7 +174,6 @@ void Pho_PutLinkToChangeUsrPhoto (const struct UsrData *UsrDat) static void Pho_PutLinkToRemoveUsrPhoto (const struct UsrData *UsrDat) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Remove_photo; /***** Link for removing the photo *****/ @@ -188,10 +184,7 @@ static void Pho_PutLinkToRemoveUsrPhoto (const struct UsrData *UsrDat) Act_FormStart (ActRemUsrPho); Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod); } - - Act_LinkFormSubmit (Txt_Remove_photo,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("delon",Txt_Remove_photo,Txt_Remove_photo); - Act_FormEnd (); + Act_PutContextualLink ("delon",Txt_Remove_photo,Txt_Remove_photo,Txt_Remove_photo); } /*****************************************************************************/ @@ -1671,15 +1664,17 @@ static Pho_HowOrderDegrees_t Pho_GetHowOrderDegreesFromForm (void) static void Pho_PutLinkToPrintViewOfDegreeStats (void) { + extern const char *Txt_Print; + fprintf (Gbl.F.Out,"
"); - Lay_PutLinkToPrintView1 (ActPrnPhoDeg); + Act_FormStart (ActPrnPhoDeg); Pho_PutHiddenParamTypeOfAvg (); Pho_PutHiddenParamPhotoSize (); Pho_PutHiddenParamOrderDegrees (); Usr_PutParamUsrListType (Gbl.Usrs.Me.ListType); Usr_PutParamColsClassPhoto (); Usr_PutParamListWithPhotos (); - Lay_PutLinkToPrintView2 (); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); fprintf (Gbl.F.Out,"
"); } @@ -1708,7 +1703,7 @@ static void Pho_PutLinkToCalculateDegreeStats (void) Deg_GetDataOfDegreeByCod (&Deg); /***** Start div *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); /***** Start form *****/ Act_FormStart (ActCalPhoDeg); diff --git a/swad_place.c b/swad_place.c index 84b615cbd..3e3c6f689 100644 --- a/swad_place.c +++ b/swad_place.c @@ -200,14 +200,11 @@ static void Plc_GetParamPlcOrderType (void) static void Plc_PutFormToEditPlcs (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); Act_FormStart (ActEdiPlc); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_plugin.c b/swad_plugin.c index 0168633d0..11b69c6af 100644 --- a/swad_plugin.c +++ b/swad_plugin.c @@ -150,14 +150,11 @@ void Plg_ListPlugins (void) static void Plg_PutFormToEditPlugins (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; fprintf (Gbl.F.Out,"
"); Act_FormStart (ActEdiPlg); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_record.c b/swad_record.c index fb5992b10..3ce4488b0 100644 --- a/swad_record.c +++ b/swad_record.c @@ -868,14 +868,11 @@ void Rec_FreeListFields (void) void Rec_PutLinkToEditRecordFields (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit_record_fields; /***** Link to edit record fields *****/ Act_FormStart (ActEdiRecFie); - Act_LinkFormSubmit (Txt_Edit_record_fields,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit_record_fields,Txt_Edit_record_fields); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit_record_fields,Txt_Edit_record_fields,Txt_Edit_record_fields); } /*****************************************************************************/ @@ -3229,14 +3226,11 @@ static void Rec_GetUsrCommentsFromForm (struct UsrData *UsrDat) static void Rec_PutLinkToChangeMyInsCtrDpt (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit_my_institution; /***** Link to edit my institution, centre, department... *****/ Act_FormStart (ActReqEdiMyIns); - Act_LinkFormSubmit (Txt_Edit_my_institution,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("institution",Txt_Edit_my_institution,Txt_Edit_my_institution); - Act_FormEnd (); + Act_PutContextualLink ("institution",Txt_Edit_my_institution,Txt_Edit_my_institution,Txt_Edit_my_institution); } /*****************************************************************************/ @@ -3245,14 +3239,11 @@ static void Rec_PutLinkToChangeMyInsCtrDpt (void) static void Rec_PutLinkToChangeMySocialNetworks (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit_my_webs_networks; /***** Link to edit my social networks *****/ Act_FormStart (ActReqEdiMyNet); - Act_LinkFormSubmit (Txt_Edit_my_webs_networks,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("earth",Txt_Edit_my_webs_networks,Txt_Edit_my_webs_networks); - Act_FormEnd (); + Act_PutContextualLink ("earth",Txt_Edit_my_webs_networks,Txt_Edit_my_webs_networks,Txt_Edit_my_webs_networks); } /*****************************************************************************/ diff --git a/swad_survey.c b/swad_survey.c index af70ce667..9220e137b 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -694,7 +694,6 @@ void Svy_PutHiddenParamSvyOrderType (void) static void Svy_PutFormToCreateNewSvy (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_New_survey; fprintf (Gbl.F.Out,"
"); @@ -702,9 +701,7 @@ static void Svy_PutFormToCreateNewSvy (void) Svy_PutHiddenParamSvyOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Act_LinkFormSubmit (Txt_New_survey,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("new",Txt_New_survey,Txt_New_survey); - Act_FormEnd (); + Act_PutContextualLink ("new",Txt_New_survey,Txt_New_survey,Txt_New_survey); fprintf (Gbl.F.Out,"
"); } diff --git a/swad_test.c b/swad_test.c index 383d17f63..9329d4ab6 100644 --- a/swad_test.c +++ b/swad_test.c @@ -312,14 +312,11 @@ void Tst_ShowFormAskTst (void) static void Tst_PutFormToSeeResultsOfUsersTests (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Results_tests; Act_FormStart (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_STUDENT ? ActReqSeeMyTstExa: ActReqSeeUsrTstExa); - Act_LinkFormSubmit (Txt_Results_tests,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("file",Txt_Results_tests,Txt_Results_tests); - Act_FormEnd (); + Act_PutContextualLink ("file",Txt_Results_tests,Txt_Results_tests,Txt_Results_tests); } /*****************************************************************************/ @@ -328,13 +325,10 @@ static void Tst_PutFormToSeeResultsOfUsersTests (void) static void Tst_PutFormToEdit (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; Act_FormStart (ActEdiTstQst); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); } /*****************************************************************************/ @@ -343,14 +337,10 @@ static void Tst_PutFormToEdit (void) static void Tst_PutFormToConfigure (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; - extern const char *Txt_Configure_tests; extern const char *Txt_Configure; Act_FormStart (ActCfgTst); - Act_LinkFormSubmit (Txt_Configure_tests,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("configtest",Txt_Configure,Txt_Configure); - Act_FormEnd (); + Act_PutContextualLink ("configtest",Txt_Configure,Txt_Configure,Txt_Configure); } /*****************************************************************************/ diff --git a/swad_timetable.c b/swad_timetable.c index 2b3054c09..83b4a1df9 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -218,9 +218,9 @@ static void TT_GetParamsTimeTable (void) void TT_ShowClassTimeTable (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Edit; extern const char *Txt_Edit_office_hours; + extern const char *Txt_Print; extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES]; TT_TimeTableType_t TimeTableType = TT_COURSE_TIMETABLE; bool PutEditButton = (Gbl.CurrentAct == ActSeeCrsTimTbl && @@ -255,25 +255,21 @@ void TT_ShowClassTimeTable (void) { Act_FormStart (ActEdiCrsTimTbl); Grp_PutParamWhichGrps (); - Act_LinkFormSubmit (Txt_Edit,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit,Txt_Edit); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit,Txt_Edit,Txt_Edit); } if (PutEditOfficeHours) { Act_FormStart (ActEdiTut); - Act_LinkFormSubmit (Txt_Edit_office_hours,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("edit",Txt_Edit_office_hours,Txt_Edit_office_hours); - Act_FormEnd (); + Act_PutContextualLink ("edit",Txt_Edit_office_hours,Txt_Edit_office_hours,Txt_Edit_office_hours); } if (!PrintView) { - Lay_PutLinkToPrintView1 (Gbl.CurrentAct == ActSeeCrsTimTbl ? ActPrnCrsTimTbl : - ActPrnMyTimTbl); + Act_FormStart (Gbl.CurrentAct == ActSeeCrsTimTbl ? ActPrnCrsTimTbl : + ActPrnMyTimTbl); Grp_PutParamWhichGrps (); - Lay_PutLinkToPrintView2 (); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); } fprintf (Gbl.F.Out,"
"); } @@ -318,15 +314,12 @@ void TT_ShowClassTimeTable (void) void TT_EditCrsTimeTable (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Show_timetable; /***** Link (form) to see my timetable *****/ fprintf (Gbl.F.Out,"
"); Act_FormStart (ActSeeCrsTimTbl); - Act_LinkFormSubmit (Txt_Show_timetable,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("clock",Txt_Show_timetable,Txt_Show_timetable); - Act_FormEnd (); + Act_PutContextualLink ("clock",Txt_Show_timetable,Txt_Show_timetable,Txt_Show_timetable); fprintf (Gbl.F.Out,"
"); /***** Start of table *****/ @@ -349,16 +342,13 @@ void TT_EditCrsTimeTable (void) void TT_ShowMyTutTimeTable (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Show_timetable; extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES]; /***** Link (form) to see my timetable *****/ fprintf (Gbl.F.Out,"
"); Act_FormStart (ActSeeMyTimTbl); - Act_LinkFormSubmit (Txt_Show_timetable,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("clock",Txt_Show_timetable,Txt_Show_timetable); - Act_FormEnd (); + Act_PutContextualLink ("clock",Txt_Show_timetable,Txt_Show_timetable,Txt_Show_timetable); fprintf (Gbl.F.Out,"
"); /***** Time table *****/ diff --git a/swad_user.c b/swad_user.c index 75a447e56..ec9e89b8c 100644 --- a/swad_user.c +++ b/swad_user.c @@ -1335,7 +1335,6 @@ void Usr_WriteFormLogin (void) { extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_New_on_PLATFORM_Sign_up; - extern const char *Txt_Create_account; extern const char *Txt_Enter_from_X; extern const char *Txt_Log_in; extern const char *Txt_User; @@ -1350,9 +1349,7 @@ void Usr_WriteFormLogin (void) /* Link to create a new account */ Act_FormStart (ActFrmUsrAcc); sprintf (Gbl.Title,Txt_New_on_PLATFORM_Sign_up,Cfg_PLATFORM_SHORT_NAME); - Act_LinkFormSubmit (Gbl.Title,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("arroba",Txt_Create_account,Gbl.Title); - Act_FormEnd (); + Act_PutContextualLink ("arroba",Gbl.Title,Gbl.Title,Gbl.Title); /* Link to enter from external site */ if (Cfg_EXTERNAL_LOGIN_URL[0] && @@ -1369,9 +1366,7 @@ void Usr_WriteFormLogin (void) /* Link to send a new password */ Act_FormStart (ActReqSndNewPwd); Par_PutHiddenParamString ("UsrId",Gbl.Usrs.Me.UsrIdLogin); - Act_LinkFormSubmit (Txt_I_forgot_my_password,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("key",Txt_I_forgot_my_password,Txt_I_forgot_my_password); - Act_FormEnd (); + Act_PutContextualLink ("key",Txt_I_forgot_my_password,Txt_I_forgot_my_password,Txt_I_forgot_my_password); fprintf (Gbl.F.Out,"
"); @@ -2450,7 +2445,6 @@ void Usr_WarningWhenDegreeTypeDoesntAllowDirectLogin (void) void Usr_ShowFormsLogoutAndRole (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Log_out; extern const char *Txt_You_are_LOGGED_as_X; @@ -2461,9 +2455,7 @@ void Usr_ShowFormsLogoutAndRole (void) /***** Link to log out *****/ fprintf (Gbl.F.Out,"
"); Act_FormStart (ActLogOut); - Act_LinkFormSubmit (Txt_Log_out,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("logout",Txt_Log_out,Txt_Log_out); - Act_FormEnd (); + Act_PutContextualLink ("logout",Txt_Log_out,Txt_Log_out,Txt_Log_out); fprintf (Gbl.F.Out,"
"); /***** Write message with my new logged role *****/ @@ -6289,8 +6281,8 @@ static void Usr_UpdateMyPrefAboutListWithPhotosPhotoInDB (void) void Usr_SeeGuests (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Scope; + extern const char *Txt_Print; extern const char *Txt_Show_all_data; extern const char *Txt_Show_records; @@ -6342,17 +6334,15 @@ void Usr_SeeGuests (void) { case Usr_CLASS_PHOTO: /***** Link to print view *****/ - Lay_PutLinkToPrintView1 (ActPrnInvPho); - Lay_PutLinkToPrintView2 (); + Act_FormStart (ActPrnInvPho); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); break; case Usr_LIST: /****** Link to show all the data ******/ Act_FormStart (ActLstInvAll); Usr_PutParamListWithPhotos (); Usr_PutExtraParamsUsrList (ActLstInvAll); - Act_LinkFormSubmit (Txt_Show_all_data,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("table",Txt_Show_all_data,Txt_Show_all_data); - Act_FormEnd (); + Act_PutContextualLink ("table",Txt_Show_all_data,Txt_Show_all_data,Txt_Show_all_data); break; } fprintf (Gbl.F.Out,""); @@ -6412,8 +6402,8 @@ void Usr_SeeGuests (void) void Usr_SeeStudents (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Scope; + extern const char *Txt_Print; extern const char *Txt_Show_all_data; extern const char *Txt_Show_records; bool ICanViewRecords; @@ -6489,9 +6479,9 @@ void Usr_SeeStudents (void) case Usr_CLASS_PHOTO: /***** Link to print view *****/ fprintf (Gbl.F.Out,"
"); - Lay_PutLinkToPrintView1 (ActPrnStdPho); + Act_FormStart (ActPrnStdPho); Grp_PutParamsCodGrps (); - Lay_PutLinkToPrintView2 (); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); fprintf (Gbl.F.Out,"
"); break; case Usr_LIST: @@ -6503,9 +6493,7 @@ void Usr_SeeStudents (void) Grp_PutParamsCodGrps (); Usr_PutParamListWithPhotos (); Usr_PutExtraParamsUsrList (ActLstStdAll); - Act_LinkFormSubmit (Txt_Show_all_data,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("table",Txt_Show_all_data,Txt_Show_all_data); - Act_FormEnd (); + Act_PutContextualLink ("table",Txt_Show_all_data,Txt_Show_all_data,Txt_Show_all_data); fprintf (Gbl.F.Out,""); } break; @@ -6583,8 +6571,8 @@ void Usr_SeeStudents (void) void Usr_SeeTeachers (void) { extern const char *The_ClassFormul[The_NUM_THEMES]; - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Scope; + extern const char *Txt_Print; extern const char *Txt_Show_all_data; extern const char *Txt_Show_records; extern const char *Txt_No_users_found[Rol_NUM_ROLES]; @@ -6633,9 +6621,9 @@ void Usr_SeeTeachers (void) { case Usr_CLASS_PHOTO: fprintf (Gbl.F.Out,"
"); - Lay_PutLinkToPrintView1 (ActPrnTchPho); + Act_FormStart (ActPrnTchPho); Sco_PutParamScope (Gbl.Scope.Current); - Lay_PutLinkToPrintView2 (); + Act_PutContextualLink ("print",Txt_Print,Txt_Print,Txt_Print); fprintf (Gbl.F.Out,"
"); break; case Usr_LIST: @@ -6646,9 +6634,7 @@ void Usr_SeeTeachers (void) Act_FormStart (ActLstTchAll); Sco_PutParamScope (Gbl.Scope.Current); Usr_PutParamListWithPhotos (); - Act_LinkFormSubmit (Txt_Show_all_data,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("table",Txt_Show_all_data,Txt_Show_all_data); - Act_FormEnd (); + Act_PutContextualLink ("table",Txt_Show_all_data,Txt_Show_all_data,Txt_Show_all_data); fprintf (Gbl.F.Out,""); } break; @@ -6719,7 +6705,6 @@ void Usr_SeeTeachers (void) static void Usr_PutLinkToListOfficialStudents (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Official_students; bool ExternalUsrsServiceAvailable = (Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND[0] != '\0'); @@ -6730,9 +6715,7 @@ static void Usr_PutLinkToListOfficialStudents (void) { /***** Link to list official students *****/ Act_FormStart (ActGetExtLstStd); - Act_LinkFormSubmit (Txt_Official_students,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("list",Txt_Official_students,Txt_Official_students); - Act_FormEnd (); + Act_PutContextualLink ("list",Txt_Official_students,Txt_Official_students,Txt_Official_students); } } diff --git a/swad_zip.c b/swad_zip.c index f547b6e86..61d015d52 100644 --- a/swad_zip.c +++ b/swad_zip.c @@ -111,7 +111,6 @@ static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL, void ZIP_PutButtonToCreateZIPAsgWrk (void) { - extern const char *The_ClassFormulB[The_NUM_THEMES]; extern const char *Txt_Create_ZIP_file; fprintf (Gbl.F.Out,"
"); @@ -120,9 +119,7 @@ void ZIP_PutButtonToCreateZIPAsgWrk (void) if (Gbl.FileBrowser.FullTree) Par_PutHiddenParamChar ("FullTree",'Y'); Par_PutHiddenParamChar ("CreateZIP",'Y'); - Act_LinkFormSubmit (Txt_Create_ZIP_file,The_ClassFormulB[Gbl.Prefs.Theme]); - Lay_PutSendIcon ("download",Txt_Create_ZIP_file,Txt_Create_ZIP_file); - Act_FormEnd (); + Act_PutContextualLink ("download",Txt_Create_ZIP_file,Txt_Create_ZIP_file,Txt_Create_ZIP_file); fprintf (Gbl.F.Out,"
"); }