diff --git a/Makefile b/Makefile index 536d1cfd..1ccea3d9 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ OBJS = swad_account.o swad_action.o swad_agenda.o swad_alert.o \ swad_record.o swad_report.o swad_role.o swad_RSS.o \ swad_scope.o swad_search.o swad_session.o swad_setup.o swad_social.o \ swad_statistic.o swad_string.o swad_survey.o swad_syllabus.o \ - swad_tab.o swad_test.o swad_test_import.o swad_theme.o swad_timetable.o \ + swad_tab.o swad_table.o swad_test.o swad_test_import.o swad_theme.o swad_timetable.o \ swad_user.o \ swad_web_service.o \ swad_xml.o \ diff --git a/swad_ID.c b/swad_ID.c index c729a685..ac57abf5 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -37,6 +37,7 @@ #include "swad_ID.h" #include "swad_parameter.h" #include "swad_QR.h" +#include "swad_table.h" #include "swad_user.h" /*****************************************************************************/ @@ -415,7 +416,7 @@ bool ID_ICanSeeOtherUsrIDs (const struct UsrData *UsrDat) /* Check 2: I can see the IDs of confirmed students */ if (UsrDat->Roles.InCurrentCrs.Role == Rol_STD && // A student - UsrDat->Accepted) // who accepted registration + UsrDat->Accepted) // who accepted registration return true; /* Check 3: I can see the IDs of users with user's data empty */ @@ -441,7 +442,7 @@ bool ID_ICanSeeOtherUsrIDs (const struct UsrData *UsrDat) } /*****************************************************************************/ -/****************** Put a link to confirm of another user's ID ***************/ +/****************** Put a link to confirm another user's ID ******************/ /*****************************************************************************/ static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID, @@ -558,10 +559,10 @@ void ID_ShowFormOthIDs (void) &Gbl.Usrs.Other.UsrDat,NULL); /***** Form with the user's ID *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); ID_ShowFormChangeUsrID (&Gbl.Usrs.Other.UsrDat, (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me? - Lay_EndTable (); + Tbl_EndTable (); /***** End frame *****/ Box_EndBox (); diff --git a/swad_action.c b/swad_action.c index 20b2aeb5..9dc45ffc 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2568,9 +2568,9 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActRcvFrmEnrSevNET*/{1643,-1,TabUnk,ActLstTch ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Enr_ReceiveFormAdminNonEditTchs,NULL}, /* ActRcvFrmEnrSevTch*/{1429,-1,TabUnk,ActLstTch ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Enr_ReceiveFormAdminTchs ,NULL}, - /* ActCnfID_Oth */{1568,-1,TabUnk,ActLstOth ,0x3E0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL}, - /* ActCnfID_Std */{1569,-1,TabUnk,ActLstStd ,0x3E0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL}, - /* ActCnfID_Tch */{1570,-1,TabUnk,ActLstTch ,0x3E0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL}, + /* ActCnfID_Oth */{1568,-1,TabUnk,ActLstOth ,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL}, + /* ActCnfID_Std */{1569,-1,TabUnk,ActLstStd ,0x3F0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL}, + /* ActCnfID_Tch */{1570,-1,TabUnk,ActLstTch ,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL}, /* ActFrmIDsOth */{1447,-1,TabUnk,ActLstOth ,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ShowFormOthIDs ,NULL}, /* ActFrmIDsStd */{1448,-1,TabUnk,ActLstStd ,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ShowFormOthIDs ,NULL}, diff --git a/swad_agenda.c b/swad_agenda.c index c43e804f..06927af3 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -42,6 +42,7 @@ #include "swad_privacy.h" #include "swad_QR.h" #include "swad_string.h" +#include "swad_table.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -477,7 +478,7 @@ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType) if (Gbl.Agenda.Num) { /***** Start table *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); /***** Table head *****/ Agd_WriteHeaderListEvents (AgendaType); @@ -489,7 +490,7 @@ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType) Agd_ShowOneEvent (AgendaType,Gbl.Agenda.LstAgdCods[NumEvent - 1]); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else Ale_ShowAlert (Ale_INFO,Txt_No_events); diff --git a/swad_assignment.c b/swad_assignment.c index 5fddfccf..5a3987d3 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -40,6 +40,7 @@ #include "swad_parameter.h" #include "swad_photo.h" #include "swad_string.h" +#include "swad_table.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -147,7 +148,7 @@ static void Asg_ShowAllAssignments (void) if (Gbl.Asgs.Num) { /***** Table head *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); Asg_PutHeadForSeeing (false); // Not print view /***** Write all the assignments *****/ @@ -158,7 +159,7 @@ static void Asg_ShowAllAssignments (void) false); // Not print view /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No assignments created Ale_ShowAlert (Ale_INFO,Txt_No_assignments); @@ -331,7 +332,7 @@ void Asg_PrintOneAssignment (void) Gbl.CurrentCrs.Crs.CrsCod); /***** Table head *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); Asg_PutHeadForSeeing (true); // Print view /***** Write assignment *****/ @@ -339,7 +340,7 @@ void Asg_PrintOneAssignment (void) true); // Print view /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_attendance.c b/swad_attendance.c index 22404a69..2cf50736 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -41,6 +41,7 @@ #include "swad_parameter.h" #include "swad_photo.h" #include "swad_QR.h" +#include "swad_table.h" /*****************************************************************************/ /*************** External global variables from others modules ***************/ @@ -236,7 +237,7 @@ static void Att_ShowAllAttEvents (void) if (Gbl.AttEvents.Num) { /***** Table head *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); fprintf (Gbl.F.Out,"" ""); // Column for contextual icons for (Order = Dat_START_TIME; @@ -275,7 +276,7 @@ static void Att_ShowAllAttEvents (void) Att_ShowOneAttEvent (&Gbl.AttEvents.Lst[NumAttEvent - 1],false); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No events created Ale_ShowAlert (Ale_INFO,Txt_No_events); @@ -1961,7 +1962,7 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) Grp_PutParamsCodGrps (); /***** List students' data *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); fprintf (Gbl.F.Out,"" "" @@ -1997,7 +1998,7 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) Att_WriteRowStdToCallTheRoll (NumStd + 1,&UsrDat,Att); } - Lay_EndTable (); + Tbl_EndTable (); /* Send button */ Btn_PutConfirmButton (Txt_Save); @@ -2702,9 +2703,9 @@ void Usr_ReqListStdsAttendanceCrs (void) Grp_PutParamsCodGrps (); /* Write list of students to select some of them */ - Lay_StartTableCenter (0); + Tbl_StartTableCenter (0); Usr_ListUsersToSelect (Rol_STD); - Lay_EndTable (); + Tbl_EndTable (); /* Send button */ Btn_PutConfirmButton (Txt_Show_list); @@ -3227,9 +3228,9 @@ static void Att_ListStdsAttendanceTable (Att_TypeOfView_t TypeOfView, Hlp_USERS_Attendance_attendance_list, false); // Not closable if (PutButtonShowDetails) - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); else - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Heading row *****/ Att_WriteTableHeadSeveralAttEvents (); @@ -3277,7 +3278,7 @@ static void Att_ListStdsAttendanceTable (Att_TypeOfView_t TypeOfView, } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Button to show more details *****/ if (PutButtonShowDetails) diff --git a/swad_banner.c b/swad_banner.c index 4fcf5201..2c4072f6 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -36,6 +36,7 @@ #include "swad_global.h" #include "swad_parameter.h" #include "swad_photo.h" +#include "swad_table.h" #include "swad_text.h" /*****************************************************************************/ @@ -382,7 +383,7 @@ static void Ban_ListBannersForEdition (void) struct Banner *Ban; /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Table head *****/ Ban_PutHeadBanners (); @@ -478,7 +479,7 @@ static void Ban_ListBannersForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_box.c b/swad_box.c index cde8e2fb..4f3cc02b 100644 --- a/swad_box.c +++ b/swad_box.c @@ -32,6 +32,7 @@ #include "swad_box.h" #include "swad_global.h" #include "swad_help.h" +#include "swad_table.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -73,7 +74,7 @@ void Box_StartBoxTable (const char *Width,const char *Title, Box_StartBox (Width,Title,FunctionToDrawContextualIcons, HelpLink, Closable); - Lay_StartTableWide (CellPadding); + Tbl_StartTableWide (CellPadding); } void Box_StartBoxTableShadow (const char *Width,const char *Title, @@ -84,7 +85,7 @@ void Box_StartBoxTableShadow (const char *Width,const char *Title, Box_StartBoxShadow (Width,Title, FunctionToDrawContextualIcons, HelpLink); - Lay_StartTableWide (CellPadding); + Tbl_StartTableWide (CellPadding); } void Box_StartBox (const char *Width,const char *Title, @@ -192,13 +193,13 @@ static void Box_StartBoxInternal (const char *Width,const char *Title, void Box_EndBoxTable (void) { - Lay_EndTable (); + Tbl_EndTable (); Box_EndBox (); } void Box_EndBoxTableWithButton (Btn_Button_t Button,const char *TxtButton) { - Lay_EndTable (); + Tbl_EndTable (); Box_EndBoxWithButton (Button,TxtButton); } diff --git a/swad_centre.c b/swad_centre.c index b6f15e84..fc68ffd0 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -44,6 +44,7 @@ #include "swad_parameter.h" #include "swad_QR.h" #include "swad_string.h" +#include "swad_table.h" #include "swad_text.h" /*****************************************************************************/ @@ -386,7 +387,7 @@ static void Ctr_Configuration (bool PrintView) } /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Institution *****/ fprintf (Gbl.F.Out,"" @@ -630,7 +631,7 @@ static void Ctr_Configuration (bool PrintView) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** End frame *****/ Box_EndBox (); @@ -754,7 +755,7 @@ static void Ctr_ListCentres (void) if (Gbl.Ctrs.Num) // There are centres in the current institution { /***** Start table *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); Ctr_PutHeadCentresForSeeing (true); // Order selectable /***** Write all the centres and their nuber of teachers *****/ @@ -764,7 +765,7 @@ static void Ctr_ListCentres (void) Ctr_ListOneCentreForSeeing (&(Gbl.Ctrs.Lst[NumCtr]),NumCtr + 1); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No centres created in the current institution Ale_ShowAlert (Ale_INFO,Txt_No_centres); @@ -1410,7 +1411,7 @@ static void Ctr_ListCentresForEdition (void) Usr_UsrDataConstructor (&UsrDat); /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); Ctr_PutHeadCentresForEdition (); /***** Write all the centres *****/ @@ -1599,7 +1600,7 @@ static void Ctr_ListCentresForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); diff --git a/swad_changelog.h b/swad_changelog.h index 91d232b0..bdfe08da 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -237,19 +237,19 @@ // TODO: En listado de accesos, las fechas (no el día de la semana) deberían ir alineadas a la derecha. -// TODO: Fix bug: un profesor no editor no puede confirmar DNI? Si es así, no le debería salir el enlace "Confirmar ID", y si queremos que pueda, hay que darle permisos - /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.240.1 (2017-06-11)" +#define Log_PLATFORM_VERSION "SWAD 16.241.1 (2017-06-11)" #define CSS_FILE "swad16.235.1.css" #define JS_FILE "swad16.206.3.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.241.1: Jun 11, 2017 Fix bug confirming another user's ID. (222132 lines) + Version 16.241: Jun 11, 2017 New module swad_table to draw tables. (222132 lines) Version 16.240.1: Jun 11, 2017 Some functions moved from swad_layout to swad_icon. (222024 lines) Version 16.240: Jun 11, 2017 New module swad_button to draw buttons. (222023 lines) Version 16.239: Jun 10, 2017 New module swad_box to draw boxes. (221970 lines) diff --git a/swad_connected.c b/swad_connected.c index 390c7a83..0734902f 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -39,6 +39,7 @@ #include "swad_photo.h" #include "swad_role.h" #include "swad_string.h" +#include "swad_table.h" #include "swad_user.h" /*****************************************************************************/ @@ -217,7 +218,7 @@ void Con_GetAndShowLastClicks (void) NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get last clicks"); /***** Write list of connected users *****/ - Lay_StartTableCenter (1); + Tbl_StartTableCenter (1); fprintf (Gbl.F.Out,"" "" @@ -335,7 +336,7 @@ void Con_GetAndShowLastClicks (void) ClassRow,Deg.ShrtName, ClassRow,row[8]); } - Lay_EndTable (); + Tbl_EndTable (); /***** Free structure that stores the query result *****/ mysql_free_result (mysql_res); diff --git a/swad_country.c b/swad_country.c index a4db4b61..739d2805 100644 --- a/swad_country.c +++ b/swad_country.c @@ -40,6 +40,7 @@ #include "swad_language.h" #include "swad_preference.h" #include "swad_QR.h" +#include "swad_table.h" #include "swad_text.h" /*****************************************************************************/ @@ -304,7 +305,7 @@ static void Cty_Configuration (bool PrintView) } /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Country name (an link to WWW if exists) *****/ fprintf (Gbl.F.Out,"" @@ -440,7 +441,7 @@ static void Cty_Configuration (bool PrintView) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** End frame *****/ Box_EndBox (); @@ -1530,7 +1531,7 @@ static void Cty_ListCountriesForEdition (void) Txt_Language_t Lan; /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); Cty_PutHeadCountriesForEdition (); /***** Write all the countries *****/ @@ -1629,7 +1630,7 @@ static void Cty_ListCountriesForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_course.c b/swad_course.c index 0c20f332..8b6eb01a 100644 --- a/swad_course.c +++ b/swad_course.c @@ -49,6 +49,7 @@ #include "swad_role.h" #include "swad_RSS.h" #include "swad_tab.h" +#include "swad_table.h" #include "swad_theme.h" /*****************************************************************************/ @@ -219,7 +220,7 @@ static void Crs_Configuration (bool PrintView) Gbl.CurrentCrs.Crs.FullName); /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Degree *****/ fprintf (Gbl.F.Out,"" @@ -464,7 +465,7 @@ static void Crs_Configuration (bool PrintView) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** End frame *****/ Box_EndBox (); @@ -1144,7 +1145,7 @@ static void Crs_ListCourses (void) if (Gbl.CurrentDeg.NumCrss) // There are courses in the current degree { /***** Start table *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); Crs_PutHeadCoursesForSeeing (); /***** List the courses *****/ @@ -1156,7 +1157,7 @@ static void Crs_ListCourses (void) Crs_ListCoursesOfAYearForSeeing (0); // Courses without a year selected /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No courses created in the current degree Ale_ShowAlert (Ale_INFO,Txt_No_courses); @@ -1376,7 +1377,7 @@ static void Crs_ListCoursesForEdition (void) unsigned Year; /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); Crs_PutHeadCoursesForEdition (); /***** List the courses *****/ @@ -1387,7 +1388,7 @@ static void Crs_ListCoursesForEdition (void) Crs_ListCoursesOfAYearForEdition (0); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index 72407d0c..798073b9 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -52,6 +52,7 @@ #include "swad_RSS.h" #include "swad_string.h" #include "swad_tab.h" +#include "swad_table.h" #include "swad_text.h" #include "swad_theme.h" @@ -321,7 +322,7 @@ static void Deg_Configuration (bool PrintView) fprintf (Gbl.F.Out,""); /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Centre *****/ fprintf (Gbl.F.Out,"" @@ -526,7 +527,7 @@ static void Deg_Configuration (bool PrintView) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** End frame *****/ Box_EndBox (); @@ -684,7 +685,7 @@ static void Deg_ListDegreesForEdition (void) Usr_UsrDataConstructor (&UsrDat); /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); Deg_PutHeadDegreesForEdition (); /***** List the degrees *****/ @@ -858,7 +859,7 @@ static void Deg_ListDegreesForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); @@ -1183,7 +1184,7 @@ static void Deg_ListDegrees (void) if (Gbl.CurrentCtr.Ctr.Degs.Num) // There are degrees in the current centre { /***** Write heading *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); Deg_PutHeadDegreesForSeeing (); /***** List the degrees *****/ @@ -1193,7 +1194,7 @@ static void Deg_ListDegrees (void) Deg_ListOneDegreeForSeeing (&(Gbl.CurrentCtr.Ctr.Degs.Lst[NumDeg]),NumDeg + 1); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No degrees created in the current centre Ale_ShowAlert (Ale_INFO,Txt_No_degrees); diff --git a/swad_degree_type.c b/swad_degree_type.c index 77a8d36b..21d5a0f6 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -40,6 +40,7 @@ #include "swad_degree_type.h" #include "swad_global.h" #include "swad_parameter.h" +#include "swad_table.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -225,14 +226,14 @@ static void DT_ListDegreeTypes (Act_Action_t NextAction,DT_Order_t SelectedOrder if (Gbl.Degs.DegTypes.Num) { /***** Write heading *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); DT_PutHeadDegreeTypesForSeeing (NextAction,SelectedOrder); /***** List current degree types for seeing *****/ DT_ListDegreeTypesForSeeing (); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No degree types created Ale_ShowAlert (Ale_INFO,Txt_No_types_of_degree); @@ -361,7 +362,7 @@ static void DT_ListDegreeTypesForEdition (void) unsigned NumDegTyp; /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); DT_PutHeadDegreeTypesForEdition (); /***** List degree types with forms for edition *****/ @@ -411,7 +412,7 @@ static void DT_ListDegreeTypesForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_duplicate.c b/swad_duplicate.c index 508792b8..fdb2b4a7 100644 --- a/swad_duplicate.c +++ b/swad_duplicate.c @@ -34,6 +34,7 @@ #include "swad_layout.h" #include "swad_profile.h" #include "swad_role_type.h" +#include "swad_table.h" #include "swad_user.h" /*****************************************************************************/ @@ -161,7 +162,7 @@ void Dup_ListDuplicateUsrs (void) Usr_UsrDataConstructor (&UsrDat); /***** Start table *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); /***** Heading row with column names *****/ Gbl.Usrs.Listing.WithPhotos = true; @@ -220,7 +221,7 @@ void Dup_ListDuplicateUsrs (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); @@ -294,7 +295,7 @@ static void Dup_ListSimilarUsrs (void) Usr_UsrDataConstructor (&UsrDat); /***** Start table *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); /***** Heading row with column names *****/ Gbl.Usrs.Listing.WithPhotos = true; @@ -362,7 +363,7 @@ static void Dup_ListSimilarUsrs (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); diff --git a/swad_enrolment.c b/swad_enrolment.c index 9be1daf7..a71674f3 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -39,6 +39,7 @@ #include "swad_notification.h" #include "swad_parameter.h" #include "swad_role.h" +#include "swad_table.h" #include "swad_user.h" /*****************************************************************************/ @@ -917,7 +918,7 @@ static void Enr_PutAreaToEnterUsrsIDs (void) extern const char *Txt_List_of_nicks_emails_or_IDs; /***** Text area for users' IDs *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); fprintf (Gbl.F.Out,"" "" "" @@ -930,7 +931,7 @@ static void Enr_PutAreaToEnterUsrsIDs (void) "", The_ClassForm[Gbl.Prefs.Theme], Txt_List_of_nicks_emails_or_IDs); - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ @@ -2314,7 +2315,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) /***** Selection of scope and roles *****/ /* Start form and table */ Act_FormStart (ActUpdSignUpReq); - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); /* Scope (whole platform, current centre, current degree or current course) */ fprintf (Gbl.F.Out,"" @@ -2343,7 +2344,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) ""); /* End table and form */ - Lay_EndTable (); + Tbl_EndTable (); Act_FormEnd (); /***** Build query *****/ @@ -2786,7 +2787,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) Usr_UsrDataConstructor (&UsrDat); /* Start table */ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); fprintf (Gbl.F.Out,"" "" "%s" @@ -2943,7 +2944,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) } /* End table */ - Lay_EndTable (); + Tbl_EndTable (); /* Free memory used for user's data */ Usr_UsrDataDestructor (&UsrDat); diff --git a/swad_file_browser.c b/swad_file_browser.c index 54077d91..613c0703 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -50,6 +50,7 @@ #include "swad_profile.h" #include "swad_social.h" #include "swad_string.h" +#include "swad_table.h" #include "swad_zip.h" /*****************************************************************************/ @@ -3146,11 +3147,11 @@ void Brw_AskEditWorksCrs (void) Brw_PutHiddenParamFullTreeIfSelected (); /* Put list of users to select some of them */ - Lay_StartTableCenter (0); + Tbl_StartTableCenter (0); Usr_ListUsersToSelect (Rol_TCH); Usr_ListUsersToSelect (Rol_NET); Usr_ListUsersToSelect (Rol_STD); - Lay_EndTable (); + Tbl_EndTable (); /* Send button */ Btn_PutConfirmButton (Txt_View_homework); diff --git a/swad_forum.c b/swad_forum.c index a5e8278b..7b3aa85c 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -44,6 +44,7 @@ #include "swad_profile.h" #include "swad_role.h" #include "swad_social.h" +#include "swad_table.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -1067,7 +1068,7 @@ static void For_ShowPostsOfAThread (Ale_AlertType_t AlertType,const char *Messag &PaginationPsts); /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Show posts from this page, the author and the date of last reply *****/ mysql_data_seek (mysql_res,(my_ulonglong) (PaginationPsts.FirstItemVisible - 1)); @@ -1119,7 +1120,7 @@ static void For_ShowPostsOfAThread (Ale_AlertType_t AlertType,const char *Messag } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Write again links to pages *****/ if (PaginationPsts.MoreThanOnePage) @@ -2587,7 +2588,7 @@ static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted, &PaginationThrs); /***** Heading row *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); fprintf (Gbl.F.Out,"" "" "" // Column for contextual icons @@ -2639,7 +2640,7 @@ static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted, For_ListForumThrs (ThrCods,ThrCodHighlighted,&PaginationThrs); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Write links to all the pages in the listing of threads *****/ if (PaginationThrs.MoreThanOnePage) @@ -3881,7 +3882,7 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject) } /***** Subject and content *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); // If writing a reply to a message of an existing thread ==> write subject /* Subject */ @@ -3915,7 +3916,7 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject) "", The_ClassForm[Gbl.Prefs.Theme],Txt_MSG_Content); - Lay_EndTable (); + Tbl_EndTable (); /***** Help for text editor *****/ Lay_HelpPlainEditor (); diff --git a/swad_group.c b/swad_group.c index 68a0f531..186c8ef1 100644 --- a/swad_group.c +++ b/swad_group.c @@ -36,6 +36,7 @@ #include "swad_group.h" #include "swad_notification.h" #include "swad_parameter.h" +#include "swad_table.h" /*****************************************************************************/ /*************************** Internal constants ******************************/ @@ -386,13 +387,13 @@ void Grp_ShowFormToSelectSeveralGroups (Act_Action_t NextAction) Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS); /***** List the groups for each group type *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); for (NumGrpTyp = 0; NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num; NumGrpTyp++) if (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) Grp_ListGrpsForMultipleSelection (&Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp]); - Lay_EndTable (); + Tbl_EndTable (); /***** Free list of groups types and groups in this course *****/ Grp_FreeListGrpTypesAndGrps (); @@ -1243,7 +1244,7 @@ static void Grp_ListGroupTypesForEdition (void) char Id[32]; /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); Grp_WriteHeadingGroupTypes (); /***** List group types with forms for edition *****/ @@ -1321,7 +1322,7 @@ static void Grp_ListGroupTypesForEdition (void) fprintf (Gbl.F.Out,""); Act_FormStartAnchor (ActChgTimGrpTyp,Grp_GROUP_TYPES_SECTION_ID); Grp_PutParamGrpTypCod (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); fprintf (Gbl.F.Out,"" "" "" ""); - Lay_EndTable (); + Tbl_EndTable (); Act_FormEnd (); fprintf (Gbl.F.Out,""); @@ -1360,7 +1361,7 @@ static void Grp_ListGroupTypesForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ @@ -1449,7 +1450,7 @@ static void Grp_ListGroupsForEdition (void) Rol_Role_t Role; /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); Grp_WriteHeadingGroups (); /***** List the groups *****/ @@ -1572,7 +1573,7 @@ static void Grp_ListGroupsForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ @@ -1739,7 +1740,7 @@ void Grp_ShowLstGrpsToChgMyGrps (void) Act_FormStart (ActChgGrp); /***** List the groups the user belongs to for change *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); for (NumGrpTyp = 0; NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num; NumGrpTyp++) @@ -1749,7 +1750,7 @@ void Grp_ShowLstGrpsToChgMyGrps (void) &NumGrpsThisTypeIBelong); NumGrpsIBelong += NumGrpsThisTypeIBelong; } - Lay_EndTable (); + Tbl_EndTable (); /***** End form *****/ if (PutFormToChangeGrps) @@ -2405,7 +2406,7 @@ static void Grp_PutFormToCreateGroupType (void) /***** Open time *****/ fprintf (Gbl.F.Out,""); - Lay_StartTable (2); + Tbl_StartTable (2); fprintf (Gbl.F.Out,"" "" "" ""); - Lay_EndTable (); + Tbl_EndTable (); fprintf (Gbl.F.Out,""); /***** Number of groups of this type *****/ diff --git a/swad_hierarchy.c b/swad_hierarchy.c index 0784d63b..995c6e46 100644 --- a/swad_hierarchy.c +++ b/swad_hierarchy.c @@ -32,6 +32,7 @@ #include "swad_degree.h" #include "swad_global.h" #include "swad_logo.h" +#include "swad_table.h" #include "swad_theme.h" /*****************************************************************************/ @@ -97,7 +98,7 @@ void Hie_WriteMenuHierarchy (void) extern const char *Txt_Course; /***** Start of table *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); /***** Write a 1st selector with all the countries *****/ @@ -172,7 +173,7 @@ void Hie_WriteMenuHierarchy (void) } /***** End of table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_holiday.c b/swad_holiday.c index 5734e85e..ebabedd7 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -34,6 +34,7 @@ #include "swad_global.h" #include "swad_holiday.h" #include "swad_parameter.h" +#include "swad_table.h" #include "swad_text.h" /*****************************************************************************/ @@ -107,7 +108,7 @@ void Hld_SeeHolidays (void) false); // Not closable if (Gbl.Hlds.Num) { - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); fprintf (Gbl.F.Out,""); for (Order = Hld_ORDER_BY_PLACE; Order <= Hld_ORDER_BY_START_DATE; @@ -171,7 +172,7 @@ void Hld_SeeHolidays (void) "", Gbl.Hlds.Lst[NumHld].Name); } - Lay_EndTable (); + Tbl_EndTable (); } else // No holidays created in the current institution Ale_ShowAlert (Ale_INFO,Txt_No_holidays); diff --git a/swad_indicator.c b/swad_indicator.c index 32f7c1d5..f95c3a1a 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -35,6 +35,7 @@ #include "swad_global.h" #include "swad_indicator.h" #include "swad_parameter.h" +#include "swad_table.h" #include "swad_theme.h" /*****************************************************************************/ @@ -113,7 +114,7 @@ void Ind_ReqIndicatorsCourses (void) /***** Form to update indicators *****/ /* Start form and table */ Act_FormStart (ActReqStaCrs); - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /* Scope */ fprintf (Gbl.F.Out,"" @@ -175,7 +176,7 @@ void Ind_ReqIndicatorsCourses (void) ""); /* End table and form */ - Lay_EndTable (); + Tbl_EndTable (); Act_FormEnd (); /***** Show the stats of courses *****/ @@ -593,7 +594,7 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 const char *ClassHighlight = "DAT RIGHT_MIDDLE LIGHT_BLUE"; /***** Write number of courses with each number of indicators valid *****/ - Lay_StartTable (2); + Tbl_StartTable (2); fprintf (Gbl.F.Out,""); if (PutForm) @@ -665,7 +666,7 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 NumCrss, 100.0); - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_institution.c b/swad_institution.c index e611de80..4c6b0607 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -40,6 +40,7 @@ #include "swad_logo.h" #include "swad_parameter.h" #include "swad_QR.h" +#include "swad_table.h" #include "swad_text.h" #include "swad_user.h" @@ -330,7 +331,7 @@ static void Ins_Configuration (bool PrintView) fprintf (Gbl.F.Out,""); /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Country *****/ fprintf (Gbl.F.Out,"" @@ -585,7 +586,7 @@ static void Ins_Configuration (bool PrintView) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** End frame *****/ Box_EndBox (); @@ -677,7 +678,7 @@ static void Ins_ListInstitutions (void) if (Gbl.Inss.Num) // There are institutions in the current country { /***** Start table *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); Ins_PutHeadInstitutionsForSeeing (true); // Order selectable /***** Write all the institutions and their nuber of users *****/ @@ -687,7 +688,7 @@ static void Ins_ListInstitutions (void) Ins_ListOneInstitutionForSeeing (&(Gbl.Inss.Lst[NumIns]),NumIns + 1); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No insrtitutions created in the current country Ale_ShowAlert (Ale_INFO,Txt_No_institutions); @@ -1405,7 +1406,7 @@ static void Ins_ListInstitutionsForEdition (void) Usr_UsrDataConstructor (&UsrDat); /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); Ins_PutHeadInstitutionsForEdition (); /***** Write all the institutions *****/ @@ -1566,7 +1567,7 @@ static void Ins_ListInstitutionsForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); diff --git a/swad_layout.c b/swad_layout.c index 88a12d59..9bc706ec 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1154,47 +1154,6 @@ void Lay_PutContextualCheckbox (Act_Action_t NextAction, // jumping to the next line on narrow screens } -/*****************************************************************************/ -/******************************* Start/end table *****************************/ -/*****************************************************************************/ - -void Lay_StartTable (unsigned CellPadding) - { - fprintf (Gbl.F.Out,""); - } - -void Lay_StartTableCenter (unsigned CellPadding) - { - fprintf (Gbl.F.Out,""); - } - -void Lay_StartTableWide (unsigned CellPadding) - { - fprintf (Gbl.F.Out,"
"); - } - -void Lay_StartTableWideMargin (unsigned CellPadding) - { - fprintf (Gbl.F.Out,"
"); - } - -void Lay_EndTable (void) - { - fprintf (Gbl.F.Out,"
"); - } - /*****************************************************************************/ /****************************** Start/end section ****************************/ /*****************************************************************************/ diff --git a/swad_layout.h b/swad_layout.h index 50e0018b..b69ec65c 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -61,12 +61,6 @@ void Lay_PutContextualCheckbox (Act_Action_t NextAction, bool Checked,bool Disabled, const char *Title,const char *Text); -void Lay_StartTable (unsigned CellPadding); -void Lay_StartTableCenter (unsigned CellPadding); -void Lay_StartTableWide (unsigned CellPadding); -void Lay_StartTableWideMargin (unsigned CellPadding); -void Lay_EndTable (void); - void Lay_StartSection (const char *SectionId); void Lay_EndSection (void); diff --git a/swad_link.c b/swad_link.c index 763347bc..5368cda1 100644 --- a/swad_link.c +++ b/swad_link.c @@ -35,6 +35,7 @@ #include "swad_global.h" #include "swad_link.h" #include "swad_parameter.h" +#include "swad_table.h" #include "swad_text.h" /*****************************************************************************/ @@ -390,7 +391,7 @@ static void Lnk_ListLinksForEdition (void) struct Link *Lnk; /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Table head *****/ Lnk_PutHeadLinks (); @@ -459,7 +460,7 @@ static void Lnk_ListLinksForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_mail.c b/swad_mail.c index 61dd1995..035fa7f0 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -39,6 +39,7 @@ #include "swad_parameter.h" #include "swad_QR.h" #include "swad_tab.h" +#include "swad_table.h" #include "swad_text.h" /*****************************************************************************/ @@ -1197,10 +1198,10 @@ void Mai_ShowFormOthEmail (void) &Gbl.Usrs.Other.UsrDat,NULL); /***** Form with the user's email *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); Mai_ShowFormChangeUsrEmail (&Gbl.Usrs.Other.UsrDat, (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me? - Lay_EndTable (); + Tbl_EndTable (); /***** End frame *****/ Box_EndBox (); diff --git a/swad_message.c b/swad_message.c index a62172b1..a2323ab8 100644 --- a/swad_message.c +++ b/swad_message.c @@ -45,6 +45,7 @@ #include "swad_parameter.h" #include "swad_photo.h" #include "swad_profile.h" +#include "swad_table.h" #include "swad_user.h" /*****************************************************************************/ @@ -283,7 +284,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1]) } /***** Start table *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); /***** "To:" section (recipients) *****/ fprintf (Gbl.F.Out,"" @@ -298,7 +299,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1]) else { /***** Show potential recipients *****/ - Lay_StartTableWide (0); + Tbl_StartTableWide (0); if (ShowUsrsInCrs) { Usr_ListUsersToSelect (Rol_TCH); // All teachers in course @@ -306,7 +307,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1]) Usr_ListUsersToSelect (Rol_STD); // All students in selected groups } Msg_WriteFormUsrsIDsOrNicksOtherRecipients (); // Other users (nicknames) - Lay_EndTable (); + Tbl_EndTable (); } fprintf (Gbl.F.Out,"" @@ -316,7 +317,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1]) Msg_WriteFormSubjectAndContentMsgToUsrs (Content); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Help for text editor and send button *****/ Lay_HelpPlainEditor (); @@ -1827,7 +1828,7 @@ static void Msg_ShowSentOrReceivedMessages (void) &Pagination); /***** Show received / sent messages in this page *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); mysql_data_seek (mysql_res,(my_ulonglong) (Pagination.FirstItemVisible - 1)); for (NumRow = Pagination.FirstItemVisible; @@ -1842,7 +1843,7 @@ static void Msg_ShowSentOrReceivedMessages (void) Msg_ShowASentOrReceivedMessage (NumMsg,MsgCod); } - Lay_EndTable (); + Tbl_EndTable (); /***** Write again links to pages *****/ if (Pagination.MoreThanOnePage) @@ -2579,7 +2580,7 @@ void Msg_ShowFormToFilterMsgs (void) }; /***** Table start *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); /***** Filter authors/recipients *****/ fprintf (Gbl.F.Out,"" @@ -2608,7 +2609,7 @@ void Msg_ShowFormToFilterMsgs (void) Msg_MAX_CHARS_FILTER_CONTENT,Gbl.Msg.FilterContent); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ @@ -2937,7 +2938,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) { fprintf (Gbl.F.Out,"" ""); - Lay_StartTable (2); + Tbl_StartTable (2); /***** Write course origin of message *****/ fprintf (Gbl.F.Out,"" @@ -2956,7 +2957,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) fprintf (Gbl.F.Out,"" ""); - Lay_EndTable (); + Tbl_EndTable (); fprintf (Gbl.F.Out,""); /***** Write "From:" *****/ @@ -3131,7 +3132,7 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,bool Enabled,const char *BgColor bool WriteAuthor = false; /***** Start table *****/ - Lay_StartTable (2); + Tbl_StartTable (2); /***** Start first column *****/ fprintf (Gbl.F.Out,"" @@ -3182,7 +3183,7 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,bool Enabled,const char *BgColor ""); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_notification.c b/swad_notification.c index e92775d9..786db31c 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -45,6 +45,7 @@ #include "swad_notification.h" #include "swad_parameter.h" #include "swad_social.h" +#include "swad_table.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -400,7 +401,7 @@ void Ntf_ShowMyNotifications (void) Usr_UsrDataConstructor (&UsrDat); /***** Start table *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); fprintf (Gbl.F.Out,"" "" "%s" @@ -636,7 +637,7 @@ void Ntf_ShowMyNotifications (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); @@ -1910,7 +1911,7 @@ void Ntf_PutFormChangeNotifSentByEMail (void) Mai_WriteWarningEmailNotifications (); /***** List of notifications *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); fprintf (Gbl.F.Out,"" "" "" @@ -1952,7 +1953,7 @@ void Ntf_PutFormChangeNotifSentByEMail (void) ""); } - Lay_EndTable (); + Tbl_EndTable (); /***** Button to save changes *****/ Btn_PutConfirmButton (Txt_Save_changes); diff --git a/swad_password.c b/swad_password.c index 32a0ccf2..af26358e 100644 --- a/swad_password.c +++ b/swad_password.c @@ -37,6 +37,7 @@ #include "swad_ID.h" #include "swad_password.h" #include "swad_parameter.h" +#include "swad_table.h" #include "swad_user.h" /*****************************************************************************/ @@ -854,9 +855,9 @@ void Pwd_ShowFormOthPwd (void) Usr_PutParamOtherUsrCodEncrypted (); /* New password */ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); Pwd_PutFormToGetNewPasswordTwice (); - Lay_EndTable (); + Tbl_EndTable (); /* End form */ Btn_PutConfirmButton (Txt_Change_password); diff --git a/swad_photo.c b/swad_photo.c index 67e6fd13..befdeeee 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -45,6 +45,7 @@ #include "swad_parameter.h" #include "swad_photo.h" #include "swad_privacy.h" +#include "swad_table.h" #include "swad_theme.h" #include "swad_user.h" @@ -901,7 +902,7 @@ static void Pho_UpdatePhoto2 (void) unsigned NumPhoto; /***** Show the three images resulting of the processing *****/ - Lay_StartTableWide (0); + Tbl_StartTableWide (0); fprintf (Gbl.F.Out,""); for (NumPhoto = 0; NumPhoto < 3; @@ -919,7 +920,7 @@ static void Pho_UpdatePhoto2 (void) Pho_PHOTO_REAL_WIDTH,Pho_PHOTO_REAL_HEIGHT, Txt_PHOTO_PROCESSING_CAPTIONS[NumPhoto]); fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Tbl_EndTable (); /***** Show message *****/ Ale_ShowPendingAlert (); @@ -1696,7 +1697,7 @@ void Pho_ShowOrPrintPhotoDegree (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) Pho_PutIconToPrintDegreeStats, Hlp_STATS_Degrees, false); // Not closable - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); /***** Put a selector for the type of average *****/ Pho_PutSelectorForTypeOfAvg (); @@ -1707,7 +1708,7 @@ void Pho_ShowOrPrintPhotoDegree (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) /***** Put a selector for the order of degrees *****/ Pho_PutSelectorForHowOrderDegrees (); - Lay_EndTable (); + Tbl_EndTable (); break; case Pho_DEGREES_PRINT: /***** Start frame *****/ @@ -2091,7 +2092,7 @@ static void Pho_ShowOrPrintClassPhotoDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrin /***** Form to select type of list used to display degree photos *****/ if (SeeOrPrint == Pho_DEGREES_SEE) Usr_ShowFormsToSelectUsrListType (ActSeePhoDeg); - Lay_StartTableCenter (0); + Tbl_StartTableCenter (0); /***** Get and print degrees *****/ for (NumRow = 0, NumDegsNotEmpty = 0; @@ -2134,7 +2135,7 @@ static void Pho_ShowOrPrintClassPhotoDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrin if (TRIsOpen) fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Tbl_EndTable (); } else // No degrees with students found /***** Show warning indicating no students found *****/ @@ -2176,7 +2177,7 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) Usr_ShowFormsToSelectUsrListType (ActSeePhoDeg); /***** Write heading *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); fprintf (Gbl.F.Out,"" "" "%s" @@ -2248,7 +2249,7 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) } /***** Photos end *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No degrees with students found! /***** Show warning indicating no students found *****/ diff --git a/swad_place.c b/swad_place.c index eb4c1c09..05574615 100644 --- a/swad_place.c +++ b/swad_place.c @@ -35,6 +35,7 @@ #include "swad_global.h" #include "swad_parameter.h" #include "swad_place.h" +#include "swad_table.h" #include "swad_text.h" /*****************************************************************************/ @@ -122,7 +123,7 @@ void Plc_SeePlaces (void) NULL, Hlp_INSTITUTION_Places, false); // Not closable - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); fprintf (Gbl.F.Out,""); for (Order = Plc_ORDER_BY_PLACE; Order <= Plc_ORDER_BY_NUM_CTRS; @@ -196,7 +197,7 @@ void Plc_SeePlaces (void) NumCtrsWithPlc); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Button to create place *****/ if (ICanEdit) @@ -465,7 +466,7 @@ static void Plc_ListPlacesForEdition (void) struct Place *Plc; /***** Write heading *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); Plc_PutHeadPlaces (); /***** Write all the places *****/ @@ -528,7 +529,7 @@ static void Plc_ListPlacesForEdition (void) } /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_record.c b/swad_record.c index 116bedab..b1792ddf 100644 --- a/swad_record.c +++ b/swad_record.c @@ -47,6 +47,7 @@ #include "swad_QR.h" #include "swad_record.h" #include "swad_role.h" +#include "swad_table.h" #include "swad_user.h" /*****************************************************************************/ @@ -1786,7 +1787,7 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView, /***** Header *****/ fprintf (Gbl.F.Out,"" ""); - Lay_StartTableWide (0); + Tbl_StartTableWide (0); fprintf (Gbl.F.Out,"" "", Rec_DEGREE_LOGO_SIZE); @@ -1799,7 +1800,7 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView, "", Gbl.CurrentDeg.Deg.FullName,Gbl.CurrentCrs.Crs.FullName, UsrDat->FullName); - Lay_EndTable (); + Tbl_EndTable (); fprintf (Gbl.F.Out,"" ""); @@ -2355,7 +2356,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, /***** Show email and user's IDs *****/ if (ShowIDRows) { - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /* Show email */ Rec_ShowEmail (UsrDat,ClassForm); @@ -2363,7 +2364,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, /* Show user's IDs */ Rec_ShowUsrIDs (UsrDat,ClassForm,Anchor); - Lay_EndTable (); + Tbl_EndTable (); } /***** Start form *****/ @@ -2417,7 +2418,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, break; } - Lay_StartTableWide (2); + Tbl_StartTableWide (2); if (ShowIDRows) { @@ -2476,7 +2477,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, Rec_ShowOfficePhone (UsrDat,ShowData,ClassForm); } - Lay_EndTable (); + Tbl_EndTable (); /***** Button and end form *****/ switch (TypeOfView) diff --git a/swad_statistic.c b/swad_statistic.c index 961eea1c..f026b5e7 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -52,6 +52,7 @@ #include "swad_social.h" #include "swad_statistic.h" #include "swad_tab.h" +#include "swad_table.h" #include "swad_web_service.h" /*****************************************************************************/ @@ -503,7 +504,7 @@ void Sta_AskShowCrsHits (void) Par_PutHiddenParamLong ("LastRow",0); /***** Put list of users to select some of them *****/ - Lay_StartTableCenter (2); + Tbl_StartTableCenter (2); fprintf (Gbl.F.Out,"" "%s:" "" @@ -595,7 +596,7 @@ void Sta_AskShowCrsHits (void) "" "" ""); - Lay_EndTable (); + Tbl_EndTable (); /***** Hidden param used to get client time zone *****/ Dat_PutHiddenParBrowserTZDiff (); @@ -1653,7 +1654,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql /***** Put heading with backward and forward buttons *****/ fprintf (Gbl.F.Out,"" ""); - Lay_StartTableWide (2); + Tbl_StartTableWide (2); fprintf (Gbl.F.Out,""); /* Put link to jump to previous page (older clicks) */ @@ -1718,7 +1719,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql Act_FormEnd (); fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Tbl_EndTable (); fprintf (Gbl.F.Out,"" ""); @@ -2431,7 +2432,7 @@ static void Sta_DrawBarColors (Sta_ColorType_t ColorType,float HitsMax) unsigned B; /***** Write numbers from 0 to Hits.Max *****/ - Lay_StartTableWide (0); + Tbl_StartTableWide (0); fprintf (Gbl.F.Out,"" "" @@ -2473,7 +2474,7 @@ static void Sta_DrawBarColors (Sta_ColorType_t ColorType,float HitsMax) R,G,B,Gbl.Prefs.IconsURL); } fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_survey.c b/swad_survey.c index 679ec1bb..1e45ccb2 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -39,6 +39,7 @@ #include "swad_parameter.h" #include "swad_role.h" #include "swad_survey.h" +#include "swad_table.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -224,7 +225,7 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst) if (Gbl.Svys.Num) { /***** Table head *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); fprintf (Gbl.F.Out,"" ""); // Column for contextual icons for (Order = Svy_ORDER_BY_START_DATE; @@ -266,7 +267,7 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst) Svy_ShowOneSurvey (Gbl.Svys.LstSvyCods[NumSvy - 1],SvyQst,false); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); } else // No surveys created Ale_ShowAlert (Ale_INFO,Txt_No_surveys); @@ -443,7 +444,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, /***** Start table *****/ if (ShowOnlyThisSvyComplete) - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Write first row of data of this assignment *****/ /* Forms to remove/edit this assignment */ @@ -671,7 +672,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, if (ShowOnlyThisSvyComplete) { /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** End frame *****/ Box_EndBox (); @@ -2673,7 +2674,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, Svy_PutParamQstCod (SvyQst->QstCod); /***** Start table *****/ - Lay_StartTableWide (2); + Tbl_StartTableWide (2); /***** Stem *****/ fprintf (Gbl.F.Out,"" @@ -2722,7 +2723,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, fprintf (Gbl.F.Out,"" "" ""); - Lay_StartTable (2); + Tbl_StartTable (2); for (NumAns = 0; NumAns < Svy_MAX_ANSWERS_PER_QUESTION; NumAns++) @@ -2745,12 +2746,12 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, "" ""); } - Lay_EndTable (); + Tbl_EndTable (); fprintf (Gbl.F.Out,"" ""); /***** End table *****/ - Lay_EndTable (); + Tbl_EndTable (); /***** Send button *****/ if (SvyQst->QstCod > 0) // If the question already has assigned a code @@ -3195,7 +3196,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ } /***** Write the heading *****/ - Lay_StartTableWideMargin (2); + Tbl_StartTableWideMargin (2); fprintf (Gbl.F.Out,""); if (Svy->Status.ICanEdit) fprintf (Gbl.F.Out,""); @@ -3279,7 +3280,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ ""); } - Lay_EndTable (); + Tbl_EndTable (); if (PutFormAnswerSurvey) { @@ -3379,7 +3380,7 @@ static void Svy_WriteAnswersOfAQst (struct Survey *Svy,struct SurveyQuestion *Sv /***** Write the answers *****/ if (NumAnswers) { - Lay_StartTable (5); + Tbl_StartTable (5); for (NumAns = 0; NumAns < NumAnswers; NumAns++) @@ -3443,7 +3444,7 @@ static void Svy_WriteAnswersOfAQst (struct Survey *Svy,struct SurveyQuestion *Sv /* Free memory allocated for the answer */ free ((void *) Answer); } - Lay_EndTable (); + Tbl_EndTable (); } /***** Free structure that stores the query result *****/ diff --git a/swad_table.c b/swad_table.c new file mode 100644 index 00000000..3cec4af5 --- /dev/null +++ b/swad_table.c @@ -0,0 +1,94 @@ +// swad_table.c: tables + +/* + SWAD (Shared Workspace At a Distance), + is a web platform developed at the University of Granada (Spain), + and used to support university teaching. + + This file is part of SWAD core. + Copyright (C) 1999-2017 Antonio Cañas Vargas + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*****************************************************************************/ +/********************************* Headers ***********************************/ +/*****************************************************************************/ + +#include // For fprintf + +#include "swad_table.h" +#include "swad_global.h" + +/*****************************************************************************/ +/************** External global variables from others modules ****************/ +/*****************************************************************************/ + +extern struct Globals Gbl; + +/*****************************************************************************/ +/****************************** Public constants *****************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/***************************** Private constants *****************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/******************************* Private types *******************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/***************************** Private prototypes ****************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/******************************* Start/end table *****************************/ +/*****************************************************************************/ + +void Tbl_StartTable (unsigned CellPadding) + { + fprintf (Gbl.F.Out,""); + } + +void Tbl_StartTableCenter (unsigned CellPadding) + { + fprintf (Gbl.F.Out,""); + } + +void Tbl_StartTableWide (unsigned CellPadding) + { + fprintf (Gbl.F.Out,"
"); + } + +void Tbl_StartTableWideMargin (unsigned CellPadding) + { + fprintf (Gbl.F.Out,"
"); + } + +void Tbl_EndTable (void) + { + fprintf (Gbl.F.Out,"
"); + } diff --git a/swad_table.h b/swad_table.h new file mode 100644 index 00000000..1fab7af8 --- /dev/null +++ b/swad_table.h @@ -0,0 +1,48 @@ +// swad_table.h: tables + +#ifndef _SWAD_TBL +#define _SWAD_TBL +/* + SWAD (Shared Workspace At a Distance in Spanish), + is a web platform developed at the University of Granada (Spain), + and used to support university teaching. + + This file is part of SWAD core. + Copyright (C) 1999-2017 Antonio Cañas Vargas + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*****************************************************************************/ +/********************************* Headers ***********************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/****************************** Public constants *****************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/********************************* Public types ******************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +/****************************** Public prototypes ****************************/ +/*****************************************************************************/ + +void Tbl_StartTable (unsigned CellPadding); +void Tbl_StartTableCenter (unsigned CellPadding); +void Tbl_StartTableWide (unsigned CellPadding); +void Tbl_StartTableWideMargin (unsigned CellPadding); +void Tbl_EndTable (void); + +#endif diff --git a/swad_test.c b/swad_test.c index 2c161bb0..4e64fa8c 100644 --- a/swad_test.c +++ b/swad_test.c @@ -43,6 +43,7 @@ #include "swad_ID.h" #include "swad_image.h" #include "swad_parameter.h" +#include "swad_table.h" #include "swad_theme.h" #include "swad_test.h" #include "swad_test_import.h" @@ -328,7 +329,7 @@ void Tst_ShowFormAskTst (void) { Act_FormStart (ActSeeTst); - Lay_StartTable (2); + Tbl_StartTable (2); /***** Selection of tags *****/ Tst_ShowFormSelTags (NumRows,mysql_res,true,1); @@ -357,7 +358,7 @@ void Tst_ShowFormAskTst (void) "" ""); - Lay_EndTable (); + Tbl_EndTable (); /***** Send button *****/ Btn_PutConfirmButton (Txt_Generate_test); @@ -450,9 +451,9 @@ void Tst_ShowNewTest (void) Par_PutHiddenParamUnsigned ("NumQst",Gbl.Test.NumQsts); /***** List the questions *****/ - Lay_StartTableWideMargin (10); + Tbl_StartTableWideMargin (10); Tst_ShowTestQuestionsWhenSeeing (mysql_res); - Lay_EndTable (); + Tbl_EndTable (); /***** Test result will be saved? *****/ fprintf (Gbl.F.Out,"
1) fprintf (Gbl.F.Out," colspan=\"%u\"",NumCols); fprintf (Gbl.F.Out," class=\"LEFT_TOP\">"); - Lay_StartTable (2); + Tbl_StartTable (2); fprintf (Gbl.F.Out,""); if (!ShowOnlyEnabledTags) fprintf (Gbl.F.Out,""); @@ -1714,7 +1715,7 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res, row[1]); } - Lay_EndTable (); + Tbl_EndTable (); fprintf (Gbl.F.Out,"" ""); } @@ -1860,7 +1861,7 @@ static void Tst_ShowFormConfigTst (void) Act_FormStart (ActRcvCfgTst); /***** Tests are visible from plugins? *****/ - Lay_StartTable (2); + Tbl_StartTable (2); fprintf (Gbl.F.Out,"" "" "%s:" @@ -1893,14 +1894,14 @@ static void Tst_ShowFormConfigTst (void) "", The_ClassForm[Gbl.Prefs.Theme], Txt_No_of_questions); - Lay_StartTable (2); + Tbl_StartTable (2); Tst_PutInputFieldNumQst ("NumQstMin",Txt_minimum, Gbl.Test.Config.Min); // Minimum number of questions Tst_PutInputFieldNumQst ("NumQstDef",Txt_default, Gbl.Test.Config.Def); // Default number of questions Tst_PutInputFieldNumQst ("NumQstMax",Txt_maximum, Gbl.Test.Config.Max); // Maximum number of questions - Lay_EndTable (); + Tbl_EndTable (); fprintf (Gbl.F.Out,"" ""); @@ -1945,7 +1946,7 @@ static void Tst_ShowFormConfigTst (void) } fprintf (Gbl.F.Out,"" ""); - Lay_EndTable (); + Tbl_EndTable (); /***** Send button *****/ Btn_PutConfirmButton (Txt_Save); @@ -2270,7 +2271,7 @@ static void Tst_ShowFormAnswerTypes (unsigned NumCols) if (NumCols > 1) fprintf (Gbl.F.Out," colspan=\"%u\"",NumCols); fprintf (Gbl.F.Out," class=\"LEFT_TOP\">"); - Lay_StartTable (2); + Tbl_StartTable (2); fprintf (Gbl.F.Out,"" "" "