Version19.42.3

This commit is contained in:
Antonio Cañas Vargas 2019-10-23 21:37:01 +02:00
parent 8824f0ba48
commit 6f566c2ab8
21 changed files with 153 additions and 112 deletions

View File

@ -59,6 +59,7 @@ static unsigned HTM_TABLE_NestingLevel = 0;
static unsigned HTM_TR_NestingLevel = 0;
static unsigned HTM_TH_NestingLevel = 0;
static unsigned HTM_TD_NestingLevel = 0;
static unsigned HTM_DIV_NestingLevel = 0;
/*****************************************************************************/
/***************************** Private prototypes ****************************/
@ -73,6 +74,8 @@ static void HTM_TH_BeginAttr (const char *fmt,...);
static void HTM_TD_BeginWithoutAttr (void);
static void HTM_DIV_BeginWithoutAttr (void);
/*****************************************************************************/
/******************************* Start/end table *****************************/
/*****************************************************************************/
@ -447,7 +450,50 @@ void HTM_TD_ColouredEmpty (unsigned NumColumns)
/************************************ Divs ***********************************/
/*****************************************************************************/
void HTM_DIV_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,"<div %s>",Attr);
free ((void *) Attr);
}
else
HTM_DIV_BeginWithoutAttr ();
}
else
HTM_DIV_BeginWithoutAttr ();
HTM_DIV_NestingLevel++;
}
static void HTM_DIV_BeginWithoutAttr (void)
{
fprintf (Gbl.F.Out,"<div>");
}
void HTM_DIV_End (void)
{
if (HTM_DIV_NestingLevel == 0) // No TH open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened DIV.");
fprintf (Gbl.F.Out,"</div>");
HTM_TD_NestingLevel--;
}

View File

@ -62,6 +62,7 @@ void HTM_TD_End (void);
void HTM_TD_Empty (unsigned NumColumns);
void HTM_TD_ColouredEmpty (unsigned NumColumns);
void HTM_DIV_Begin (const char *fmt,...);
void HTM_DIV_End (void);
#endif

View File

@ -116,7 +116,7 @@ void Acc_ShowFormMyAccount (void)
else // Not logged
{
/***** Links to other actions *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
Usr_PutLinkToLogin ();
Pwd_PutLinkToSendNewPasswd ();
Lan_PutLinkToChangeLanguage ();
@ -189,7 +189,7 @@ void Acc_CheckIfEmptyAccountExists (void)
MYSQL_ROW row;
/***** Links to other actions *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
Usr_PutLinkToLogin ();
Pwd_PutLinkToSendNewPasswd ();
Lan_PutLinkToChangeLanguage ();
@ -325,7 +325,7 @@ static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct UsrD
void Acc_ShowFormCreateMyAccount (void)
{
/***** Links to other actions *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
Usr_PutLinkToLogin ();
Pwd_PutLinkToSendNewPasswd ();
Lan_PutLinkToChangeLanguage ();
@ -486,16 +486,16 @@ void Acc_ShowFormChgMyAccount (void)
}
/***** Start container for this user *****/
fprintf (Gbl.F.Out,"<div class=\"REC_USR\">");
HTM_DIV_Begin ("class=\"REC_USR\"");
/***** Show form to change my password and my nickname ****/
fprintf (Gbl.F.Out,"<div class=\"REC_LEFT\">");
HTM_DIV_Begin ("class=\"REC_LEFT\"");
Pwd_ShowFormChgMyPwd ();
Nck_ShowFormChangeMyNickname (IMustCreateMyNicknameNow);
HTM_DIV_End ();
/***** Show form to change my email and my ID *****/
fprintf (Gbl.F.Out,"<div class=\"REC_RIGHT\">");
HTM_DIV_Begin ("class=\"REC_RIGHT\"");
Mai_ShowFormChangeMyEmail (IMustFillInMyEmailNow,IShouldConfirmMyEmailNow);
ID_ShowFormChangeMyID (IShouldFillInMyIDNow);
HTM_DIV_End ();
@ -525,16 +525,16 @@ void Acc_ShowFormChgOtherUsrAccount (void)
&Gbl.Usrs.Other.UsrDat,NULL);
/***** Start container for this user *****/
fprintf (Gbl.F.Out,"<div class=\"REC_USR\">");
HTM_DIV_Begin ("class=\"REC_USR\"");
/***** Show form to change password and nickname *****/
fprintf (Gbl.F.Out,"<div class=\"REC_LEFT\">");
HTM_DIV_Begin ("class=\"REC_LEFT\"");
Pwd_ShowFormChgOtherUsrPwd ();
Nck_ShowFormChangeOtherUsrNickname ();
HTM_DIV_End ();
/***** Show form to change email and ID *****/
fprintf (Gbl.F.Out,"<div class=\"REC_RIGHT\">");
HTM_DIV_Begin ("class=\"REC_RIGHT\"");
Mai_ShowFormChangeOtherUsrEmail ();
ID_ShowFormChangeOtherUsrID ();
HTM_DIV_End ();

View File

@ -193,9 +193,9 @@ static void Agd_ShowFormToSelPast__FutureEvents (void)
PstFut <= Agd_FUTURE_EVENTS;
PstFut++)
{
fprintf (Gbl.F.Out,"<div class=\"%s\">",
(Gbl.Agenda.Past__FutureEvents & (1 << PstFut)) ? "PREF_ON" :
"PREF_OFF");
HTM_DIV_Begin ("class=\"%s\"",
(Gbl.Agenda.Past__FutureEvents & (1 << PstFut)) ? "PREF_ON" :
"PREF_OFF");
Frm_StartForm (ActSeeMyAgd);
Agd_PutParamsMyAgenda (Gbl.Agenda.Past__FutureEvents ^ (1 << PstFut), // Toggle
Gbl.Agenda.PrivatPublicEvents,
@ -229,9 +229,9 @@ static void Agd_ShowFormToSelPrivatPublicEvents (void)
PrvPub <= Agd_PUBLIC_EVENTS;
PrvPub++)
{
fprintf (Gbl.F.Out,"<div class=\"%s\">",
(Gbl.Agenda.PrivatPublicEvents & (1 << PrvPub)) ? "PREF_ON" :
"PREF_OFF");
HTM_DIV_Begin ("class=\"%s\"",
(Gbl.Agenda.PrivatPublicEvents & (1 << PrvPub)) ? "PREF_ON" :
"PREF_OFF");
Frm_StartForm (ActSeeMyAgd);
Agd_PutParamsMyAgenda (Gbl.Agenda.Past__FutureEvents,
Gbl.Agenda.PrivatPublicEvents ^ (1 << PrvPub), // Toggle
@ -265,9 +265,9 @@ static void Agd_ShowFormToSelHiddenVisiblEvents (void)
HidVis <= Agd_VISIBL_EVENTS;
HidVis++)
{
fprintf (Gbl.F.Out,"<div class=\"%s\">",
(Gbl.Agenda.HiddenVisiblEvents & (1 << HidVis)) ? "PREF_ON" :
"PREF_OFF");
HTM_DIV_Begin ("class=\"%s\"",
(Gbl.Agenda.HiddenVisiblEvents & (1 << HidVis)) ? "PREF_ON" :
"PREF_OFF");
Frm_StartForm (ActSeeMyAgd);
Agd_PutParamsMyAgenda (Gbl.Agenda.Past__FutureEvents,
Gbl.Agenda.PrivatPublicEvents,
@ -772,11 +772,9 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod)
/* Location */
HTM_TD_Begin ("class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<div class=\"%s\">"
"%s",
AgdEvent.Hidden ? "ASG_TITLE_LIGHT" :
"ASG_TITLE",
AgdEvent.Location);
HTM_DIV_Begin ("class=\"%s\"",AgdEvent.Hidden ? "ASG_TITLE_LIGHT" :
"ASG_TITLE");
fprintf (Gbl.F.Out,"%s",AgdEvent.Location);
HTM_DIV_End ();
HTM_TD_End ();
@ -805,11 +803,9 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod)
Str_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
HTM_TD_Begin ("colspan=\"2\" class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<div class=\"PAR %s\">"
"%s",
AgdEvent.Hidden ? "DAT_LIGHT" :
"DAT",
Txt);
HTM_DIV_Begin ("class=\"PAR %s\"",AgdEvent.Hidden ? "DAT_LIGHT" :
"DAT");
fprintf (Gbl.F.Out,"%s",Txt);
HTM_DIV_End ();
HTM_TD_End ();

View File

@ -413,12 +413,12 @@ static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Tx
fprintf (Gbl.F.Out," id=\"%s\"",IdAlert);
}
fprintf (Gbl.F.Out," class=\"CM\">");
fprintf (Gbl.F.Out,"<div class=\"ALERT\">");
HTM_DIV_Begin ("class=\"ALERT\"");
/***** Icon to close the alert *****/
if (AlertClosable[AlertType])
{
fprintf (Gbl.F.Out,"<div class=\"ALERT_CLOSE\">");
HTM_DIV_Begin ("class=\"ALERT_CLOSE\"");
fprintf (Gbl.F.Out,"<a href=\"\""
" onclick=\"toggleDisplay('%s');return false;\" />"
"<img src=\"%s/close.svg\""

View File

@ -234,7 +234,7 @@ void Ann_ShowMyAnnouncementsNotMarkedAsSeen (void)
/***** Show the announcements *****/
if (NumAnnouncements)
{
fprintf (Gbl.F.Out,"<div class=\"CM\">");
HTM_DIV_Begin ("class=\"CM\"");
for (NumAnn = 0;
NumAnn < NumAnnouncements;
@ -303,8 +303,7 @@ static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status,
Gbl.Announcements.AnnCod = AnnCod; // Parameter for forms
/***** Start yellow note *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">",
ContainerClass[Status]);
HTM_DIV_Begin ("class=\"%s\"",ContainerClass[Status]);
if (ICanEdit)
{
@ -324,17 +323,17 @@ static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status,
}
/***** Write the subject of the announcement *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">",SubjectClass[Status]);
HTM_DIV_Begin ("class=\"%s\"",SubjectClass[Status]);
fprintf (Gbl.F.Out,"%s",Subject);
HTM_DIV_End ();
/***** Write the content of the announcement *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">",ContentClass[Status]);
HTM_DIV_Begin ("class=\"%s\"",ContentClass[Status]);
fprintf (Gbl.F.Out,"%s",Content);
HTM_DIV_End ();
/***** Write form *****/
fprintf (Gbl.F.Out,"<div class=\"NOTICE_USERS %s\">",UsersClass[Status]);
HTM_DIV_Begin ("class=\"NOTICE_USERS %s\"",UsersClass[Status]);
if (ShowAllAnnouncements)
{

View File

@ -443,9 +443,8 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
HTM_TD_Begin ("colspan=\"2\" class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
if (Gbl.Crs.Grps.NumGrps)
Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (&Asg);
fprintf (Gbl.F.Out,"<div class=\"PAR %s\">",
Asg.Hidden ? "DAT_LIGHT" :
"DAT");
HTM_DIV_Begin ("class=\"PAR %s\"",Asg.Hidden ? "DAT_LIGHT" :
"DAT");
fprintf (Gbl.F.Out,"%s",Txt);
HTM_DIV_End ();
HTM_TD_End ();
@ -1632,12 +1631,10 @@ static void Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (struct Assignment *Asg)
Asg->AsgCod);
/***** Write heading *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">",
Asg->Hidden ? "ASG_GRP_LIGHT" :
"ASG_GRP");
fprintf (Gbl.F.Out,"%s: ",
(NumRows == 1) ? Txt_Group :
Txt_Groups);
HTM_DIV_Begin ("class=\"%s\"",Asg->Hidden ? "ASG_GRP_LIGHT" :
"ASG_GRP");
fprintf (Gbl.F.Out,"%s: ",(NumRows == 1) ? Txt_Group :
Txt_Groups);
/***** Write groups *****/
if (NumRows) // Groups found...

View File

@ -172,14 +172,14 @@ void Att_SeeAttEvents (void)
switch (Gbl.Usrs.Me.Role.Logged)
{
case Rol_STD:
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
Att_PutFormToListMyAttendance ();
HTM_DIV_End ();
break;
case Rol_NET:
case Rol_TCH:
case Rol_SYS_ADM:
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
Att_PutFormToListStdsAttendance ();
HTM_DIV_End ();
break;
@ -481,9 +481,8 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
HTM_TD_Begin ("colspan=\"2\" class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
if (Gbl.Crs.Grps.NumGrps)
Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (Att);
fprintf (Gbl.F.Out,"<div class=\"%s\">",
Att->Hidden ? "DAT_LIGHT" :
"DAT");
HTM_DIV_Begin ("class=\"%s\"",Att->Hidden ? "DAT_LIGHT" :
"DAT");
fprintf (Gbl.F.Out,"%s",Description);
HTM_DIV_End ();
HTM_TD_End ();
@ -1523,9 +1522,8 @@ static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct AttendanceEve
Att->AttCod);
/***** Write heading *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">",
Att->Hidden ? "ASG_GRP_LIGHT" :
"ASG_GRP");
HTM_DIV_Begin ("class=\"%s\"",Att->Hidden ? "ASG_GRP_LIGHT" :
"ASG_GRP");
fprintf (Gbl.F.Out,"%s: ",
(NumGrps == 1) ? Txt_Group :
Txt_Groups);

View File

@ -1045,7 +1045,7 @@ void Ban_WriteMenuWithBanners (void)
NumBan++)
{
/* Write data of this banner */
fprintf (Gbl.F.Out,"<div class=\"CM\">");
HTM_DIV_Begin ("class=\"CM\"");
Frm_StartForm (ActClkBan);
Ban_PutParamBanCod (Gbl.Banners.Lst[NumBan].BanCod);
Par_PutHiddenParamString ("URL",Gbl.Banners.Lst[NumBan].WWW);

View File

@ -155,18 +155,18 @@ static void Box_StartBoxInternal (const char *Width,const char *Title,
fprintf (Gbl.F.Out,">");
/***** Row for left and right icons *****/
fprintf (Gbl.F.Out,"<div class=\"FRAME_ICO\">");
HTM_DIV_Begin ("class=\"FRAME_ICO\"");
/* Contextual icons at left */
if (FunctionToDrawContextualIcons)
{
fprintf (Gbl.F.Out,"<div class=\"FRAME_ICO_LEFT\">");
HTM_DIV_Begin ("class=\"FRAME_ICO_LEFT\"");
FunctionToDrawContextualIcons ();
HTM_DIV_End ();
}
/* Icons at right: help and close */
fprintf (Gbl.F.Out,"<div class=\"FRAME_ICO_RIGHT\">");
HTM_DIV_Begin ("class=\"FRAME_ICO_RIGHT\"");
if (HelpLink) // Link to help
{
@ -195,9 +195,9 @@ static void Box_StartBoxInternal (const char *Width,const char *Title,
/***** Frame title *****/
if (Title)
{
fprintf (Gbl.F.Out,"<div class=\"FRAME_TITLE %s\">",
Gbl.Box.Nested ? "FRAME_TITLE_SMALL" :
"FRAME_TITLE_BIG");
HTM_DIV_Begin ("class=\"FRAME_TITLE %s\"",
Gbl.Box.Nested ? "FRAME_TITLE_SMALL" :
"FRAME_TITLE_BIG");
fprintf (Gbl.F.Out,"%s",Title);
HTM_DIV_End ();
}

View File

@ -99,7 +99,7 @@ void Btn_PutButtonInline (Btn_Button_t Button,const char *TxtButton)
void Btn_PutCreateButton (const char *TxtButton)
{
fprintf (Gbl.F.Out,"<div class=\"CM\">");
HTM_DIV_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<button type=\"submit\" class=\"BT_SUBMIT BT_CREATE\">"
"%s"
"</button>",
@ -117,7 +117,7 @@ void Btn_PutCreateButtonInline (const char *TxtButton)
void Btn_PutConfirmButton (const char *TxtButton)
{
fprintf (Gbl.F.Out,"<div class=\"CM\">");
HTM_DIV_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<button type=\"submit\" class=\"BT_SUBMIT BT_CONFIRM\">"
"%s"
"</button>",
@ -135,7 +135,7 @@ void Btn_PutConfirmButtonInline (const char *TxtButton)
void Btn_PutRemoveButton (const char *TxtButton)
{
fprintf (Gbl.F.Out,"<div class=\"CM\">");
HTM_DIV_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<button type=\"submit\" class=\"BT_SUBMIT BT_REMOVE\">"
"%s"
"</button>",

View File

@ -117,9 +117,9 @@ void Cal_ShowFormToSelFirstDayOfWeek (Act_Action_t Action,void (*FuncParams) (vo
FirstDayOfWeek++)
if (Cal_DayIsValidAsFirstDayOfWeek[FirstDayOfWeek])
{
fprintf (Gbl.F.Out,"<div class=\"%s\">",
FirstDayOfWeek == Gbl.Prefs.FirstDayOfWeek ? "PREF_ON" :
"PREF_OFF");
HTM_DIV_Begin ("class=\"%s\"",
FirstDayOfWeek == Gbl.Prefs.FirstDayOfWeek ? "PREF_ON" :
"PREF_OFF");
Frm_StartForm (Action);
Par_PutHiddenParamUnsigned ("FirstDayOfWeek",FirstDayOfWeek);
if (FuncParams) // Extra parameters depending on the action
@ -210,7 +210,7 @@ void Cal_DrawCurrentMonth (void)
/***** Draw the month in JavaScript *****/
/* JavaScript will write HTML here */
fprintf (Gbl.F.Out,"<div id=\"CurrentMonth\">");
HTM_DIV_Begin ("id=\"CurrentMonth\"");
HTM_DIV_End ();
/* Write script to draw the month */
@ -278,7 +278,7 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
/***** Draw several months *****/
/* JavaScript will write HTML here */
fprintf (Gbl.F.Out,"<div id=\"calendar\">");
HTM_DIV_Begin ("id=\"calendar\"");
HTM_DIV_End ();
/* Write script to draw the month */

View File

@ -332,7 +332,7 @@ static void Ctr_Configuration (bool PrintView)
/***** Title *****/
PutLink = !PrintView && Gbl.Hierarchy.Ctr.WWW[0];
fprintf (Gbl.F.Out,"<div class=\"FRAME_TITLE FRAME_TITLE_BIG\">");
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG\"");
if (PutLink)
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\""
" class=\"FRAME_TITLE_BIG\" title=\"%s\">",
@ -352,7 +352,7 @@ static void Ctr_Configuration (bool PrintView)
Ctr_GetPhotoAttribution (Gbl.Hierarchy.Ctr.CtrCod,&PhotoAttribution);
/* Photo image */
fprintf (Gbl.F.Out,"<div class=\"DAT_SMALL CM\">");
HTM_DIV_Begin ("class=\"DAT_SMALL CM\"");
if (PutLink)
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"DAT_N\">",
Gbl.Hierarchy.Ctr.WWW);
@ -377,7 +377,7 @@ static void Ctr_Configuration (bool PrintView)
// Only centre admins, institution admins and centre admins
// have permission to edit photo attribution
{
fprintf (Gbl.F.Out,"<div class=\"CM\">");
HTM_DIV_Begin ("class=\"CM\"");
Frm_StartForm (ActChgCtrPhoAtt);
fprintf (Gbl.F.Out,"<textarea id=\"AttributionArea\""
" name=\"Attribution\" rows=\"2\""
@ -391,7 +391,7 @@ static void Ctr_Configuration (bool PrintView)
}
else if (PhotoAttribution)
{
fprintf (Gbl.F.Out,"<div class=\"ATTRIBUTION\">");
HTM_DIV_Begin ("class=\"ATTRIBUTION\"");
fprintf (Gbl.F.Out,"%s",PhotoAttribution);
HTM_DIV_End ();
}
@ -586,7 +586,7 @@ static void Ctr_Configuration (bool PrintView)
}
else // I can not change centre WWW
{
fprintf (Gbl.F.Out,"<div class=\"EXTERNAL_WWW_LONG\">");
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_LONG\"");
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"DAT\">"
"%s"
"</a>",
@ -1605,7 +1605,7 @@ static void Ctr_ListCentresForEdition (void)
{
Str_Copy (WWW,Ctr->WWW,
Cns_MAX_BYTES_WWW);
fprintf (Gbl.F.Out,"<div class=\"EXTERNAL_WWW_SHORT\">");
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_SHORT\"");
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\""
" class=\"DAT\" title=\"%s\">"
"%s"

View File

@ -487,7 +487,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.42.2 (2019-10-23)"
#define Log_PLATFORM_VERSION "SWAD 19.42.3 (2019-10-23)"
#define CSS_FILE "swad19.41.3.css"
#define JS_FILE "swad19.39.js"
/*
@ -495,6 +495,7 @@ ps2pdf source.ps destination.pdf
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
// TODO: Change icon to upload file in timeline to photo-video.svg
Version 19.42.3: Oct 23, 2019 Code refactoring in HTML divs. (246052 lines)
Version 19.42.2: Oct 23, 2019 Code refactoring in HTML divs. (246025 lines)
Version 19.42.1: Oct 23, 2019 Code refactoring in HTML divs. (246088 lines)
Version 19.42: Oct 23, 2019 Module swad_table is renamed as swad_HTML. (245956 lines)

View File

@ -86,7 +86,7 @@ void Con_ShowConnectedUsrs (void)
/***** Link to show last clicks in real time *****/
if (Gbl.Usrs.Me.Logged)
{
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
Sta_PutLinkToLastClicks ();
HTM_DIV_End ();
}
@ -161,7 +161,7 @@ void Con_ShowGlobalConnectedUsrs (void)
}
/***** Container start *****/
fprintf (Gbl.F.Out,"<div class=\"CONNECTED\">");
HTM_DIV_Begin ("class=\"CONNECTED\"");
/***** Number of sessions *****/
/* Link to view more details about connected users */
@ -181,7 +181,7 @@ void Con_ShowGlobalConnectedUsrs (void)
if (NumUsrsTotal)
{
fprintf (Gbl.F.Out,"<div class=\"CONNECTED_LIST\">");
HTM_DIV_Begin ("class=\"CONNECTED_LIST\"");
/***** Write total number of users *****/
fprintf (Gbl.F.Out,"%u %s:",
@ -264,11 +264,11 @@ static void Con_ShowConnectedUsrsBelongingToLocation (void)
struct ConnectedUsrs Usrs;
/***** Start container *****/
fprintf (Gbl.F.Out,"<div class=\"CONNECTED\">");
HTM_DIV_Begin ("class=\"CONNECTED\"");
/***** Number of connected users who belong to scope *****/
Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_UNK,&Usrs);
fprintf (Gbl.F.Out,"<div class=\"CONNECTED_TXT\">");
HTM_DIV_Begin ("class=\"CONNECTED_TXT\"");
fprintf (Gbl.F.Out,"%u %s ",Usrs.NumUsrs,Txt_from);
/* Put form to change scope */
@ -310,7 +310,7 @@ void Con_ShowConnectedUsrsBelongingToCurrentCrs (void)
return;
/***** Start container *****/
fprintf (Gbl.F.Out,"<div class=\"CONNECTED\">");
HTM_DIV_Begin ("class=\"CONNECTED\"");
/***** Number of connected users who belong to course *****/
/* Link to view more details about connected users */
@ -847,11 +847,13 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
break;
}
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
fprintf (Gbl.F.Out,"<div class=\"CON_NAME_NARROW\">"); // Limited width
HTM_DIV_Begin ("class=\"CON_NAME_NARROW\""); // Limited width
Frm_LinkFormSubmitUnique (Txt_View_record_for_this_course,Font);
Usr_WriteFirstNameBRSurnames (UsrDat);
fprintf (Gbl.F.Out,"</a>");
HTM_DIV_End ();
Frm_EndForm ();
HTM_TD_End ();
@ -859,10 +861,9 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
Font = (Gbl.Usrs.Connected.Lst[Gbl.Usrs.Connected.NumUsr].ThisCrs ? "CON_SINCE CON_CRS" :
"CON_SINCE CON_NO_CRS");
HTM_TD_Begin ("class=\"%s COLOR%u\"",Font,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<div id=\"hm%u\">",
Gbl.Usrs.Connected.NumUsr); // Used for automatic update, only when displayed on right column
HTM_DIV_Begin ("id=\"hm%u\"",Gbl.Usrs.Connected.NumUsr); // Used for automatic update, only when displayed on right column
Dat_WriteHoursMinutesSecondsFromSeconds (Gbl.Usrs.Connected.Lst[Gbl.Usrs.Connected.NumUsr].TimeDiff);
HTM_DIV_End (); // Used for automatic update, only when displayed on right column
HTM_DIV_End (); // Used for automatic update, only when displayed on right column
HTM_TD_End ();
HTM_TR_End ();
@ -1062,13 +1063,15 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
}
Usr_PutParamUsrCodEncrypted (UsrDat.EncryptedUsrCod);
}
fprintf (Gbl.F.Out,"<div class=\"CON_NAME_WIDE\">"); // Limited width
HTM_DIV_Begin ("class=\"CON_NAME_WIDE\""); // Limited width
if (PutLinkToRecord)
Frm_LinkFormSubmit (UsrDat.FullName,Font,NULL);
Usr_WriteFirstNameBRSurnames (&UsrDat);
if (PutLinkToRecord)
fprintf (Gbl.F.Out,"</a>");
HTM_DIV_End ();
if (PutLinkToRecord)
Frm_EndForm ();
HTM_TD_End ();

View File

@ -76,9 +76,9 @@ void Coo_EditMyPrefsOnCookies (void)
Frm_StartFormAnchor (ActChgCooPrf,Coo_COOKIES_ID);
/* Start container */
fprintf (Gbl.F.Out,"<div class=\"%s\">",
(Gbl.Usrs.Me.UsrDat.Prefs.AcceptThirdPartyCookies) ? "DAT_N LIGHT_BLUE" :
"DAT");
HTM_DIV_Begin ("class=\"%s\"",
(Gbl.Usrs.Me.UsrDat.Prefs.AcceptThirdPartyCookies) ? "DAT_N LIGHT_BLUE" :
"DAT");
/* Check box */
fprintf (Gbl.F.Out,"<label>"
"<input type=\"checkbox\""

View File

@ -263,7 +263,7 @@ static void Cty_Configuration (bool PrintView)
/***** Title *****/
PutLink = !PrintView && Gbl.Hierarchy.Cty.WWW[Gbl.Prefs.Language][0];
fprintf (Gbl.F.Out,"<div class=\"FRAME_TITLE FRAME_TITLE_BIG\">");
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG\"");
if (PutLink)
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\""
" class=\"FRAME_TITLE_BIG\" title=\"%s\">",
@ -281,7 +281,7 @@ static void Cty_Configuration (bool PrintView)
Cty_GetMapAttribution (Gbl.Hierarchy.Cty.CtyCod,&MapAttribution);
/* Map image */
fprintf (Gbl.F.Out,"<div class=\"DAT_SMALL CM\">");
HTM_DIV_Begin ("class=\"DAT_SMALL CM\"");
if (PutLink)
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\">",
Gbl.Hierarchy.Cty.WWW[Gbl.Prefs.Language]);
@ -294,7 +294,7 @@ static void Cty_Configuration (bool PrintView)
/* Map attribution */
if (!PrintView && Cty_CheckIfICanEditCountries ())
{
fprintf (Gbl.F.Out,"<div class=\"CM\">");
HTM_DIV_Begin ("class=\"CM\"");
Frm_StartForm (ActChgCtyMapAtt);
fprintf (Gbl.F.Out,"<textarea name=\"Attribution\""
" cols=\"50\" rows=\"2\""
@ -308,7 +308,7 @@ static void Cty_Configuration (bool PrintView)
}
else if (MapAttribution)
{
fprintf (Gbl.F.Out,"<div class=\"ATTRIBUTION\">");
HTM_DIV_Begin ("class=\"ATTRIBUTION\"");
fprintf (Gbl.F.Out,"%s",MapAttribution);
HTM_DIV_End ();
}
@ -632,7 +632,7 @@ void Cty_ListCountries2 (void)
/***** Div for Google Geochart *****/
if (Gbl.Action.Act == ActSeeCty)
{
fprintf (Gbl.F.Out,"<div id=\"chart_div\">");
HTM_DIV_Begin ("id=\"chart_div\"");
HTM_DIV_End ();
}
@ -815,7 +815,7 @@ void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action,
/***** Begin form *****/
Frm_StartFormGoTo (Action);
Cty_PutParamCtyCod (Cty->CtyCod);
fprintf (Gbl.F.Out,"<div class=\"%s\">",ClassContainer);
HTM_DIV_Begin ("class=\"%s\"",ClassContainer);
/***** Link to action *****/
snprintf (Gbl.Title,sizeof (Gbl.Title),

View File

@ -145,7 +145,7 @@ static void Crs_EditingCourseDestructor (void);
void Crs_ShowIntroduction (void)
{
/***** Course configuration *****/
fprintf (Gbl.F.Out,"<div class=\"CM\">");
HTM_DIV_Begin ("class=\"CM\"");
Crs_Configuration (false);
HTM_DIV_End ();
@ -204,7 +204,7 @@ static void Crs_Configuration (bool PrintView)
if (Gbl.Usrs.Me.Role.Logged == Rol_GST ||
Gbl.Usrs.Me.Role.Logged == Rol_USR)
{
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
Enr_PutLinkToRequestSignUp ();
HTM_DIV_End ();
}
@ -220,7 +220,7 @@ static void Crs_Configuration (bool PrintView)
/***** Title *****/
PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0];
fprintf (Gbl.F.Out,"<div class=\"FRAME_TITLE FRAME_TITLE_BIG\">");
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG\"");
if (PutLink)
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\""
" class=\"FRAME_TITLE_BIG\" title=\"%s\">",

View File

@ -310,10 +310,10 @@ void Dat_ShowClientLocalTime (void)
/***** Draw the current date and time *****/
/* Start container */
fprintf (Gbl.F.Out,"<div id=\"current_date\">");
HTM_DIV_Begin ("id=\"current_date\"");
/* Month with link to calendar */
fprintf (Gbl.F.Out,"<div id=\"current_month\">");
HTM_DIV_Begin ("id=\"current_month\"");
Frm_StartForm (ActSeeCal);
Frm_LinkFormSubmit (Txt_Show_calendar,"CURRENT_MONTH",NULL);
fprintf (Gbl.F.Out,"<span id=\"current_month_txt\">" // JavaScript will write HTML here
@ -323,7 +323,7 @@ void Dat_ShowClientLocalTime (void)
HTM_DIV_End ();
/* Day with link to agenda (if I am logged) */
fprintf (Gbl.F.Out,"<div id=\"current_day\">");
HTM_DIV_Begin ("id=\"current_day\"");
if (Gbl.Usrs.Me.Logged)
{
Frm_StartForm (ActSeeMyAgd);
@ -339,7 +339,7 @@ void Dat_ShowClientLocalTime (void)
HTM_DIV_End ();
/* Time */
fprintf (Gbl.F.Out,"<div id=\"current_time\">"); // JavaScript will write HTML here
HTM_DIV_Begin ("id=\"current_time\""); // JavaScript will write HTML here
HTM_DIV_End ();
/* End container */

View File

@ -320,7 +320,7 @@ static void Deg_Configuration (bool PrintView)
/***** Title *****/
PutLink = !PrintView && Gbl.Hierarchy.Deg.WWW[0];
fprintf (Gbl.F.Out,"<div class=\"FRAME_TITLE FRAME_TITLE_BIG\">");
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG\"");
if (PutLink)
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\""
" class=\"FRAME_TITLE_BIG\" title=\"%s\">",
@ -471,7 +471,7 @@ static void Deg_Configuration (bool PrintView)
}
else // I can not change degree WWW
{
fprintf (Gbl.F.Out,"<div class=\"EXTERNAL_WWW_LONG\">");
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_LONG\"");
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"DAT\">"
"%s"
"</a>",
@ -835,7 +835,7 @@ static void Deg_ListDegreesForEdition (void)
{
Str_Copy (WWW,Deg->WWW,
Cns_MAX_BYTES_WWW);
fprintf (Gbl.F.Out,"<div class=\"EXTERNAL_WWW_SHORT\">");
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_SHORT\"");
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\""
" class=\"DAT\" title=\"%s\">"
"%s"

View File

@ -670,7 +670,7 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
/***** Put contextual links *****/
if (Gbl.Hierarchy.Level == Hie_CRS) // Course selected
{
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
switch (Role)
{
@ -728,7 +728,7 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
Hlp_USERS_Administration_administer_multiple_users,Box_NOT_CLOSABLE);
/***** Step 1: List of students to be enroled / removed *****/
fprintf (Gbl.F.Out,"<div class=\"%s LM\">",The_ClassTitle[Gbl.Prefs.Theme]);
HTM_DIV_Begin ("class=\"%s LM\"",The_ClassTitle[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s",Txt_Step_1_Provide_a_list_of_users);
HTM_DIV_End ();
@ -736,13 +736,13 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
Enr_PutAreaToEnterUsrsIDs ();
/***** Step 2: Put different actions to register/remove users to/from current course *****/
fprintf (Gbl.F.Out,"<div class=\"%s LM\">",The_ClassTitle[Gbl.Prefs.Theme]);
HTM_DIV_Begin ("class=\"%s LM\"",The_ClassTitle[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s",Txt_Step_2_Select_the_desired_action);
HTM_DIV_End ();
Enr_PutActionsRegRemSeveralUsrs ();
/***** Step 3: Select groups in which register / remove users *****/
fprintf (Gbl.F.Out,"<div class=\"%s LM\">",The_ClassTitle[Gbl.Prefs.Theme]);
HTM_DIV_Begin ("class=\"%s LM\"",The_ClassTitle[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s",Txt_Step_3_Optionally_select_groups);
HTM_DIV_End ();
if (Gbl.Hierarchy.Level == Hie_CRS) // Course selected
@ -759,7 +759,7 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
}
/***** Step 4: Confirm register / remove students *****/
fprintf (Gbl.F.Out,"<div class=\"%s LM\">",The_ClassTitle[Gbl.Prefs.Theme]);
HTM_DIV_Begin ("class=\"%s LM\"",The_ClassTitle[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s",Txt_Step_4_Confirm_the_enrolment_removing);
HTM_DIV_End ();
Pwd_AskForConfirmationOnDangerousAction ();
@ -2888,7 +2888,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
/***** User name *****/
HTM_TD_Begin ("class=\"DAT LT\"");
fprintf (Gbl.F.Out,"<div class=\"REQUESTER_NAME\">"); // Limited width
HTM_DIV_Begin ("class=\"REQUESTER_NAME\""); // Limited width
Usr_WriteFirstNameBRSurnames (&UsrDat);
HTM_DIV_End ();
HTM_TD_End ();
@ -3086,7 +3086,7 @@ void Enr_ReqRegRemStd (void)
if (Enr_ICanAdminOtherUsrs[Gbl.Usrs.Me.Role.Logged])
{
/***** Put contextual links *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
HTM_DIV_Begin ("class=\"CONTEXT_MENU\"");
/* Put link to go to admin several students */
Enr_PutLinkToAdminSeveralUsrs (Rol_STD);