diff --git a/swad_ID.c b/swad_ID.c index 820bbe0e..a86a7bdc 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -594,7 +594,7 @@ static void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat, Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_ID); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** List existing user's IDs *****/ for (NumID = 0; diff --git a/swad_agenda.c b/swad_agenda.c index 5d10ad14..ad18891a 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -466,7 +466,7 @@ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType) if (Gbl.Agenda.Num) { /***** Start table *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); /***** Table head *****/ Agd_WriteHeaderListEvents (AgendaType); diff --git a/swad_assignment.c b/swad_assignment.c index 93f308a1..088545d9 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -157,7 +157,7 @@ static void Asg_ShowAllAssignments (void) if (Gbl.Asgs.Num) { /***** Table head *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Asg_PutHeadForSeeing (false); // Not print view /***** Write all the assignments *****/ @@ -324,7 +324,7 @@ void Asg_PrintOneAssignment (void) Gbl.Hierarchy.Crs.CrsCod); /***** Table head *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Asg_PutHeadForSeeing (true); // Print view /***** Write assignment *****/ diff --git a/swad_attendance.c b/swad_attendance.c index 68972622..e0624f32 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -237,7 +237,7 @@ static void Att_ShowAllAttEvents (void) if (Gbl.AttEvents.Num) { /***** Table head *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,"" ""); // Column for contextual icons for (Order = Dat_START_TIME; @@ -1875,7 +1875,7 @@ static void Att_ListAttOnlyMeAsStudent (struct AttendanceEvent *Att) Hlp_USERS_Attendance,Box_NOT_CLOSABLE); /* Start table */ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); /* Header */ fprintf (Gbl.F.Out,"" @@ -1962,7 +1962,7 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) Grp_PutParamsCodGrps (); /* Start table */ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); /* Header */ fprintf (Gbl.F.Out,"" @@ -3101,7 +3101,7 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView) } /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Heading row *****/ fprintf (Gbl.F.Out,"" @@ -3232,7 +3232,7 @@ static void Att_ListUsrsAttendanceTable (Att_TypeOfView_t TypeOfView, Lay_StartSection (Att_ATTENDANCE_TABLE_ID); /***** Start table *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); /***** Heading row *****/ Att_WriteTableHeadSeveralAttEvents (); @@ -3535,11 +3535,11 @@ static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat) fprintf (Gbl.F.Out,""); /***** Write user's ID ******/ - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,"" "", UsrDat->FirstName); + fprintf (Gbl.F.Out,"
", + Gbl.RowEvenOdd); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"" "" - "" - "
", - Gbl.RowEvenOdd, UsrDat->Accepted ? "DAT_N" : "DAT"); ID_WriteUsrIDs (UsrDat,NULL); @@ -3553,11 +3553,11 @@ static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat) if (UsrDat->Surname2[0]) fprintf (Gbl.F.Out," %s",UsrDat->Surname2); fprintf (Gbl.F.Out,", %s
" - "
"); + fprintf (Gbl.F.Out,"" + ""); /***** List the events with students *****/ for (NumAttEvent = 0, UniqueId = 1; diff --git a/swad_banner.c b/swad_banner.c index d04b2035..9e383d42 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -404,7 +404,7 @@ static void Ban_ListBannersForEdition (void) char *Anchor = NULL; /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Table head *****/ Ban_PutHeadBanners (); diff --git a/swad_box.c b/swad_box.c index 3a492c09..91d1f97c 100644 --- a/swad_box.c +++ b/swad_box.c @@ -79,7 +79,7 @@ void Box_StartBoxTable (const char *Width,const char *Title, { Box_StartBox (Width,Title,FunctionToDrawContextualIcons, HelpLink,Closable); - Tbl_StartTableWide (CellPadding); + Tbl_StartTableWidePadding (CellPadding); } void Box_StartBoxTableShadow (const char *Width,const char *Title, @@ -90,7 +90,7 @@ void Box_StartBoxTableShadow (const char *Width,const char *Title, Box_StartBoxShadow (Width,Title, FunctionToDrawContextualIcons, HelpLink); - Tbl_StartTableWide (CellPadding); + Tbl_StartTableWidePadding (CellPadding); } void Box_StartBox (const char *Width,const char *Title, diff --git a/swad_centre.c b/swad_centre.c index a251ce9f..d44db9fc 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -405,7 +405,7 @@ static void Ctr_Configuration (bool PrintView) } /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Institution *****/ fprintf (Gbl.F.Out,"" @@ -810,7 +810,7 @@ static void Ctr_ListCentres (void) if (Gbl.Hierarchy.Ins.Ctrs.Num) // There are centres in the current institution { /***** Start table *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Ctr_PutHeadCentresForSeeing (true); // Order selectable /***** Write all the centres and their nuber of teachers *****/ @@ -1483,7 +1483,7 @@ static void Ctr_ListCentresForEdition (void) Usr_UsrDataConstructor (&UsrDat); /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Ctr_PutHeadCentresForEdition (); /***** Write all the centres *****/ diff --git a/swad_changelog.h b/swad_changelog.h index c1b08799..09e27df4 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -464,6 +464,8 @@ https://oficinavirtual.ugr.es/awc/horario/ve_horario/visor.jsp?programa=M37156&s contiene una de las que yo imparto. Así que me imagino que te esperarás la sugerencia (petición con café o cerveza como recompensa): ¿sería posible que en la pestaña de horario se pudiese embeber esa página? (Creo que los grados usan algo parecido también.) */ + +// TODO: Mostrar cifras sobre partidas (matches) en el apartado Figures > Games. // TODO: En resultados de test y de juegos, en preguntas modificadas se podría mostrar la puntuación obtenida en la pregunta (ahora no sale) // TODO: Al crear un nuevo juego, debería irse a la pantalla de añadir preguntas (la misma opción que sale cuando pulsas en editar un juego existente) @@ -485,12 +487,14 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.30.3 (2019-10-03)" +#define Log_PLATFORM_VERSION "SWAD 19.30.5 (2019-10-03)" #define CSS_FILE "swad19.29.css" #define JS_FILE "swad19.30.js" /* // TODO: Perico: poner un candado de bloqueo de creación/edición de proyectos (por ejemplo en asignaturas obsoletas) + Version 19.30.5: Oct 03, 2019 Code refactoring in HTML tables. (246922 lines) + Version 19.30.4: Oct 03, 2019 Code refactoring in HTML tables. (246897 lines) Version 19.30.3: Oct 03, 2019 Changes in help links. (246895 lines) Version 19.30.2: Oct 03, 2019 Changes in edition of games. (246914 lines) Version 19.30.1: Oct 01, 2019 Changes in match playing. (246904 lines) diff --git a/swad_classroom.c b/swad_classroom.c index dde3d503..7d7fc930 100644 --- a/swad_classroom.c +++ b/swad_classroom.c @@ -114,7 +114,7 @@ void Cla_SeeClassrooms (void) /***** Table head *****/ Box_StartBox (NULL,Txt_Classrooms,Cla_PutIconsListingClassrooms, Hlp_CENTRE_Classrooms,Box_NOT_CLOSABLE); - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,""); for (Order = (Cla_Order_t) 0; Order <= (Cla_Order_t) (Cla_NUM_ORDERS - 1); @@ -474,7 +474,7 @@ static void Cla_ListClassroomsForEdition (void) struct Classroom *Cla; /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Cla_PutHeadClassrooms (); /***** Write all the classrooms *****/ diff --git a/swad_country.c b/swad_country.c index af5bf8f7..b2a39df0 100644 --- a/swad_country.c +++ b/swad_country.c @@ -322,7 +322,7 @@ static void Cty_Configuration (bool PrintView) } /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Country name (an link to WWW if exists) *****/ fprintf (Gbl.F.Out,"" @@ -1600,7 +1600,7 @@ static void Cty_ListCountriesForEdition (void) Lan_Language_t Lan; /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Cty_PutHeadCountriesForEdition (); /***** Write all the countries *****/ diff --git a/swad_course.c b/swad_course.c index c4a1e199..1243f5cc 100644 --- a/swad_course.c +++ b/swad_course.c @@ -235,7 +235,7 @@ static void Crs_Configuration (bool PrintView) Gbl.Hierarchy.Crs.FullName); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Degree *****/ fprintf (Gbl.F.Out,"" @@ -1165,7 +1165,7 @@ static void Crs_ListCourses (void) if (Gbl.Hierarchy.Deg.Crss.Num) // There are courses in the current degree { /***** Start table *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Crs_PutHeadCoursesForSeeing (); /***** List the courses *****/ @@ -1430,7 +1430,7 @@ static void Crs_ListCoursesForEdition (void) unsigned Year; /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Crs_PutHeadCoursesForEdition (); /***** List the courses *****/ diff --git a/swad_date.c b/swad_date.c index 1f0b0709..d9bdaba5 100644 --- a/swad_date.c +++ b/swad_date.c @@ -549,8 +549,8 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id, /***** Start table *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,""); /***** Year *****/ fprintf (Gbl.F.Out,"" - "
" @@ -664,8 +664,8 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id, } /***** End table *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); /***** Hidden field with UTC time (seconds since 1970) used to send time *****/ fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); /***** Year *****/ fprintf (Gbl.F.Out,""); /***** End table *****/ - fprintf (Gbl.F.Out,"" - "
" @@ -894,8 +894,8 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear, "
"); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index 2366b2a8..c01f52be 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -339,7 +339,7 @@ static void Deg_Configuration (bool PrintView) fprintf (Gbl.F.Out,""); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Centre *****/ fprintf (Gbl.F.Out,"" @@ -705,7 +705,7 @@ static void Deg_ListDegreesForEdition (void) Usr_UsrDataConstructor (&UsrDat); /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Deg_PutHeadDegreesForEdition (); /***** List the degrees *****/ @@ -1183,7 +1183,7 @@ static void Deg_ListDegrees (void) if (Gbl.Hierarchy.Ctr.Degs.Num) // There are degrees in the current centre { /***** Write heading *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Deg_PutHeadDegreesForSeeing (); /***** List the degrees *****/ diff --git a/swad_degree_type.c b/swad_degree_type.c index fc6a7dca..1ef1eb79 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -215,7 +215,7 @@ static void DT_ListDegreeTypes (Act_Action_t NextAction,DT_Order_t SelectedOrder if (Gbl.DegTypes.Num) { /***** Write heading *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); DT_PutHeadDegreeTypesForSeeing (NextAction,SelectedOrder); /***** List current degree types for seeing *****/ @@ -391,7 +391,7 @@ static void DT_ListDegreeTypesForEdition (void) unsigned NumDegTyp; /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); DT_PutHeadDegreeTypesForEdition (); /***** List degree types with forms for edition *****/ diff --git a/swad_department.c b/swad_department.c index ecaf7322..04dfa185 100644 --- a/swad_department.c +++ b/swad_department.c @@ -492,7 +492,7 @@ static void Dpt_ListDepartmentsForEdition (void) unsigned NumIns; /***** Start table *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); /***** Write heading *****/ Dpt_PutHeadDepartments (); diff --git a/swad_duplicate.c b/swad_duplicate.c index 753500f1..7fbebaf3 100644 --- a/swad_duplicate.c +++ b/swad_duplicate.c @@ -159,7 +159,7 @@ void Dup_ListDuplicateUsrs (void) Usr_UsrDataConstructor (&UsrDat); /***** Start table *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); /***** Heading row with column names *****/ Gbl.Usrs.Listing.WithPhotos = true; @@ -292,7 +292,7 @@ static void Dup_ListSimilarUsrs (void) Usr_UsrDataConstructor (&UsrDat); /***** Start table *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); /***** Heading row with column names *****/ Gbl.Usrs.Listing.WithPhotos = true; diff --git a/swad_enrolment.c b/swad_enrolment.c index ba194156..c0dbf102 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -927,7 +927,7 @@ static void Enr_PutAreaToEnterUsrsIDs (void) extern const char *Txt_List_of_nicks_emails_or_IDs; /***** Text area for users' IDs *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); fprintf (Gbl.F.Out,"" "" "" @@ -2291,7 +2291,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) /***** Selection of scope and roles *****/ /* Start form and table */ Frm_StartForm (ActUpdSignUpReq); - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); /* Scope (whole platform, current centre, current degree or current course) */ fprintf (Gbl.F.Out,"" @@ -2801,7 +2801,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) Usr_UsrDataConstructor (&UsrDat); /* Start table */ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); fprintf (Gbl.F.Out,"" "" "%s" diff --git a/swad_figure.c b/swad_figure.c index f99468ba..b24e5352 100644 --- a/swad_figure.c +++ b/swad_figure.c @@ -1606,7 +1606,7 @@ static void Fig_GetAndShowFileBrowsersStats (void) Hlp_ANALYTICS_Figures_folders_and_files,Box_NOT_CLOSABLE); /***** Write sizes of all file zones *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); Fig_WriteStatsExpTreesTableHead1 (); for (NumStat = 0; NumStat < Fig_NUM_STAT_CRS_FILE_ZONES; @@ -1617,7 +1617,7 @@ static void Fig_GetAndShowFileBrowsersStats (void) Tbl_EndTable (); /***** Write sizes of all file zones per course *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); Fig_WriteStatsExpTreesTableHead2 (); for (NumStat = 0; NumStat < Fig_NUM_STAT_CRS_FILE_ZONES; @@ -1628,7 +1628,7 @@ static void Fig_GetAndShowFileBrowsersStats (void) Tbl_EndTable (); /***** Write sizes of all file zones per user *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); Fig_WriteStatsExpTreesTableHead3 (); for (NumStat = 0; NumStat < Fig_NUM_STAT_CRS_FILE_ZONES; diff --git a/swad_file_browser.c b/swad_file_browser.c index 7d6ef926..fb8cb316 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -5589,10 +5589,10 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, /***** Indentation depending on level, icon, and file/folder name *****/ /* Start column */ fprintf (Gbl.F.Out,"" - "" - "", + " style=\"width:99%%;\">", Gbl.RowEvenOdd); + fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,""); /* Indent depending on level */ if (Level) @@ -5628,9 +5628,9 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, Brw_WriteFileName (Level,FileMetadata.IsPublic); /* End column */ - fprintf (Gbl.F.Out,"" - "
" - ""); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); if (AdminMarks) /***** Header and footer rows *****/ @@ -5818,9 +5818,9 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level, const char *FileBrowserId,const char *RowId, Brw_IconTree_t IconThisRow) { - fprintf (Gbl.F.Out,"" - "" - ""); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Brw_IndentDependingOnLevel (Level); /***** Icon to expand/contract *****/ @@ -5854,9 +5854,9 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level, } fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "
" - "
"); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ @@ -8506,8 +8506,8 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow) FileNameToShow); /***** URL *****/ - fprintf (Gbl.F.Out,"" - "" + fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"" "" - "" - "
" "
", + "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Save_as,Txt_optional, Brw_MAX_CHARS_FOLDER); + fprintf (Gbl.F.Out,""); /***** Send button and end box *****/ Box_EndBoxWithButton (Btn_CREATE_BUTTON,Txt_Create_link); diff --git a/swad_forum.c b/swad_forum.c index 59dafce5..07b8c96d 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1031,7 +1031,7 @@ static void For_ShowPostsOfAThread (Ale_AlertType_t AlertType,const char *Messag &PaginationPsts); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Show posts from this page, the author and the date of last reply *****/ mysql_data_seek (mysql_res,(my_ulonglong) (PaginationPsts.FirstItemVisible - 1)); @@ -2559,7 +2559,7 @@ static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted, &PaginationThrs); /***** Heading row *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,"" "" "" // Column for contextual icons @@ -3958,7 +3958,7 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject) } /***** Subject and content *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); // If writing a reply to a message of an existing thread ==> write subject /* Subject */ diff --git a/swad_game.c b/swad_game.c index 0e6fe16e..0890604b 100644 --- a/swad_game.c +++ b/swad_game.c @@ -209,7 +209,7 @@ static void Gam_ListAllGames (void) if (Gbl.Games.Num) { /***** Table head *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,""); if (Gam_CheckIfICanEditGames ()) fprintf (Gbl.F.Out,""); // Column for contextual icons @@ -394,7 +394,7 @@ void Gam_ShowOneGame (long GamCod, /***** Start table *****/ if (ShowOnlyThisGame) - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Start first row of this game *****/ fprintf (Gbl.F.Out,""); @@ -1633,7 +1633,7 @@ static void Gam_ListOneOrMoreQuestionsForEdition (long GamCod,unsigned NumQsts, MaxQstInd = Gam_GetMaxQuestionIndexInGame (GamCod); /***** Write the heading *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,"" "" "" diff --git a/swad_group.c b/swad_group.c index b2dc3092..3ecb9d70 100644 --- a/swad_group.c +++ b/swad_group.c @@ -397,7 +397,7 @@ void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void), Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS); /***** List the groups for each group type *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); for (NumGrpTyp = 0; NumGrpTyp < Gbl.Crs.Grps.GrpTypes.Num; NumGrpTyp++) @@ -1285,7 +1285,7 @@ static void Grp_ListGroupTypesForEdition (void) char Id[32]; /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Grp_WriteHeadingGroupTypes (); /***** List group types with forms for edition *****/ @@ -1363,7 +1363,7 @@ static void Grp_ListGroupTypesForEdition (void) fprintf (Gbl.F.Out,""); Frm_StartFormAnchor (ActChgTimGrpTyp,Grp_GROUP_TYPES_SECTION_ID); Grp_PutParamGrpTypCod (Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); fprintf (Gbl.F.Out,"" "" ""); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,"" "" ""); for (Order = Hld_ORDER_BY_PLACE; Order <= Hld_ORDER_BY_START_DATE; diff --git a/swad_indicator.c b/swad_indicator.c index 3f9396a8..84ad9cc4 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -117,7 +117,7 @@ void Ind_ReqIndicatorsCourses (void) /***** Form to update indicators *****/ /* Start form and table */ Frm_StartForm (ActReqStaCrs); - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /* Scope */ fprintf (Gbl.F.Out,"" @@ -630,7 +630,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 *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,""); if (PutForm) diff --git a/swad_institution.c b/swad_institution.c index 1ac81562..0546d2e5 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -353,7 +353,7 @@ static void Ins_Configuration (bool PrintView) fprintf (Gbl.F.Out,""); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Country *****/ fprintf (Gbl.F.Out,"" @@ -704,7 +704,7 @@ static void Ins_ListInstitutions (void) if (Gbl.Hierarchy.Cty.Inss.Num) // There are institutions in the current country { /***** Start table *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Ins_PutHeadInstitutionsForSeeing (true); // Order selectable /***** Write all the institutions and their nuber of users *****/ @@ -1470,7 +1470,7 @@ static void Ins_ListInstitutionsForEdition (void) Usr_UsrDataConstructor (&UsrDat); /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Ins_PutHeadInstitutionsForEdition (); /***** Write all the institutions *****/ diff --git a/swad_layout.c b/swad_layout.c index ea85f052..61db23b5 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1681,8 +1681,8 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto, fprintf (Gbl.F.Out,""); /***** End table *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_link.c b/swad_link.c index d2821031..a7f2ee98 100644 --- a/swad_link.c +++ b/swad_link.c @@ -410,7 +410,7 @@ static void Lnk_ListLinksForEdition (void) struct Link *Lnk; /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Table head *****/ Lnk_PutHeadLinks (); diff --git a/swad_mail.c b/swad_mail.c index 87511d0a..c36615b9 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -1258,7 +1258,7 @@ static void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe, UsrDat->UsrCod); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** List emails *****/ for (NumEmail = 1; diff --git a/swad_match.c b/swad_match.c index dc178a87..97f45185 100644 --- a/swad_match.c +++ b/swad_match.c @@ -368,7 +368,7 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game, bool ICanEditMatches = Mch_CheckIfICanEditMatches (); /***** Write the heading *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Mch_ListOneOrMoreMatchesHeading (ICanEditMatches); /***** Write rows *****/ @@ -2481,7 +2481,7 @@ static void Mch_ShowQuestionAndAnswersStd (struct Match *Match) NumOptions = Tst_GetNumAnswersQst (Match->Status.QstCod); /***** Start table *****/ - Tbl_StartTableWide (8); + Tbl_StartTableWidePadding (8); for (NumOpt = 0; NumOpt < NumOptions; @@ -3146,7 +3146,7 @@ static void Mch_DrawBarNumUsrs (unsigned NumAnswerersAns,unsigned NumAnswerersQs (float) NumAnswerersQst) + 0.5); /***** Bar proportional to number of users *****/ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); fprintf (Gbl.F.Out,""); for (i = 0; i < 100; diff --git a/swad_match_result.c b/swad_match_result.c index 96576687..3a6203c4 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -204,7 +204,7 @@ void McR_SelUsrsToViewUsrsMchResults (void) Grp_PutParamsCodGrps (); /***** Put list of users to select some of them *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); fprintf (Gbl.F.Out,"" "" "%s:" @@ -212,7 +212,7 @@ void McR_SelUsrsToViewUsrsMchResults (void) "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Users, The_ClassFormInBox[Gbl.Prefs.Theme]); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); Usr_ListUsersToSelect (Rol_TCH); Usr_ListUsersToSelect (Rol_NET); Usr_ListUsersToSelect (Rol_STD); @@ -773,7 +773,7 @@ void McR_ShowOneMchResult (void) Gbl.Hierarchy.Crs.CrsCod); /***** Start table *****/ - Tbl_StartTableWideMargin (10); + Tbl_StartTableWideMarginPadding (10); /***** Header row *****/ /* Get data of the user who answer the match */ diff --git a/swad_message.c b/swad_message.c index 87ca908f..81337eed 100644 --- a/swad_message.c +++ b/swad_message.c @@ -287,7 +287,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1]) } /***** Start table *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); /***** "To:" section (recipients) *****/ fprintf (Gbl.F.Out,"" @@ -302,7 +302,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1]) else { /***** Show potential recipients *****/ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); if (ShowUsrsInCrs) { Usr_ListUsersToSelect (Rol_TCH); // All teachers in course @@ -1812,7 +1812,7 @@ static void Msg_ShowSentOrReceivedMessages (void) &Pagination); /***** Show received / sent messages in this page *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); mysql_data_seek (mysql_res,(my_ulonglong) (Pagination.FirstItemVisible - 1)); for (NumRow = Pagination.FirstItemVisible; @@ -2642,7 +2642,7 @@ void Msg_ShowFormToFilterMsgs (void) }; /***** Start table *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); /***** Filter authors/recipients *****/ fprintf (Gbl.F.Out,"" @@ -2999,7 +2999,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) { fprintf (Gbl.F.Out,"" ""); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); /***** Write course origin of message *****/ fprintf (Gbl.F.Out,"" @@ -3191,7 +3191,7 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,bool Enabled,const char *BgColor bool WriteAuthor = false; /***** Start table *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); /***** Start first column *****/ fprintf (Gbl.F.Out,"" @@ -3349,8 +3349,8 @@ static void Msg_WriteMsgFrom (struct UsrData *UsrDat,bool Deleted) char PhotoURL[PATH_MAX + 1]; /***** Put an icon to show if user has read the message *****/ - fprintf (Gbl.F.Out,"" - "" + fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"" "" - "
" "\"%s\"" - "
"); + ""); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_network.c b/swad_network.c index 36239a6f..de58bcef 100644 --- a/swad_network.c +++ b/swad_network.c @@ -292,7 +292,7 @@ void Net_ShowFormMyWebsAndSocialNets (void) Hlp_PROFILE_Webs,Box_NOT_CLOSABLE); /***** Start table *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); /***** Start form *****/ Frm_StartFormAnchor (ActChgMyNet,Net_MY_WEBS_ID); diff --git a/swad_nickname.c b/swad_nickname.c index 7fc97bc7..9f87272a 100644 --- a/swad_nickname.c +++ b/swad_nickname.c @@ -258,7 +258,7 @@ static void Nck_ShowFormChangeUsrNickname (const struct UsrData *UsrDat,bool Its Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_nickname); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** List nicknames *****/ for (NumNick = 1; diff --git a/swad_notification.c b/swad_notification.c index 80685e88..09ece265 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -393,7 +393,7 @@ void Ntf_ShowMyNotifications (void) Usr_UsrDataConstructor (&UsrDat); /***** Start table *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,"" "" "%s" @@ -1938,7 +1938,7 @@ void Ntf_PutFormChangeNotifSentByEMail (void) Mai_WriteWarningEmailNotifications (); /***** List of notifications *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); fprintf (Gbl.F.Out,"" "" "" diff --git a/swad_password.c b/swad_password.c index d7e43e14..d63792c3 100644 --- a/swad_password.c +++ b/swad_password.c @@ -680,7 +680,7 @@ void Pwd_ShowFormChgMyPwd (void) } /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Current password *****/ if (IHaveAPasswordInDB) // If I have a password in database... @@ -852,7 +852,7 @@ void Pwd_ShowFormChgOtherUsrPwd (void) Usr_PutParamOtherUsrCodEncrypted (); /* New password */ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Pwd_PutFormToGetNewPasswordTwice (); Tbl_EndTable (); diff --git a/swad_photo.c b/swad_photo.c index 801d728a..a2dfb958 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -891,7 +891,7 @@ static void Pho_UpdatePhoto2 (void) Ale_ShowLastAlertAndButton1 (); /***** Show the three images resulting of the processing *****/ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); fprintf (Gbl.F.Out,""); for (NumPhoto = 0; NumPhoto < 3; @@ -1718,7 +1718,7 @@ void Pho_ShowOrPrintPhotoDegree (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) /***** Start box *****/ Box_StartBox (NULL,Txt_Degrees,Pho_PutIconToPrintDegreeStats, Hlp_ANALYTICS_Degrees,Box_NOT_CLOSABLE); - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); /***** Put a selector for the type of average *****/ Pho_PutSelectorForTypeOfAvg (); @@ -2121,7 +2121,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 (Pho_PutParamsDegPhoto); - Tbl_StartTableCenter (0); + Tbl_StartTableCenter (); /***** Get and print degrees *****/ for (NumDeg = 0, NumDegsNotEmpty = 0; @@ -2204,7 +2204,7 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint) Usr_ShowFormsToSelectUsrListType (Pho_PutParamsDegPhoto); /***** Write heading *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); fprintf (Gbl.F.Out,"" "" "%s" diff --git a/swad_place.c b/swad_place.c index 1eec42eb..1705342e 100644 --- a/swad_place.c +++ b/swad_place.c @@ -113,7 +113,7 @@ void Plc_SeePlaces (void) /***** Table head *****/ Box_StartBox (NULL,Txt_Places,Plc_PutIconsListingPlaces, Hlp_INSTITUTION_Places,Box_NOT_CLOSABLE); - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,""); for (Order = Plc_ORDER_BY_PLACE; Order <= Plc_ORDER_BY_NUM_CTRS; @@ -512,7 +512,7 @@ static void Plc_ListPlacesForEdition (void) struct Place *Plc; /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Plc_PutHeadPlaces (); /***** Write all the places *****/ diff --git a/swad_plugin.c b/swad_plugin.c index 6eb98e47..0bbd680e 100644 --- a/swad_plugin.c +++ b/swad_plugin.c @@ -382,7 +382,7 @@ static void Plg_ListPluginsForEdition (void) struct Plugin *Plg; /***** Write heading *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Plg_PutHeadPlugins (); /***** Write all the plugins *****/ diff --git a/swad_project.c b/swad_project.c index d1bb4dfc..561c4ee7 100644 --- a/swad_project.c +++ b/swad_project.c @@ -242,7 +242,7 @@ void Prj_ShowTableAllProjects (void) Prj_AllocMemProject (&Prj); /***** Table head *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); Prj_ShowTableAllProjectsHead (); /***** Write all the projects *****/ @@ -325,7 +325,7 @@ static void Prj_ShowProjectsInCurrentPage (void) Prj_AllocMemProject (&Prj); /***** Table head *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Prj_ShowProjectsHead (Prj_LIST_PROJECTS); /***** Write all the projects *****/ @@ -906,7 +906,7 @@ static void Prj_PutIconsToLockUnlockAllProjects (void) void Prj_ShowOneUniqueProject (struct Project *Prj) { /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Write project head *****/ Prj_ShowProjectsHead (Prj_FILE_BROWSER_PROJECT); @@ -940,7 +940,7 @@ void Prj_PrintOneProject (void) Gbl.Hierarchy.Crs.CrsCod); /***** Table head *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); Prj_ShowProjectsHead (Prj_PRINT_ONE_PROJECT); /***** Write project *****/ @@ -1702,7 +1702,7 @@ static void Prj_ShowOneProjectMembersWithARole (const struct Project *Prj, } /***** Start table with all members with this role *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); /***** Write users *****/ for (NumUsr = 0; diff --git a/swad_record.c b/swad_record.c index e4da2501..cf411bde 100644 --- a/swad_record.c +++ b/swad_record.c @@ -1749,7 +1749,7 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView, /***** Write heading *****/ fprintf (Gbl.F.Out,"" ""); - Tbl_StartTableWide (0); + Tbl_StartTableWide (); fprintf (Gbl.F.Out,"" "", Rec_DEGREE_LOGO_SIZE); @@ -2291,7 +2291,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, /***** Show email and user's IDs *****/ if (ShowIDRows) { - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /* Show email */ Rec_ShowEmail (UsrDat,ClassForm); @@ -2353,7 +2353,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, break; } - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); if (ShowIDRows) { diff --git a/swad_statistic.c b/swad_statistic.c index c98d1147..60a918ea 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -374,19 +374,19 @@ void Sta_AskShowCrsHits (void) Par_PutHiddenParamLong ("LastRow",0); /***** Put list of users to select some of them *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); fprintf (Gbl.F.Out,"" "%s:" "" - "" - "", + "" + fprintf (Gbl.F.Out,"
", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Users, The_ClassFormInBox[Gbl.Prefs.Theme]); + fprintf (Gbl.F.Out,""); Usr_ListUsersToSelect (Rol_TCH); Usr_ListUsersToSelect (Rol_NET); Usr_ListUsersToSelect (Rol_STD); - fprintf (Gbl.F.Out,"
" - "
"); + fprintf (Gbl.F.Out,"" ""); /***** Initial and final dates of the search *****/ @@ -1582,7 +1582,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql /***** Put heading with backward and forward buttons *****/ fprintf (Gbl.F.Out,"" ""); - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); fprintf (Gbl.F.Out,""); /* Put link to jump to previous page (older clicks) */ @@ -2371,7 +2371,7 @@ static void Sta_DrawBarColors (Sta_ColorType_t ColorType,float HitsMax) unsigned B; /***** Write numbers from 0 to Hits.Max *****/ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); fprintf (Gbl.F.Out,"" "" @@ -4124,7 +4124,7 @@ void Sta_GetAndShowLastClicks (void) " OR actions.Language IS NULL"); // When action is not present in table of actions /***** Write list of connected users *****/ - Tbl_StartTableCenter (1); + Tbl_StartTableCenterPadding (1); fprintf (Gbl.F.Out,"" "" diff --git a/swad_survey.c b/swad_survey.c index 36eb5c0b..26880575 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -244,7 +244,7 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst) if (Gbl.Svys.Num) { /***** Table head *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,"" ""); // Column for contextual icons for (Order = Svy_ORDER_BY_START_DATE; @@ -456,7 +456,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, /***** Start table *****/ if (ShowOnlyThisSvyComplete) - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Write first row of data of this assignment *****/ /* Forms to remove/edit this assignment */ @@ -2675,7 +2675,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, Svy_PutParamQstCod (SvyQst->QstCod); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Stem *****/ fprintf (Gbl.F.Out,"" @@ -2724,7 +2724,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst, fprintf (Gbl.F.Out,"" "" ""); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); for (NumAns = 0; NumAns < Svy_MAX_ANSWERS_PER_QUESTION; NumAns++) @@ -3188,7 +3188,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy, } /***** Write the heading *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,""); if (Svy->Status.ICanEdit) fprintf (Gbl.F.Out,""); @@ -3379,7 +3379,7 @@ static void Svy_WriteAnswersOfAQst (struct Survey *Svy, Lay_ShowErrorAndExit ("Wrong number of answers."); /* Write one row for each answer */ - Tbl_StartTable (5); + Tbl_StartTablePadding (5); for (NumAns = 0; NumAns < NumAnswers; NumAns++) diff --git a/swad_table.c b/swad_table.c index 5d4ff2b1..048ac727 100644 --- a/swad_table.c +++ b/swad_table.c @@ -56,36 +56,60 @@ extern struct Globals Gbl; /******************************* Start/end table *****************************/ /*****************************************************************************/ -void Tbl_StartTable (unsigned CellPadding) +void Tbl_StartTablePadding (unsigned CellPadding) { - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"", + CellPadding); // CellPadding must be 0, 1, 2, 5 or 10 + else + Tbl_StartTable (); } -void Tbl_StartTableCenter (unsigned CellPadding) +void Tbl_StartTable (void) { - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); } -void Tbl_StartTableWide (unsigned CellPadding) +void Tbl_StartTableCenterPadding (unsigned CellPadding) { - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
", + CellPadding); // CellPadding must be 0, 1, 2, 5 or 10 + else + Tbl_StartTableCenter (); } -void Tbl_StartTableWideMargin (unsigned CellPadding) +void Tbl_StartTableCenter (void) + { + fprintf (Gbl.F.Out,"
"); + } + +void Tbl_StartTableWidePadding (unsigned CellPadding) { - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
", + CellPadding); // CellPadding must be 0, 1, 2, 5 or 10 + else + Tbl_StartTableWide (); + } + +void Tbl_StartTableWide (void) + { + fprintf (Gbl.F.Out,"
"); + } + +void Tbl_StartTableWideMarginPadding (unsigned CellPadding) + { + if (CellPadding) + fprintf (Gbl.F.Out,"
", + CellPadding); // CellPadding must be 0, 1, 2, 5 or 10 + else + Tbl_StartTableWideMargin (); + } + +void Tbl_StartTableWideMargin (void) + { + fprintf (Gbl.F.Out,"
"); } void Tbl_EndTable (void) diff --git a/swad_table.h b/swad_table.h index 4e730010..6b726e7c 100644 --- a/swad_table.h +++ b/swad_table.h @@ -39,10 +39,18 @@ /****************************** Public prototypes ****************************/ /*****************************************************************************/ -void Tbl_StartTable (unsigned CellPadding); -void Tbl_StartTableCenter (unsigned CellPadding); -void Tbl_StartTableWide (unsigned CellPadding); -void Tbl_StartTableWideMargin (unsigned CellPadding); +void Tbl_StartTablePadding (unsigned CellPadding); +void Tbl_StartTable (void); + +void Tbl_StartTableCenterPadding (unsigned CellPadding); +void Tbl_StartTableCenter (void); + +void Tbl_StartTableWidePadding (unsigned CellPadding); +void Tbl_StartTableWide (void); + +void Tbl_StartTableWideMarginPadding (unsigned CellPadding); +void Tbl_StartTableWideMargin (void); + void Tbl_EndTable (void); void Tbl_PutEmptyCells (unsigned NumColumns); diff --git a/swad_test.c b/swad_test.c index 27b7af8e..12698588 100644 --- a/swad_test.c +++ b/swad_test.c @@ -344,7 +344,7 @@ void Tst_ShowFormAskTst (void) { Frm_StartForm (ActSeeTst); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); /***** Selection of tags *****/ Tst_ShowFormSelTags (NumRows,mysql_res,true,1); @@ -464,7 +464,7 @@ void Tst_ShowNewTest (void) Par_PutHiddenParamUnsigned ("NumQst",Gbl.Test.NumQsts); /***** List the questions *****/ - Tbl_StartTableWideMargin (10); + Tbl_StartTableWideMarginPadding (10); Tst_ShowTestQuestionsWhenSeeing (mysql_res); Tbl_EndTable (); @@ -565,7 +565,7 @@ void Tst_AssessTest (void) } /***** Write answers and solutions *****/ - Tbl_StartTableWideMargin (10); + Tbl_StartTableWideMarginPadding (10); Tst_ShowTestResultAfterAssess (TstCod,&NumQstsNotBlank,&TotalScore); Tbl_EndTable (); @@ -1298,7 +1298,7 @@ void Tst_ShowFormAskEditTsts (void) Frm_StartForm (ActLstTstQst); Par_PutHiddenParamUnsigned ("Order",(unsigned) Tst_ORDER_STEM); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); /***** Selection of tags *****/ Tst_ShowFormSelTags (NumRows,mysql_res,false,2); @@ -1354,7 +1354,7 @@ void Tst_ShowFormAskSelectTstsForGame (void) Frm_StartForm (ActGamLstTstQst); Gam_PutParams (); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); /***** Selection of tags *****/ Tst_ShowFormSelTags (NumRows,mysql_res,false,2); @@ -1704,7 +1704,7 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res, if (NumCols > 1) fprintf (Gbl.F.Out," colspan=\"%u\"",NumCols); fprintf (Gbl.F.Out," class=\"LEFT_TOP\">"); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,""); if (!ShowOnlyEnabledTags) fprintf (Gbl.F.Out,""); @@ -1909,7 +1909,7 @@ static void Tst_ShowFormConfigTst (void) Frm_StartForm (ActRcvCfgTst); /***** Tests are visible from plugins? *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,"" "" "" "" "" "" ""); Tst_WriteHeadUserCorrect (UsrDat); fprintf (Gbl.F.Out,""); @@ -3721,7 +3721,7 @@ static void Tst_WriteChoiceAnsViewTest (unsigned NumQst,long QstCod,bool Shuffle */ /***** Start table *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); for (NumOpt = 0; NumOpt < Gbl.Test.Answer.NumOptions; @@ -3839,7 +3839,7 @@ static void Tst_WriteChoiceAnsAssessTest (struct UsrData *UsrDat, Tst_ComputeScoreQst (Indexes,AnswersUsr,ScoreThisQst,AnswerIsNotBlank); /***** Start table *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,""); Tst_WriteHeadUserCorrect (UsrDat); fprintf (Gbl.F.Out,"" @@ -4196,7 +4196,7 @@ static void Tst_WriteChoiceAnsViewMatch (long MchCod,unsigned QstInd,long QstCod Mch_GetIndexes (MchCod,QstInd,Indexes); /***** Start table *****/ - Tbl_StartTableWide (2); + Tbl_StartTableWidePadding (2); /***** Show one row for each option *****/ for (NumOpt = 0; @@ -4314,7 +4314,7 @@ static void Tst_WriteTextAnsAssessTest (struct UsrData *UsrDat, } /***** Header with the title of each column *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,""); Tst_WriteHeadUserCorrect (UsrDat); fprintf (Gbl.F.Out,""); @@ -4368,7 +4368,7 @@ static void Tst_WriteTextAnsAssessTest (struct UsrData *UsrDat, Gbl.Test.Config.Feedback == Tst_FEEDBACK_FULL_FEEDBACK) { fprintf (Gbl.F.Out,""); Tst_WriteHeadUserCorrect (UsrDat); fprintf (Gbl.F.Out,""); @@ -4602,7 +4602,7 @@ static void Tst_WriteFloatAnsAssessTest (struct UsrData *UsrDat, } /***** Header with the title of each column *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,""); Tst_WriteHeadUserCorrect (UsrDat); fprintf (Gbl.F.Out,""); @@ -5067,7 +5067,7 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], Tst_PutParamQstCod (); /***** Start table *****/ - Tbl_StartTable (2); // Table for this question + Tbl_StartTablePadding (2); // Table for this question /***** Help for text editor *****/ fprintf (Gbl.F.Out,"" @@ -5086,7 +5086,7 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], "" "" "" "" ""); @@ -6880,7 +6880,7 @@ void Usr_ListAllDataStds (void) } /***** Start table with list of students *****/ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); if (!Gbl.Usrs.ClassPhoto.AllGroups) { fprintf (Gbl.F.Out,"" @@ -7102,7 +7102,7 @@ void Usr_ListAllDataTchs (void) NumColumns = Usr_NUM_ALL_FIELDS_DATA_TCH; /***** Start table with lists of teachers *****/ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); /***** List teachers and non-editing teachers *****/ Gbl.RowEvenOdd = 0; @@ -7382,8 +7382,8 @@ void Usr_ListDataAdms (void) fprintf (Gbl.F.Out,""); /***** Heading row with column names *****/ - fprintf (Gbl.F.Out,"
" "%s:" @@ -1942,7 +1942,7 @@ static void Tst_ShowFormConfigTst (void) "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_No_of_questions); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); Tst_PutInputFieldNumQst ("NumQstMin",Txt_minimum, Gbl.Test.Config.Min); // Minimum number of questions Tst_PutInputFieldNumQst ("NumQstDef",Txt_default, @@ -2323,7 +2323,7 @@ static void Tst_ShowFormAnswerTypes (unsigned NumCols) if (NumCols > 1) fprintf (Gbl.F.Out," colspan=\"%u\"",NumCols); fprintf (Gbl.F.Out," class=\"LEFT_TOP\">"); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,"
" "
" @@ -3078,7 +3078,7 @@ static void Tst_ListOneOrMoreQuestionsForSelection (unsigned long NumRows, Gam_PutParams (); /***** Write the heading *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); fprintf (Gbl.F.Out,"
" @@ -3375,7 +3375,7 @@ void Tst_WriteAnswersEdit (long QstCod) case Tst_ANS_UNIQUE_CHOICE: case Tst_ANS_MULTIPLE_CHOICE: case Tst_ANS_TEXT: - Tbl_StartTable (2); + Tbl_StartTablePadding (2); for (NumOpt = 0; NumOpt < Gbl.Test.Answer.NumOptions; NumOpt++) @@ -3653,7 +3653,7 @@ static void Tst_WriteTFAnsAssessTest (struct UsrData *UsrDat, } /***** Header with the title of each column *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,"
"); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); for (NumOpt = 0; NumOpt < Gbl.Test.Answer.NumOptions; @@ -4477,7 +4477,7 @@ static void Tst_WriteIntAnsAssessTest (struct UsrData *UsrDat, Lay_ShowErrorAndExit ("Wrong integer answer."); /***** Header with the title of each column *****/ - Tbl_StartTable (2); + Tbl_StartTablePadding (2); fprintf (Gbl.F.Out,"
", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Tags); - Tbl_StartTable (2); // Table for tags + Tbl_StartTablePadding (2); // Table for tags for (NumTag = 0; NumTag < Tst_MAX_TAGS_PER_QUESTION; @@ -5268,7 +5268,7 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1], fprintf (Gbl.F.Out,"
"); - Tbl_StartTable (2); // Table with choice answers + Tbl_StartTablePadding (2); // Table with choice answers OptionsDisabled = Gbl.Test.AnswerType != Tst_ANS_UNIQUE_CHOICE && Gbl.Test.AnswerType != Tst_ANS_MULTIPLE_CHOICE && @@ -7451,7 +7451,7 @@ void Tst_SelUsrsToViewUsrsTstResults (void) Grp_PutParamsCodGrps (); /***** Put list of users to select some of them *****/ - Tbl_StartTableCenter (2); + Tbl_StartTableCenterPadding (2); fprintf (Gbl.F.Out,"
" "%s:" @@ -7459,7 +7459,7 @@ void Tst_SelUsrsToViewUsrsTstResults (void) "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Users, The_ClassFormInBox[Gbl.Prefs.Theme]); - Tbl_StartTable (2); + Tbl_StartTablePadding (2); Usr_ListUsersToSelect (Rol_TCH); Usr_ListUsersToSelect (Rol_NET); Usr_ListUsersToSelect (Rol_STD); @@ -8105,7 +8105,7 @@ void Tst_ShowOneTstResult (void) Gbl.Hierarchy.Crs.CrsCod); /***** Start table *****/ - Tbl_StartTableWideMargin (10); + Tbl_StartTableWideMarginPadding (10); /***** Header row *****/ /* Get data of the user who made the test */ diff --git a/swad_test_import.c b/swad_test_import.c index 7b885160..e2ca422f 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -531,7 +531,7 @@ static void TsI_ImportQuestionsFromXMLBuffer (const char *XMLBuffer) /* Current element is */ /***** Write heading of list of imported questions *****/ - Tbl_StartTableWideMargin (2); + Tbl_StartTableWideMarginPadding (2); TsI_WriteHeadingListImportedQst (); /***** For each question... *****/ diff --git a/swad_user.c b/swad_user.c index d8b55cc8..f3496b39 100644 --- a/swad_user.c +++ b/swad_user.c @@ -6218,7 +6218,7 @@ void Usr_PutFormToSelectUsrsToGoToAct (Act_Action_t NextAction,void (*FuncParams Brw_PutHiddenParamFullTreeIfSelected (); /* Put list of users to select some of them */ - Tbl_StartTableCenter (0); + Tbl_StartTableCenter (); Usr_ListUsersToSelect (Rol_TCH); Usr_ListUsersToSelect (Rol_NET); Usr_ListUsersToSelect (Rol_STD); @@ -6732,7 +6732,7 @@ void Usr_ListAllDataGsts (void) NumColumnsCommonCard = Usr_NUM_ALL_FIELDS_DATA_GST; /***** Start table with list of guests *****/ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); /* Start row */ fprintf (Gbl.F.Out,"
" - ""); + fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,""); for (NumCol = 0; NumCol < Usr_NUM_MAIN_FIELDS_DATA_ADM; NumCol++) @@ -7873,7 +7873,7 @@ void Usr_SeeGuests (void) Frm_StartForm (ActDoActOnSevGst); /* Start table */ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); /* Draw the classphoto/list */ switch (Gbl.Usrs.Me.ListType) @@ -8040,7 +8040,7 @@ void Usr_SeeStudents (void) } /* Start table */ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); /* Draw the classphoto/list */ switch (Gbl.Usrs.Me.ListType) @@ -8214,7 +8214,7 @@ void Usr_SeeTeachers (void) } /* Start table */ - Tbl_StartTableWide (0); + Tbl_StartTableWide (); /***** Draw the classphoto/list *****/ switch (Gbl.Usrs.Me.ListType) @@ -8746,7 +8746,7 @@ void Usr_SeeGstClassPhotoPrn (void) Gbl.Scope.Current == Hie_INS) ? Gbl.Hierarchy.Ins.InsCod : -1L, -1L,-1L); - Tbl_StartTableWide (0); + Tbl_StartTableWide (); Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN, Rol_GST,false); Tbl_EndTable (); @@ -8794,7 +8794,7 @@ void Usr_SeeStdClassPhotoPrn (void) -1L, Gbl.Scope.Current == Hie_CRS ? Gbl.Hierarchy.Crs.CrsCod : -1L); - Tbl_StartTableWide (0); + Tbl_StartTableWide (); Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN, Rol_STD,false); Tbl_EndTable (); @@ -8861,7 +8861,7 @@ void Usr_SeeTchClassPhotoPrn (void) -1L, Gbl.Scope.Current == Hie_CRS ? Gbl.Hierarchy.Crs.CrsCod : -1L); - Tbl_StartTableWide (0); + Tbl_StartTableWide (); /* List teachers and non-editing teachers */ Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,