Version 23.46: Nov 07, 2023 Code refactoring and layout changes in lists of my courses, forums and chat.

This commit is contained in:
acanas 2023-11-07 19:06:18 +01:00
parent 61d93d612f
commit ae614985de
10 changed files with 157 additions and 5228 deletions

File diff suppressed because it is too large Load Diff

View File

@ -633,10 +633,11 @@ Me sale este error, no s
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod') "can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/ */
#define Log_PLATFORM_VERSION "SWAD 23.45 (2023-11-07)" #define Log_PLATFORM_VERSION "SWAD 23.46 (2023-11-07)"
#define CSS_FILE "swad23.45.css" #define CSS_FILE "swad23.46.css"
#define JS_FILE "swad22.49.js" #define JS_FILE "swad22.49.js"
/* /*
Version 23.46: Nov 07, 2023 Code refactoring and layout changes in lists of my courses, forums and chat. (335525 lines)
Version 23.45: Nov 07, 2023 Improvements in responsive design. (335468 lines) Version 23.45: Nov 07, 2023 Improvements in responsive design. (335468 lines)
Version 23.44.4: Nov 06, 2023 Code refactoring in hierarchy. (335412 lines) Version 23.44.4: Nov 06, 2023 Code refactoring in hierarchy. (335412 lines)
Version 23.44.3: Nov 06, 2023 Code refactoring in hierarchy. (335391 lines) Version 23.44.3: Nov 06, 2023 Code refactoring in hierarchy. (335391 lines)

View File

@ -73,7 +73,7 @@ extern struct Globals Gbl;
/*****************************************************************************/ /*****************************************************************************/
static void Cht_WriteLinkToChat1 (const char *RoomCode,const char *RoomShrtName,const char *RoomFullName, static void Cht_WriteLinkToChat1 (const char *RoomCode,const char *RoomShrtName,const char *RoomFullName,
unsigned Level,bool IsLastItemInLevel[1 + Cht_CHAT_MAX_LEVELS]); unsigned Level,Lay_LastItem_t IsLastItemInLevel[1 + Cht_CHAT_MAX_LEVELS]);
static void Cht_WriteLinkToChat2 (const char *RoomCode,const char *RoomFullName); static void Cht_WriteLinkToChat2 (const char *RoomCode,const char *RoomFullName);
/*****************************************************************************/ /*****************************************************************************/
@ -112,7 +112,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
extern const char *Txt_ROLES_PLURAL_BRIEF_Abc[Rol_NUM_ROLES]; extern const char *Txt_ROLES_PLURAL_BRIEF_Abc[Rol_NUM_ROLES];
extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS]; extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS];
bool IsLastItemInLevel[1 + Cht_CHAT_MAX_LEVELS]; Lay_LastItem_t IsLastItemInLevel[1 + Cht_CHAT_MAX_LEVELS];
unsigned NumMyDeg; unsigned NumMyDeg;
struct Hie_Node Deg; struct Hie_Node Deg;
struct Hie_Node Crs; struct Hie_Node Crs;
@ -136,15 +136,18 @@ void Cht_ShowListOfAvailableChatRooms (void)
HTM_UL_Begin ("class=\"LIST_TREE\""); HTM_UL_Begin ("class=\"LIST_TREE\"");
/***** Link to chat available for all users *****/ /***** Link to chat available for all users *****/
IsLastItemInLevel[1] = (!Gbl.Usrs.Me.IBelongToCurrent[Hie_CRS] && IsLastItemInLevel[1] = (Gbl.Usrs.Me.IBelongToCurrent[Hie_CRS] ||
!Gbl.Usrs.Me.Hierarchy[Hie_DEG].Num); Gbl.Usrs.Me.Hierarchy[Hie_DEG].Num) ? Lay_NO_LAST_ITEM :
Lay_LAST_ITEM;
snprintf (ThisRoomFullName,sizeof (ThisRoomFullName),"%s (%s)", snprintf (ThisRoomFullName,sizeof (ThisRoomFullName),"%s (%s)",
Txt_General,Txt_SEX_PLURAL_abc[Usr_SEX_ALL]); Txt_General,Txt_SEX_PLURAL_abc[Usr_SEX_ALL]);
Cht_WriteLinkToChat1 ("GBL_USR",Txt_SEX_PLURAL_Abc[Usr_SEX_ALL],ThisRoomFullName,1,IsLastItemInLevel); Cht_WriteLinkToChat1 ("GBL_USR",Txt_SEX_PLURAL_Abc[Usr_SEX_ALL],
ThisRoomFullName,1,IsLastItemInLevel);
Ico_PutIcon ("comments.svg",Ico_BLACK,ThisRoomFullName,"ICO16x16"); Ico_PutIcon ("comments.svg",Ico_BLACK,ThisRoomFullName,"ICO16x16");
Cht_WriteLinkToChat2 ("GBL_USR",ThisRoomFullName); Cht_WriteLinkToChat2 ("GBL_USR",ThisRoomFullName);
IsLastItemInLevel[1] = !Gbl.Usrs.Me.Hierarchy[Hie_DEG].Num; IsLastItemInLevel[1] = Gbl.Usrs.Me.Hierarchy[Hie_DEG].Num ? Lay_NO_LAST_ITEM :
Lay_LAST_ITEM;
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
{ {
case Rol_STD: case Rol_STD:
@ -179,13 +182,15 @@ void Cht_ShowListOfAvailableChatRooms (void)
Err_WrongDegreeExit (); Err_WrongDegreeExit ();
/* Link to the room of this degree */ /* Link to the room of this degree */
IsLastItemInLevel[1] = (NumMyDeg == Gbl.Usrs.Me.Hierarchy[Hie_DEG].Num - 1); IsLastItemInLevel[1] = (NumMyDeg == Gbl.Usrs.Me.Hierarchy[Hie_DEG].Num - 1) ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
snprintf (ThisRoomCode,sizeof (ThisRoomCode),"DEG_%ld",Deg.HieCod); snprintf (ThisRoomCode,sizeof (ThisRoomCode),"DEG_%ld",Deg.HieCod);
snprintf (ThisRoomShrtName,sizeof (ThisRoomShrtName),"%s", snprintf (ThisRoomShrtName,sizeof (ThisRoomShrtName),"%s",
Deg.ShrtName); Deg.ShrtName);
snprintf (ThisRoomFullName,sizeof (ThisRoomFullName),"%s %s", snprintf (ThisRoomFullName,sizeof (ThisRoomFullName),"%s %s",
Txt_HIERARCHY_SINGUL_Abc[Hie_DEG],Deg.ShrtName); Txt_HIERARCHY_SINGUL_Abc[Hie_DEG],Deg.ShrtName);
Cht_WriteLinkToChat1 (ThisRoomCode,ThisRoomShrtName,ThisRoomFullName,1,IsLastItemInLevel); Cht_WriteLinkToChat1 (ThisRoomCode,ThisRoomShrtName,
ThisRoomFullName,1,IsLastItemInLevel);
Lgo_DrawLogo (Hie_DEG, Lgo_DrawLogo (Hie_DEG,
Deg.HieCod, Deg.HieCod,
Deg.ShrtName, Deg.ShrtName,
@ -210,14 +215,16 @@ void Cht_ShowListOfAvailableChatRooms (void)
Crs_GetCourseDataByCod (&Crs); Crs_GetCourseDataByCod (&Crs);
/* Link to the room of this course */ /* Link to the room of this course */
IsLastItemInLevel[2] = (NumCrs == NumCrss - 1); IsLastItemInLevel[2] = (NumCrs == NumCrss - 1) ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
snprintf (ThisRoomCode,sizeof (ThisRoomCode),"CRS_%ld", snprintf (ThisRoomCode,sizeof (ThisRoomCode),"CRS_%ld",
Crs.HieCod); Crs.HieCod);
snprintf (ThisRoomShrtName,sizeof (ThisRoomShrtName),"%s", snprintf (ThisRoomShrtName,sizeof (ThisRoomShrtName),"%s",
Crs.ShrtName); Crs.ShrtName);
snprintf (ThisRoomFullName,sizeof (ThisRoomFullName),"%s %s", snprintf (ThisRoomFullName,sizeof (ThisRoomFullName),"%s %s",
Txt_HIERARCHY_SINGUL_Abc[Hie_CRS],Crs.ShrtName); Txt_HIERARCHY_SINGUL_Abc[Hie_CRS],Crs.ShrtName);
Cht_WriteLinkToChat1 (ThisRoomCode,ThisRoomShrtName,ThisRoomFullName,2,IsLastItemInLevel); Cht_WriteLinkToChat1 (ThisRoomCode,ThisRoomShrtName,
ThisRoomFullName,2,IsLastItemInLevel);
Ico_PutIcon ("chalkboard-teacher.svg",Ico_BLACK,ThisRoomFullName,"ICO16x16"); Ico_PutIcon ("chalkboard-teacher.svg",Ico_BLACK,ThisRoomFullName,"ICO16x16");
Cht_WriteLinkToChat2 (ThisRoomCode,ThisRoomFullName); Cht_WriteLinkToChat2 (ThisRoomCode,ThisRoomFullName);
} }
@ -290,12 +297,12 @@ void Cht_ShowListOfChatRoomsWithUsrs (void)
/*****************************************************************************/ /*****************************************************************************/
static void Cht_WriteLinkToChat1 (const char *RoomCode,const char *RoomShrtName,const char *RoomFullName, static void Cht_WriteLinkToChat1 (const char *RoomCode,const char *RoomShrtName,const char *RoomFullName,
unsigned Level,bool IsLastItemInLevel[1 + Cht_CHAT_MAX_LEVELS]) unsigned Level,Lay_LastItem_t IsLastItemInLevel[1 + Cht_CHAT_MAX_LEVELS])
{ {
/***** Begin list item *****/ /***** Begin list item *****/
HTM_LI_Begin (NULL); HTM_LI_Begin (NULL);
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel); Lay_IndentDependingOnLevel (Level,IsLastItemInLevel,Lay_HORIZONTAL_LINE_AT_RIGHT);
/***** Begin form *****/ /***** Begin form *****/
Frm_BeginForm (ActCht); Frm_BeginForm (ActCht);

View File

@ -156,7 +156,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
extern const char *Txt_My_courses; extern const char *Txt_My_courses;
extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS]; extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS];
struct Hie_Node Hie[Hie_NUM_LEVELS]; struct Hie_Node Hie[Hie_NUM_LEVELS];
bool IsLastItemInLevel[1 + 6]; Lay_LastItem_t IsLastItemInLevel[1 + 6];
bool Highlight; // Highlight because degree, course, etc. is selected bool Highlight; // Highlight because degree, course, etc. is selected
MYSQL_RES *mysql_resCty; MYSQL_RES *mysql_resCty;
MYSQL_RES *mysql_resIns; MYSQL_RES *mysql_resIns;
@ -187,8 +187,9 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Highlight = (Gbl.Hierarchy.Node[Hie_CTY].HieCod <= 0); Highlight = (Gbl.Hierarchy.Node[Hie_CTY].HieCod <= 0);
HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" : HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" :
NULL); NULL);
IsLastItemInLevel[1] = true; IsLastItemInLevel[1] = Lay_LAST_ITEM;
Lay_IndentDependingOnLevel (1,IsLastItemInLevel); Lay_IndentDependingOnLevel (1,IsLastItemInLevel,
Lay_HORIZONTAL_LINE_AT_RIGHT);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
Par_PutParLong (NULL,Par_CodeStr[Hie_ParCod[Hie_CTY]],-1L); Par_PutParLong (NULL,Par_CodeStr[Hie_ParCod[Hie_CTY]],-1L);
HTM_BUTTON_Submit_Begin (Txt_HIERARCHY_SINGUL_Abc[Hie_SYS], HTM_BUTTON_Submit_Begin (Txt_HIERARCHY_SINGUL_Abc[Hie_SYS],
@ -219,8 +220,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Gbl.Hierarchy.Node[Hie_CTY].HieCod == Hie[Hie_CTY].HieCod); Gbl.Hierarchy.Node[Hie_CTY].HieCod == Hie[Hie_CTY].HieCod);
HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" : HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" :
NULL); NULL);
IsLastItemInLevel[2] = (NumCty == NumCtys - 1); IsLastItemInLevel[2] = (NumCty == NumCtys - 1) ? Lay_LAST_ITEM :
Lay_IndentDependingOnLevel (2,IsLastItemInLevel); Lay_NO_LAST_ITEM;
Lay_IndentDependingOnLevel (2,IsLastItemInLevel,
Lay_HORIZONTAL_LINE_AT_RIGHT);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (Hie_ParCod[Hie_CTY],Hie[Hie_CTY].HieCod); ParCod_PutPar (Hie_ParCod[Hie_CTY],Hie[Hie_CTY].HieCod);
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtyInf), HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtyInf),
@ -252,8 +255,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Gbl.Hierarchy.Node[Hie_INS].HieCod == Hie[Hie_INS].HieCod); Gbl.Hierarchy.Node[Hie_INS].HieCod == Hie[Hie_INS].HieCod);
HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" : HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" :
NULL); NULL);
IsLastItemInLevel[3] = (NumIns == NumInss - 1); IsLastItemInLevel[3] = (NumIns == NumInss - 1) ? Lay_LAST_ITEM :
Lay_IndentDependingOnLevel (3,IsLastItemInLevel); Lay_NO_LAST_ITEM;
Lay_IndentDependingOnLevel (3,IsLastItemInLevel,
Lay_HORIZONTAL_LINE_AT_RIGHT);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (Hie_ParCod[Hie_INS],Hie[Hie_INS].HieCod); ParCod_PutPar (Hie_ParCod[Hie_INS],Hie[Hie_INS].HieCod);
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeInsInf), HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeInsInf),
@ -287,8 +292,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Gbl.Hierarchy.Node[Hie_CTR].HieCod == Hie[Hie_CTR].HieCod); Gbl.Hierarchy.Node[Hie_CTR].HieCod == Hie[Hie_CTR].HieCod);
HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" : HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" :
NULL); NULL);
IsLastItemInLevel[4] = (NumCtr == NumCtrs - 1); IsLastItemInLevel[4] = (NumCtr == NumCtrs - 1) ? Lay_LAST_ITEM :
Lay_IndentDependingOnLevel (4,IsLastItemInLevel); Lay_NO_LAST_ITEM;
Lay_IndentDependingOnLevel (4,IsLastItemInLevel,
Lay_HORIZONTAL_LINE_AT_RIGHT);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (Hie_ParCod[Hie_CTR],Hie[Hie_CTR].HieCod); ParCod_PutPar (Hie_ParCod[Hie_CTR],Hie[Hie_CTR].HieCod);
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtrInf), HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtrInf),
@ -322,8 +329,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Gbl.Hierarchy.Node[Hie_DEG].HieCod == Hie[Hie_DEG].HieCod); Gbl.Hierarchy.Node[Hie_DEG].HieCod == Hie[Hie_DEG].HieCod);
HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" : HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" :
NULL); NULL);
IsLastItemInLevel[5] = (NumDeg == NumDegs - 1); IsLastItemInLevel[5] = (NumDeg == NumDegs - 1) ? Lay_LAST_ITEM :
Lay_IndentDependingOnLevel (5,IsLastItemInLevel); Lay_NO_LAST_ITEM;
Lay_IndentDependingOnLevel (5,IsLastItemInLevel,
Lay_HORIZONTAL_LINE_AT_RIGHT);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (Hie_ParCod[Hie_DEG],Hie[Hie_DEG].HieCod); ParCod_PutPar (Hie_ParCod[Hie_DEG],Hie[Hie_DEG].HieCod);
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeDegInf), HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeDegInf),
@ -357,10 +366,12 @@ 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.Node[Hie_CRS].HieCod == Hie[Hie_CRS].HieCod); Gbl.Hierarchy.Node[Hie_CRS].HieCod == Hie[Hie_CRS].HieCod);
IsLastItemInLevel[6] = (NumCrs == NumCrss - 1) ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" : HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" :
NULL); NULL);
IsLastItemInLevel[6] = (NumCrs == NumCrss - 1); Lay_IndentDependingOnLevel (6,IsLastItemInLevel,
Lay_IndentDependingOnLevel (6,IsLastItemInLevel); Lay_HORIZONTAL_LINE_AT_RIGHT);
Frm_BeginForm (ActMyCrs); Frm_BeginForm (ActMyCrs);
ParCod_PutPar (Hie_ParCod[Hie_CRS],Hie[Hie_CRS].HieCod); ParCod_PutPar (Hie_ParCod[Hie_CRS],Hie[Hie_CRS].HieCod);
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Hie[Hie_CRS].ShrtName), HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Hie[Hie_CRS].ShrtName),
@ -377,11 +388,12 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
HTM_DIV_End (); HTM_DIV_End ();
HTM_BUTTON_End (); HTM_BUTTON_End ();
Frm_EndForm (); Frm_EndForm ();
/***** Put link to register students *****/
Enr_PutButtonInlineToRegisterStds (Hie[Hie_CRS].HieCod);
HTM_LI_End (); HTM_LI_End ();
/***** Put link to register students *****/
Enr_PutButtonInlineToRegisterStds (Hie[Hie_CRS].HieCod,
6,IsLastItemInLevel,
Highlight);
} }
/* Free structure that stores the query result */ /* Free structure that stores the query result */

View File

@ -172,19 +172,25 @@ void Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (void)
/****************** Put inline button to register students *******************/ /****************** Put inline button to register students *******************/
/*****************************************************************************/ /*****************************************************************************/
void Enr_PutButtonInlineToRegisterStds (long CrsCod) void Enr_PutButtonInlineToRegisterStds (long CrsCod,
unsigned Level,Lay_LastItem_t IsLastItemInLevel[],
bool Highlight)
{ {
extern const char *Txt_Register_students; extern const char *Txt_Register_students;
// if (Gbl.Usrs.Me.Role.Logged == Rol_TCH) // Course selected and I am logged as teacher
if (Rol_GetMyRoleInCrs (CrsCod) == Rol_TCH) // I am a teacher in the given course if (Rol_GetMyRoleInCrs (CrsCod) == Rol_TCH) // I am a teacher in the given course
if (!Enr_GetNumUsrsInCrss (Hie_CRS,CrsCod, if (!Enr_GetNumUsrsInCrss (Hie_CRS,CrsCod,
1 << Rol_STD)) // No students in course 1 << Rol_STD)) // No students in course
{ {
Frm_BeginForm (ActReqEnrSevStd); HTM_LI_Begin (Highlight ? "class=\"BG_HIGHLIGHT\"" :
ParCod_PutPar (ParCod_Crs,CrsCod); NULL);
Btn_PutCreateButtonInline (Txt_Register_students); Lay_IndentDependingOnLevel (Level,IsLastItemInLevel,
Frm_EndForm (); Lay_NO_HORIZONTAL_LINE_AT_RIGHT);
Frm_BeginForm (ActReqEnrSevStd);
ParCod_PutPar (ParCod_Crs,CrsCod);
Btn_PutCreateButtonInline (Txt_Register_students);
Frm_EndForm ();
HTM_LI_End ();
} }
} }

View File

@ -74,7 +74,9 @@ typedef enum
/*****************************************************************************/ /*****************************************************************************/
void Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (void); void Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (void);
void Enr_PutButtonInlineToRegisterStds (long CrsCod); void Enr_PutButtonInlineToRegisterStds (long CrsCod,
unsigned Level,Lay_LastItem_t IsLastItemInLevel[],
bool Highlight);
void Enr_PutLinkToRequestSignUp (void); void Enr_PutLinkToRequestSignUp (void);

View File

@ -337,27 +337,27 @@ static void For_PutIconsForums (__attribute__((unused)) void *Args);
static void For_PutFormWhichForums (const struct For_Forums *Forums); static void For_PutFormWhichForums (const struct For_Forums *Forums);
static void For_WriteLinksToGblForums (const struct For_Forums *Forums, static void For_WriteLinksToGblForums (const struct For_Forums *Forums,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]); Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]);
static void For_WriteLinksToPlatformForums (const struct For_Forums *Forums, static void For_WriteLinksToPlatformForums (const struct For_Forums *Forums,
bool IsLastForum, bool IsLastForum,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]); Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]);
static long For_WriteLinksToInsForums (const struct For_Forums *Forums, static long For_WriteLinksToInsForums (const struct For_Forums *Forums,
long InsCod,bool IsLastIns, long InsCod,bool IsLastIns,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]); Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]);
static long For_WriteLinksToCtrForums (const struct For_Forums *Forums, static long For_WriteLinksToCtrForums (const struct For_Forums *Forums,
long CtrCod,bool IsLastCtr, long CtrCod,bool IsLastCtr,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]); Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]);
static long For_WriteLinksToDegForums (const struct For_Forums *Forums, static long For_WriteLinksToDegForums (const struct For_Forums *Forums,
long DegCod,bool IsLastDeg, long DegCod,bool IsLastDeg,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]); Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]);
static long For_WriteLinksToCrsForums (const struct For_Forums *Forums, static long For_WriteLinksToCrsForums (const struct For_Forums *Forums,
long CrsCod,bool IsLastCrs, long CrsCod,bool IsLastCrs,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]); Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]);
static void For_WriteLinkToForum (const struct For_Forums *Forums, static void For_WriteLinkToForum (const struct For_Forums *Forums,
const struct For_Forum *Forum, const struct For_Forum *Forum,
bool Highlight, bool Highlight,
unsigned Level, unsigned Level,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]); Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]);
static unsigned For_GetNumThrsWithNewPstsInForum (const struct For_Forum *Forum, static unsigned For_GetNumThrsWithNewPstsInForum (const struct For_Forum *Forum,
unsigned NumThreads); unsigned NumThreads);
static unsigned For_GetNumOfUnreadPostsInThr (long ThrCod,unsigned NumPostsInThr); static unsigned For_GetNumOfUnreadPostsInThr (long ThrCod,unsigned NumPostsInThr);
@ -1213,7 +1213,7 @@ void For_ShowForumList (struct For_Forums *Forums)
{ {
extern const char *Hlp_COMMUNICATION_Forums; extern const char *Hlp_COMMUNICATION_Forums;
extern const char *Txt_Forums; extern const char *Txt_Forums;
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]; Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS];
MYSQL_RES *mysql_resCtr; MYSQL_RES *mysql_resCtr;
MYSQL_RES *mysql_resDeg; MYSQL_RES *mysql_resDeg;
MYSQL_RES *mysql_resCrs; MYSQL_RES *mysql_resCrs;
@ -1454,7 +1454,7 @@ static void For_PutFormWhichForums (const struct For_Forums *Forums)
/*****************************************************************************/ /*****************************************************************************/
static void For_WriteLinksToGblForums (const struct For_Forums *Forums, static void For_WriteLinksToGblForums (const struct For_Forums *Forums,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS])
{ {
bool Highlight; bool Highlight;
bool ICanSeeTeacherForum; bool ICanSeeTeacherForum;
@ -1470,7 +1470,7 @@ static void For_WriteLinksToGblForums (const struct For_Forums *Forums,
Forum.Type = For_FORUM_GLOBAL_USRS; Forum.Type = For_FORUM_GLOBAL_USRS;
Forum.HieCod = -1L; Forum.HieCod = -1L;
Highlight = (Forums->Forum.Type == For_FORUM_GLOBAL_USRS); Highlight = (Forums->Forum.Type == For_FORUM_GLOBAL_USRS);
IsLastItemInLevel[1] = false; IsLastItemInLevel[1] = Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,1,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,1,IsLastItemInLevel);
/***** Link to forum of teachers global *****/ /***** Link to forum of teachers global *****/
@ -1480,7 +1480,7 @@ static void For_WriteLinksToGblForums (const struct For_Forums *Forums,
Forum.Type = For_FORUM_GLOBAL_TCHS; Forum.Type = For_FORUM_GLOBAL_TCHS;
Forum.HieCod = -1L; Forum.HieCod = -1L;
Highlight = (Forums->Forum.Type == For_FORUM_GLOBAL_TCHS); Highlight = (Forums->Forum.Type == For_FORUM_GLOBAL_TCHS);
IsLastItemInLevel[1] = false; IsLastItemInLevel[1] = Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,1,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,1,IsLastItemInLevel);
} }
} }
@ -1491,7 +1491,7 @@ static void For_WriteLinksToGblForums (const struct For_Forums *Forums,
static void For_WriteLinksToPlatformForums (const struct For_Forums *Forums, static void For_WriteLinksToPlatformForums (const struct For_Forums *Forums,
bool IsLastForum, bool IsLastForum,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS])
{ {
bool Highlight; bool Highlight;
bool ICanSeeTeacherForum; bool ICanSeeTeacherForum;
@ -1507,7 +1507,8 @@ static void For_WriteLinksToPlatformForums (const struct For_Forums *Forums,
Forum.Type = For_FORUM__SWAD__USRS; Forum.Type = For_FORUM__SWAD__USRS;
Forum.HieCod = -1L; Forum.HieCod = -1L;
Highlight = (Forums->Forum.Type == For_FORUM__SWAD__USRS); Highlight = (Forums->Forum.Type == For_FORUM__SWAD__USRS);
IsLastItemInLevel[1] = (IsLastForum && !ICanSeeTeacherForum); IsLastItemInLevel[1] = (IsLastForum && !ICanSeeTeacherForum) ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,1,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,1,IsLastItemInLevel);
/***** Link to forum of teachers about the platform *****/ /***** Link to forum of teachers about the platform *****/
@ -1516,7 +1517,8 @@ static void For_WriteLinksToPlatformForums (const struct For_Forums *Forums,
Forum.Type = For_FORUM__SWAD__TCHS; Forum.Type = For_FORUM__SWAD__TCHS;
Forum.HieCod = -1L; Forum.HieCod = -1L;
Highlight = (Forums->Forum.Type == For_FORUM__SWAD__TCHS); Highlight = (Forums->Forum.Type == For_FORUM__SWAD__TCHS);
IsLastItemInLevel[1] = IsLastForum; IsLastItemInLevel[1] = IsLastForum ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,1,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,1,IsLastItemInLevel);
} }
} }
@ -1528,7 +1530,7 @@ static void For_WriteLinksToPlatformForums (const struct For_Forums *Forums,
static long For_WriteLinksToInsForums (const struct For_Forums *Forums, static long For_WriteLinksToInsForums (const struct For_Forums *Forums,
long InsCod,bool IsLastIns, long InsCod,bool IsLastIns,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS])
{ {
bool Highlight; bool Highlight;
Rol_Role_t MaxRoleInIns; Rol_Role_t MaxRoleInIns;
@ -1547,7 +1549,8 @@ static long For_WriteLinksToInsForums (const struct For_Forums *Forums,
Forum.HieCod = InsCod; Forum.HieCod = InsCod;
Highlight = (Forums->Forum.Type == For_FORUM_INSTIT_USRS && Highlight = (Forums->Forum.Type == For_FORUM_INSTIT_USRS &&
Forums->Forum.HieCod == InsCod); Forums->Forum.HieCod == InsCod);
IsLastItemInLevel[2] = (IsLastIns && !ICanSeeTeacherForum); IsLastItemInLevel[2] = (IsLastIns && !ICanSeeTeacherForum) ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,2,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,2,IsLastItemInLevel);
/***** Link to forum of teachers from this institution *****/ /***** Link to forum of teachers from this institution *****/
@ -1557,7 +1560,8 @@ static long For_WriteLinksToInsForums (const struct For_Forums *Forums,
Forum.HieCod = InsCod; Forum.HieCod = InsCod;
Highlight = (Forums->Forum.Type == For_FORUM_INSTIT_TCHS && Highlight = (Forums->Forum.Type == For_FORUM_INSTIT_TCHS &&
Forums->Forum.HieCod == InsCod); Forums->Forum.HieCod == InsCod);
IsLastItemInLevel[2] = IsLastIns; IsLastItemInLevel[2] = IsLastIns ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,2,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,2,IsLastItemInLevel);
} }
} }
@ -1571,7 +1575,7 @@ static long For_WriteLinksToInsForums (const struct For_Forums *Forums,
static long For_WriteLinksToCtrForums (const struct For_Forums *Forums, static long For_WriteLinksToCtrForums (const struct For_Forums *Forums,
long CtrCod,bool IsLastCtr, long CtrCod,bool IsLastCtr,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS])
{ {
bool Highlight; bool Highlight;
Rol_Role_t MaxRoleInCtr; Rol_Role_t MaxRoleInCtr;
@ -1590,7 +1594,8 @@ static long For_WriteLinksToCtrForums (const struct For_Forums *Forums,
Forum.HieCod = CtrCod; Forum.HieCod = CtrCod;
Highlight = (Forums->Forum.Type == For_FORUM_CENTER_USRS && Highlight = (Forums->Forum.Type == For_FORUM_CENTER_USRS &&
Forums->Forum.HieCod == CtrCod); Forums->Forum.HieCod == CtrCod);
IsLastItemInLevel[3] = (IsLastCtr && !ICanSeeTeacherForum); IsLastItemInLevel[3] = (IsLastCtr && !ICanSeeTeacherForum) ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,3,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,3,IsLastItemInLevel);
/***** Link to forum of teachers from this center *****/ /***** Link to forum of teachers from this center *****/
@ -1600,7 +1605,8 @@ static long For_WriteLinksToCtrForums (const struct For_Forums *Forums,
Forum.HieCod = CtrCod; Forum.HieCod = CtrCod;
Highlight = (Forums->Forum.Type == For_FORUM_CENTER_TCHS && Highlight = (Forums->Forum.Type == For_FORUM_CENTER_TCHS &&
Forums->Forum.HieCod == CtrCod); Forums->Forum.HieCod == CtrCod);
IsLastItemInLevel[3] = IsLastCtr; IsLastItemInLevel[3] = IsLastCtr ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,3,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,3,IsLastItemInLevel);
} }
} }
@ -1614,7 +1620,7 @@ static long For_WriteLinksToCtrForums (const struct For_Forums *Forums,
static long For_WriteLinksToDegForums (const struct For_Forums *Forums, static long For_WriteLinksToDegForums (const struct For_Forums *Forums,
long DegCod,bool IsLastDeg, long DegCod,bool IsLastDeg,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS])
{ {
bool Highlight; bool Highlight;
Rol_Role_t MaxRoleInDeg; Rol_Role_t MaxRoleInDeg;
@ -1633,7 +1639,8 @@ static long For_WriteLinksToDegForums (const struct For_Forums *Forums,
Forum.HieCod = DegCod; Forum.HieCod = DegCod;
Highlight = (Forums->Forum.Type == For_FORUM_DEGREE_USRS && Highlight = (Forums->Forum.Type == For_FORUM_DEGREE_USRS &&
Forums->Forum.HieCod == DegCod); Forums->Forum.HieCod == DegCod);
IsLastItemInLevel[4] = (IsLastDeg && !ICanSeeTeacherForum); IsLastItemInLevel[4] = (IsLastDeg && !ICanSeeTeacherForum) ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,4,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,4,IsLastItemInLevel);
/***** Link to forum of teachers from this degree *****/ /***** Link to forum of teachers from this degree *****/
@ -1643,7 +1650,8 @@ static long For_WriteLinksToDegForums (const struct For_Forums *Forums,
Forum.HieCod = DegCod; Forum.HieCod = DegCod;
Highlight = (Forums->Forum.Type == For_FORUM_DEGREE_TCHS && Highlight = (Forums->Forum.Type == For_FORUM_DEGREE_TCHS &&
Forums->Forum.HieCod == DegCod); Forums->Forum.HieCod == DegCod);
IsLastItemInLevel[4] = IsLastDeg; IsLastItemInLevel[4] = IsLastDeg ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,4,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,4,IsLastItemInLevel);
} }
} }
@ -1657,7 +1665,7 @@ static long For_WriteLinksToDegForums (const struct For_Forums *Forums,
static long For_WriteLinksToCrsForums (const struct For_Forums *Forums, static long For_WriteLinksToCrsForums (const struct For_Forums *Forums,
long CrsCod,bool IsLastCrs, long CrsCod,bool IsLastCrs,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS])
{ {
bool Highlight; bool Highlight;
Rol_Role_t MyRoleInCrs; Rol_Role_t MyRoleInCrs;
@ -1676,7 +1684,8 @@ static long For_WriteLinksToCrsForums (const struct For_Forums *Forums,
Forum.HieCod = CrsCod; Forum.HieCod = CrsCod;
Highlight = (Forums->Forum.Type == For_FORUM_COURSE_USRS && Highlight = (Forums->Forum.Type == For_FORUM_COURSE_USRS &&
Forums->Forum.HieCod == CrsCod); Forums->Forum.HieCod == CrsCod);
IsLastItemInLevel[5] = (IsLastCrs && !ICanSeeTeacherForum); IsLastItemInLevel[5] = (IsLastCrs && !ICanSeeTeacherForum) ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,5,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,5,IsLastItemInLevel);
/***** Link to forum of teachers from this course *****/ /***** Link to forum of teachers from this course *****/
@ -1686,7 +1695,8 @@ static long For_WriteLinksToCrsForums (const struct For_Forums *Forums,
Forum.HieCod = CrsCod; Forum.HieCod = CrsCod;
Highlight = (Forums->Forum.Type == For_FORUM_COURSE_TCHS && Highlight = (Forums->Forum.Type == For_FORUM_COURSE_TCHS &&
Forums->Forum.HieCod == CrsCod); Forums->Forum.HieCod == CrsCod);
IsLastItemInLevel[5] = IsLastCrs; IsLastItemInLevel[5] = IsLastCrs ? Lay_LAST_ITEM :
Lay_NO_LAST_ITEM;
For_WriteLinkToForum (Forums,&Forum,Highlight,5,IsLastItemInLevel); For_WriteLinkToForum (Forums,&Forum,Highlight,5,IsLastItemInLevel);
} }
} }
@ -1701,7 +1711,7 @@ static void For_WriteLinkToForum (const struct For_Forums *Forums,
const struct For_Forum *Forum, const struct For_Forum *Forum,
bool Highlight, bool Highlight,
unsigned Level, unsigned Level,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) Lay_LastItem_t IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS])
{ {
extern const char *Txt_Copy_not_allowed; extern const char *Txt_Copy_not_allowed;
unsigned NumThrs; unsigned NumThrs;
@ -1717,7 +1727,8 @@ static void For_WriteLinkToForum (const struct For_Forums *Forums,
NULL); NULL);
/***** Indent forum title *****/ /***** Indent forum title *****/
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel); Lay_IndentDependingOnLevel (Level,IsLastItemInLevel,
Lay_HORIZONTAL_LINE_AT_RIGHT);
/***** Write paste button used to move a thread in clipboard to this forum *****/ /***** Write paste button used to move a thread in clipboard to this forum *****/
if (Forums->Thread.ToMove >= 0) // If I have permission to paste threads and there is a thread ready to be pasted... if (Forums->Thread.ToMove >= 0) // If I have permission to paste threads and there is a thread ready to be pasted...
@ -1808,11 +1819,13 @@ static void For_WriteLinkToForum (const struct For_Forums *Forums,
Frm_EndForm (); Frm_EndForm ();
/***** Put link to register students *****/
if (Forum->Type == For_FORUM_COURSE_USRS)
Enr_PutButtonInlineToRegisterStds (Forum->HieCod);
HTM_LI_End (); HTM_LI_End ();
/***** Put link to register students *****/
if (Forum->Type == For_FORUM_COURSE_USRS)
Enr_PutButtonInlineToRegisterStds (Forum->HieCod,
5,IsLastItemInLevel,
Highlight);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -1604,31 +1604,36 @@ void Lay_AdvertisementMobile (void)
} }
/*****************************************************************************/ /*****************************************************************************/
/*********************** Indent forum or chat title **************************/ /****************** Indent forum, chat or course tree title ******************/
/*****************************************************************************/ /*****************************************************************************/
// IsLastItemInLevel[] is a vector with at least 1 + Level booleans // IsLastItemInLevel[] is a vector with at least 1 + Level elements
void Lay_IndentDependingOnLevel (unsigned Level,bool IsLastItemInLevel[]) void Lay_IndentDependingOnLevel (unsigned Level,
Lay_LastItem_t IsLastItemInLevel[],
Lay_HorizontalLineAtRight_t HorizontalLineAtRight)
{ {
unsigned i; static const char *Icons[Lay_NUM_HORIZONTAL_LINE_AT_RIGHT][Lay_NUM_LAST_ITEM] =
{
[Lay_NO_HORIZONTAL_LINE_AT_RIGHT][Lay_NO_LAST_ITEM] = "subleft20x20.gif",
[Lay_NO_HORIZONTAL_LINE_AT_RIGHT][Lay_LAST_ITEM ] = "tr20x20.gif",
[Lay_HORIZONTAL_LINE_AT_RIGHT ][Lay_NO_LAST_ITEM] = "submid20x20.gif",
[Lay_HORIZONTAL_LINE_AT_RIGHT ][Lay_LAST_ITEM ] = "subend20x20.gif",
};
unsigned L;
if (Level <= 1) if (Level <= 1)
return; return;
/***** Indent (from 1 to Level-1) *****/ /***** Indent (from 1 to Level-1) *****/
for (i = 2; for (L = 2;
i < Level; L < Level;
i++) L++)
Ico_PutIcon (IsLastItemInLevel[i] ? "tr20x20.gif" : Ico_PutIcon (Icons[Lay_NO_HORIZONTAL_LINE_AT_RIGHT][IsLastItemInLevel[L]],
"subleft20x20.gif", Ico_BLACK,"","ICO25x25");
Ico_BLACK,
"","ICO25x25");
/***** Level *****/ /***** Level *****/
Ico_PutIcon (IsLastItemInLevel[Level] ? "subend20x20.gif" : Ico_PutIcon (Icons[HorizontalLineAtRight][IsLastItemInLevel[Level]],
"submid20x20.gif", Ico_BLACK,"","ICO25x25");
Ico_BLACK,
"","ICO25x25");
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -40,6 +40,20 @@
#define Lay_SHOW_LEFT_COLUMN 2 // 10 #define Lay_SHOW_LEFT_COLUMN 2 // 10
#define Lay_SHOW_BOTH_COLUMNS (Lay_SHOW_LEFT_COLUMN | Lay_SHOW_RIGHT_COLUMN) // 11 #define Lay_SHOW_BOTH_COLUMNS (Lay_SHOW_LEFT_COLUMN | Lay_SHOW_RIGHT_COLUMN) // 11
#define Lay_NUM_LAST_ITEM 2
typedef enum
{
Lay_NO_LAST_ITEM,
Lay_LAST_ITEM,
} Lay_LastItem_t;
#define Lay_NUM_HORIZONTAL_LINE_AT_RIGHT 2
typedef enum
{
Lay_NO_HORIZONTAL_LINE_AT_RIGHT,
Lay_HORIZONTAL_LINE_AT_RIGHT,
} Lay_HorizontalLineAtRight_t;
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public prototypes ****************************/ /****************************** Public prototypes ****************************/
/*****************************************************************************/ /*****************************************************************************/
@ -72,7 +86,9 @@ void Lay_WriteHeaderClassPhoto (Vie_ViewType_t ViewType);
void Lay_AdvertisementMobile (void); void Lay_AdvertisementMobile (void);
void Lay_IndentDependingOnLevel (unsigned Level,bool IsLastItemInLevel[]); void Lay_IndentDependingOnLevel (unsigned Level,
Lay_LastItem_t IsLastItemInLevel[],
Lay_HorizontalLineAtRight_t HorizontalLineAtRight);
void Lay_HelpPlainEditor (void); void Lay_HelpPlainEditor (void);
void Lay_HelpRichEditor (void); void Lay_HelpRichEditor (void);

View File

@ -88,10 +88,11 @@ void Lgo_DrawLogo (Hie_Level_t Level,
}; };
const char *Folder = NULL; // To avoid warning const char *Folder = NULL; // To avoid warning
char PathLogo[PATH_MAX + 1]; char PathLogo[PATH_MAX + 1];
bool LogoFound; bool LogoFound = false;
long InsCod; long InsCod = HieCod;
long CtrCod; long CtrCod = HieCod;
long DegCod; long DegCod = HieCod;
long CrsCod = HieCod;
char *URL; char *URL;
char *Icon; char *Icon;
bool ClassNotEmpty; bool ClassNotEmpty;
@ -102,16 +103,13 @@ void Lgo_DrawLogo (Hie_Level_t Level,
if (HieCod > 0) // Institution, center or degree exists if (HieCod > 0) // Institution, center or degree exists
{ {
/* Course */ /* Course */
LogoFound = false;
/* Degree */ /* Degree */
if (!LogoFound && Level >= Hie_DEG) if (!LogoFound && Level >= Hie_DEG)
{ {
Folder = Cfg_FOLDER_DEG; Folder = Cfg_FOLDER_DEG;
if (Level >= Hie_CRS) // && !LogoFound if (Level >= Hie_CRS)
DegCod = Crs_DB_GetDegCodOfCourseByCod (HieCod); DegCod = Crs_DB_GetDegCodOfCourseByCod (CrsCod);
else
DegCod = HieCod;
snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png", snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png",
Cfg_PATH_DEG_PUBLIC, Cfg_PATH_DEG_PUBLIC,
(unsigned) (DegCod % 100), (unsigned) (DegCod % 100),
@ -126,7 +124,7 @@ void Lgo_DrawLogo (Hie_Level_t Level,
if (!LogoFound && Level >= Hie_CTR) if (!LogoFound && Level >= Hie_CTR)
{ {
Folder = Cfg_FOLDER_CTR; Folder = Cfg_FOLDER_CTR;
if (Level >= Hie_DEG) // && !LogoFound if (Level >= Hie_DEG)
CtrCod = Deg_DB_GetCtrCodOfDegreeByCod (DegCod); CtrCod = Deg_DB_GetCtrCodOfDegreeByCod (DegCod);
else else
CtrCod = HieCod; CtrCod = HieCod;
@ -144,10 +142,8 @@ void Lgo_DrawLogo (Hie_Level_t Level,
if (!LogoFound) if (!LogoFound)
{ {
Folder = Cfg_FOLDER_INS; Folder = Cfg_FOLDER_INS;
if (Level >= Hie_CTR) // && !LogoFound if (Level >= Hie_CTR)
InsCod = Ctr_DB_GetInsCodOfCenterByCod (CtrCod); InsCod = Ctr_DB_GetInsCodOfCenterByCod (CtrCod);
else
InsCod = HieCod;
snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png", snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png",
Cfg_PATH_INS_PUBLIC, Cfg_PATH_INS_PUBLIC,
(unsigned) (InsCod % 100), (unsigned) (InsCod % 100),