Version19.44.3

This commit is contained in:
Antonio Cañas Vargas 2019-10-26 12:25:27 +02:00
parent 21ac3c4017
commit 17f255aac8
25 changed files with 109 additions and 65 deletions

View File

@ -74,7 +74,7 @@ form
}
address
{
font-style: normal;
font-style:normal;
}
/*********************** Text decoration of links ****************************/
@ -2237,6 +2237,15 @@ a:hover img.CENTRE_PHOTO_SHOW
height:25px;
}
.LIST_I_MUST_READ
{
display:inline-block;
padding:0;
margin:12px 0;
text-align:left;
vertical-align:middle;
}
/******************************* File browsers *******************************/
.FILENAME
{

View File

@ -60,6 +60,7 @@ static unsigned HTM_TR_NestingLevel = 0;
static unsigned HTM_TH_NestingLevel = 0;
static unsigned HTM_TD_NestingLevel = 0;
static unsigned HTM_DIV_NestingLevel = 0;
static unsigned HTM_UL_NestingLevel = 0;
/*****************************************************************************/
/***************************** Private prototypes ****************************/
@ -76,6 +77,8 @@ static void HTM_TD_BeginWithoutAttr (void);
static void HTM_DIV_BeginWithoutAttr (void);
static void HTM_UL_BeginWithoutAttr (void);
/*****************************************************************************/
/******************************* Start/end table *****************************/
/*****************************************************************************/
@ -412,7 +415,7 @@ static void HTM_TD_BeginWithoutAttr (void)
void HTM_TD_End (void)
{
if (HTM_TD_NestingLevel == 0) // No TH open
if (HTM_TD_NestingLevel == 0) // No TD open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened TD.");
fprintf (Gbl.F.Out,"</td>");
@ -490,12 +493,12 @@ static void HTM_DIV_BeginWithoutAttr (void)
void HTM_DIV_End (void)
{
if (HTM_DIV_NestingLevel == 0) // No TH open
if (HTM_DIV_NestingLevel == 0) // No DIV open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened DIV.");
fprintf (Gbl.F.Out,"</div>");
HTM_TD_NestingLevel--;
HTM_DIV_NestingLevel--;
}
/*****************************************************************************/
@ -543,13 +546,51 @@ void HTM_SECTION_End (void)
/*****************************************************************************/
/****************************** Unordered lists ******************************/
/*****************************************************************************/
/*
void HTM_UL_Begin (const char *SectionId)
void HTM_UL_Begin (const char *fmt,...)
{
fprintf (Gbl.F.Out,"<ul id=\"%s\">",SectionId);
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,"<ul %s>",Attr);
free ((void *) Attr);
}
else
HTM_UL_BeginWithoutAttr ();
}
else
HTM_UL_BeginWithoutAttr ();
HTM_UL_NestingLevel++;
}
*/
static void HTM_UL_BeginWithoutAttr (void)
{
fprintf (Gbl.F.Out,"<ul>");
}
void HTM_UL_End (void)
{
if (HTM_UL_NestingLevel == 0) // No UL open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened UL.");
fprintf (Gbl.F.Out,"</ul>");
HTM_UL_NestingLevel--;
}

View File

@ -74,6 +74,7 @@ void HTM_ARTICLE_End (void);
void HTM_SECTION_Begin (const char *SectionId);
void HTM_SECTION_End (void);
void HTM_UL_Begin (const char *fmt,...);
void HTM_UL_End (void);
#endif

View File

@ -223,7 +223,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
HTM_DIV_Begin ("id=\"MFU_actions_big\"");
/***** Write list of frequently used actions *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
HTM_UL_Begin ("class=\"LIST_LEFT\"");
for (NumAct = 0;
NumAct < ListMFUActions->NumActions;
NumAct++)
@ -286,7 +286,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
Frm_EndForm ();
/***** Write list of frequently used actions *****/
fprintf (Gbl.F.Out,"<ul>");
HTM_UL_Begin (NULL);
for (NumAct = 0;
NumAct < ListMFUActions->NumActions;
NumAct++)

View File

@ -144,7 +144,7 @@ static void Ban_WriteListOfBanners (void)
unsigned NumBan;
/***** List start *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
HTM_UL_Begin ("class=\"LIST_LEFT\"");
/***** Write all the banners *****/
for (NumBan = 0;

View File

@ -488,14 +488,13 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.44.3 (2019-10-26)"
#define CSS_FILE "swad19.44.2.css"
#define CSS_FILE "swad19.44.3.css"
#define JS_FILE "swad19.39.js"
/*
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
// TODO: Impedir la creación y edición de proyectos si no son editables.
// TODO: Buscar emparejamientos <ul de HTM_UL_End ();
Version 19.44.3: Oct 26, 2019 Code refactoring in HTML lists. (? lines)
Version 19.44.3: Oct 26, 2019 Code refactoring in HTML lists. (246369 lines)
Version 19.44.2: Oct 26, 2019 Changes in layout. (246318 lines)
Version 19.44.1: Oct 26, 2019 Remove course from project configuration when removing course. (246284 lines)
Version 19.44: Oct 25, 2019 Configuration of all projects.

View File

@ -126,7 +126,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
/***** Begin box *****/
Box_BoxBegin (NULL,Txt_Chat_rooms,NULL,
NULL,Box_NOT_CLOSABLE);
fprintf (Gbl.F.Out,"<ul class=\"LIST_TREE\">");
HTM_UL_Begin ("class=\"LIST_TREE\"");
/***** Title of top level *****/
fprintf (Gbl.F.Out,"<li class=\"DAT\">"

View File

@ -583,7 +583,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Begin box *****/
Box_BoxBegin (NULL,Txt_My_courses,Crs_PutIconToSearchCourses,
Hlp_PROFILE_Courses,Box_NOT_CLOSABLE);
fprintf (Gbl.F.Out,"<ul class=\"LIST_TREE\">");
HTM_UL_Begin ("class=\"LIST_TREE\"");
/***** Write link to platform *****/
Highlight = (Gbl.Hierarchy.Cty.CtyCod <= 0);

View File

@ -111,7 +111,7 @@ void Dat_PutBoxToSelectDateFormat (void)
/***** Form with list of options *****/
Frm_StartForm (ActChgDatFmt);
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
HTM_UL_Begin ("class=\"LIST_LEFT\"");
for (Format = (Dat_Format_t) 0;
Format <= (Dat_Format_t) (Dat_NUM_OPTIONS_FORMAT - 1);
Format++)

View File

@ -952,8 +952,7 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
extern const char *Txt_Eliminate_from_the_platform_the_users_indicated_in_step_1;
/***** Start list of options *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT %s\">",
The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_UL_Begin ("class=\"LIST_LEFT %s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
/***** Register / remove users listed or not listed *****/
if (Gbl.Hierarchy.Level == Hie_CRS) // Course selected
@ -1497,8 +1496,7 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
}
/***** Start list of options *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT %s\">",
The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_UL_Begin ("class=\"LIST_LEFT %s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
/***** Register user in course / Modify user's data *****/
if (Gbl.Hierarchy.Level == Hie_CRS && Gbl.Usrs.Me.Role.Logged >= Rol_STD)

View File

@ -3260,7 +3260,7 @@ static void Brw_FormToChangeCrsGrpZone (void)
Brw_PutHiddenParamFullTreeIfSelected ();
/***** List start *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
HTM_UL_Begin ("class=\"LIST_LEFT\"");
/***** Select the complete course, not a group *****/
fprintf (Gbl.F.Out,"<li class=\"%s\">"

View File

@ -1583,7 +1583,7 @@ static void For_ShowForumList (void)
For_PutFormWhichForums ();
/***** Start list *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_TREE\">");
HTM_UL_Begin ("class=\"LIST_TREE\"");
/***** Links to global forums *****/
For_WriteLinksToGblForums (IsLastItemInLevel);
@ -1758,7 +1758,7 @@ static void For_PutFormWhichForums (void)
Frm_StartForm (ActSeeFor);
For_PutParamForumOrder (Gbl.Forum.ThreadsOrder);
HTM_DIV_Begin ("class=\"SEL_BELOW_TITLE\"");
fprintf (Gbl.F.Out,"<ul>");
HTM_UL_Begin (NULL);
for (ForumSet = (For_ForumSet_t) 0;
ForumSet < For_NUM_FORUM_SETS;

View File

@ -603,8 +603,7 @@ void Inf_WriteMsgYouMustReadInfo (void)
/***** Write every information I must read *****/
HTM_DIV_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\""
" style=\"list-style-type:initial;\">");
HTM_UL_Begin ("class=\"LIST_I_MUST_READ\"");
for (InfoType = (Inf_InfoType_t) 0;
InfoType < Inf_NUM_INFO_TYPES;
InfoType++)

View File

@ -188,7 +188,7 @@ static void Lnk_WriteListOfLinks (void)
unsigned NumLnk;
/***** List start *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
HTM_UL_Begin ("class=\"LIST_LEFT\"");
/***** Write all links *****/
for (NumLnk = 0;

View File

@ -339,8 +339,8 @@ void Mnu_WriteMenuThisTab (void)
bool IsTheSelectedAction;
/***** Menu start *****/
fprintf (Gbl.F.Out,"<nav class=\"MENU_LIST_CONTAINER\">"
"<ul class=\"MENU_LIST\">");
fprintf (Gbl.F.Out,"<nav class=\"MENU_LIST_CONTAINER\">");
HTM_UL_Begin ("class=\"MENU_LIST\"");
/***** Loop to write all options in menu. Each row holds an option *****/
for (NumOptInMenu = 0;

View File

@ -166,7 +166,7 @@ static void Pri_PutFormVisibility (const char *TxtLabel,
HTM_TD_Begin ("class=\"LT\"");
if (Action != ActUnk)
Frm_StartFormAnchor (Action,Pri_PRIVACY_ID);
fprintf (Gbl.F.Out,"<ul class=\"PRI_LIST LIST_LEFT\">");
HTM_UL_Begin ("class=\"PRI_LIST LIST_LEFT\"");
for (Visibility = Pri_VISIBILITY_USER;
Visibility <= Pri_VISIBILITY_WORLD;
Visibility++)

View File

@ -399,7 +399,7 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
/***** Left list *****/
/* Start left list */
HTM_DIV_Begin ("class=\"PRF_FIG_LEFT_CONTAINER\"");
fprintf (Gbl.F.Out,"<ul class=\"PRF_FIG_UL DAT_NOBR_N\">");
HTM_UL_Begin ("class=\"PRF_FIG_UL DAT_NOBR_N\"");
/* Time since first click */
Prf_ShowTimeSinceFirstClick (UsrDat,&UsrFigures);
@ -424,7 +424,7 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
if (!UsrIsBannedFromRanking)
{
/* Start right list */
fprintf (Gbl.F.Out,"<ul class=\"PRF_FIG_UL DAT_NOBR_N\">");
HTM_UL_Begin ("class=\"PRF_FIG_UL DAT_NOBR_N\"");
/* Number of clicks */
Prf_ShowNumClicks (UsrDat,&UsrFigures);

View File

@ -2023,7 +2023,7 @@ static void Prj_ShowTableAllProjectsMembersWithARole (const struct Project *Prj,
if (NumUsrs)
{
/***** Write users *****/
fprintf (Gbl.F.Out,"<ul class=\"PRJ_LST_USR\">");
HTM_UL_Begin ("class=\"PRJ_LST_USR\"");
for (NumUsr = 0;
NumUsr < NumUsrs;

View File

@ -465,9 +465,8 @@ static void Rep_WriteHeader (const struct Rep_Report *Report)
snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Report_of_use_of_PLATFORM,
Cfg_PLATFORM_SHORT_NAME);
fprintf (Gbl.F.Rep,"<h1>%s</h1>"
"<ul>",
Gbl.Title);
fprintf (Gbl.F.Rep,"<h1>%s</h1>",Gbl.Title);
HTM_UL_Begin (NULL);
/***** User *****/
fprintf (Gbl.F.Rep,"<li>%s: <strong>%s</strong></li>",
@ -508,9 +507,9 @@ static void Rep_WriteSectionPlatform (void)
/***** Start section *****/
fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>"
"<ul>",
"<h3>%s</h3>",
Txt_Teaching_platform);
HTM_UL_Begin (NULL);
/***** Platform name *****/
fprintf (Gbl.F.Rep,"<li>%s: %s, %s</li>",
@ -547,9 +546,9 @@ static void Rep_WriteSectionUsrInfo (void)
/***** Start section *****/
fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>"
"<ul>",
"<h3>%s</h3>",
Txt_Personal_information);
HTM_UL_Begin (NULL);
/***** User's name *****/
fprintf (Gbl.F.Rep,"<li>%s: %s</li>",
@ -609,9 +608,9 @@ static void Rep_WriteSectionUsrFigures (const struct Rep_Report *Report)
/***** Start section *****/
fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>"
"<ul>",
"<h3>%s</h3>",
Txt_Figures);
HTM_UL_Begin (NULL);
/***** Time since first click until now *****/
fprintf (Gbl.F.Rep,"<li>%s ",Txt_TIME_Since);
@ -872,8 +871,8 @@ static void Rep_WriteSectionCurrentCourses (struct Rep_Report *Report)
Txt_Courses);
if (Report->CurrentTimeUTC.StrDate[0])
fprintf (Gbl.F.Rep," (%s)",Report->CurrentTimeUTC.StrDate);
fprintf (Gbl.F.Rep,"</h3>"
"<ul>");
fprintf (Gbl.F.Rep,"</h3>");
HTM_UL_Begin (NULL);
/***** Number of courses in which the user is student/teacher *****/
for (Role = Rol_STD;
@ -904,7 +903,7 @@ static void Rep_WriteSectionHistoricCourses (struct Rep_Report *Report)
Txt_Courses,Txt_historical_log);
fprintf (Gbl.F.Rep,Txt_Only_courses_with_more_than_X_clicks_are_shown,
Rep_MIN_CLICKS_CRS);
fprintf (Gbl.F.Rep,"<ul>");
HTM_UL_Begin (NULL);
/********* Historic clicks of a user without course selected ***********/
Rep_GetAndWriteMyHistoricClicsWithoutCrs (Report);

View File

@ -727,7 +727,7 @@ static void Svy_WriteStatus (struct Survey *Svy)
extern const char *Txt_SURVEY_You_have_not_answered;
/***** Start list with items of status *****/
fprintf (Gbl.F.Out,"<ul>");
HTM_UL_Begin (NULL);
/* Write whether survey is visible or hidden */
if (Svy->Status.Visible)

View File

@ -142,7 +142,7 @@ void Syl_PutFormWhichSyllabus (void)
/***** Form to select which syllabus I want to see (lectures/practicals) *****/
Frm_StartForm (ActSeeSyl);
HTM_DIV_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
HTM_UL_Begin ("class=\"LIST_LEFT\"");
for (WhichSyllabus = (Syl_WhichSyllabus_t) 0;
WhichSyllabus < For_NUM_FORUM_SETS;

View File

@ -100,8 +100,8 @@ void Tab_DrawTabs (void)
/***** Start tabs container *****/
HTM_DIV_Begin ("class=\"%s\"",ClassHeadRow3[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"<nav id=\"tabs\">"
"<ul class=\"TAB_LIST\">");
fprintf (Gbl.F.Out,"<nav id=\"tabs\">");
HTM_UL_Begin ("class=\"TAB_LIST\"");
/***** Draw the tabs *****/
for (NumTab = (Tab_Tab_t) 1;

View File

@ -906,7 +906,7 @@ void Tst_ShowTagList (unsigned NumTags,MYSQL_RES *mysql_res)
if (NumTags)
{
/***** Write the tags *****/
fprintf (Gbl.F.Out,"<ul>");
HTM_UL_Begin (NULL);
for (NumTag = 0;
NumTag < NumTags;
NumTag++)
@ -4773,7 +4773,7 @@ void Tst_GetAndWriteTagsQst (long QstCod)
if ((NumRows = Tst_GetTagsQst (QstCod,&mysql_res))) // Result: TagTxt
{
/***** Write the tags *****/
fprintf (Gbl.F.Out,"<ul class=\"TEST_TAG_LIST DAT_SMALL\">");
HTM_UL_Begin ("class=\"TEST_TAG_LIST DAT_SMALL\"");
for (NumRow = 0;
NumRow < NumRows;
NumRow++)

View File

@ -1014,16 +1014,16 @@ static void TL_ShowTimeline (char *Query,
TL_PutLinkToViewNewPublications ();
/* Hidden list where insert just received (not visible) publications via AJAX */
fprintf (Gbl.F.Out,"<ul id=\"just_now_timeline_list\" class=\"TL_LIST\">");
HTM_UL_Begin ("id=\"just_now_timeline_list\" class=\"TL_LIST\"");
HTM_UL_End ();
/* Hidden list where insert new (not visible) publications via AJAX */
fprintf (Gbl.F.Out,"<ul id=\"new_timeline_list\" class=\"TL_LIST\">");
HTM_UL_Begin ("id=\"new_timeline_list\" class=\"TL_LIST\"");
HTM_UL_End ();
}
/***** List recent publications in timeline *****/
fprintf (Gbl.F.Out,"<ul id=\"timeline_list\" class=\"TL_LIST\">");
HTM_UL_Begin ("id=\"timeline_list\" class=\"TL_LIST\"");
for (NumPub = 0, SocPub.PubCod = 0;
NumPub < NumPubsGot;
@ -1057,7 +1057,7 @@ static void TL_ShowTimeline (char *Query,
TL_PutLinkToViewOldPublications ();
/***** Hidden list where insert old publications via AJAX *****/
fprintf (Gbl.F.Out,"<ul id=\"old_timeline_list\" class=\"TL_LIST\">");
HTM_UL_Begin ("id=\"old_timeline_list\" class=\"TL_LIST\"");
HTM_UL_End ();
}
@ -1474,7 +1474,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
{
Box_BoxBegin (NULL,NULL,NULL,
NULL,Box_CLOSABLE);
fprintf (Gbl.F.Out,"<ul class=\"TL_LIST\">");
HTM_UL_Begin ("class=\"TL_LIST\"");
}
/***** Start list item *****/
@ -2317,8 +2317,8 @@ static void TL_PutFormToWriteNewPost (void)
char PhotoURL[PATH_MAX + 1];
/***** Start list *****/
fprintf (Gbl.F.Out,"<ul class=\"TL_LIST\">"
"<li class=\"TL_WIDTH\">");
HTM_UL_Begin ("class=\"TL_LIST\"");
fprintf (Gbl.F.Out,"<li class=\"TL_WIDTH\">");
/***** Left: write author's photo (my photo) *****/
HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\"");
@ -2638,9 +2638,8 @@ static void TL_WriteCommentsInNote (const struct TL_Note *SocNot)
HTM_DIV_End ();
/***** First list with comments initially hidden *****/
fprintf (Gbl.F.Out,"<ul id=\"com_%s\" class=\"LIST_LEFT\""
" style=\"display:none;\">", // Initially hidden
IdComments);
HTM_UL_Begin ("id=\"com_%s\" class=\"LIST_LEFT\" style=\"display:none;\"", // Initially hidden
IdComments);
for (NumCom = 0;
NumCom < NumCommentsInitiallyHidden;
NumCom++)
@ -2658,7 +2657,7 @@ static void TL_WriteCommentsInNote (const struct TL_Note *SocNot)
}
/***** Second list with comments initially visible *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
HTM_UL_Begin ("class=\"LIST_LEFT\"");
for (NumCom = NumCommentsInitiallyHidden;
NumCom < NumComments;
NumCom++)
@ -2743,7 +2742,7 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
HTM_DIV_End ();
HTM_DIV_Begin ("class=\"TL_RIGHT_CONT TL_RIGHT_WIDTH\"");
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
HTM_UL_Begin ("class=\"LIST_LEFT\"");
}
/***** Start list item *****/

View File

@ -8340,8 +8340,7 @@ static void Usr_PutOptionsListUsrs (const bool ICanChooseOption[Usr_LIST_USRS_NU
/***** Write list of options *****/
/* Start list of options */
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT %s\">",
The_ClassFormInBox[Gbl.Prefs.Theme]);
HTM_UL_Begin ("class=\"LIST_LEFT %s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
/* Show option items */
for (Opt = (Usr_ListUsrsOption_t) 1; // Skip unknown option