From a897bd234c9c879e4612f6fee0f7e5068b661466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 2 Nov 2019 12:59:31 +0100 Subject: [PATCH] Version19.51 --- swad_HTML.c | 55 ++++++++++++++++++++++++++ swad_HTML.h | 3 ++ swad_ID.c | 7 ++-- swad_account.c | 10 +++-- swad_agenda.c | 9 +++-- swad_announcement.c | 3 +- swad_assignment.c | 14 ++++--- swad_attendance.c | 22 ++++++----- swad_centre.c | 16 +++++--- swad_changelog.h | 4 +- swad_cookie.c | 4 +- swad_course.c | 17 +++++--- swad_date.c | 11 ++++-- swad_degree.c | 12 ++++-- swad_enrolment.c | 44 +++++++++++---------- swad_exam.c | 30 ++++++++++----- swad_figure.c | 7 ++-- swad_file_browser.c | 29 +++++++------- swad_forum.c | 10 +++-- swad_game.c | 6 ++- swad_group.c | 11 +++--- swad_hierarchy.c | 15 +++++--- swad_indicator.c | 12 ++++-- swad_info.c | 11 +++--- swad_institution.c | 12 ++++-- swad_layout.c | 2 +- swad_logo.c | 4 +- swad_mail.c | 11 +++--- swad_mark.c | 8 ++-- swad_match.c | 7 ++-- swad_message.c | 31 +++++++-------- swad_network.c | 4 +- swad_nickname.c | 12 +++--- swad_password.c | 30 ++++++++------- swad_photo.c | 13 ++++--- swad_privacy.c | 4 +- swad_profile.c | 4 +- swad_project.c | 16 +++++--- swad_record.c | 69 ++++++++++++++++++--------------- swad_role.c | 8 ++-- swad_search.c | 6 +-- swad_statistic.c | 33 +++++++++------- swad_survey.c | 32 ++++++++------- swad_syllabus.c | 4 +- swad_test.c | 94 ++++++++++++++++++++++++--------------------- swad_test_import.c | 4 +- swad_timetable.c | 30 +++++++-------- swad_user.c | 29 +++++++------- 48 files changed, 495 insertions(+), 334 deletions(-) diff --git a/swad_HTML.c b/swad_HTML.c index 5f84df2f..6f6b9877 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -64,6 +64,7 @@ static unsigned HTM_UL_NestingLevel = 0; static unsigned HTM_LI_NestingLevel = 0; static unsigned HTM_A_NestingLevel = 0; static unsigned HTM_SCRIPT_NestingLevel = 0; +static unsigned HTM_LABEL_NestingLevel = 0; static unsigned HTM_TEXTAREA_NestingLevel = 0; /*****************************************************************************/ @@ -86,6 +87,8 @@ static void HTM_LI_BeginWithoutAttr (void); static void HTM_A_BeginWithoutAttr (void); +static void HTM_LABEL_BeginWithoutAttr (void); + static void HTM_TEXTAREA_BeginWithoutAttr (void); /*****************************************************************************/ @@ -736,6 +739,58 @@ void HTM_SCRIPT_End (void) HTM_SCRIPT_NestingLevel--; } +/*****************************************************************************/ +/*********************************** Labels **********************************/ +/*****************************************************************************/ + +void HTM_LABEL_Begin (const char *fmt,...) + { + va_list ap; + int NumBytesPrinted; + char *Attr; + + if (fmt) + { + if (fmt[0]) + { + va_start (ap,fmt); + NumBytesPrinted = vasprintf (&Attr,fmt,ap); + va_end (ap); + + if (NumBytesPrinted < 0) // If memory allocation wasn't possible, + // or some other error occurs, + // vasprintf will return -1 + Lay_NotEnoughMemoryExit (); + + /***** Print HTML *****/ + fprintf (Gbl.F.Out,"