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,"
");
/***** 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,"");
}
/***** 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,"");
}
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_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,"");
@@ -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,"");
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,"");
}
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,"");
}
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,"");
}
@@ -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,"");
}
@@ -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,"");
}
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,"");
}
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,"");
}
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,"");
}
@@ -1708,7 +1703,7 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
Deg_GetDataOfDegreeByCod (&Deg);
/***** Start div *****/
- 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,"");
/***** 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,"");
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,"");
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,"");
}