Version19.45

This commit is contained in:
Antonio Cañas Vargas 2019-10-26 22:49:13 +02:00
parent 464b62c2c5
commit 71cbf128f2
25 changed files with 293 additions and 202 deletions

View File

@ -1976,18 +1976,6 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
margin:12px; margin:12px;
} }
/********************* List of my courses ************************************/
.MY_CRSS_LNK
{
box-sizing:border-box;
max-width:500px;
text-align:left;
vertical-align:middle;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
/******************* Web of institution, centre, degree **********************/ /******************* Web of institution, centre, degree **********************/
.EXTERNAL_WWW_SHORT .EXTERNAL_WWW_SHORT
{ {
@ -2234,7 +2222,15 @@ a:hover img.CENTRE_PHOTO_SHOW
} }
.LIST_TREE li .LIST_TREE li
{ {
box-sizing:border-box;
max-width:500px;
height:25px; height:25px;
text-align:left;
vertical-align:middle;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
} }
.LIST_I_MUST_READ .LIST_I_MUST_READ

View File

@ -61,6 +61,7 @@ static unsigned HTM_TH_NestingLevel = 0;
static unsigned HTM_TD_NestingLevel = 0; static unsigned HTM_TD_NestingLevel = 0;
static unsigned HTM_DIV_NestingLevel = 0; static unsigned HTM_DIV_NestingLevel = 0;
static unsigned HTM_UL_NestingLevel = 0; static unsigned HTM_UL_NestingLevel = 0;
static unsigned HTM_LI_NestingLevel = 0;
/*****************************************************************************/ /*****************************************************************************/
/***************************** Private prototypes ****************************/ /***************************** Private prototypes ****************************/
@ -78,6 +79,7 @@ static void HTM_TD_BeginWithoutAttr (void);
static void HTM_DIV_BeginWithoutAttr (void); static void HTM_DIV_BeginWithoutAttr (void);
static void HTM_UL_BeginWithoutAttr (void); static void HTM_UL_BeginWithoutAttr (void);
static void HTM_LI_BeginWithoutAttr (void);
/*****************************************************************************/ /*****************************************************************************/
/******************************* Start/end table *****************************/ /******************************* Start/end table *****************************/
@ -594,3 +596,55 @@ void HTM_UL_End (void)
HTM_UL_NestingLevel--; HTM_UL_NestingLevel--;
} }
/*****************************************************************************/
/******************************** List items *********************************/
/*****************************************************************************/
void HTM_LI_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,"<li %s>",Attr);
free ((void *) Attr);
}
else
HTM_LI_BeginWithoutAttr ();
}
else
HTM_LI_BeginWithoutAttr ();
HTM_LI_NestingLevel++;
}
static void HTM_LI_BeginWithoutAttr (void)
{
fprintf (Gbl.F.Out,"<li>");
}
void HTM_LI_End (void)
{
if (HTM_LI_NestingLevel == 0) // No LI open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened LI.");
fprintf (Gbl.F.Out,"</li>");
HTM_LI_NestingLevel--;
}

View File

@ -77,4 +77,7 @@ void HTM_SECTION_End (void);
void HTM_UL_Begin (const char *fmt,...); void HTM_UL_Begin (const char *fmt,...);
void HTM_UL_End (void); void HTM_UL_End (void);
void HTM_LI_Begin (const char *fmt,...);
void HTM_LI_End (void);
#endif #endif

View File

@ -242,7 +242,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
TabStr,MenuStr); TabStr,MenuStr);
/* Icon and text */ /* Icon and text */
fprintf (Gbl.F.Out,"<li class=\"ICO_HIGHLIGHT\">"); HTM_LI_Begin ("class=\"ICO_HIGHLIGHT\"");
Frm_StartForm (Action); Frm_StartForm (Action);
Frm_LinkFormSubmit (TabMenuStr,The_ClassFormInBoxNoWrap[Gbl.Prefs.Theme],NULL); Frm_LinkFormSubmit (TabMenuStr,The_ClassFormInBoxNoWrap[Gbl.Prefs.Theme],NULL);
fprintf (Gbl.F.Out,"<img src=\"%s/%s\" alt=\"%s\" />", fprintf (Gbl.F.Out,"<img src=\"%s/%s\" alt=\"%s\" />",
@ -251,7 +251,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
MenuStr); MenuStr);
fprintf (Gbl.F.Out," %s</a>",TabMenuStr); fprintf (Gbl.F.Out," %s</a>",TabMenuStr);
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
} }
@ -305,7 +305,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
TabStr,MenuStr); TabStr,MenuStr);
/* Icon and text */ /* Icon and text */
fprintf (Gbl.F.Out,"<li class=\"ICO_HIGHLIGHT\">"); HTM_LI_Begin ("class=\"ICO_HIGHLIGHT\"");
Frm_StartForm (Action); Frm_StartForm (Action);
Frm_LinkFormSubmit (TabMenuStr,NULL,NULL); Frm_LinkFormSubmit (TabMenuStr,NULL,NULL);
fprintf (Gbl.F.Out,"<img src=\"%s/%s\" alt=\"%s\" />", fprintf (Gbl.F.Out,"<img src=\"%s/%s\" alt=\"%s\" />",
@ -314,7 +314,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
MenuStr); MenuStr);
fprintf (Gbl.F.Out," %s</a>",MenuStr); fprintf (Gbl.F.Out," %s</a>",MenuStr);
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
} }
HTM_UL_End (); HTM_UL_End ();

View File

@ -150,20 +150,22 @@ static void Ban_WriteListOfBanners (void)
for (NumBan = 0; for (NumBan = 0;
NumBan < Gbl.Banners.Num; NumBan < Gbl.Banners.Num;
NumBan++) NumBan++)
{
/* Write data of this banner */ /* Write data of this banner */
fprintf (Gbl.F.Out,"<li>" HTM_LI_Begin (NULL);
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">" fprintf (Gbl.F.Out,"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">"
"<img src=\"%s/%s\"" "<img src=\"%s/%s\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"BANNER\" />" " class=\"BANNER\" />"
"</a>" "</a>",
"</li>",
Gbl.Banners.Lst[NumBan].WWW, Gbl.Banners.Lst[NumBan].WWW,
Gbl.Banners.Lst[NumBan].FullName, Gbl.Banners.Lst[NumBan].FullName,
Cfg_URL_BANNER_PUBLIC, Cfg_URL_BANNER_PUBLIC,
Gbl.Banners.Lst[NumBan].Img, Gbl.Banners.Lst[NumBan].Img,
Gbl.Banners.Lst[NumBan].ShrtName, Gbl.Banners.Lst[NumBan].ShrtName,
Gbl.Banners.Lst[NumBan].FullName); Gbl.Banners.Lst[NumBan].FullName);
HTM_LI_End ();
}
/***** List end *****/ /***** List end *****/
HTM_UL_End (); HTM_UL_End ();

View File

@ -487,13 +487,14 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD: En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 19.44.4 (2019-10-26)" #define Log_PLATFORM_VERSION "SWAD 19.45 (2019-10-26)"
#define CSS_FILE "swad19.44.3.css" #define CSS_FILE "swad19.45.css"
#define JS_FILE "swad19.39.js" #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: 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: Impedir la creación y edición de proyectos si no son editables.
Version 19.45: Oct 26, 2019 Code refactoring in HTML lists. (246444 lines)
Version 19.44.4: Oct 26, 2019 Fixed bug in HTML divs. (246370 lines) Version 19.44.4: Oct 26, 2019 Fixed bug in HTML divs. (246370 lines)
Version 19.44.3: Oct 26, 2019 Code refactoring in HTML lists. (246369 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.2: Oct 26, 2019 Changes in layout. (246318 lines)

View File

@ -129,16 +129,16 @@ void Cht_ShowListOfAvailableChatRooms (void)
HTM_UL_Begin ("class=\"LIST_TREE\""); HTM_UL_Begin ("class=\"LIST_TREE\"");
/***** Title of top level *****/ /***** Title of top level *****/
fprintf (Gbl.F.Out,"<li class=\"DAT\">" HTM_LI_Begin ("class=\"DAT\"");
"<img src=\"%s/comments.svg\"" fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICO16x16\" />" " class=\"ICO16x16\" />"
" %s" " %s",
"</li>",
Cfg_URL_ICON_PUBLIC, Cfg_URL_ICON_PUBLIC,
Txt_Chat_rooms, Txt_Chat_rooms,
Txt_Chat_rooms, Txt_Chat_rooms,
Txt_Chat_rooms); Txt_Chat_rooms);
HTM_LI_End ();
/***** Link to chat available for all the users *****/ /***** Link to chat available for all the users *****/
IsLastItemInLevel[1] = (!Gbl.Usrs.Me.IBelongToCurrentCrs && IsLastItemInLevel[1] = (!Gbl.Usrs.Me.IBelongToCurrentCrs &&
@ -328,7 +328,7 @@ static void Cht_WriteLinkToChat1 (const char *RoomCode,const char *RoomShrtName,
{ {
extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *The_ClassFormInBox[The_NUM_THEMES];
fprintf (Gbl.F.Out,"<li>"); HTM_LI_Begin (NULL);
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel); Lay_IndentDependingOnLevel (Level,IsLastItemInLevel);
Frm_StartForm (ActCht); Frm_StartForm (ActCht);
Cht_WriteParamsRoomCodeAndNames (RoomCode,RoomShrtName,RoomFullName); Cht_WriteParamsRoomCodeAndNames (RoomCode,RoomShrtName,RoomFullName);
@ -354,7 +354,7 @@ static void Cht_WriteLinkToChat2 (const char *RoomCode,const char *RoomFullName)
fprintf (Gbl.F.Out,"</strong>"); fprintf (Gbl.F.Out,"</strong>");
fprintf (Gbl.F.Out,"</a>"); fprintf (Gbl.F.Out,"</a>");
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -587,9 +587,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to platform *****/ /***** Write link to platform *****/
Highlight = (Gbl.Hierarchy.Cty.CtyCod <= 0); Highlight = (Gbl.Hierarchy.Cty.CtyCod <= 0);
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\">", HTM_LI_Begin ("class=\"%s\"",Highlight ? ClassHighlight :
Highlight ? ClassHighlight : ClassNormal);
ClassNormal);
Frm_StartForm (ActMyCrs); Frm_StartForm (ActMyCrs);
Cty_PutParamCtyCod (-1L); Cty_PutParamCtyCod (-1L);
Frm_LinkFormSubmit (Txt_System, Frm_LinkFormSubmit (Txt_System,
@ -604,7 +603,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Txt_System, Txt_System,
Txt_System); Txt_System);
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
/***** Get my countries *****/ /***** Get my countries *****/
NumCtys = Usr_GetCtysFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,&mysql_resCty); NumCtys = Usr_GetCtysFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,&mysql_resCty);
@ -623,9 +622,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to country *****/ /***** Write link to country *****/
Highlight = (Gbl.Hierarchy.Ins.InsCod <= 0 && Highlight = (Gbl.Hierarchy.Ins.InsCod <= 0 &&
Gbl.Hierarchy.Cty.CtyCod == Cty.CtyCod); Gbl.Hierarchy.Cty.CtyCod == Cty.CtyCod);
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\">", HTM_LI_Begin ("class=\"%s\"",Highlight ? ClassHighlight :
Highlight ? ClassHighlight : ClassNormal);
ClassNormal);
IsLastItemInLevel[1] = (NumCty == NumCtys - 1); IsLastItemInLevel[1] = (NumCty == NumCtys - 1);
Lay_IndentDependingOnLevel (1,IsLastItemInLevel); Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
Frm_StartForm (ActMyCrs); Frm_StartForm (ActMyCrs);
@ -644,7 +642,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Cty.Name[Gbl.Prefs.Language], Cty.Name[Gbl.Prefs.Language],
Cty.Name[Gbl.Prefs.Language]); Cty.Name[Gbl.Prefs.Language]);
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
/***** Get my institutions in this country *****/ /***** Get my institutions in this country *****/
NumInss = (unsigned) Usr_GetInssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod, NumInss = (unsigned) Usr_GetInssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,
@ -664,9 +662,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to institution *****/ /***** Write link to institution *****/
Highlight = (Gbl.Hierarchy.Ctr.CtrCod <= 0 && Highlight = (Gbl.Hierarchy.Ctr.CtrCod <= 0 &&
Gbl.Hierarchy.Ins.InsCod == Ins.InsCod); Gbl.Hierarchy.Ins.InsCod == Ins.InsCod);
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\">", HTM_LI_Begin ("class=\"%s\"",Highlight ? ClassHighlight :
Highlight ? ClassHighlight : ClassNormal);
ClassNormal);
IsLastItemInLevel[2] = (NumIns == NumInss - 1); IsLastItemInLevel[2] = (NumIns == NumInss - 1);
Lay_IndentDependingOnLevel (2,IsLastItemInLevel); Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
Frm_StartForm (ActMyCrs); Frm_StartForm (ActMyCrs);
@ -677,7 +674,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Log_DrawLogo (Hie_INS,Ins.InsCod,Ins.ShrtName,16,NULL,true); Log_DrawLogo (Hie_INS,Ins.InsCod,Ins.ShrtName,16,NULL,true);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",Ins.FullName); fprintf (Gbl.F.Out,"&nbsp;%s</a>",Ins.FullName);
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
/***** Get my centres in this institution *****/ /***** Get my centres in this institution *****/
NumCtrs = (unsigned) Usr_GetCtrsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod, NumCtrs = (unsigned) Usr_GetCtrsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,
@ -697,9 +694,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to centre *****/ /***** Write link to centre *****/
Highlight = (Gbl.Hierarchy.Level == Hie_CTR && Highlight = (Gbl.Hierarchy.Level == Hie_CTR &&
Gbl.Hierarchy.Ctr.CtrCod == Ctr.CtrCod); Gbl.Hierarchy.Ctr.CtrCod == Ctr.CtrCod);
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\">", HTM_LI_Begin ("class=\"%s\"",Highlight ? ClassHighlight :
Highlight ? ClassHighlight : ClassNormal);
ClassNormal);
IsLastItemInLevel[3] = (NumCtr == NumCtrs - 1); IsLastItemInLevel[3] = (NumCtr == NumCtrs - 1);
Lay_IndentDependingOnLevel (3,IsLastItemInLevel); Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
Frm_StartForm (ActMyCrs); Frm_StartForm (ActMyCrs);
@ -710,7 +706,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Log_DrawLogo (Hie_CTR,Ctr.CtrCod,Ctr.ShrtName,16,NULL,true); Log_DrawLogo (Hie_CTR,Ctr.CtrCod,Ctr.ShrtName,16,NULL,true);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",Ctr.FullName); fprintf (Gbl.F.Out,"&nbsp;%s</a>",Ctr.FullName);
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
/***** Get my degrees in this centre *****/ /***** Get my degrees in this centre *****/
NumDegs = (unsigned) Usr_GetDegsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod, NumDegs = (unsigned) Usr_GetDegsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,
@ -730,9 +726,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to degree *****/ /***** Write link to degree *****/
Highlight = (Gbl.Hierarchy.Level == Hie_DEG && Highlight = (Gbl.Hierarchy.Level == Hie_DEG &&
Gbl.Hierarchy.Deg.DegCod == Deg.DegCod); Gbl.Hierarchy.Deg.DegCod == Deg.DegCod);
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\">", HTM_LI_Begin ("class=\"%s\"",Highlight ? ClassHighlight :
Highlight ? ClassHighlight : ClassNormal);
ClassNormal);
IsLastItemInLevel[4] = (NumDeg == NumDegs - 1); IsLastItemInLevel[4] = (NumDeg == NumDegs - 1);
Lay_IndentDependingOnLevel (4,IsLastItemInLevel); Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
Frm_StartForm (ActMyCrs); Frm_StartForm (ActMyCrs);
@ -743,7 +738,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Log_DrawLogo (Hie_DEG,Deg.DegCod,Deg.ShrtName,16,NULL,true); Log_DrawLogo (Hie_DEG,Deg.DegCod,Deg.ShrtName,16,NULL,true);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",Deg.FullName); fprintf (Gbl.F.Out,"&nbsp;%s</a>",Deg.FullName);
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
/***** Get my courses in this degree *****/ /***** Get my courses in this degree *****/
NumCrss = (unsigned) Usr_GetCrssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod, NumCrss = (unsigned) Usr_GetCrssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,
@ -763,9 +758,8 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Write link to course *****/ /***** Write link to course *****/
Highlight = (Gbl.Hierarchy.Level == Hie_CRS && Highlight = (Gbl.Hierarchy.Level == Hie_CRS &&
Gbl.Hierarchy.Crs.CrsCod == Crs.CrsCod); Gbl.Hierarchy.Crs.CrsCod == Crs.CrsCod);
fprintf (Gbl.F.Out,"<li class=\"MY_CRSS_LNK %s\">", HTM_LI_Begin ("class=\"%s\"",Highlight ? ClassHighlight :
Highlight ? ClassHighlight : ClassNormal);
ClassNormal);
IsLastItemInLevel[5] = (NumCrs == NumCrss - 1); IsLastItemInLevel[5] = (NumCrs == NumCrss - 1);
Lay_IndentDependingOnLevel (5,IsLastItemInLevel); Lay_IndentDependingOnLevel (5,IsLastItemInLevel);
Frm_StartForm (ActMyCrs); Frm_StartForm (ActMyCrs);
@ -790,7 +784,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Put link to register students *****/ /***** Put link to register students *****/
Enr_PutButtonInlineToRegisterStds (Crs.CrsCod); Enr_PutButtonInlineToRegisterStds (Crs.CrsCod);
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
/* Free structure that stores the query result */ /* Free structure that stores the query result */

View File

@ -36,6 +36,7 @@
#include "swad_config.h" #include "swad_config.h"
#include "swad_database.h" #include "swad_database.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_HTML.h"
#include "swad_language.h" #include "swad_language.h"
/*****************************************************************************/ /*****************************************************************************/
@ -3236,7 +3237,10 @@ mysql> DESCRIBE ws_keys;
static void DB_CreateTable (const char *Query) static void DB_CreateTable (const char *Query)
{ {
fprintf (Gbl.F.Out,"<li class=\"DAT\">%s</li>",Query); HTM_LI_Begin ("class=\"DAT\"");
fprintf (Gbl.F.Out,"%s",Query);
HTM_LI_End ();
if (mysql_query (&Gbl.mysql,Query)) if (mysql_query (&Gbl.mysql,Query))
DB_ExitOnMySQLError ("can not create table"); DB_ExitOnMySQLError ("can not create table");
} }

View File

@ -116,11 +116,10 @@ void Dat_PutBoxToSelectDateFormat (void)
Format <= (Dat_Format_t) (Dat_NUM_OPTIONS_FORMAT - 1); Format <= (Dat_Format_t) (Dat_NUM_OPTIONS_FORMAT - 1);
Format++) Format++)
{ {
fprintf (Gbl.F.Out,"<li class=\"%s\">" HTM_LI_Begin ("class=\%s\"",(Format == Gbl.Prefs.DateFormat) ? "DAT_N LIGHT_BLUE" :
"<label>" "DAT");
fprintf (Gbl.F.Out,"<label>"
"<input type=\"radio\" name=\"DateFormat\" value=\"%u\"", "<input type=\"radio\" name=\"DateFormat\" value=\"%u\"",
(Format == Gbl.Prefs.DateFormat) ? "DAT_N LIGHT_BLUE" :
"DAT",
(unsigned) Format); (unsigned) Format);
if (Format == Gbl.Prefs.DateFormat) if (Format == Gbl.Prefs.DateFormat)
fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," checked=\"checked\"");
@ -128,8 +127,8 @@ void Dat_PutBoxToSelectDateFormat (void)
Gbl.Form.Id); Gbl.Form.Id);
Dat_PutSpanDateFormat (Format); Dat_PutSpanDateFormat (Format);
Dat_PutScriptDateFormat (Format); Dat_PutScriptDateFormat (Format);
fprintf (Gbl.F.Out,"</label>" fprintf (Gbl.F.Out,"</label>");
"</li>"); HTM_LI_End ();
} }
/***** End list *****/ /***** End list *****/

View File

@ -956,55 +956,61 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
/***** Register / remove users listed or not listed *****/ /***** Register / remove users listed or not listed *****/
if (Gbl.Hierarchy.Level == Hie_CRS) // Course selected if (Gbl.Hierarchy.Level == Hie_CRS) // Course selected
fprintf (Gbl.F.Out,"<li>" {
"<input type=\"radio\" id=\"RegRemAction%u\"" HTM_LI_Begin (NULL);
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\" checked=\"checked\" />" " name=\"RegRemAction\" value=\"%u\" checked=\"checked\" />"
"<label for=\"RegRemAction%u\">" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>",
"</li>" (unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
"<li>" (unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
"<input type=\"radio\" id=\"RegRemAction%u\"" (unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
Txt_Register_the_users_indicated_in_step_1);
HTM_LI_End ();
HTM_LI_Begin (NULL);
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\" />" " name=\"RegRemAction\" value=\"%u\" />"
"<label for=\"RegRemAction%u\">" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>",
"</li>" (unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
"<li>" (unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
"<input type=\"radio\" id=\"RegRemAction%u\"" (unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
Txt_Remove_the_users_indicated_in_step_1);
HTM_LI_End ();
HTM_LI_Begin (NULL);
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\" />" " name=\"RegRemAction\" value=\"%u\" />"
"<label for=\"RegRemAction%u\">" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>",
"</li>" (unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
"<li>" (unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
"<input id=\"RegRemAction%u\" type=\"radio\"" (unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
Txt_Remove_the_users_not_indicated_in_step_1);
HTM_LI_End ();
HTM_LI_Begin (NULL);
fprintf (Gbl.F.Out,"<input id=\"RegRemAction%u\" type=\"radio\""
" name=\"RegRemAction\" value=\"%u\" />" " name=\"RegRemAction\" value=\"%u\" />"
"<label for=\"RegRemAction%u\">" "<label for=\"RegRemAction%u\">"
"%s" "%s"
"</label>" "</label>",
"</li>",
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
(unsigned) Enr_REGISTER_SPECIFIED_USRS_IN_CRS,
Txt_Register_the_users_indicated_in_step_1,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_SPECIFIED_USRS_FROM_CRS,
Txt_Remove_the_users_indicated_in_step_1,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
(unsigned) Enr_REMOVE_NOT_SPECIFIED_USRS_FROM_CRS,
Txt_Remove_the_users_not_indicated_in_step_1,
(unsigned) Enr_UPDATE_USRS_IN_CRS, (unsigned) Enr_UPDATE_USRS_IN_CRS,
(unsigned) Enr_UPDATE_USRS_IN_CRS, (unsigned) Enr_UPDATE_USRS_IN_CRS,
(unsigned) Enr_UPDATE_USRS_IN_CRS, (unsigned) Enr_UPDATE_USRS_IN_CRS,
Txt_Register_the_users_indicated_in_step_1_and_remove_the_users_not_indicated); Txt_Register_the_users_indicated_in_step_1_and_remove_the_users_not_indicated);
HTM_LI_End ();
}
/***** Only for superusers *****/ /***** Only for superusers *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
fprintf (Gbl.F.Out,"<li>" {
"<input type=\"radio\" id=\"RegRemAction%u\"" HTM_LI_Begin (NULL);
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\" />" " name=\"RegRemAction\" value=\"%u\" />"
"<label for=\"RegRemAction%u\">" "<label for=\"RegRemAction%u\">"
"%s" "%s"
@ -1014,6 +1020,8 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
(unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM, (unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM,
(unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM, (unsigned) Enr_ELIMINATE_USRS_FROM_PLATFORM,
Txt_Eliminate_from_the_platform_the_users_indicated_in_step_1); Txt_Eliminate_from_the_platform_the_users_indicated_in_step_1);
HTM_LI_End ();
}
/***** End list of options *****/ /***** End list of options *****/
HTM_UL_End (); HTM_UL_End ();
@ -1758,8 +1766,8 @@ static void Enr_PutActionRemUsrAcc (bool *OptionChecked,bool ItsMe)
static void Enr_StartRegRemOneUsrAction (Enr_RegRemOneUsrAction_t RegRemOneUsrAction, static void Enr_StartRegRemOneUsrAction (Enr_RegRemOneUsrAction_t RegRemOneUsrAction,
bool *OptionChecked) bool *OptionChecked)
{ {
fprintf (Gbl.F.Out,"<li>" HTM_LI_Begin (NULL);
"<input type=\"radio\" id=\"RegRemAction%u\"" fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"RegRemAction%u\""
" name=\"RegRemAction\" value=\"%u\"", " name=\"RegRemAction\" value=\"%u\"",
(unsigned) RegRemOneUsrAction, (unsigned) RegRemOneUsrAction,
(unsigned) RegRemOneUsrAction); (unsigned) RegRemOneUsrAction);
@ -1775,8 +1783,8 @@ static void Enr_StartRegRemOneUsrAction (Enr_RegRemOneUsrAction_t RegRemOneUsrAc
static void Enr_EndRegRemOneUsrAction (void) static void Enr_EndRegRemOneUsrAction (void)
{ {
fprintf (Gbl.F.Out,"</label>" fprintf (Gbl.F.Out,"</label>");
"</li>"); HTM_LI_End ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -3263,19 +3263,18 @@ static void Brw_FormToChangeCrsGrpZone (void)
HTM_UL_Begin ("class=\"LIST_LEFT\""); HTM_UL_Begin ("class=\"LIST_LEFT\"");
/***** Select the complete course, not a group *****/ /***** Select the complete course, not a group *****/
fprintf (Gbl.F.Out,"<li class=\"%s\">" HTM_LI_Begin ("class=\"%s\"",IsCourseZone ? "BROWSER_TITLE" :
"<label>" "BROWSER_TITLE_LIGHT");
"<input type=\"radio\" name=\"GrpCod\" value=\"-1\"", fprintf (Gbl.F.Out,"<label>"
IsCourseZone ? "BROWSER_TITLE" : "<input type=\"radio\" name=\"GrpCod\" value=\"-1\"");
"BROWSER_TITLE_LIGHT");
if (IsCourseZone) if (IsCourseZone)
fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />" fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />"
"%s" "%s"
"</label>" "</label>",
"</li>",
Gbl.Form.Id, Gbl.Form.Id,
Gbl.Hierarchy.Crs.FullName); Gbl.Hierarchy.Crs.FullName);
HTM_LI_End ();
/***** List my groups for unique selection *****/ /***** List my groups for unique selection *****/
if (Gbl.Crs.Grps.NumGrps) // This course has groups? if (Gbl.Crs.Grps.NumGrps) // This course has groups?
@ -3289,16 +3288,16 @@ static void Brw_FormToChangeCrsGrpZone (void)
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetDataOfGroupByCod (&GrpDat);
/* Select this group */ /* Select this group */
fprintf (Gbl.F.Out,"<li class=\"%s\">" HTM_LI_Begin ("class=\%s\"",
"<img src=\"%s/%s20x20.gif\"" (IsGroupZone &&
GrpDat.GrpCod == Gbl.Crs.Grps.GrpCod) ? "BROWSER_TITLE" :
"BROWSER_TITLE_LIGHT");
fprintf (Gbl.F.Out,"<img src=\"%s/%s20x20.gif\""
" alt=\"\" title=\"\"" " alt=\"\" title=\"\""
" class=\"ICO25x25\"" " class=\"ICO25x25\""
" style=\"margin-left:6px;\" />" " style=\"margin-left:6px;\" />"
"<label>" "<label>"
"<input type=\"radio\" name=\"GrpCod\" value=\"%ld\"", "<input type=\"radio\" name=\"GrpCod\" value=\"%ld\"",
(IsGroupZone &&
GrpDat.GrpCod == Gbl.Crs.Grps.GrpCod) ? "BROWSER_TITLE" :
"BROWSER_TITLE_LIGHT",
Cfg_URL_ICON_PUBLIC, Cfg_URL_ICON_PUBLIC,
NumGrp < LstMyGrps.NumGrps - 1 ? "submid" : NumGrp < LstMyGrps.NumGrps - 1 ? "submid" :
"subend", "subend",
@ -3307,10 +3306,10 @@ static void Brw_FormToChangeCrsGrpZone (void)
fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />" fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />"
"%s %s" "%s %s"
"</label>" "</label>",
"</li>",
Gbl.Form.Id, Gbl.Form.Id,
GrpDat.GrpTypName,GrpDat.GrpName); GrpDat.GrpTypName,GrpDat.GrpName);
HTM_LI_End ();
} }
/***** Free memory with the list of groups I belong to *****/ /***** Free memory with the list of groups I belong to *****/

View File

@ -1764,8 +1764,8 @@ static void For_PutFormWhichForums (void)
ForumSet < For_NUM_FORUM_SETS; ForumSet < For_NUM_FORUM_SETS;
ForumSet++) ForumSet++)
{ {
fprintf (Gbl.F.Out,"<li>" HTM_LI_Begin (NULL);
"<label>" fprintf (Gbl.F.Out,"<label>"
"<input type=\"radio\" name=\"ForumSet\"" "<input type=\"radio\" name=\"ForumSet\""
" value=\"%u\"", " value=\"%u\"",
(unsigned) ForumSet); (unsigned) ForumSet);
@ -1773,9 +1773,9 @@ static void For_PutFormWhichForums (void)
fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />" fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />"
"%s" "%s"
"</label>" "</label>",
"</li>",
Gbl.Form.Id,Txt_FORUM_WHICH_FORUM[ForumSet]); Gbl.Form.Id,Txt_FORUM_WHICH_FORUM[ForumSet]);
HTM_LI_End ();
} }
HTM_UL_End (); HTM_UL_End ();
HTM_DIV_End (); HTM_DIV_End ();
@ -2046,10 +2046,8 @@ static void For_WriteLinkToForum (struct Forum *Forum,
The_ClassFormInBox[Gbl.Prefs.Theme]); The_ClassFormInBox[Gbl.Prefs.Theme]);
/***** Start row *****/ /***** Start row *****/
fprintf (Gbl.F.Out,"<li"); HTM_LI_Begin (Highlight ? "class=\"LIGHT_BLUE\"" :
if (Highlight) NULL);
fprintf (Gbl.F.Out," class=\"LIGHT_BLUE\"");
fprintf (Gbl.F.Out,">");
/***** Indent forum title *****/ /***** Indent forum title *****/
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel); Lay_IndentDependingOnLevel (Level,IsLastItemInLevel);
@ -2151,7 +2149,7 @@ static void For_WriteLinkToForum (struct Forum *Forum,
if (Forum->Type == For_FORUM_COURSE_USRS) if (Forum->Type == For_FORUM_COURSE_USRS)
Enr_PutButtonInlineToRegisterStds (Forum->Location); Enr_PutButtonInlineToRegisterStds (Forum->Location);
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -609,7 +609,7 @@ void Inf_WriteMsgYouMustReadInfo (void)
InfoType++) InfoType++)
if (Gbl.Crs.Info.MustBeRead[InfoType]) if (Gbl.Crs.Info.MustBeRead[InfoType])
{ {
fprintf (Gbl.F.Out,"<li>"); HTM_LI_Begin (NULL);
Frm_StartForm (Inf_ActionsSeeInfo[InfoType]); Frm_StartForm (Inf_ActionsSeeInfo[InfoType]);
Frm_LinkFormSubmit (Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType]), Frm_LinkFormSubmit (Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType]),
The_ClassFormInBox[Gbl.Prefs.Theme],NULL); The_ClassFormInBox[Gbl.Prefs.Theme],NULL);
@ -617,7 +617,7 @@ void Inf_WriteMsgYouMustReadInfo (void)
"</a>", "</a>",
Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType])); Act_GetTitleAction (Inf_ActionsSeeInfo[InfoType]));
Frm_EndForm (); Frm_EndForm ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
HTM_UL_End (); HTM_UL_End ();
HTM_DIV_End (); HTM_DIV_End ();

View File

@ -194,16 +194,18 @@ static void Lnk_WriteListOfLinks (void)
for (NumLnk = 0; for (NumLnk = 0;
NumLnk < Gbl.Links.Num; NumLnk < Gbl.Links.Num;
NumLnk++) NumLnk++)
{
/* Write data of this link */ /* Write data of this link */
fprintf (Gbl.F.Out,"<li class=\"INS_LNK\">" HTM_LI_Begin ("class=\"INS_LNK\"");
"<a href=\"%s\" title=\"%s\" class=\"INS_LNK\"" fprintf (Gbl.F.Out,"<a href=\"%s\" title=\"%s\" class=\"INS_LNK\""
" target=\"_blank\">" " target=\"_blank\">"
"%s" "%s"
"</a>" "</a>",
"</li>",
Gbl.Links.Lst[NumLnk].WWW, Gbl.Links.Lst[NumLnk].WWW,
Gbl.Links.Lst[NumLnk].FullName, Gbl.Links.Lst[NumLnk].FullName,
Gbl.Links.Lst[NumLnk].ShrtName); Gbl.Links.Lst[NumLnk].ShrtName);
HTM_LI_End ();
}
/***** List end *****/ /***** List end *****/
HTM_UL_End (); HTM_UL_End ();

View File

@ -357,7 +357,7 @@ void Mnu_WriteMenuThisTab (void)
Title = Act_GetSubtitleAction (NumAct); Title = Act_GetSubtitleAction (NumAct);
/***** Start element *****/ /***** Start element *****/
fprintf (Gbl.F.Out,"<li class=\"MENU_LIST_ITEM\">"); HTM_LI_Begin ("class=\"MENU_LIST_ITEM\"");
/***** Start container used to highlight this option *****/ /***** Start container used to highlight this option *****/
HTM_DIV_Begin ("class=\"%s\"", HTM_DIV_Begin ("class=\"%s\"",
@ -387,7 +387,7 @@ void Mnu_WriteMenuThisTab (void)
HTM_DIV_End (); HTM_DIV_End ();
/***** End element *****/ /***** End element *****/
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
} }

View File

@ -172,11 +172,11 @@ static void Pri_PutFormVisibility (const char *TxtLabel,
Visibility++) Visibility++)
if (MaskAllowedVisibility & (1 << Visibility)) if (MaskAllowedVisibility & (1 << Visibility))
{ {
fprintf (Gbl.F.Out,"<li class=\"%s\">" HTM_LI_Begin ("class=\"%s\"",
"<label>" (Visibility == CurrentVisibilityInDB) ? "DAT_N LIGHT_BLUE" :
"DAT");
fprintf (Gbl.F.Out,"<label>"
"<input type=\"radio\" name=\"%s\" value=\"%u\"", "<input type=\"radio\" name=\"%s\" value=\"%u\"",
(Visibility == CurrentVisibilityInDB) ? "DAT_N LIGHT_BLUE" :
"DAT",
ParamName,(unsigned) Visibility); ParamName,(unsigned) Visibility);
if (Visibility == CurrentVisibilityInDB) if (Visibility == CurrentVisibilityInDB)
fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," checked=\"checked\"");
@ -187,9 +187,9 @@ static void Pri_PutFormVisibility (const char *TxtLabel,
Gbl.Form.Id); Gbl.Form.Id);
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"%s" "%s"
"</label>" "</label>",
"</li>",
Txt_PRIVACY_OPTIONS[Visibility]); Txt_PRIVACY_OPTIONS[Visibility]);
HTM_LI_End ();
} }
/***** End list and form *****/ /***** End list and form *****/

View File

@ -780,15 +780,15 @@ static void Prf_ShowNumMessagesSent (const struct UsrData *UsrDat,
static void Prf_StartListItem (const char *Title,const char *Icon) static void Prf_StartListItem (const char *Title,const char *Icon)
{ {
fprintf (Gbl.F.Out,"<li title=\"%s\" class=\"PRF_FIG_LI\"" HTM_LI_Begin ("title=\"%s\" class=\"PRF_FIG_LI\""
" style=\"background-image:url('%s/%s');\">", " style=\"background-image:url('%s/%s');\"",
Title, Title,
Cfg_URL_ICON_PUBLIC,Icon); Cfg_URL_ICON_PUBLIC,Icon);
} }
static void Prf_EndListItem (void) static void Prf_EndListItem (void)
{ {
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -2037,10 +2037,12 @@ static void Prj_ShowTableAllProjectsMembersWithARole (const struct Project *Prj,
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS)) if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Usr_DONT_GET_PREFS))
{ {
/* Write user's name in "Surname1 Surname2, FirstName" format */ /* Write user's name in "Surname1 Surname2, FirstName" format */
fprintf (Gbl.F.Out,"<li>%s",Gbl.Usrs.Other.UsrDat.Surname1); HTM_LI_Begin (NULL);
fprintf (Gbl.F.Out,"%s",Gbl.Usrs.Other.UsrDat.Surname1);
if (Gbl.Usrs.Other.UsrDat.Surname2[0]) if (Gbl.Usrs.Other.UsrDat.Surname2[0])
fprintf (Gbl.F.Out," %s",Gbl.Usrs.Other.UsrDat.Surname2); fprintf (Gbl.F.Out," %s",Gbl.Usrs.Other.UsrDat.Surname2);
fprintf (Gbl.F.Out,", %s</li>",Gbl.Usrs.Other.UsrDat.FirstName); fprintf (Gbl.F.Out,", %s",Gbl.Usrs.Other.UsrDat.FirstName);
HTM_LI_End ();
} }
} }

View File

@ -731,59 +731,84 @@ static void Svy_WriteStatus (struct Survey *Svy)
/* Write whether survey is visible or hidden */ /* Write whether survey is visible or hidden */
if (Svy->Status.Visible) if (Svy->Status.Visible)
fprintf (Gbl.F.Out,"<li class=\"STATUS_GREEN\">%s</li>", {
Txt_Visible_survey); HTM_LI_Begin ("class=\"STATUS_GREEN\"");
fprintf (Gbl.F.Out,"%s",Txt_Visible_survey);
}
else else
fprintf (Gbl.F.Out,"<li class=\"STATUS_RED_LIGHT\">%s</li>", {
Txt_Hidden_survey); HTM_LI_Begin ("class=\"STATUS_RED_LIGHT\"");
fprintf (Gbl.F.Out,"%s",Txt_Hidden_survey);
}
HTM_LI_End ();
/* Write whether survey is open or closed */ /* Write whether survey is open or closed */
if (Svy->Status.Open) if (Svy->Status.Open)
fprintf (Gbl.F.Out,"<li class=\"%s\">%s</li>", {
Svy->Status.Visible ? "STATUS_GREEN" : HTM_LI_Begin ("class=\"%s\"",
"STATUS_GREEN_LIGHT", Svy->Status.Visible ? "STATUS_GREEN" :
Txt_Open_survey); "STATUS_GREEN_LIGHT");
fprintf (Gbl.F.Out,"%s",Txt_Open_survey);
}
else else
fprintf (Gbl.F.Out,"<li class=\"%s\">%s</li>", {
Svy->Status.Visible ? "STATUS_RED" : HTM_LI_Begin ("class=\"%s\"",
"STATUS_RED_LIGHT", Svy->Status.Visible ? "STATUS_RED" :
Txt_Closed_survey); "STATUS_RED_LIGHT");
fprintf (Gbl.F.Out,"%s",Txt_Closed_survey);
}
HTM_LI_End ();
/* Write whether survey can be answered by me or not depending on user type */ /* Write whether survey can be answered by me or not depending on user type */
if (Svy->Status.IAmLoggedWithAValidRoleToAnswer) if (Svy->Status.IAmLoggedWithAValidRoleToAnswer)
fprintf (Gbl.F.Out,"<li class=\"%s\">%s</li>", {
Svy->Status.Visible ? "STATUS_GREEN" : HTM_LI_Begin ("class=\"%s\"",
"STATUS_GREEN_LIGHT", Svy->Status.Visible ? "STATUS_GREEN" :
Txt_SURVEY_Type_of_user_allowed); "STATUS_GREEN_LIGHT");
fprintf (Gbl.F.Out,"%s",Txt_SURVEY_Type_of_user_allowed);
}
else else
fprintf (Gbl.F.Out,"<li class=\"%s\">%s</li>", {
Svy->Status.Visible ? "STATUS_RED" : HTM_LI_Begin ("class=\"%s\"",
"STATUS_RED_LIGHT", Svy->Status.Visible ? "STATUS_RED" :
Txt_SURVEY_Type_of_user_not_allowed); "STATUS_RED_LIGHT");
fprintf (Gbl.F.Out,"%s",Txt_SURVEY_Type_of_user_not_allowed);
}
HTM_LI_End ();
/* Write whether survey can be answered by me or not depending on groups */ /* Write whether survey can be answered by me or not depending on groups */
if (Svy->Status.IBelongToScope) if (Svy->Status.IBelongToScope)
fprintf (Gbl.F.Out,"<li class=\"%s\">%s</li>", {
Svy->Status.Visible ? "STATUS_GREEN" : HTM_LI_Begin ("class=\"%s\"",
"STATUS_GREEN_LIGHT", Svy->Status.Visible ? "STATUS_GREEN" :
Txt_SURVEY_You_belong_to_the_scope_of_the_survey); "STATUS_GREEN_LIGHT");
fprintf (Gbl.F.Out,"%s",Txt_SURVEY_You_belong_to_the_scope_of_the_survey);
}
else else
fprintf (Gbl.F.Out,"<li class=\"%s\">%s</li>", {
Svy->Status.Visible ? "STATUS_RED" : HTM_LI_Begin ("class=\"%s\"",
"STATUS_RED_LIGHT", Svy->Status.Visible ? "STATUS_RED" :
Txt_SURVEY_You_dont_belong_to_the_scope_of_the_survey); "STATUS_RED_LIGHT");
fprintf (Gbl.F.Out,"%s",Txt_SURVEY_You_dont_belong_to_the_scope_of_the_survey);
}
HTM_LI_End ();
/* Write whether survey has been already answered by me or not */ /* Write whether survey has been already answered by me or not */
if (Svy->Status.IHaveAnswered) if (Svy->Status.IHaveAnswered)
fprintf (Gbl.F.Out,"<li class=\"%s\">%s</li>", {
Svy->Status.Visible ? "STATUS_GREEN" : HTM_LI_Begin ("class=\"%s\"",
"STATUS_GREEN_LIGHT", Svy->Status.Visible ? "STATUS_GREEN" :
Txt_SURVEY_You_have_already_answered); "STATUS_GREEN_LIGHT");
fprintf (Gbl.F.Out,"%s",Txt_SURVEY_You_have_already_answered);
}
else else
fprintf (Gbl.F.Out,"<li class=\"%s\">%s</li>", {
Svy->Status.Visible ? "STATUS_RED" : HTM_LI_Begin ("class=\"%s\"",
"STATUS_RED_LIGHT", Svy->Status.Visible ? "STATUS_RED" :
Txt_SURVEY_You_have_not_answered); "STATUS_RED_LIGHT");
fprintf (Gbl.F.Out,"%s",Txt_SURVEY_You_have_not_answered);
}
HTM_LI_End ();
/***** End list with items of status *****/ /***** End list with items of status *****/
HTM_UL_End (); HTM_UL_End ();

View File

@ -148,17 +148,17 @@ void Syl_PutFormWhichSyllabus (void)
WhichSyllabus < For_NUM_FORUM_SETS; WhichSyllabus < For_NUM_FORUM_SETS;
WhichSyllabus++) WhichSyllabus++)
{ {
fprintf (Gbl.F.Out,"<li class=\"DAT LM\">" HTM_LI_Begin ("class=\"DAT LM\"");
"<label>" fprintf (Gbl.F.Out,"<label>"
"<input type=\"radio\" name=\"WhichSyllabus\" value=\"%u\"", "<input type=\"radio\" name=\"WhichSyllabus\" value=\"%u\"",
(unsigned) WhichSyllabus); (unsigned) WhichSyllabus);
if (WhichSyllabus == Gbl.Syllabus.WhichSyllabus) if (WhichSyllabus == Gbl.Syllabus.WhichSyllabus)
fprintf (Gbl.F.Out," checked=\"checked\""); fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />" fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />"
"%s" "%s"
"</label>" "</label>",
"</li>",
Gbl.Form.Id,Txt_SYLLABUS_WHICH_SYLLABUS[WhichSyllabus]); Gbl.Form.Id,Txt_SYLLABUS_WHICH_SYLLABUS[WhichSyllabus]);
HTM_LI_End ();
} }
HTM_UL_End (); HTM_UL_End ();
HTM_DIV_End (); HTM_DIV_End ();

View File

@ -120,11 +120,11 @@ void Tab_DrawTabs (void)
if (ICanViewTab) // Don't show the first hidden tabs if (ICanViewTab) // Don't show the first hidden tabs
{ {
/* Form, icon (at top) and text (at bottom) of the tab */ /* Form, icon (at top) and text (at bottom) of the tab */
fprintf (Gbl.F.Out,"<li class=\"%s %s\">", HTM_LI_Begin ("class=\"%s %s\"",
NumTab == Gbl.Action.Tab ? "TAB_ON" : NumTab == Gbl.Action.Tab ? "TAB_ON" :
"TAB_OFF", "TAB_OFF",
NumTab == Gbl.Action.Tab ? The_TabOnBgColors[Gbl.Prefs.Theme] : NumTab == Gbl.Action.Tab ? The_TabOnBgColors[Gbl.Prefs.Theme] :
The_TabOffBgColors[Gbl.Prefs.Theme]); The_TabOffBgColors[Gbl.Prefs.Theme]);
if (NumTab == Gbl.Action.Tab) if (NumTab == Gbl.Action.Tab)
HTM_DIV_Begin (NULL); // This div must be present even in current tab in order to render properly the tab HTM_DIV_Begin (NULL); // This div must be present even in current tab in order to render properly the tab
@ -151,7 +151,7 @@ void Tab_DrawTabs (void)
Frm_EndForm (); Frm_EndForm ();
HTM_DIV_End (); HTM_DIV_End ();
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
} }
} }

View File

@ -912,8 +912,9 @@ void Tst_ShowTagList (unsigned NumTags,MYSQL_RES *mysql_res)
NumTag++) NumTag++)
{ {
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
fprintf (Gbl.F.Out,"<li>%s</li>", HTM_LI_Begin (NULL);
row[0]); fprintf (Gbl.F.Out,"%s",row[0]);
HTM_LI_End ();
} }
HTM_UL_End (); HTM_UL_End ();
} }
@ -4779,7 +4780,9 @@ void Tst_GetAndWriteTagsQst (long QstCod)
NumRow++) NumRow++)
{ {
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
fprintf (Gbl.F.Out,"<li>%s</li>",row[0]); HTM_LI_Begin (NULL);
fprintf (Gbl.F.Out,"%s",row[0]);
HTM_LI_End ();
} }
HTM_UL_End (); HTM_UL_End ();
} }

View File

@ -1478,12 +1478,11 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
} }
/***** Start list item *****/ /***** Start list item *****/
fprintf (Gbl.F.Out,"<li class=\"TL_WIDTH"); HTM_LI_Begin ("class=\"%s\"",
if (!ShowNoteAlone) ShowNoteAlone ? (Highlight ? "TL_WIDTH TL_NEW_PUB" :
fprintf (Gbl.F.Out," TL_SEP"); "TL_WIDTH") :
if (Highlight) (Highlight ? "TL_WIDTH TL_SEP TL_NEW_PUB" :
fprintf (Gbl.F.Out," TL_NEW_PUB"); "TL_WIDTH TL_SEP"));
fprintf (Gbl.F.Out,"\">");
if (SocNot->NotCod <= 0 || if (SocNot->NotCod <= 0 ||
SocNot->NoteType == TL_NOTE_UNKNOWN || SocNot->NoteType == TL_NOTE_UNKNOWN ||
@ -1684,7 +1683,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
} }
/***** End list item *****/ /***** End list item *****/
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
/***** End box ****/ /***** End box ****/
if (ShowNoteAlone) if (ShowNoteAlone)
@ -2318,7 +2317,7 @@ static void TL_PutFormToWriteNewPost (void)
/***** Start list *****/ /***** Start list *****/
HTM_UL_Begin ("class=\"TL_LIST\""); HTM_UL_Begin ("class=\"TL_LIST\"");
fprintf (Gbl.F.Out,"<li class=\"TL_WIDTH\">"); HTM_LI_Begin ("class=\"TL_WIDTH\"");
/***** Left: write author's photo (my photo) *****/ /***** Left: write author's photo (my photo) *****/
HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\""); HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\"");
@ -2356,7 +2355,7 @@ static void TL_PutFormToWriteNewPost (void)
HTM_DIV_End (); HTM_DIV_End ();
/***** End list *****/ /***** End list *****/
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
HTM_UL_End (); HTM_UL_End ();
} }
@ -2746,10 +2745,10 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
} }
/***** Start list item *****/ /***** Start list item *****/
fprintf (Gbl.F.Out,"<li"); if (ShowCommentAlone)
if (!ShowCommentAlone) HTM_LI_Begin (NULL);
fprintf (Gbl.F.Out," class=\"TL_COM\""); else
fprintf (Gbl.F.Out,">"); HTM_LI_Begin ("class=\"TL_COM\"");
if (SocCom->PubCod <= 0 || if (SocCom->PubCod <= 0 ||
SocCom->NotCod <= 0 || SocCom->NotCod <= 0 ||
@ -2815,7 +2814,7 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
} }
/***** End list item *****/ /***** End list item *****/
fprintf (Gbl.F.Out,"</li>"); HTM_LI_End ();
if (ShowCommentAlone) if (ShowCommentAlone)
{ {

View File

@ -8363,8 +8363,9 @@ static void Usr_PutOptionsListUsrs (const bool ICanChooseOption[Usr_LIST_USRS_NU
static void Usr_ShowOneListUsrsOption (Usr_ListUsrsOption_t ListUsrsAction, static void Usr_ShowOneListUsrsOption (Usr_ListUsrsOption_t ListUsrsAction,
const char *Label) const char *Label)
{ {
fprintf (Gbl.F.Out,"<li>" HTM_LI_Begin (NULL);
"<input type=\"radio\" id=\"ListUsrsAction%u\""
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"ListUsrsAction%u\""
" name=\"ListUsrsAction\" value=\"%u\"", " name=\"ListUsrsAction\" value=\"%u\"",
(unsigned) ListUsrsAction, (unsigned) ListUsrsAction,
(unsigned) ListUsrsAction); (unsigned) ListUsrsAction);
@ -8373,10 +8374,11 @@ static void Usr_ShowOneListUsrsOption (Usr_ListUsrsOption_t ListUsrsAction,
fprintf (Gbl.F.Out," />" fprintf (Gbl.F.Out," />"
"<label for=\"ListUsrsAction%u\">" "<label for=\"ListUsrsAction%u\">"
"%s" "%s"
"</label>" "</label>",
"</li>",
(unsigned) ListUsrsAction, (unsigned) ListUsrsAction,
Label); Label);
HTM_LI_End ();
} }
/*****************************************************************************/ /*****************************************************************************/