diff --git a/swad_changelog.h b/swad_changelog.h
index 128ec9b1..6ec417e8 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -35,11 +35,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 14.47.1 (2014/12/29)"
+#define Log_PLATFORM_VERSION "SWAD 14.47.2 (2014/12/29)"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1
/*
+ Version 14.47.2 :Dic 29, 2014 Changes in listing of chat rooms, forums and user's courses. (174677 lines)
Version 14.47.1 :Dic 29, 2014 Changes in listing of chat rooms, forums and user's courses.
Fixed bugs in CSS. (174619 lines)
Version 14.47 :Dic 29, 2014 Changes in listing of user's courses. (174659 lines)
diff --git a/swad_chat.c b/swad_chat.c
index 8253bbb8..55d427ce 100644
--- a/swad_chat.c
+++ b/swad_chat.c
@@ -60,6 +60,7 @@ extern struct Globals Gbl;
static void Cht_WriteLinkToChat (const char *Icon,const char *RoomCode,const char *RoomShortName,const char *RoomFullName,
unsigned Level,bool IsLastItemInLevel[1+Cht_CHAT_MAX_LEVELS]);
+static unsigned Cht_GetNumUsrsInChatRoom (const char *RoomCode);
/*****************************************************************************/
/****************** List available whiteboard/chat rooms *********************/
@@ -116,15 +117,19 @@ void Cht_ShowListOfAvailableChatRooms (void)
/***** Table start *****/
Lay_StartRoundFrameTable10 (NULL,0,Txt_Chat_rooms);
fprintf (Gbl.F.Out,"
"
- ""
+ ""
+ " ",
- The_ClassFormul[Gbl.Prefs.Theme]);
+ The_ClassFormul[Gbl.Prefs.Theme]);
/***** Title of top level *****/
- fprintf (Gbl.F.Out,""
+ ""
- " %s | "
- "
",
+ " %s"
+ "",
Gbl.Prefs.IconsURL,Txt_Chat_rooms);
/***** Link to chat available for all the users *****/
@@ -205,6 +210,10 @@ void Cht_ShowListOfAvailableChatRooms (void)
}
/***** End table *****/
+ fprintf (Gbl.F.Out,""
+ ""
+ ""
+ "");
Lay_EndRoundFrameTable10 ();
}
@@ -279,24 +288,19 @@ static void Cht_WriteLinkToChat (const char *Icon,const char *RoomCode,const cha
unsigned Level,bool IsLastItemInLevel[1+Cht_CHAT_MAX_LEVELS])
{
extern const char *The_ClassFormul[The_NUM_THEMES];
- extern const char *The_ClassFormulB[The_NUM_THEMES];
extern const char *Txt_connected_PLURAL;
extern const char *Txt_connected_SINGULAR;
- const char *Style;
- int NumUsrsInRoom = Cht_GetNumUsrsInChatRoom (RoomCode);
+ unsigned NumUsrsInRoom = Cht_GetNumUsrsInChatRoom (RoomCode);
sprintf (Gbl.Chat.WindowName,"%s_%s",RoomCode,Gbl.UniqueNameEncrypted);
- Style = (NumUsrsInRoom > 0 ? The_ClassFormulB[Gbl.Prefs.Theme] :
- The_ClassFormul[Gbl.Prefs.Theme]);
- fprintf (Gbl.F.Out,""
- "",
- Style);
+ fprintf (Gbl.F.Out,"");
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel);
Act_FormStart (ActCht);
Cht_WriteParamsRoomCodeAndNames (RoomCode,RoomShortName,RoomFullName);
- Act_LinkFormSubmit (RoomFullName,Style);
+ Act_LinkFormSubmit (RoomFullName,The_ClassFormul[Gbl.Prefs.Theme]);
+ if (NumUsrsInRoom)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out,"%s %s",Icon,RoomFullName);
if (NumUsrsInRoom > 1)
fprintf (Gbl.F.Out," [%d %s]",
@@ -304,10 +308,11 @@ static void Cht_WriteLinkToChat (const char *Icon,const char *RoomCode,const cha
else if (NumUsrsInRoom == 1)
fprintf (Gbl.F.Out," [1 %s]",
Txt_connected_SINGULAR);
+ if (NumUsrsInRoom)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out,""
""
- " | "
- "
");
+ "");
}
/*****************************************************************************/
@@ -325,27 +330,23 @@ void Cht_WriteParamsRoomCodeAndNames (const char *RoomCode,const char *RoomShort
/*************** Get number of users connected to a chat room ****************/
/*****************************************************************************/
-int Cht_GetNumUsrsInChatRoom (const char *RoomCode)
+static unsigned Cht_GetNumUsrsInChatRoom (const char *RoomCode)
{
char Query[512];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
- unsigned long NumRows;
- int NumUsrs = -1; // -1 ==> room is not in database. We can not know the number of usrs connected
+ unsigned NumUsrs = 0;
/***** Get number of users connected to chat rooms from database *****/
- sprintf (Query,"SELECT NumUsrs FROM chat WHERE RoomCode='%s'",RoomCode);
- NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get number of users connected to a chat room");
-
- /***** Check number of rows of the result *****/
- if (NumRows == 1)
+ sprintf (Query,"SELECT NumUsrs FROM chat WHERE RoomCode='%s'",
+ RoomCode);
+ if (DB_QuerySELECT (Query,&mysql_res,"can not get number of users connected to a chat room"))
{
/* Get number of users connected to the chat room */
row = mysql_fetch_row (mysql_res);
if (row[0])
- if (sscanf (row[0],"%d",&NumUsrs) == 1)
- if (NumUsrs < 0)
- NumUsrs = -1;
+ if (sscanf (row[0],"%u",&NumUsrs) != 1)
+ NumUsrs = 0;
}
/***** Free structure that stores the query result *****/
diff --git a/swad_chat.h b/swad_chat.h
index 120d02b9..223fb219 100644
--- a/swad_chat.h
+++ b/swad_chat.h
@@ -43,7 +43,6 @@ void Cht_ShowChatRooms (void);
void Cht_ShowListOfAvailableChatRooms (void);
void Cht_ShowListOfChatRoomsWithUsrs (void);
void Cht_WriteParamsRoomCodeAndNames (const char *RoomCode,const char *RoomShortName,const char *RoomFullName);
-int Cht_GetNumUsrsInChatRoom (const char *RoomCode);
void Cht_OpenChatWindow (void);
#endif
diff --git a/swad_course.c b/swad_course.c
index 44f8224e..93919438 100644
--- a/swad_course.c
+++ b/swad_course.c
@@ -546,6 +546,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
struct Degree Deg;
struct Course Crs;
bool IsLastItemInLevel[1+5];
+ bool Highlight; // Highlight because degree, course, etc. is selected
MYSQL_RES *mysql_resCty;
MYSQL_RES *mysql_resIns;
MYSQL_RES *mysql_resCtr;
@@ -562,29 +563,35 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
/***** Table start *****/
Lay_StartRoundFrameTable10 (NULL,0,Txt_My_courses);
-
- /***** Write link to country *****/
fprintf (Gbl.F.Out,""
- "",
- The_ClassFormul[Gbl.Prefs.Theme]);
+ " | "
+ ""
+ " ",
+ The_ClassFormul[Gbl.Prefs.Theme]);
+
+ /***** Write link to platform *****/
+ fprintf (Gbl.F.Out,"- ");
Act_FormGoToStart (ActMnu);
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) TabSys);
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[TabSys],
The_ClassFormul[Gbl.Prefs.Theme]);
- /* Country map */
fprintf (Gbl.F.Out,"",
Gbl.Prefs.IconsURL,
Txt_TABS_FULL_TXT[TabSys],
Txt_TABS_FULL_TXT[TabSys]);
+ Highlight = (Gbl.CurrentCty.Cty.CtyCod <= 0);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out," %s",Txt_TABS_FULL_TXT[TabSys]);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out,""
""
- "
| "
- "
");
+ "");
/***** Get my countries *****/
NumCtys = Usr_GetCtysFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,&mysql_resCty);
@@ -601,11 +608,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_ShowErrorAndExit ("Country not found.");
/***** Write link to country *****/
- fprintf (Gbl.F.Out,""
- "",
- The_ClassFormul[Gbl.Prefs.Theme]);
+ fprintf (Gbl.F.Out,"");
IsLastItemInLevel[1] = (NumCty == NumCtys - 1);
Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
Act_FormStart (ActSeeCtyInf);
@@ -621,14 +624,20 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Cty.Alpha2,
Cty.Alpha2,
Cty.Name[Gbl.Prefs.Language]);
+ Highlight = (Gbl.CurrentIns.Ins.InsCod <= 0 &&
+ Gbl.CurrentCty.Cty.CtyCod == Cty.CtyCod);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out," %s",Cty.Name[Gbl.Prefs.Language]);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out,""
""
- " | "
- "
");
+ "");
/***** Get my institutions in this country *****/
- NumInss = (unsigned) Usr_GetInssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,Cty.CtyCod,&mysql_resIns);
+ NumInss = (unsigned) Usr_GetInssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,
+ Cty.CtyCod,&mysql_resIns);
for (NumIns = 0;
NumIns < NumInss;
NumIns++)
@@ -642,11 +651,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_ShowErrorAndExit ("Institution not found.");
/***** Write link to institution *****/
- fprintf (Gbl.F.Out,""
- "",
- The_ClassFormul[Gbl.Prefs.Theme]);
+ fprintf (Gbl.F.Out,"");
IsLastItemInLevel[2] = (NumIns == NumInss - 1);
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
Act_FormStart (ActSeeInsInf);
@@ -654,14 +659,20 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeInsInf].ActCod,ActTxt),
The_ClassFormul[Gbl.Prefs.Theme]);
Ins_DrawInstitutionLogo (Ins.Logo,Ins.ShortName,16,"vertical-align:middle;");
+ Highlight = (Gbl.CurrentCtr.Ctr.CtrCod <= 0 &&
+ Gbl.CurrentIns.Ins.InsCod == Ins.InsCod);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out," %s",Ins.FullName);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out,""
""
- " | "
- "
");
+ "");
/***** Get my centres in this institution *****/
- NumCtrs = (unsigned) Usr_GetCtrsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,Ins.InsCod,&mysql_resCtr);
+ NumCtrs = (unsigned) Usr_GetCtrsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,
+ Ins.InsCod,&mysql_resCtr);
for (NumCtr = 0;
NumCtr < NumCtrs;
NumCtr++)
@@ -675,11 +686,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_ShowErrorAndExit ("Centre not found.");
/***** Write link to centre *****/
- fprintf (Gbl.F.Out,""
- "",
- The_ClassFormul[Gbl.Prefs.Theme]);
+ fprintf (Gbl.F.Out,"");
IsLastItemInLevel[3] = (NumCtr == NumCtrs - 1);
Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
Act_FormStart (ActSeeCtrInf);
@@ -687,14 +694,20 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtrInf].ActCod,ActTxt),
The_ClassFormul[Gbl.Prefs.Theme]);
Ctr_DrawCentreLogo (Ctr.Logo,Ctr.ShortName,16,"vertical-align:middle;");
+ Highlight = (Gbl.CurrentDeg.Deg.DegCod <= 0 &&
+ Gbl.CurrentCtr.Ctr.CtrCod == Ctr.CtrCod);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out," %s",Ctr.FullName);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out,""
""
- " | "
- "
");
+ "");
/***** Get my degrees in this centre *****/
- NumDegs = (unsigned) Usr_GetDegsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,Ctr.CtrCod,&mysql_resDeg);
+ NumDegs = (unsigned) Usr_GetDegsFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,
+ Ctr.CtrCod,&mysql_resDeg);
for (NumDeg = 0;
NumDeg < NumDegs;
NumDeg++)
@@ -708,11 +721,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_ShowErrorAndExit ("Degree not found.");
/***** Write link to degree *****/
- fprintf (Gbl.F.Out,""
- "",
- The_ClassFormul[Gbl.Prefs.Theme]);
+ fprintf (Gbl.F.Out,"");
IsLastItemInLevel[4] = (NumDeg == NumDegs - 1);
Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
Act_FormStart (ActSeeDegInf);
@@ -720,14 +729,20 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeDegInf].ActCod,ActTxt),
The_ClassFormul[Gbl.Prefs.Theme]);
Deg_DrawDegreeLogo (Deg.Logo,Deg.ShortName,16,"vertical-align:middle;");
+ Highlight = (Gbl.CurrentCrs.Crs.CrsCod <= 0 &&
+ Gbl.CurrentDeg.Deg.DegCod == Deg.DegCod);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out," %s",Deg.FullName);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
fprintf (Gbl.F.Out,""
""
- " | "
- "
");
+ "");
/***** Get my courses in this degree *****/
- NumCrss = (unsigned) Usr_GetCrssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,Deg.DegCod,&mysql_resCrs);
+ NumCrss = (unsigned) Usr_GetCrssFromUsr (Gbl.Usrs.Me.UsrDat.UsrCod,
+ Deg.DegCod,&mysql_resCrs);
for (NumCrs = 0;
NumCrs < NumCrss;
NumCrs++)
@@ -741,11 +756,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_ShowErrorAndExit ("Course not found.");
/***** Write link to course *****/
- fprintf (Gbl.F.Out,""
- "",
- The_ClassFormul[Gbl.Prefs.Theme]);
+ fprintf (Gbl.F.Out,"");
IsLastItemInLevel[5] = (NumCrs == NumCrss - 1);
Lay_IndentDependingOnLevel (5,IsLastItemInLevel);
Act_FormStart (ActSeeCrsInf);
@@ -755,12 +766,16 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
The_ClassFormul[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,""
- " %s"
- ""
- "",
- Gbl.Prefs.IconsURL,Crs.ShortName,
- Crs.FullName);
+ " style=\"vertical-align:middle;\" />",
+ Gbl.Prefs.IconsURL,Crs.ShortName);
+ Highlight = (Gbl.CurrentCrs.Crs.CrsCod == Crs.CrsCod);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
+ fprintf (Gbl.F.Out," %s",Crs.FullName);
+ if (Highlight)
+ fprintf (Gbl.F.Out,"");
+ fprintf (Gbl.F.Out,""
+ "");
/***** Write link to RSS file *****/
sprintf (PathRelRSSFile,"%s/%s/%ld/%s/%s",
@@ -776,8 +791,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
"",
Gbl.Prefs.IconsURL);
- fprintf (Gbl.F.Out," | "
- "
");
+ fprintf (Gbl.F.Out,"");
}
/* Free structure that stores the query result */
@@ -800,6 +814,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
DB_FreeMySQLResult (&mysql_resCty);
/***** End frame *****/
+ fprintf (Gbl.F.Out,""
+ ""
+ ""
+ "");
Lay_EndRoundFrameTable10 ();
}
diff --git a/swad_enrollment.c b/swad_enrollment.c
index 4331500a..24a584ee 100644
--- a/swad_enrollment.c
+++ b/swad_enrollment.c
@@ -741,7 +741,8 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
/***** Start list of options *****/
fprintf (Gbl.F.Out,""
- "
",
+ "",
The_ClassFormul[Gbl.Prefs.Theme]);
/***** Register user in course / Modify user's data *****/
@@ -866,7 +867,8 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
/***** Start list of options *****/
fprintf (Gbl.F.Out,""
- "
",
+ "",
The_ClassFormul[Gbl.Prefs.Theme]);
/***** Register / remove users listed or not listed *****/
diff --git a/swad_file_browser.c b/swad_file_browser.c
index de1003ca..d697d853 100644
--- a/swad_file_browser.c
+++ b/swad_file_browser.c
@@ -2273,7 +2273,8 @@ static void Brw_FormToChangeZone (void)
}
/***** List start *****/
- fprintf (Gbl.F.Out,"");
+ fprintf (Gbl.F.Out,"");
/***** Select the complete course, not a group *****/
fprintf (Gbl.F.Out,"- "
diff --git a/swad_forum.c b/swad_forum.c
index ed2efecf..4ce8dfe8 100644
--- a/swad_forum.c
+++ b/swad_forum.c
@@ -243,6 +243,7 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject);
static void For_PutParamWhichForum (void);
static void For_PutParamForumOrder (void);
static void For_PutFormWhichForums (void);
+static void For_WriteLinkToTopLevelOfForums (void);
static void For_PutParamsForumInsDegCrs (void);
static void For_WriteLinksToGblForums (bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS]);
static void For_WriteLinksToPlatformForums (bool IsLastForum,bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS]);
@@ -265,6 +266,7 @@ static void For_PutHiddenParamPstCod (long PstCod);
static long For_GetParamPstCod (void);
static void For_ShowAForumPost (struct ForumThread *Thr,unsigned PstNum,long PstCod,bool LastPst,char *LastSubject,bool NewPst,bool ICanModerateForum);
static void For_GetPstData (long PstCod,long *UsrCod,char *CreatTime,char *Subject, char *Content);
+static void For_WriteNumberOfPosts (For_ForumType_t ForumType,long UsrCod);
/*****************************************************************************/
/****************************** Enable a forum post **************************/
@@ -841,6 +843,8 @@ void For_RemoveUsrFromReadThrs (long UsrCod)
static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
{
+ extern const char *The_ClassFormul[The_NUM_THEMES];
+ extern const char *Txt_Forums;
bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS];
struct ForumThread Thr;
char Query[1024];
@@ -872,12 +876,19 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
For_GetThrReadTime (ThrCod,ReadTime);
/* Table start */
- Lay_StartRoundFrameTable10 (NULL,0,NULL);
+ Lay_StartRoundFrameTable10 (NULL,0,Txt_Forums);
/* Put a form to select which forums */
For_PutFormWhichForums ();
/* Write a link to top level of forums */
+ fprintf (Gbl.F.Out,"
"
+ ""
+ ""
+ " ",
+ The_ClassFormul[Gbl.Prefs.Theme]);
For_WriteLinkToTopLevelOfForums ();
/* Write a link to current forum */
@@ -885,9 +896,7 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
For_WriteLinkToAForum (Gbl.Forum.ForumType,true,1,IsLastItemInLevel);
/* Write thread title */
- fprintf (Gbl.F.Out,""
- "");
+ fprintf (Gbl.F.Out,"- ");
IsLastItemInLevel[2] = true;
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
@@ -911,8 +920,11 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
fprintf (Gbl.F.Out," ");
Msg_WriteNumMsgs (NumPsts,0);
- fprintf (Gbl.F.Out,"
| "
- " ");
+ fprintf (Gbl.F.Out,""
+ " "
+ " "
+ " | "
+ "
");
Lay_EndRoundFrameTable10 ();
LastSubject[0] = '\0';
@@ -1271,7 +1283,7 @@ void For_GetNotifForumPst (char *SummaryStr,char **ContentStr,long PstCod,unsign
/*************** Write number of posts in a forum of an user *****************/
/*****************************************************************************/
-void For_WriteNumberOfPosts (For_ForumType_t ForumType,long UsrCod)
+static void For_WriteNumberOfPosts (For_ForumType_t ForumType,long UsrCod)
{
extern const char *Txt_post;
extern const char *Txt_posts;
@@ -1556,6 +1568,7 @@ void For_SetForumTypeAndRestrictAccess (void)
void For_ShowForumList (void)
{
+ extern const char *The_ClassFormul[The_NUM_THEMES];
extern const char *Txt_Forums;
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER); // If I have permission to move threads...
bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS];
@@ -1588,6 +1601,13 @@ void For_ShowForumList (void)
For_PutFormWhichForums ();
/***** Write a link to top level of forums *****/
+ fprintf (Gbl.F.Out,""
+ ""
+ ""
+ " ",
+ The_ClassFormul[Gbl.Prefs.Theme]);
For_WriteLinkToTopLevelOfForums ();
/***** Links to global forums *****/
@@ -1698,6 +1718,10 @@ void For_ShowForumList (void)
}
/***** End table *****/
+ fprintf (Gbl.F.Out," "
+ " "
+ " | "
+ "
");
Lay_EndRoundFrameTable10 ();
}
@@ -1745,15 +1769,12 @@ static void For_PutFormWhichForums (void)
/**************** Write title and link to top level of forums ****************/
/*****************************************************************************/
-void For_WriteLinkToTopLevelOfForums (void)
+static void For_WriteLinkToTopLevelOfForums (void)
{
extern const char *The_ClassFormul[The_NUM_THEMES];
extern const char *Txt_Forums;
- fprintf (Gbl.F.Out,""
- "",
- The_ClassFormul[Gbl.Prefs.Theme]);
+ fprintf (Gbl.F.Out,"- ");
Act_FormStart (ActSeeFor);
For_PutAllHiddenParamsForum ();
Act_LinkFormSubmit (Txt_Forums,The_ClassFormul[Gbl.Prefs.Theme]);
@@ -1763,8 +1784,7 @@ void For_WriteLinkToTopLevelOfForums (void)
" %s"
""
""
- "
| "
- "
",
+ " ",
Gbl.Prefs.IconsURL,
Txt_Forums,
Txt_Forums,
@@ -2090,10 +2110,7 @@ static void For_WriteLinkToForum (For_ForumType_t ForumType,Act_Action_t NextAct
The_ClassFormul[Gbl.Prefs.Theme]);
/***** Start row *****/
- fprintf (Gbl.F.Out,""
- "",
- Style);
+ fprintf (Gbl.F.Out,"- ");
/***** Indent forum title *****/
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel);
@@ -2157,8 +2174,7 @@ static void For_WriteLinkToForum (For_ForumType_t ForumType,Act_Action_t NextAct
fprintf (Gbl.F.Out,""
""
- "
| "
- "
");
+ "");
}
/*****************************************************************************/
@@ -2320,6 +2336,8 @@ static unsigned For_GetNumOfPostsInThrNewerThan (long ThrCod,const char *Time)
void For_ShowForumThrs (void)
{
+ extern const char *The_ClassFormul[The_NUM_THEMES];
+ extern const char *Txt_Forums;
extern const char *Txt_MSG_Subject;
extern const char *Txt_FORUM_THREAD_HELP_ORDER[2];
extern const char *Txt_FORUM_THREAD_ORDER[2];
@@ -2355,17 +2373,25 @@ void For_ShowForumThrs (void)
/***** Get threads of a forum from database *****/
switch (Gbl.Forum.ForumType)
{
- case For_FORUM_INSTITUTION_USRS: case For_FORUM_INSTITUTION_TCHS:
- sprintf (SubQuery," AND forum_thread.Location='%ld'",Gbl.Forum.Ins.InsCod);
+ case For_FORUM_INSTITUTION_USRS:
+ case For_FORUM_INSTITUTION_TCHS:
+ sprintf (SubQuery," AND forum_thread.Location='%ld'",
+ Gbl.Forum.Ins.InsCod);
break;
- case For_FORUM_CENTRE_USRS: case For_FORUM_CENTRE_TCHS:
- sprintf (SubQuery," AND forum_thread.Location='%ld'",Gbl.Forum.Ctr.CtrCod);
+ case For_FORUM_CENTRE_USRS:
+ case For_FORUM_CENTRE_TCHS:
+ sprintf (SubQuery," AND forum_thread.Location='%ld'",
+ Gbl.Forum.Ctr.CtrCod);
break;
- case For_FORUM_DEGREE_USRS: case For_FORUM_DEGREE_TCHS:
- sprintf (SubQuery," AND forum_thread.Location='%ld'",Gbl.Forum.Deg.DegCod);
+ case For_FORUM_DEGREE_USRS:
+ case For_FORUM_DEGREE_TCHS:
+ sprintf (SubQuery," AND forum_thread.Location='%ld'",
+ Gbl.Forum.Deg.DegCod);
break;
- case For_FORUM_COURSE_USRS: case For_FORUM_COURSE_TCHS:
- sprintf (SubQuery," AND forum_thread.Location='%ld'",Gbl.Forum.Crs.CrsCod);
+ case For_FORUM_COURSE_USRS:
+ case For_FORUM_COURSE_TCHS:
+ sprintf (SubQuery," AND forum_thread.Location='%ld'",
+ Gbl.Forum.Crs.CrsCod);
break;
default:
SubQuery[0] = '\0';
@@ -2414,12 +2440,19 @@ void For_ShowForumThrs (void)
/***** Header whith the name of this forum, the number of threads, and the total number of posts *****/
/* Table start */
- Lay_StartRoundFrameTable10 (NULL,0,NULL);
+ Lay_StartRoundFrameTable10 (NULL,0,Txt_Forums);
/* Put a form to select which forums */
For_PutFormWhichForums ();
/* Write a link to top level of forums */
+ fprintf (Gbl.F.Out,""
+ ""
+ ""
+ " ",
+ The_ClassFormul[Gbl.Prefs.Theme]);
For_WriteLinkToTopLevelOfForums ();
/* Write a link to current forum */
@@ -2427,6 +2460,10 @@ void For_ShowForumThrs (void)
For_WriteLinkToAForum (Gbl.Forum.ForumType,true,1,IsLastItemInLevel);
/* End table */
+ fprintf (Gbl.F.Out," "
+ " "
+ " | "
+ "
");
Lay_EndRoundFrameTable10 ();
/***** List the threads *****/
diff --git a/swad_forum.h b/swad_forum.h
index e6e7f7d9..158d8a19 100644
--- a/swad_forum.h
+++ b/swad_forum.h
@@ -116,11 +116,9 @@ void For_RemoveUsrFromReadThrs (long UsrCod);
void For_GetNotifForumPst (char *SummaryStr,char **ContentStr,long PstCod,unsigned MaxChars,bool GetContent);
-void For_WriteNumberOfPosts (For_ForumType_t ForumType,long UsrCod);
void For_PutAllHiddenParamsForum (void);
void For_SetForumTypeAndRestrictAccess (void);
void For_ShowForumList (void);
-void For_WriteLinkToTopLevelOfForums (void);
void For_SetForumName (For_ForumType_t ForumType,
struct Institution *Ins,
struct Centre *Ctr,