diff --git a/swad_agenda.c b/swad_agenda.c
index 715b77e8b..d279a994a 100644
--- a/swad_agenda.c
+++ b/swad_agenda.c
@@ -652,13 +652,7 @@ static void Agd_PutIconToCreateNewEvent (void)
static void Agd_PutIconToViewEditMyFullAgenda (void)
{
- extern const char *Txt_Edit;
-
- /***** Put form to create a new event *****/
- Lay_PutContextualLink (ActSeeMyAgd,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActSeeMyAgd,NULL);
}
static void Agd_PutIconToShowQR (void)
@@ -848,7 +842,6 @@ static void Agd_PutFormsToRemEditOneEvent (struct AgendaEvent *AgdEvent)
extern const char *Txt_Hide;
extern const char *Txt_Event_private_click_to_make_it_visible_to_the_users_of_your_courses;
extern const char *Txt_Event_visible_to_the_users_of_your_courses_click_to_make_it_private;
- extern const char *Txt_Edit;
Gbl.Agenda.AgdCodToEdit = AgdEvent->AgdCod; // Used as parameter in contextual links
@@ -871,10 +864,7 @@ static void Agd_PutFormsToRemEditOneEvent (struct AgendaEvent *AgdEvent)
NULL);
/***** Put form to edit event *****/
- Lay_PutContextualLink (ActEdiOneEvtMyAgd,NULL,Agd_PutCurrentParamsMyAgenda,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiOneEvtMyAgd,Agd_PutCurrentParamsMyAgenda);
/***** Put form to make event public/private *****/
if (AgdEvent->Public)
diff --git a/swad_assignment.c b/swad_assignment.c
index 9130426de..fb3d4ccee 100644
--- a/swad_assignment.c
+++ b/swad_assignment.c
@@ -505,7 +505,6 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden)
extern const char *Txt_Remove;
extern const char *Txt_Show;
extern const char *Txt_Hide;
- extern const char *Txt_Edit;
fprintf (Gbl.F.Out,"
");
@@ -530,10 +529,7 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden)
NULL);
/***** Put form to edit assignment *****/
- Lay_PutContextualLink (ActEdiOneAsg,NULL,Asg_PutParams,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiOneAsg,Asg_PutParams);
fprintf (Gbl.F.Out,"
");
}
diff --git a/swad_attendance.c b/swad_attendance.c
index 2e41d0a6c..6d8f3bd3a 100644
--- a/swad_attendance.c
+++ b/swad_attendance.c
@@ -545,7 +545,6 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden)
extern const char *Txt_Remove;
extern const char *Txt_Show;
extern const char *Txt_Hide;
- extern const char *Txt_Edit;
fprintf (Gbl.F.Out,"");
@@ -570,10 +569,7 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden)
NULL);
/***** Put form to edit attendance event *****/
- Lay_PutContextualLink (ActEdiOneAtt,NULL,Att_PutParams,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiOneAtt,Att_PutParams);
fprintf (Gbl.F.Out,"
");
}
@@ -2968,13 +2964,7 @@ static void Att_GetListSelectedAttCods (char **StrAttCodsSelected)
static void Att_PutIconToPrintMyList (void)
{
- extern const char *Txt_Print;
-
- /***** Link to print view *****/
- Lay_PutContextualLink (ActPrnLstMyAtt,NULL,Att_PutFormToPrintMyListParams,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnLstMyAtt,Att_PutFormToPrintMyListParams);
}
static void Att_PutFormToPrintMyListParams (void)
@@ -2991,13 +2981,7 @@ static void Att_PutFormToPrintMyListParams (void)
static void Att_PutIconToPrintStdsList (void)
{
- extern const char *Txt_Print;
-
- /***** Link to print view *****/
- Lay_PutContextualLink (ActPrnLstStdAtt,NULL,Att_PutParamsToPrintStdsList,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnLstStdAtt,Att_PutParamsToPrintStdsList);
}
static void Att_PutParamsToPrintStdsList (void)
diff --git a/swad_banner.c b/swad_banner.c
index cd9393edf..f48ad3429 100644
--- a/swad_banner.c
+++ b/swad_banner.c
@@ -170,14 +170,8 @@ static void Ban_WriteListOfBanners (void)
static void Ban_PutFormToEditBanners (void)
{
- extern const char *Txt_Edit;
-
if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
- /***** Link to edit banners *****/
- Lay_PutContextualLink (ActEdiBan,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiBan,NULL);
}
/*****************************************************************************/
diff --git a/swad_calendar.c b/swad_calendar.c
index 54d517fc6..8ca48b116 100644
--- a/swad_calendar.c
+++ b/swad_calendar.c
@@ -346,36 +346,20 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
static void Cal_PutIconToPrintCalendarSys (void)
{
- extern const char *Txt_Print;
-
- /***** Print calendar *****/
- Lay_PutContextualLink (ActPrnCalSys,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCalSys,NULL);
}
static void Cal_PutIconToPrintCalendarCty (void)
{
- extern const char *Txt_Print;
-
- /***** Print calendar *****/
- Lay_PutContextualLink (ActPrnCalCty,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCalCty,NULL);
}
static void Cal_PutIconToPrintCalendarIns (void)
{
- extern const char *Txt_Print;
extern const char *Txt_Holidays;
/***** Print calendar *****/
- Lay_PutContextualLink (ActPrnCalIns,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCalIns,NULL);
/***** View holidays *****/
if (Gbl.Hlds.Num || // There are holidays
@@ -388,33 +372,15 @@ static void Cal_PutIconToPrintCalendarIns (void)
static void Cal_PutIconToPrintCalendarCtr (void)
{
- extern const char *Txt_Print;
-
- /***** Print calendar *****/
- Lay_PutContextualLink (ActPrnCalCtr,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCalCtr,NULL);
}
static void Cal_PutIconToPrintCalendarDeg (void)
{
- extern const char *Txt_Print;
-
- /***** Print calendar *****/
- Lay_PutContextualLink (ActPrnCalDeg,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCalDeg,NULL);
}
static void Cal_PutIconToPrintCalendarCrs (void)
{
- extern const char *Txt_Print;
-
- /***** Print calendar *****/
- Lay_PutContextualLink (ActPrnCalCrs,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCalCrs,NULL);
}
diff --git a/swad_centre.c b/swad_centre.c
index a658d9ec0..6f02605fa 100644
--- a/swad_centre.c
+++ b/swad_centre.c
@@ -672,13 +672,8 @@ static void Ctr_Configuration (bool PrintView)
static void Ctr_PutIconsToPrintAndUpload (void)
{
- extern const char *Txt_Print;
-
/***** Link to print info about centre *****/
- Lay_PutContextualLink (ActPrnCtrInf,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCtrInf,NULL);
if (Gbl.Usrs.Me.LoggedRole >= Rol_CTR_ADM)
// Only centre admins, institution admins and system admins
@@ -824,12 +819,7 @@ static void Ctr_PutIconsListCentres (void)
static void Ctr_PutIconToEditCentres (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiCtr,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiCtr,NULL);
}
/*****************************************************************************/
@@ -989,13 +979,7 @@ static void Ctr_PutIconsEditingCentres (void)
static void Ctr_PutIconToViewCentres (void)
{
- extern const char *Txt_View;
-
- /***** Put form to view centres *****/
- Lay_PutContextualLink (ActSeeCtr,NULL,NULL,
- "eye-on64x64.png",
- Txt_View,NULL,
- NULL);
+ Lay_PutIconToView (ActSeeCtr,NULL);
}
/*****************************************************************************/
diff --git a/swad_changelog.h b/swad_changelog.h
index e946bb3b4..cb398b768 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -216,19 +216,21 @@
// TODO: Change numbers of notifications in program and database to match order in tabs
+// TODO: Icon to view en "Fuente de información"
// TODO: Print view of an assignment (suggested by Sandra Daniela Tazzioli Barroso).
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 16.197 (2017-04-30)"
+#define Log_PLATFORM_VERSION "SWAD 16.198 (2017-04-30)"
#define CSS_FILE "swad16.195.8.css"
#define JS_FILE "swad16.181.js"
// 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 16.198: Apr 30, 2017 Code refactoring related to contextual icons to edit, view and print. (218361 lines)
Version 16.197: Apr 30, 2017 Changes in layout of edition of degree types. (218579 lines)
Version 16.196.3: Apr 30, 2017 Changes in layout of edition of courses. (218540 lines)
Version 16.196.2: Apr 30, 2017 Changes in layout of edition of degrees. (218537 lines)
diff --git a/swad_country.c b/swad_country.c
index 83b5df0d0..955351f8b 100644
--- a/swad_country.c
+++ b/swad_country.c
@@ -480,12 +480,7 @@ static void Cty_Configuration (bool PrintView)
static void Cty_PutIconToPrint (void)
{
- extern const char *Txt_Print;
-
- Lay_PutContextualLink (ActPrnCtyInf,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCtyInf,NULL);
}
/*****************************************************************************/
@@ -772,12 +767,7 @@ static void Cty_PutIconsListCountries (void)
static void Cty_PutIconToEditCountries (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiCty,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiCty,NULL);
}
/*****************************************************************************/
diff --git a/swad_course.c b/swad_course.c
index a8acc1c14..a4f634267 100644
--- a/swad_course.c
+++ b/swad_course.c
@@ -492,12 +492,7 @@ static void Crs_Configuration (bool PrintView)
static void Crs_PutIconToPrint (void)
{
- extern const char *Txt_Print;
-
- Lay_PutContextualLink (ActPrnCrsInf,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnCrsInf,NULL);
}
/*****************************************************************************/
@@ -1196,12 +1191,7 @@ static void Crs_PutIconsListCourses (void)
static void Crs_PutIconToEditCourses (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiCrs,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiCrs,NULL);
}
/*****************************************************************************/
@@ -1357,13 +1347,7 @@ void Crs_EditCourses (void)
static void Crs_PutIconToViewCourses (void)
{
- extern const char *Txt_View;
-
- /***** Put form to view courses *****/
- Lay_PutContextualLink (ActSeeCrs,NULL,NULL,
- "eye-on64x64.png",
- Txt_View,NULL,
- NULL);
+ Lay_PutIconToView (ActSeeCrs,NULL);
}
/*****************************************************************************/
diff --git a/swad_degree.c b/swad_degree.c
index 231af4666..4b80193e4 100644
--- a/swad_degree.c
+++ b/swad_degree.c
@@ -553,13 +553,8 @@ static void Deg_Configuration (bool PrintView)
static void Deg_PutIconsToPrintAndUpload (void)
{
- extern const char *Txt_Print;
-
/***** Link to print info about degree *****/
- Lay_PutContextualLink (ActPrnDegInf,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnDegInf,NULL);
if (Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM)
// Only degree admins, centre admins, institution admins and system admins
@@ -1239,12 +1234,7 @@ static void Deg_PutIconsListDegrees (void)
static void Deg_PutIconToEditDegrees (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiDeg,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiDeg,NULL);
}
/*****************************************************************************/
@@ -1403,13 +1393,7 @@ static void Deg_PutIconsEditingDegrees (void)
static void Deg_PutIconToViewDegrees (void)
{
- extern const char *Txt_View;
-
- /***** Put form to view degrees *****/
- Lay_PutContextualLink (ActSeeDeg,NULL,NULL,
- "eye-on64x64.png",
- Txt_View,NULL,
- NULL);
+ Lay_PutIconToView (ActSeeDeg,NULL);
}
/*****************************************************************************/
diff --git a/swad_degree_type.c b/swad_degree_type.c
index 7332990a7..d914ea011 100644
--- a/swad_degree_type.c
+++ b/swad_degree_type.c
@@ -139,12 +139,7 @@ void DT_PutIconToViewDegreeTypes (void)
static void DT_PutIconToViewDegreeTypesWhenEditing (void)
{
- extern const char *Txt_View;
-
- Lay_PutContextualLink (ActSeeDegTyp,NULL,NULL,
- "eye-on64x64.png",
- Txt_View,NULL,
- NULL);
+ Lay_PutIconToView (ActSeeDegTyp,NULL);
}
/*****************************************************************************/
@@ -345,16 +340,12 @@ static void DT_PutIconsListDegTypes (void)
static void DT_PutIconToEditDegTypes (void)
{
- extern const char *Txt_Edit;
bool CentreTabVisible = Gbl.CurrentCtr.Ctr.CtrCod > 0 && // Centre selected
Gbl.CurrentDeg.Deg.DegCod <= 0; // No degree selected
if (CentreTabVisible && // Only editable if centre tab is visible
DT_CheckIfICanCreateDegreeTypes ())
- Lay_PutContextualLink (ActEdiDegTyp,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiDegTyp,NULL);
}
/*****************************************************************************/
diff --git a/swad_department.c b/swad_department.c
index 7081ded53..0a26e50e6 100644
--- a/swad_department.c
+++ b/swad_department.c
@@ -209,12 +209,7 @@ static void Dpt_GetParamDptOrder (void)
static void Dpt_PutIconToEditDpts (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiDpt,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiDpt,NULL);
}
/*****************************************************************************/
diff --git a/swad_exam.c b/swad_exam.c
index 7841ea561..90b4d9aa9 100644
--- a/swad_exam.c
+++ b/swad_exam.c
@@ -1538,8 +1538,6 @@ static void Exa_PutIconsExamAnnouncement (void)
extern const char *Txt_Remove;
extern const char *Txt_Show;
extern const char *Txt_Hide;
- extern const char *Txt_Edit;
- extern const char *Txt_Print;
if (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
@@ -1570,17 +1568,11 @@ static void Exa_PutIconsExamAnnouncement (void)
}
/***** Link to edit this exam announcement *****/
- Lay_PutContextualLink (ActEdiExaAnn,NULL,Exa_PutParamExaCodToEdit,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiExaAnn,Exa_PutParamExaCodToEdit);
}
/***** Link to print view *****/
- Lay_PutContextualLink (ActPrnExaAnn,NULL,Exa_PutParamExaCodToEdit,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnExaAnn,Exa_PutParamExaCodToEdit);
}
/*****************************************************************************/
diff --git a/swad_file_browser.c b/swad_file_browser.c
index 37645d25c..f3a28ea06 100644
--- a/swad_file_browser.c
+++ b/swad_file_browser.c
@@ -3673,27 +3673,18 @@ static void Brw_ShowFileBrowser (void)
static void Brw_PutIconsFileBrowser (void)
{
- extern const char *Txt_View;
- extern const char *Txt_Edit;
-
/***** Put icon to view / edit file browser *****/
switch (Gbl.FileBrowser.IconViewEdit)
{
case Brw_ICON_NONE:
break;
case Brw_ICON_VIEW:
- Lay_PutContextualLink (Brw_ActFromAdmToSee[Gbl.FileBrowser.Type],
- NULL,Brw_PutHiddenParamFullTreeIfSelected,
- "eye-on64x64.png",
- Txt_View,NULL,
- NULL);
+ Lay_PutIconToView (Brw_ActFromAdmToSee[Gbl.FileBrowser.Type],
+ Brw_PutHiddenParamFullTreeIfSelected);
break;
case Brw_ICON_EDIT:
- Lay_PutContextualLink (Brw_ActFromSeeToAdm[Gbl.FileBrowser.Type],
- NULL,Brw_PutHiddenParamFullTreeIfSelected,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (Brw_ActFromSeeToAdm[Gbl.FileBrowser.Type],
+ Brw_PutHiddenParamFullTreeIfSelected);
break;
}
diff --git a/swad_group.c b/swad_group.c
index ef488e76d..b7d8a14b5 100644
--- a/swad_group.c
+++ b/swad_group.c
@@ -1331,13 +1331,7 @@ static void Grp_PutIconsEditingGroupTypes (void)
static void Grp_PutIconToViewGroups (void)
{
- extern const char *Txt_View;
-
- /***** Put form to create a new type of group *****/
- Lay_PutContextualLink (ActReqSelGrp,NULL,NULL,
- "eye-on64x64.png",
- Txt_View,NULL,
- NULL);
+ Lay_PutIconToView (ActReqSelGrp,NULL);
}
static void Grp_PutIconToCreateNewGroupType (void)
@@ -1732,12 +1726,7 @@ void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
static void Grp_PutIconToEditGroups (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActReqEdiGrp,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActReqEdiGrp,NULL);
}
/*****************************************************************************/
diff --git a/swad_holiday.c b/swad_holiday.c
index 0e7242068..9379ce20d 100644
--- a/swad_holiday.c
+++ b/swad_holiday.c
@@ -211,12 +211,7 @@ static void Hld_GetParamHldOrder (void)
static void Hld_PutIconToEditHlds (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiHld,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiHld,NULL);
}
/*****************************************************************************/
diff --git a/swad_info.c b/swad_info.c
index 0c549a96d..8c452e238 100644
--- a/swad_info.c
+++ b/swad_info.c
@@ -467,13 +467,7 @@ static void Inf_PutButtonToEditInfo (void)
void Inf_PutIconToEditInfo (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (Inf_ActionsEditInfo[Gbl.CurrentCrs.Info.Type],
- NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (Inf_ActionsEditInfo[Gbl.CurrentCrs.Info.Type],NULL);
}
/*****************************************************************************/
diff --git a/swad_institution.c b/swad_institution.c
index d4e0eccda..4f858fbc6 100644
--- a/swad_institution.c
+++ b/swad_institution.c
@@ -627,13 +627,8 @@ static void Ins_Configuration (bool PrintView)
static void Ins_PutIconsToPrintAndUpload (void)
{
- extern const char *Txt_Print;
-
/***** Link to print info about institution *****/
- Lay_PutContextualLink (ActPrnInsInf,NULL,NULL,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnInsInf,NULL);
if (Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM)
/***** Link to upload logo of institution *****/
@@ -743,12 +738,7 @@ static void Ins_PutIconsListInstitutions (void)
static void Ins_PutIconToEditInstitutions (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiIns,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiIns,NULL);
}
/*****************************************************************************/
@@ -958,13 +948,7 @@ void Ins_EditInstitutions (void)
static void Ins_PutIconToViewInstitutions (void)
{
- extern const char *Txt_View;
-
- /***** Put form to view institutions *****/
- Lay_PutContextualLink (ActSeeIns,NULL,NULL,
- "eye-on64x64.png",
- Txt_View,NULL,
- NULL);
+ Lay_PutIconToView (ActSeeIns,NULL);
}
/*****************************************************************************/
diff --git a/swad_layout.c b/swad_layout.c
index 4df2393bb..cf92b6203 100644
--- a/swad_layout.c
+++ b/swad_layout.c
@@ -1086,6 +1086,40 @@ static void Lay_ShowRightColumn (void)
Gbl.Prefs.IconsURL);
}
+/*****************************************************************************/
+/**************** Show contextual icons to edit, view, print *****************/
+/*****************************************************************************/
+
+void Lay_PutIconToEdit (Act_Action_t NextAction,void (*FuncParams) ())
+ {
+ extern const char *Txt_Edit;
+
+ Lay_PutContextualLink (NextAction,NULL,FuncParams,
+ "edit64x64.png",
+ Txt_Edit,NULL,
+ NULL);
+ }
+
+void Lay_PutIconToView (Act_Action_t NextAction,void (*FuncParams) ())
+ {
+ extern const char *Txt_View;
+
+ Lay_PutContextualLink (NextAction,NULL,FuncParams,
+ "eye-on64x64.png",
+ Txt_View,NULL,
+ NULL);
+ }
+
+void Lay_PutIconToPrint (Act_Action_t NextAction,void (*FuncParams) ())
+ {
+ extern const char *Txt_Print;
+
+ Lay_PutContextualLink (NextAction,NULL,FuncParams,
+ "print64x64.png",
+ Txt_Print,NULL,
+ NULL);
+ }
+
/*****************************************************************************/
/**************** Show an icon with a link in contextual menu ****************/
/*****************************************************************************/
diff --git a/swad_layout.h b/swad_layout.h
index c1e47efde..358db1269 100644
--- a/swad_layout.h
+++ b/swad_layout.h
@@ -72,6 +72,9 @@ typedef enum
void Lay_WriteStartOfPage (void);
+void Lay_PutIconToEdit (Act_Action_t NextAction,void (*FuncParams) ());
+void Lay_PutIconToView (Act_Action_t NextAction,void (*FuncParams) ());
+void Lay_PutIconToPrint (Act_Action_t NextAction,void (*FuncParams) ());
void Lay_PutContextualLink (Act_Action_t NextAction,const char *Anchor,
void (*FuncParams) (),
const char *Icon,
diff --git a/swad_link.c b/swad_link.c
index 509eb7e80..32b95a815 100644
--- a/swad_link.c
+++ b/swad_link.c
@@ -130,12 +130,7 @@ void Lnk_SeeLinks (void)
static void Lnk_PutIconToEditLinks (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiLnk,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiLnk,NULL);
}
/*****************************************************************************/
diff --git a/swad_mail.c b/swad_mail.c
index 91501fd42..50e952f34 100644
--- a/swad_mail.c
+++ b/swad_mail.c
@@ -177,12 +177,7 @@ static void Mai_GetParamMaiOrder (void)
static void Mai_PutIconToEditMailDomains (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiMai,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiMai,NULL);
}
/*****************************************************************************/
diff --git a/swad_photo.c b/swad_photo.c
index 175cb1148..7a005b8fb 100644
--- a/swad_photo.c
+++ b/swad_photo.c
@@ -1862,13 +1862,7 @@ static Pho_HowOrderDegrees_t Pho_GetHowOrderDegreesFromForm (void)
static void Pho_PutIconToPrintDegreeStats (void)
{
- extern const char *Txt_Print;
-
- Lay_PutContextualLink (ActPrnPhoDeg,NULL,
- Pho_PutLinkToPrintViewOfDegreeStatsParams,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnPhoDeg,Pho_PutLinkToPrintViewOfDegreeStatsParams);
}
static void Pho_PutLinkToPrintViewOfDegreeStatsParams (void)
diff --git a/swad_place.c b/swad_place.c
index 8bbd3a946..135501e0a 100644
--- a/swad_place.c
+++ b/swad_place.c
@@ -229,12 +229,7 @@ static void Plc_GetParamPlcOrder (void)
static void Plc_PutIconToEditPlaces (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiPlc,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiPlc,NULL);
}
/*****************************************************************************/
diff --git a/swad_plugin.c b/swad_plugin.c
index 08a53dac9..9b2a7bcb1 100644
--- a/swad_plugin.c
+++ b/swad_plugin.c
@@ -151,12 +151,7 @@ void Plg_ListPlugins (void)
static void Plg_PutIconToEditPlugins (void)
{
- extern const char *Txt_Edit;
-
- Lay_PutContextualLink (ActEdiPlg,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiPlg,NULL);
}
/*****************************************************************************/
diff --git a/swad_survey.c b/swad_survey.c
index 410bc3e9e..ed4c77c4c 100644
--- a/swad_survey.c
+++ b/swad_survey.c
@@ -785,7 +785,6 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible)
extern const char *Txt_Reset;
extern const char *Txt_Show;
extern const char *Txt_Hide;
- extern const char *Txt_Edit;
fprintf (Gbl.F.Out,"");
@@ -816,10 +815,7 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible)
NULL);
/***** Put form to edit survey *****/
- Lay_PutContextualLink (ActEdiOneSvy,NULL,Svy_PutParams,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiOneSvy,Svy_PutParams);
fprintf (Gbl.F.Out,"
");
}
diff --git a/swad_test.c b/swad_test.c
index 9207539e7..e6255c7eb 100644
--- a/swad_test.c
+++ b/swad_test.c
@@ -1327,7 +1327,6 @@ static bool Tst_CheckIfICanEditTests (void)
static void Tst_PutIconsTests (void)
{
- extern const char *Txt_Edit;
extern const char *Txt_New_question;
extern const char *Txt_Configure;
@@ -1335,10 +1334,7 @@ static void Tst_PutIconsTests (void)
{
/***** Put form to edit existing test questions *****/
if (Gbl.Action.Act != ActEdiTstQst)
- Lay_PutContextualLink (ActEdiTstQst,NULL,NULL,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiTstQst,NULL);
/***** Put form to create a new test question *****/
if (Gbl.Action.Act != ActEdiOneTstQst)
diff --git a/swad_text.c b/swad_text.c
index 0a85e3e8a..5ff199ce2 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -37470,27 +37470,6 @@ const char *Txt_Show_statistic =
"Mostrar estatística";
#endif
-const char *Txt_Show_timetable =
-#if L==1
- "Veure horari";
-#elif L==2
- "Zeige Stundenplan";
-#elif L==3
- "Show timetable";
-#elif L==4
- "Ver horario";
-#elif L==5
- "Voir horaire";
-#elif L==6
- "Ver horario"; // Okoteve traducción
-#elif L==7
- "Vedi orario";
-#elif L==8
- "Wiadomości plan lekcji";
-#elif L==9
- "Veja horário";
-#endif
-
const char *Txt_Shuffle =
#if L==1
"Barrejar";
diff --git a/swad_timetable.c b/swad_timetable.c
index 727d92ba6..c676c9baa 100644
--- a/swad_timetable.c
+++ b/swad_timetable.c
@@ -392,29 +392,16 @@ void TT_ShowClassTimeTable (void)
static void TT_PutContextualIcons (void)
{
- extern const char *Txt_Edit;
- extern const char *Txt_Edit_office_hours;
- extern const char *Txt_Print;
-
if (Gbl.TimeTable.ContextualIcons.PutIconEditCrsTT)
- Lay_PutContextualLink (ActEdiCrsTT,NULL,Grp_PutParamWhichGrps,
- "edit64x64.png",
- Txt_Edit,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiCrsTT,Grp_PutParamWhichGrps);
if (Gbl.TimeTable.ContextualIcons.PutIconEditOfficeHours)
- Lay_PutContextualLink (ActEdiTut,NULL,NULL,
- "edit64x64.png",
- Txt_Edit_office_hours,NULL,
- NULL);
+ Lay_PutIconToEdit (ActEdiTut,NULL);
if (Gbl.TimeTable.ContextualIcons.PutIconPrint)
- Lay_PutContextualLink (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE ? ActPrnCrsTT :
- ActPrnMyTT,
- NULL,Grp_PutParamWhichGrps,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE ? ActPrnCrsTT :
+ ActPrnMyTT,
+ Grp_PutParamWhichGrps);
}
/*****************************************************************************/
@@ -473,13 +460,7 @@ void TT_EditMyTutTimeTable (void)
static void TT_PutIconToViewCrsTT (void)
{
- extern const char *Txt_Show_timetable;
-
- /***** Link (form) to see course timetable *****/
- Lay_PutContextualLink (ActSeeCrsTT,NULL,NULL,
- "eye-on64x64.png",
- Txt_Show_timetable,NULL,
- NULL);
+ Lay_PutIconToView (ActSeeCrsTT,NULL);
}
/*****************************************************************************/
@@ -488,13 +469,7 @@ static void TT_PutIconToViewCrsTT (void)
static void TT_PutIconToViewMyTT (void)
{
- extern const char *Txt_Show_timetable;
-
- /***** Link (form) to see my timetable *****/
- Lay_PutContextualLink (ActSeeMyTT,NULL,NULL,
- "eye-on64x64.png",
- Txt_Show_timetable,NULL,
- NULL);
+ Lay_PutIconToView (ActSeeMyTT,NULL);
}
/*****************************************************************************/
diff --git a/swad_user.c b/swad_user.c
index f8040f7d8..7cc701129 100644
--- a/swad_user.c
+++ b/swad_user.c
@@ -7657,32 +7657,17 @@ static void Usr_PutIconsListTchs (void)
static void Usr_PutIconToPrintGsts (void)
{
- extern const char *Txt_Print;
-
- Lay_PutContextualLink (ActPrnGstPho,NULL,Usr_ShowGstsAllDataParams,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnGstPho,Usr_ShowGstsAllDataParams);
}
static void Usr_PutIconToPrintStds (void)
{
- extern const char *Txt_Print;
-
- Lay_PutContextualLink (ActPrnStdPho,NULL,Usr_ShowStdsAllDataParams,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnStdPho,Usr_ShowStdsAllDataParams);
}
static void Usr_PutIconToPrintTchs (void)
{
- extern const char *Txt_Print;
-
- Lay_PutContextualLink (ActPrnTchPho,NULL,Usr_ShowTchsAllDataParams,
- "print64x64.png",
- Txt_Print,NULL,
- NULL);
+ Lay_PutIconToPrint (ActPrnTchPho,Usr_ShowTchsAllDataParams);
}
/*****************************************************************************/