mirror of https://github.com/acanas/swad-core.git
Version 14.47.2
This commit is contained in:
parent
6c035aaf87
commit
ba2ec0a62d
|
@ -35,11 +35,12 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** 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:
|
// 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
|
// 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.
|
Version 14.47.1 :Dic 29, 2014 Changes in listing of chat rooms, forums and user's courses.
|
||||||
Fixed bugs in CSS. (174619 lines)
|
Fixed bugs in CSS. (174619 lines)
|
||||||
Version 14.47 :Dic 29, 2014 Changes in listing of user's courses. (174659 lines)
|
Version 14.47 :Dic 29, 2014 Changes in listing of user's courses. (174659 lines)
|
||||||
|
|
57
swad_chat.c
57
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,
|
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]);
|
unsigned Level,bool IsLastItemInLevel[1+Cht_CHAT_MAX_LEVELS]);
|
||||||
|
static unsigned Cht_GetNumUsrsInChatRoom (const char *RoomCode);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************** List available whiteboard/chat rooms *********************/
|
/****************** List available whiteboard/chat rooms *********************/
|
||||||
|
@ -116,15 +117,19 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
/***** Table start *****/
|
/***** Table start *****/
|
||||||
Lay_StartRoundFrameTable10 (NULL,0,Txt_Chat_rooms);
|
Lay_StartRoundFrameTable10 (NULL,0,Txt_Chat_rooms);
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s\" style=\"height:20px;"
|
"<td>"
|
||||||
|
"<div style=\"display:inline-block; margin:0 auto;\">"
|
||||||
|
"<ul class=\"%s\" style=\"list-style-type:none;"
|
||||||
|
" padding:0; margin:0;"
|
||||||
" text-align:left; vertical-align:middle;\">",
|
" text-align:left; vertical-align:middle;\">",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
|
||||||
/***** Title of top level *****/
|
/***** Title of top level *****/
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/chat16x16.gif\""
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">"
|
||||||
|
"<img src=\"%s/chat16x16.gif\""
|
||||||
" class=\"ICON16x16\" style=\"vertical-align:middle;\" />"
|
" class=\"ICON16x16\" style=\"vertical-align:middle;\" />"
|
||||||
" %s</td>"
|
" %s"
|
||||||
"</tr>",
|
"</li>",
|
||||||
Gbl.Prefs.IconsURL,Txt_Chat_rooms);
|
Gbl.Prefs.IconsURL,Txt_Chat_rooms);
|
||||||
|
|
||||||
/***** Link to chat available for all the users *****/
|
/***** Link to chat available for all the users *****/
|
||||||
|
@ -205,6 +210,10 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
|
fprintf (Gbl.F.Out,"</ul>"
|
||||||
|
"</div>"
|
||||||
|
"</td>"
|
||||||
|
"</tr>");
|
||||||
Lay_EndRoundFrameTable10 ();
|
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])
|
unsigned Level,bool IsLastItemInLevel[1+Cht_CHAT_MAX_LEVELS])
|
||||||
{
|
{
|
||||||
extern const char *The_ClassFormul[The_NUM_THEMES];
|
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_PLURAL;
|
||||||
extern const char *Txt_connected_SINGULAR;
|
extern const char *Txt_connected_SINGULAR;
|
||||||
const char *Style;
|
unsigned NumUsrsInRoom = Cht_GetNumUsrsInChatRoom (RoomCode);
|
||||||
int NumUsrsInRoom = Cht_GetNumUsrsInChatRoom (RoomCode);
|
|
||||||
|
|
||||||
sprintf (Gbl.Chat.WindowName,"%s_%s",RoomCode,Gbl.UniqueNameEncrypted);
|
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,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"%s\" style=\"height:20px;"
|
|
||||||
" text-align:left; vertical-align:middle;\">",
|
|
||||||
Style);
|
|
||||||
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel);
|
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel);
|
||||||
Act_FormStart (ActCht);
|
Act_FormStart (ActCht);
|
||||||
Cht_WriteParamsRoomCodeAndNames (RoomCode,RoomShortName,RoomFullName);
|
Cht_WriteParamsRoomCodeAndNames (RoomCode,RoomShortName,RoomFullName);
|
||||||
Act_LinkFormSubmit (RoomFullName,Style);
|
Act_LinkFormSubmit (RoomFullName,The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
if (NumUsrsInRoom)
|
||||||
|
fprintf (Gbl.F.Out,"<strong>");
|
||||||
fprintf (Gbl.F.Out,"%s %s",Icon,RoomFullName);
|
fprintf (Gbl.F.Out,"%s %s",Icon,RoomFullName);
|
||||||
if (NumUsrsInRoom > 1)
|
if (NumUsrsInRoom > 1)
|
||||||
fprintf (Gbl.F.Out," [%d %s]",
|
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)
|
else if (NumUsrsInRoom == 1)
|
||||||
fprintf (Gbl.F.Out," [1 %s]",
|
fprintf (Gbl.F.Out," [1 %s]",
|
||||||
Txt_connected_SINGULAR);
|
Txt_connected_SINGULAR);
|
||||||
|
if (NumUsrsInRoom)
|
||||||
|
fprintf (Gbl.F.Out,"</strong>");
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</td>"
|
"</li>");
|
||||||
"</tr>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -325,27 +330,23 @@ void Cht_WriteParamsRoomCodeAndNames (const char *RoomCode,const char *RoomShort
|
||||||
/*************** Get number of users connected to a chat room ****************/
|
/*************** 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];
|
char Query[512];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
unsigned long NumRows;
|
unsigned NumUsrs = 0;
|
||||||
int NumUsrs = -1; // -1 ==> room is not in database. We can not know the number of usrs connected
|
|
||||||
|
|
||||||
/***** Get number of users connected to chat rooms from database *****/
|
/***** Get number of users connected to chat rooms from database *****/
|
||||||
sprintf (Query,"SELECT NumUsrs FROM chat WHERE RoomCode='%s'",RoomCode);
|
sprintf (Query,"SELECT NumUsrs FROM chat WHERE RoomCode='%s'",
|
||||||
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get number of users connected to a chat room");
|
RoomCode);
|
||||||
|
if (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)
|
|
||||||
{
|
{
|
||||||
/* Get number of users connected to the chat room */
|
/* Get number of users connected to the chat room */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
if (row[0])
|
if (row[0])
|
||||||
if (sscanf (row[0],"%d",&NumUsrs) == 1)
|
if (sscanf (row[0],"%u",&NumUsrs) != 1)
|
||||||
if (NumUsrs < 0)
|
NumUsrs = 0;
|
||||||
NumUsrs = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
|
|
|
@ -43,7 +43,6 @@ void Cht_ShowChatRooms (void);
|
||||||
void Cht_ShowListOfAvailableChatRooms (void);
|
void Cht_ShowListOfAvailableChatRooms (void);
|
||||||
void Cht_ShowListOfChatRoomsWithUsrs (void);
|
void Cht_ShowListOfChatRoomsWithUsrs (void);
|
||||||
void Cht_WriteParamsRoomCodeAndNames (const char *RoomCode,const char *RoomShortName,const char *RoomFullName);
|
void Cht_WriteParamsRoomCodeAndNames (const char *RoomCode,const char *RoomShortName,const char *RoomFullName);
|
||||||
int Cht_GetNumUsrsInChatRoom (const char *RoomCode);
|
|
||||||
void Cht_OpenChatWindow (void);
|
void Cht_OpenChatWindow (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
126
swad_course.c
126
swad_course.c
|
@ -546,6 +546,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
struct Degree Deg;
|
struct Degree Deg;
|
||||||
struct Course Crs;
|
struct Course Crs;
|
||||||
bool IsLastItemInLevel[1+5];
|
bool IsLastItemInLevel[1+5];
|
||||||
|
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;
|
||||||
MYSQL_RES *mysql_resCtr;
|
MYSQL_RES *mysql_resCtr;
|
||||||
|
@ -562,29 +563,35 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
|
|
||||||
/***** Table start *****/
|
/***** Table start *****/
|
||||||
Lay_StartRoundFrameTable10 (NULL,0,Txt_My_courses);
|
Lay_StartRoundFrameTable10 (NULL,0,Txt_My_courses);
|
||||||
|
|
||||||
/***** Write link to country *****/
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"%s\""
|
"<td>"
|
||||||
" style=\"height:20px; text-align:left;"
|
"<div style=\"display:inline-block; margin:0 auto;\">"
|
||||||
" vertical-align:middle;\">",
|
"<ul class=\"%s\" style=\"list-style-type:none;"
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
" padding:0; margin:0;"
|
||||||
|
" text-align:left; vertical-align:middle;\">",
|
||||||
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
|
||||||
|
/***** Write link to platform *****/
|
||||||
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
Act_FormGoToStart (ActMnu);
|
Act_FormGoToStart (ActMnu);
|
||||||
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) TabSys);
|
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) TabSys);
|
||||||
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[TabSys],
|
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[TabSys],
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
/* Country map */
|
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/sys16x16.gif\" alt=\"%s\" title=\"%s\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/sys16x16.gif\" alt=\"%s\" title=\"%s\""
|
||||||
" style=\"width:16px; height:16px;"
|
" style=\"width:16px; height:16px;"
|
||||||
" vertical-align:middle;\" />",
|
" vertical-align:middle;\" />",
|
||||||
Gbl.Prefs.IconsURL,
|
Gbl.Prefs.IconsURL,
|
||||||
Txt_TABS_FULL_TXT[TabSys],
|
Txt_TABS_FULL_TXT[TabSys],
|
||||||
Txt_TABS_FULL_TXT[TabSys]);
|
Txt_TABS_FULL_TXT[TabSys]);
|
||||||
|
Highlight = (Gbl.CurrentCty.Cty.CtyCod <= 0);
|
||||||
|
if (Highlight)
|
||||||
|
fprintf (Gbl.F.Out,"<strong>");
|
||||||
fprintf (Gbl.F.Out," %s",Txt_TABS_FULL_TXT[TabSys]);
|
fprintf (Gbl.F.Out," %s",Txt_TABS_FULL_TXT[TabSys]);
|
||||||
|
if (Highlight)
|
||||||
|
fprintf (Gbl.F.Out,"</strong>");
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</td>"
|
"</li>");
|
||||||
"</tr>");
|
|
||||||
|
|
||||||
/***** 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);
|
||||||
|
@ -601,11 +608,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Lay_ShowErrorAndExit ("Country not found.");
|
Lay_ShowErrorAndExit ("Country not found.");
|
||||||
|
|
||||||
/***** Write link to country *****/
|
/***** Write link to country *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"%s\""
|
|
||||||
" style=\"height:20px; text-align:left;"
|
|
||||||
" vertical-align:middle;\">",
|
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
|
||||||
IsLastItemInLevel[1] = (NumCty == NumCtys - 1);
|
IsLastItemInLevel[1] = (NumCty == NumCtys - 1);
|
||||||
Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
|
Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
|
||||||
Act_FormStart (ActSeeCtyInf);
|
Act_FormStart (ActSeeCtyInf);
|
||||||
|
@ -621,14 +624,20 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Cty.Alpha2,
|
Cty.Alpha2,
|
||||||
Cty.Alpha2,
|
Cty.Alpha2,
|
||||||
Cty.Name[Gbl.Prefs.Language]);
|
Cty.Name[Gbl.Prefs.Language]);
|
||||||
|
Highlight = (Gbl.CurrentIns.Ins.InsCod <= 0 &&
|
||||||
|
Gbl.CurrentCty.Cty.CtyCod == Cty.CtyCod);
|
||||||
|
if (Highlight)
|
||||||
|
fprintf (Gbl.F.Out,"<strong>");
|
||||||
fprintf (Gbl.F.Out," %s",Cty.Name[Gbl.Prefs.Language]);
|
fprintf (Gbl.F.Out," %s",Cty.Name[Gbl.Prefs.Language]);
|
||||||
|
if (Highlight)
|
||||||
|
fprintf (Gbl.F.Out,"</strong>");
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</td>"
|
"</li>");
|
||||||
"</tr>");
|
|
||||||
|
|
||||||
/***** Get my institutions in this country *****/
|
/***** 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;
|
for (NumIns = 0;
|
||||||
NumIns < NumInss;
|
NumIns < NumInss;
|
||||||
NumIns++)
|
NumIns++)
|
||||||
|
@ -642,11 +651,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Lay_ShowErrorAndExit ("Institution not found.");
|
Lay_ShowErrorAndExit ("Institution not found.");
|
||||||
|
|
||||||
/***** Write link to institution *****/
|
/***** Write link to institution *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"%s\""
|
|
||||||
" style=\"height:20px; text-align:left;"
|
|
||||||
" vertical-align:middle;\">",
|
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
|
||||||
IsLastItemInLevel[2] = (NumIns == NumInss - 1);
|
IsLastItemInLevel[2] = (NumIns == NumInss - 1);
|
||||||
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
|
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
|
||||||
Act_FormStart (ActSeeInsInf);
|
Act_FormStart (ActSeeInsInf);
|
||||||
|
@ -654,14 +659,20 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeInsInf].ActCod,ActTxt),
|
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeInsInf].ActCod,ActTxt),
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
Ins_DrawInstitutionLogo (Ins.Logo,Ins.ShortName,16,"vertical-align:middle;");
|
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,"<strong>");
|
||||||
fprintf (Gbl.F.Out," %s",Ins.FullName);
|
fprintf (Gbl.F.Out," %s",Ins.FullName);
|
||||||
|
if (Highlight)
|
||||||
|
fprintf (Gbl.F.Out,"</strong>");
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</td>"
|
"</li>");
|
||||||
"</tr>");
|
|
||||||
|
|
||||||
/***** Get my centres in this institution *****/
|
/***** 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;
|
for (NumCtr = 0;
|
||||||
NumCtr < NumCtrs;
|
NumCtr < NumCtrs;
|
||||||
NumCtr++)
|
NumCtr++)
|
||||||
|
@ -675,11 +686,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Lay_ShowErrorAndExit ("Centre not found.");
|
Lay_ShowErrorAndExit ("Centre not found.");
|
||||||
|
|
||||||
/***** Write link to centre *****/
|
/***** Write link to centre *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"%s\""
|
|
||||||
" style=\"height:20px; text-align:left;"
|
|
||||||
" vertical-align:middle;\">",
|
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
|
||||||
IsLastItemInLevel[3] = (NumCtr == NumCtrs - 1);
|
IsLastItemInLevel[3] = (NumCtr == NumCtrs - 1);
|
||||||
Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
|
Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
|
||||||
Act_FormStart (ActSeeCtrInf);
|
Act_FormStart (ActSeeCtrInf);
|
||||||
|
@ -687,14 +694,20 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtrInf].ActCod,ActTxt),
|
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtrInf].ActCod,ActTxt),
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
Ctr_DrawCentreLogo (Ctr.Logo,Ctr.ShortName,16,"vertical-align:middle;");
|
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,"<strong>");
|
||||||
fprintf (Gbl.F.Out," %s",Ctr.FullName);
|
fprintf (Gbl.F.Out," %s",Ctr.FullName);
|
||||||
|
if (Highlight)
|
||||||
|
fprintf (Gbl.F.Out,"</strong>");
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</td>"
|
"</li>");
|
||||||
"</tr>");
|
|
||||||
|
|
||||||
/***** Get my degrees in this centre *****/
|
/***** 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;
|
for (NumDeg = 0;
|
||||||
NumDeg < NumDegs;
|
NumDeg < NumDegs;
|
||||||
NumDeg++)
|
NumDeg++)
|
||||||
|
@ -708,11 +721,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Lay_ShowErrorAndExit ("Degree not found.");
|
Lay_ShowErrorAndExit ("Degree not found.");
|
||||||
|
|
||||||
/***** Write link to degree *****/
|
/***** Write link to degree *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"%s\""
|
|
||||||
" style=\"height:20px; text-align:left;"
|
|
||||||
" vertical-align:middle;\">",
|
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
|
||||||
IsLastItemInLevel[4] = (NumDeg == NumDegs - 1);
|
IsLastItemInLevel[4] = (NumDeg == NumDegs - 1);
|
||||||
Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
|
Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
|
||||||
Act_FormStart (ActSeeDegInf);
|
Act_FormStart (ActSeeDegInf);
|
||||||
|
@ -720,14 +729,20 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeDegInf].ActCod,ActTxt),
|
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeDegInf].ActCod,ActTxt),
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
Deg_DrawDegreeLogo (Deg.Logo,Deg.ShortName,16,"vertical-align:middle;");
|
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,"<strong>");
|
||||||
fprintf (Gbl.F.Out," %s",Deg.FullName);
|
fprintf (Gbl.F.Out," %s",Deg.FullName);
|
||||||
|
if (Highlight)
|
||||||
|
fprintf (Gbl.F.Out,"</strong>");
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</td>"
|
"</li>");
|
||||||
"</tr>");
|
|
||||||
|
|
||||||
/***** Get my courses in this degree *****/
|
/***** 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;
|
for (NumCrs = 0;
|
||||||
NumCrs < NumCrss;
|
NumCrs < NumCrss;
|
||||||
NumCrs++)
|
NumCrs++)
|
||||||
|
@ -741,11 +756,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Lay_ShowErrorAndExit ("Course not found.");
|
Lay_ShowErrorAndExit ("Course not found.");
|
||||||
|
|
||||||
/***** Write link to course *****/
|
/***** Write link to course *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"%s\""
|
|
||||||
" style=\"height:20px; text-align:left;"
|
|
||||||
" vertical-align:middle;\">",
|
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
|
||||||
IsLastItemInLevel[5] = (NumCrs == NumCrss - 1);
|
IsLastItemInLevel[5] = (NumCrs == NumCrss - 1);
|
||||||
Lay_IndentDependingOnLevel (5,IsLastItemInLevel);
|
Lay_IndentDependingOnLevel (5,IsLastItemInLevel);
|
||||||
Act_FormStart (ActSeeCrsInf);
|
Act_FormStart (ActSeeCrsInf);
|
||||||
|
@ -755,12 +766,16 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/dot16x16.gif\" alt=\"%s\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/dot16x16.gif\" alt=\"%s\""
|
||||||
" class=\"ICON16x16\""
|
" class=\"ICON16x16\""
|
||||||
" style=\"vertical-align:middle;\" />"
|
" style=\"vertical-align:middle;\" />",
|
||||||
" %s"
|
Gbl.Prefs.IconsURL,Crs.ShortName);
|
||||||
"</a>"
|
Highlight = (Gbl.CurrentCrs.Crs.CrsCod == Crs.CrsCod);
|
||||||
"</form>",
|
if (Highlight)
|
||||||
Gbl.Prefs.IconsURL,Crs.ShortName,
|
fprintf (Gbl.F.Out,"<strong>");
|
||||||
Crs.FullName);
|
fprintf (Gbl.F.Out," %s",Crs.FullName);
|
||||||
|
if (Highlight)
|
||||||
|
fprintf (Gbl.F.Out,"</strong>");
|
||||||
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
|
"</form>");
|
||||||
|
|
||||||
/***** Write link to RSS file *****/
|
/***** Write link to RSS file *****/
|
||||||
sprintf (PathRelRSSFile,"%s/%s/%ld/%s/%s",
|
sprintf (PathRelRSSFile,"%s/%s/%ld/%s/%s",
|
||||||
|
@ -776,8 +791,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.IconsURL);
|
Gbl.Prefs.IconsURL);
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</li>");
|
||||||
"</tr>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free structure that stores the query result */
|
/* Free structure that stores the query result */
|
||||||
|
@ -800,6 +814,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
DB_FreeMySQLResult (&mysql_resCty);
|
DB_FreeMySQLResult (&mysql_resCty);
|
||||||
|
|
||||||
/***** End frame *****/
|
/***** End frame *****/
|
||||||
|
fprintf (Gbl.F.Out,"</ul>"
|
||||||
|
"</div>"
|
||||||
|
"</td>"
|
||||||
|
"</tr>");
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -741,7 +741,8 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
|
|
||||||
/***** Start list of options *****/
|
/***** Start list of options *****/
|
||||||
fprintf (Gbl.F.Out,"<div style=\"display:inline-block; margin:0 auto;\">"
|
fprintf (Gbl.F.Out,"<div style=\"display:inline-block; margin:0 auto;\">"
|
||||||
"<ul style=\"list-style-type:none; text-align:left;\" class=\"%s\">",
|
"<ul class=\"%s\" style=\"list-style-type:none;"
|
||||||
|
" text-align:left;\">",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
|
||||||
/***** Register user in course / Modify user's data *****/
|
/***** Register user in course / Modify user's data *****/
|
||||||
|
@ -866,7 +867,8 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
|
||||||
|
|
||||||
/***** Start list of options *****/
|
/***** Start list of options *****/
|
||||||
fprintf (Gbl.F.Out,"<div style=\"display:inline-block; margin:0 auto;\">"
|
fprintf (Gbl.F.Out,"<div style=\"display:inline-block; margin:0 auto;\">"
|
||||||
"<ul style=\"list-style-type:none; text-align:left;\" class=\"%s\">",
|
"<ul class=\"%s\" style=\"list-style-type:none;"
|
||||||
|
" text-align:left;\">",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
|
||||||
/***** Register / remove users listed or not listed *****/
|
/***** Register / remove users listed or not listed *****/
|
||||||
|
|
|
@ -2273,7 +2273,8 @@ static void Brw_FormToChangeZone (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** List start *****/
|
/***** List start *****/
|
||||||
fprintf (Gbl.F.Out,"<ul style=\"list-style-type:none; padding-top:0; margin-top:0; text-align:left;\">");
|
fprintf (Gbl.F.Out,"<ul style=\"list-style-type:none;"
|
||||||
|
" padding-top:0; margin-top:0; text-align:left;\">");
|
||||||
|
|
||||||
/***** Select the complete course, not a group *****/
|
/***** Select the complete course, not a group *****/
|
||||||
fprintf (Gbl.F.Out,"<li class=\"%s\">"
|
fprintf (Gbl.F.Out,"<li class=\"%s\">"
|
||||||
|
|
95
swad_forum.c
95
swad_forum.c
|
@ -243,6 +243,7 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject);
|
||||||
static void For_PutParamWhichForum (void);
|
static void For_PutParamWhichForum (void);
|
||||||
static void For_PutParamForumOrder (void);
|
static void For_PutParamForumOrder (void);
|
||||||
static void For_PutFormWhichForums (void);
|
static void For_PutFormWhichForums (void);
|
||||||
|
static void For_WriteLinkToTopLevelOfForums (void);
|
||||||
static void For_PutParamsForumInsDegCrs (void);
|
static void For_PutParamsForumInsDegCrs (void);
|
||||||
static void For_WriteLinksToGblForums (bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS]);
|
static void For_WriteLinksToGblForums (bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS]);
|
||||||
static void For_WriteLinksToPlatformForums (bool IsLastForum,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 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_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_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 **************************/
|
/****************************** Enable a forum post **************************/
|
||||||
|
@ -841,6 +843,8 @@ void For_RemoveUsrFromReadThrs (long UsrCod)
|
||||||
|
|
||||||
static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
|
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];
|
bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS];
|
||||||
struct ForumThread Thr;
|
struct ForumThread Thr;
|
||||||
char Query[1024];
|
char Query[1024];
|
||||||
|
@ -872,12 +876,19 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
|
||||||
For_GetThrReadTime (ThrCod,ReadTime);
|
For_GetThrReadTime (ThrCod,ReadTime);
|
||||||
|
|
||||||
/* Table start */
|
/* Table start */
|
||||||
Lay_StartRoundFrameTable10 (NULL,0,NULL);
|
Lay_StartRoundFrameTable10 (NULL,0,Txt_Forums);
|
||||||
|
|
||||||
/* Put a form to select which forums */
|
/* Put a form to select which forums */
|
||||||
For_PutFormWhichForums ();
|
For_PutFormWhichForums ();
|
||||||
|
|
||||||
/* Write a link to top level of forums */
|
/* Write a link to top level of forums */
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td>"
|
||||||
|
"<div style=\"display:inline-block; margin:0 auto;\">"
|
||||||
|
"<ul class=\"%s\" style=\"list-style-type:none;"
|
||||||
|
" padding:0; margin:0;"
|
||||||
|
" text-align:left; vertical-align:middle;\">",
|
||||||
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
For_WriteLinkToTopLevelOfForums ();
|
For_WriteLinkToTopLevelOfForums ();
|
||||||
|
|
||||||
/* Write a link to current forum */
|
/* 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);
|
For_WriteLinkToAForum (Gbl.Forum.ForumType,true,1,IsLastItemInLevel);
|
||||||
|
|
||||||
/* Write thread title */
|
/* Write thread title */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"TIT\" style=\"height:20px;"
|
|
||||||
" text-align:left; vertical-align:middle;\">");
|
|
||||||
IsLastItemInLevel[2] = true;
|
IsLastItemInLevel[2] = true;
|
||||||
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
|
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
|
||||||
|
|
||||||
|
@ -911,8 +920,11 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
|
||||||
fprintf (Gbl.F.Out," ");
|
fprintf (Gbl.F.Out," ");
|
||||||
Msg_WriteNumMsgs (NumPsts,0);
|
Msg_WriteNumMsgs (NumPsts,0);
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</li>"
|
||||||
"</tr>");
|
"</ul>"
|
||||||
|
"</div>"
|
||||||
|
"</td>"
|
||||||
|
"</tr>");
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
|
|
||||||
LastSubject[0] = '\0';
|
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 *****************/
|
/*************** 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_post;
|
||||||
extern const char *Txt_posts;
|
extern const char *Txt_posts;
|
||||||
|
@ -1556,6 +1568,7 @@ void For_SetForumTypeAndRestrictAccess (void)
|
||||||
|
|
||||||
void For_ShowForumList (void)
|
void For_ShowForumList (void)
|
||||||
{
|
{
|
||||||
|
extern const char *The_ClassFormul[The_NUM_THEMES];
|
||||||
extern const char *Txt_Forums;
|
extern const char *Txt_Forums;
|
||||||
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER); // If I have permission to move threads...
|
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER); // If I have permission to move threads...
|
||||||
bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS];
|
bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS];
|
||||||
|
@ -1588,6 +1601,13 @@ void For_ShowForumList (void)
|
||||||
For_PutFormWhichForums ();
|
For_PutFormWhichForums ();
|
||||||
|
|
||||||
/***** Write a link to top level of forums *****/
|
/***** Write a link to top level of forums *****/
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td>"
|
||||||
|
"<div style=\"display:inline-block; margin:0 auto;\">"
|
||||||
|
"<ul class=\"%s\" style=\"list-style-type:none;"
|
||||||
|
" padding:0; margin:0;"
|
||||||
|
" text-align:left; vertical-align:middle;\">",
|
||||||
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
For_WriteLinkToTopLevelOfForums ();
|
For_WriteLinkToTopLevelOfForums ();
|
||||||
|
|
||||||
/***** Links to global forums *****/
|
/***** Links to global forums *****/
|
||||||
|
@ -1698,6 +1718,10 @@ void For_ShowForumList (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
|
fprintf (Gbl.F.Out,"</ul>"
|
||||||
|
"</div>"
|
||||||
|
"</td>"
|
||||||
|
"</tr>");
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1745,15 +1769,12 @@ static void For_PutFormWhichForums (void)
|
||||||
/**************** Write title and link to top level of forums ****************/
|
/**************** 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 *The_ClassFormul[The_NUM_THEMES];
|
||||||
extern const char *Txt_Forums;
|
extern const char *Txt_Forums;
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"%s\" style=\"height:20px;"
|
|
||||||
" text-align:left; vertical-align:middle;\">",
|
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
|
||||||
Act_FormStart (ActSeeFor);
|
Act_FormStart (ActSeeFor);
|
||||||
For_PutAllHiddenParamsForum ();
|
For_PutAllHiddenParamsForum ();
|
||||||
Act_LinkFormSubmit (Txt_Forums,The_ClassFormul[Gbl.Prefs.Theme]);
|
Act_LinkFormSubmit (Txt_Forums,The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
@ -1763,8 +1784,7 @@ void For_WriteLinkToTopLevelOfForums (void)
|
||||||
" %s"
|
" %s"
|
||||||
"</a>"
|
"</a>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</td>"
|
"</li>",
|
||||||
"</tr>",
|
|
||||||
Gbl.Prefs.IconsURL,
|
Gbl.Prefs.IconsURL,
|
||||||
Txt_Forums,
|
Txt_Forums,
|
||||||
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]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
|
||||||
/***** Start row *****/
|
/***** Start row *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<li style=\"height:20px;\">");
|
||||||
"<td class=\"%s\" style=\"height:20px;"
|
|
||||||
" text-align:left; vertical-align:middle;\">",
|
|
||||||
Style);
|
|
||||||
|
|
||||||
/***** Indent forum title *****/
|
/***** Indent forum title *****/
|
||||||
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel);
|
Lay_IndentDependingOnLevel (Level,IsLastItemInLevel);
|
||||||
|
@ -2157,8 +2174,7 @@ static void For_WriteLinkToForum (For_ForumType_t ForumType,Act_Action_t NextAct
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</form>"
|
"</form>"
|
||||||
"</td>"
|
"</li>");
|
||||||
"</tr>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2320,6 +2336,8 @@ static unsigned For_GetNumOfPostsInThrNewerThan (long ThrCod,const char *Time)
|
||||||
|
|
||||||
void For_ShowForumThrs (void)
|
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_MSG_Subject;
|
||||||
extern const char *Txt_FORUM_THREAD_HELP_ORDER[2];
|
extern const char *Txt_FORUM_THREAD_HELP_ORDER[2];
|
||||||
extern const char *Txt_FORUM_THREAD_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 *****/
|
/***** Get threads of a forum from database *****/
|
||||||
switch (Gbl.Forum.ForumType)
|
switch (Gbl.Forum.ForumType)
|
||||||
{
|
{
|
||||||
case For_FORUM_INSTITUTION_USRS: case For_FORUM_INSTITUTION_TCHS:
|
case For_FORUM_INSTITUTION_USRS:
|
||||||
sprintf (SubQuery," AND forum_thread.Location='%ld'",Gbl.Forum.Ins.InsCod);
|
case For_FORUM_INSTITUTION_TCHS:
|
||||||
|
sprintf (SubQuery," AND forum_thread.Location='%ld'",
|
||||||
|
Gbl.Forum.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_CENTRE_USRS: case For_FORUM_CENTRE_TCHS:
|
case For_FORUM_CENTRE_USRS:
|
||||||
sprintf (SubQuery," AND forum_thread.Location='%ld'",Gbl.Forum.Ctr.CtrCod);
|
case For_FORUM_CENTRE_TCHS:
|
||||||
|
sprintf (SubQuery," AND forum_thread.Location='%ld'",
|
||||||
|
Gbl.Forum.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_DEGREE_USRS: case For_FORUM_DEGREE_TCHS:
|
case For_FORUM_DEGREE_USRS:
|
||||||
sprintf (SubQuery," AND forum_thread.Location='%ld'",Gbl.Forum.Deg.DegCod);
|
case For_FORUM_DEGREE_TCHS:
|
||||||
|
sprintf (SubQuery," AND forum_thread.Location='%ld'",
|
||||||
|
Gbl.Forum.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_COURSE_USRS: case For_FORUM_COURSE_TCHS:
|
case For_FORUM_COURSE_USRS:
|
||||||
sprintf (SubQuery," AND forum_thread.Location='%ld'",Gbl.Forum.Crs.CrsCod);
|
case For_FORUM_COURSE_TCHS:
|
||||||
|
sprintf (SubQuery," AND forum_thread.Location='%ld'",
|
||||||
|
Gbl.Forum.Crs.CrsCod);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SubQuery[0] = '\0';
|
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 *****/
|
/***** Header whith the name of this forum, the number of threads, and the total number of posts *****/
|
||||||
/* Table start */
|
/* Table start */
|
||||||
Lay_StartRoundFrameTable10 (NULL,0,NULL);
|
Lay_StartRoundFrameTable10 (NULL,0,Txt_Forums);
|
||||||
|
|
||||||
/* Put a form to select which forums */
|
/* Put a form to select which forums */
|
||||||
For_PutFormWhichForums ();
|
For_PutFormWhichForums ();
|
||||||
|
|
||||||
/* Write a link to top level of forums */
|
/* Write a link to top level of forums */
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td>"
|
||||||
|
"<div style=\"display:inline-block; margin:0 auto;\">"
|
||||||
|
"<ul class=\"%s\" style=\"list-style-type:none;"
|
||||||
|
" padding:0; margin:0;"
|
||||||
|
" text-align:left; vertical-align:middle;\">",
|
||||||
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
For_WriteLinkToTopLevelOfForums ();
|
For_WriteLinkToTopLevelOfForums ();
|
||||||
|
|
||||||
/* Write a link to current forum */
|
/* Write a link to current forum */
|
||||||
|
@ -2427,6 +2460,10 @@ void For_ShowForumThrs (void)
|
||||||
For_WriteLinkToAForum (Gbl.Forum.ForumType,true,1,IsLastItemInLevel);
|
For_WriteLinkToAForum (Gbl.Forum.ForumType,true,1,IsLastItemInLevel);
|
||||||
|
|
||||||
/* End table */
|
/* End table */
|
||||||
|
fprintf (Gbl.F.Out,"</ul>"
|
||||||
|
"</div>"
|
||||||
|
"</td>"
|
||||||
|
"</tr>");
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
|
|
||||||
/***** List the threads *****/
|
/***** List the threads *****/
|
||||||
|
|
|
@ -116,11 +116,9 @@ void For_RemoveUsrFromReadThrs (long UsrCod);
|
||||||
|
|
||||||
void For_GetNotifForumPst (char *SummaryStr,char **ContentStr,long PstCod,unsigned MaxChars,bool GetContent);
|
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_PutAllHiddenParamsForum (void);
|
||||||
void For_SetForumTypeAndRestrictAccess (void);
|
void For_SetForumTypeAndRestrictAccess (void);
|
||||||
void For_ShowForumList (void);
|
void For_ShowForumList (void);
|
||||||
void For_WriteLinkToTopLevelOfForums (void);
|
|
||||||
void For_SetForumName (For_ForumType_t ForumType,
|
void For_SetForumName (For_ForumType_t ForumType,
|
||||||
struct Institution *Ins,
|
struct Institution *Ins,
|
||||||
struct Centre *Ctr,
|
struct Centre *Ctr,
|
||||||
|
|
Loading…
Reference in New Issue