mirror of https://github.com/acanas/swad-core.git
Version 20.39.8: Mar 02, 2021 Code refactoring in timeline.
This commit is contained in:
parent
3612c0ef86
commit
58e615fc69
|
@ -203,7 +203,7 @@ static void Agd_ShowMyAgenda (struct Agd_Agenda *Agenda)
|
|||
Hlp_PROFILE_Agenda,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Put forms to choice which events to show *****/
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Agd_ShowFormToSelPast__FutureEvents (Agenda);
|
||||
Agd_ShowFormToSelPrivatPublicEvents (Agenda);
|
||||
Agd_ShowFormToSelHiddenVisiblEvents (Agenda);
|
||||
|
@ -233,7 +233,7 @@ static void Agd_ShowFormToSelPast__FutureEvents (const struct Agd_Agenda *Agenda
|
|||
[Agd_FUTURE_EVENTS] = "calendar-plus.svg",
|
||||
};
|
||||
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (PstFut = Agd_PAST___EVENTS;
|
||||
PstFut <= Agd_FUTURE_EVENTS;
|
||||
PstFut++)
|
||||
|
@ -270,7 +270,7 @@ static void Agd_ShowFormToSelPrivatPublicEvents (const struct Agd_Agenda *Agenda
|
|||
[Agd_PUBLIC_EVENTS] = "unlock.svg",
|
||||
};
|
||||
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (PrvPub = Agd_PRIVAT_EVENTS;
|
||||
PrvPub <= Agd_PUBLIC_EVENTS;
|
||||
PrvPub++)
|
||||
|
@ -307,7 +307,7 @@ static void Agd_ShowFormToSelHiddenVisiblEvents (const struct Agd_Agenda *Agenda
|
|||
[Agd_VISIBL_EVENTS] = "eye-green.svg",
|
||||
};
|
||||
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (HidVis = Agd_HIDDEN_EVENTS;
|
||||
HidVis <= Agd_VISIBL_EVENTS;
|
||||
HidVis++)
|
||||
|
|
|
@ -167,7 +167,7 @@ static void Asg_ShowAllAssignments (struct Asg_Assignments *Assignments)
|
|||
/***** Select whether show only my groups or all groups *****/
|
||||
if (Gbl.Crs.Grps.NumGrps)
|
||||
{
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Grp_ShowFormToSelWhichGrps (ActSeeAsg,
|
||||
Asg_ParamsWhichGroupsToShow,Assignments);
|
||||
Set_EndSettingsHead ();
|
||||
|
|
|
@ -249,7 +249,7 @@ static void Att_ShowAllAttEvents (struct Att_Events *Events)
|
|||
/***** Select whether show only my groups or all groups *****/
|
||||
if (Gbl.Crs.Grps.NumGrps)
|
||||
{
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Grp_ShowFormToSelWhichGrps (ActSeeAtt,
|
||||
Att_ParamsWhichGroupsToShow,&Events);
|
||||
Set_EndSettingsHead ();
|
||||
|
|
|
@ -86,7 +86,7 @@ void Cal_PutIconsToSelectFirstDayOfWeek (void)
|
|||
Box_BoxBegin (NULL,Txt_Calendar,
|
||||
Cal_PutIconsFirstDayOfWeek,NULL,
|
||||
Hlp_PROFILE_Settings_calendar,Box_NOT_CLOSABLE);
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Cal_ShowFormToSelFirstDayOfWeek (ActChg1stDay,
|
||||
NULL,NULL);
|
||||
Set_EndSettingsHead ();
|
||||
|
@ -115,7 +115,7 @@ void Cal_ShowFormToSelFirstDayOfWeek (Act_Action_t Action,
|
|||
unsigned FirstDayOfWeek;
|
||||
char Icon[32 + 1];
|
||||
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (FirstDayOfWeek = 0; // Monday
|
||||
FirstDayOfWeek <= 6; // Sunday
|
||||
FirstDayOfWeek++)
|
||||
|
@ -264,7 +264,7 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
|
|||
/***** Preference selector to change first day of week *****/
|
||||
if (!PrintView)
|
||||
{
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Cal_ShowFormToSelFirstDayOfWeek (ActionChangeCalendar1stDay,
|
||||
NULL,NULL);
|
||||
Set_EndSettingsHead ();
|
||||
|
|
|
@ -598,10 +598,11 @@ TODO: DNI de un estudiante sale err
|
|||
TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede.
|
||||
TODO: Salvador Romero Cortés: @acanas opción para editar posts
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.39.7 (2021-03-02)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.39.8 (2021-03-02)"
|
||||
#define CSS_FILE "swad20.33.9.css"
|
||||
#define JS_FILE "swad20.6.2.js"
|
||||
/*
|
||||
Version 20.39.8: Mar 02, 2021 Code refactoring in timeline. (305573 lines)
|
||||
Version 20.39.7: Mar 02, 2021 Code refactoring in fav/share timeline comments. (305566 lines)
|
||||
Version 20.39.6: Mar 02, 2021 Code refactoring in fav/share timeline notes. (305570 lines)
|
||||
Version 20.39.5: Mar 02, 2021 Code refactoring in timeline notes and posts. (305620 lines)
|
||||
|
|
|
@ -232,7 +232,7 @@ void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
|||
case Rol_SYS_ADM:
|
||||
if (Gbl.Crs.Grps.NumGrps)
|
||||
{
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Grp_ShowFormToSelWhichGrps (ActSeeExa,
|
||||
Exa_PutParams,Exams);
|
||||
Set_EndSettingsHead ();
|
||||
|
|
|
@ -4993,7 +4993,7 @@ void Grp_ShowFormToSelWhichGrps (Act_Action_t Action,
|
|||
Grp_WhichGroups_t WhichGrps;
|
||||
|
||||
/***** Start setting selector *****/
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
|
||||
/***** Put icons to select which groups *****/
|
||||
for (WhichGrps = Grp_MY_GROUPS;
|
||||
|
|
|
@ -118,8 +118,8 @@ void Ico_PutIconsToSelectIconSet (void)
|
|||
Box_BoxBegin (NULL,Txt_Icons,
|
||||
Ico_PutIconsIconSet,NULL,
|
||||
Hlp_PROFILE_Settings_icons,Box_NOT_CLOSABLE);
|
||||
Set_StartSettingsHead ();
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginSettingsHead ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (IconSet = (Ico_IconSet_t) 0;
|
||||
IconSet <= (Ico_IconSet_t) (Ico_NUM_ICON_SETS - 1);
|
||||
IconSet++)
|
||||
|
|
|
@ -358,7 +358,7 @@ void Mch_ListMatches (struct Gam_Games *Games,
|
|||
case Rol_SYS_ADM:
|
||||
if (Gbl.Crs.Grps.NumGrps)
|
||||
{
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Grp_ShowFormToSelWhichGrps (ActSeeGam,
|
||||
Gam_PutParams,Games);
|
||||
Set_EndSettingsHead ();
|
||||
|
@ -2556,7 +2556,7 @@ static void Mch_ShowLeftColumnTch (struct Mch_Match *Match)
|
|||
Mch_PutMatchControlButtons (Match);
|
||||
|
||||
/***** Put forms to choice which projects to show *****/
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Mch_ShowFormColumns (Match);
|
||||
Set_EndSettingsHead ();
|
||||
|
||||
|
@ -3031,7 +3031,7 @@ static void Mch_ShowFormColumns (const struct Mch_Match *Match)
|
|||
};
|
||||
|
||||
/***** Begin selector *****/
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
|
||||
for (NumCols = 1;
|
||||
NumCols <= Mch_MAX_COLS;
|
||||
|
|
|
@ -280,8 +280,8 @@ void Mnu_PutIconsToSelectMenu (void)
|
|||
Box_BoxBegin (NULL,Txt_Menu,
|
||||
Mnu_PutIconsMenu,NULL,
|
||||
Hlp_PROFILE_Settings_menu,Box_NOT_CLOSABLE);
|
||||
Set_StartSettingsHead ();
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginSettingsHead ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (Menu = (Mnu_Menu_t) 0;
|
||||
Menu <= (Mnu_Menu_t) (Mnu_NUM_MENUS - 1);
|
||||
Menu++)
|
||||
|
|
|
@ -482,7 +482,7 @@ static void Prj_ShowPrjsInCurrentPage (void *Projects)
|
|||
|
||||
/***** Put forms to choice which projects to show *****/
|
||||
/* 1st. row */
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Prj_ShowFormToFilterByMy_All ((struct Prj_Projects *) Projects);
|
||||
Prj_ShowFormToFilterByAssign ((struct Prj_Projects *) Projects);
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
|
@ -579,7 +579,7 @@ static void Prj_ShowFormToFilterByMy_All (const struct Prj_Projects *Projects)
|
|||
1 << Usr_WHO_SELECTED |
|
||||
1 << Usr_WHO_ALL;
|
||||
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (Who = (Usr_Who_t) 1;
|
||||
Who <= (Usr_Who_t) (Usr_NUM_WHO - 1);
|
||||
Who++)
|
||||
|
@ -616,7 +616,7 @@ static void Prj_ShowFormToFilterByAssign (const struct Prj_Projects *Projects)
|
|||
struct Prj_Filter Filter;
|
||||
Prj_AssignedNonassig_t Assign;
|
||||
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (Assign = (Prj_AssignedNonassig_t) 0;
|
||||
Assign <= (Prj_AssignedNonassig_t) (Prj_NUM_ASSIGNED_NONASSIG - 1);
|
||||
Assign++)
|
||||
|
@ -657,7 +657,7 @@ static void Prj_ShowFormToFilterByHidden (const struct Prj_Projects *Projects)
|
|||
[Prj_VISIBL] = "eye-green.svg",
|
||||
};
|
||||
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (HidVis = (Prj_HiddenVisibl_t) 0;
|
||||
HidVis <= (Prj_HiddenVisibl_t) (Prj_NUM_HIDDEN_VISIBL - 1);
|
||||
HidVis++)
|
||||
|
@ -698,7 +698,7 @@ static void Prj_ShowFormToFilterByWarning (const struct Prj_Projects *Projects)
|
|||
[Prj_FAULTLESS] = "check-circle.svg",
|
||||
};
|
||||
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (Faultiness = (Prj_Faultiness_t) 0;
|
||||
Faultiness <= (Prj_Faultiness_t) (Prj_NUM_FAULTINESS - 1);
|
||||
Faultiness++)
|
||||
|
|
|
@ -252,8 +252,8 @@ static void Set_PutIconsToSelectSideCols (void)
|
|||
Box_BoxBegin (NULL,Txt_Columns,
|
||||
Set_PutIconsSideColumns,NULL,
|
||||
Hlp_PROFILE_Settings_columns,Box_NOT_CLOSABLE);
|
||||
Set_StartSettingsHead ();
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginSettingsHead ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (SideCols = 0;
|
||||
SideCols <= Lay_SHOW_BOTH_COLUMNS;
|
||||
SideCols++)
|
||||
|
@ -337,7 +337,7 @@ unsigned Set_GetParamSideCols (void)
|
|||
| +-----------------+ +-----------------+ |
|
||||
+--------------------------------------------+
|
||||
*/
|
||||
void Set_StartSettingsHead (void)
|
||||
void Set_BeginSettingsHead (void)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"PREF_CONTS\"");
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ void Set_EndSettingsHead (void)
|
|||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
void Set_StartOneSettingSelector (void)
|
||||
void Set_BeginOneSettingSelector (void)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"PREF_CONT\"");
|
||||
}
|
||||
|
|
|
@ -48,9 +48,9 @@ void Set_RemoveOldSettingsFromIP (void);
|
|||
void Set_ChangeSideCols (void);
|
||||
unsigned Set_GetParamSideCols (void);
|
||||
|
||||
void Set_StartSettingsHead (void);
|
||||
void Set_BeginSettingsHead (void);
|
||||
void Set_EndSettingsHead (void);
|
||||
void Set_StartOneSettingSelector (void);
|
||||
void Set_BeginOneSettingSelector (void);
|
||||
void Set_EndOneSettingSelector (void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -249,7 +249,7 @@ static void Svy_ListAllSurveys (struct Svy_Surveys *Surveys)
|
|||
/***** Select whether show only my groups or all groups *****/
|
||||
if (Gbl.Crs.Grps.NumGrps)
|
||||
{
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
Grp_ShowFormToSelWhichGrps (ActSeeAllSvy,
|
||||
Svy_ParamsWhichGroupsToShow,Surveys);
|
||||
Set_EndSettingsHead ();
|
||||
|
|
|
@ -321,8 +321,8 @@ void The_PutIconsToSelectTheme (void)
|
|||
Box_BoxBegin (NULL,Txt_Theme_SKIN,
|
||||
The_PutIconsTheme,NULL,
|
||||
Hlp_PROFILE_Settings_theme,Box_NOT_CLOSABLE);
|
||||
Set_StartSettingsHead ();
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginSettingsHead ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (Theme = (The_Theme_t) 0;
|
||||
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
|
||||
Theme++)
|
||||
|
|
|
@ -165,8 +165,10 @@ extern struct Globals Gbl;
|
|||
static void TL_GetAndShowOldTimeline (struct TL_Timeline *Timeline);
|
||||
|
||||
static void TL_ShowTimeline (struct TL_Timeline *Timeline,
|
||||
const char *Title,long NotCodToHighlight);
|
||||
long NotCodToHighlight,const char *Title);
|
||||
static void TL_PutIconsTimeline (__attribute__((unused)) void *Args);
|
||||
static unsigned TL_ListRecentPubs (struct TL_Timeline *Timeline,
|
||||
long NotCodToHighlight);
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************ Initialize global timeline *************************/
|
||||
|
@ -262,7 +264,7 @@ void TL_ShowTimelineGblHighlightingNot (struct TL_Timeline *Timeline,
|
|||
TL_Pub_GetListPubsToShowInTimeline (Timeline);
|
||||
|
||||
/***** Show timeline *****/
|
||||
TL_ShowTimeline (Timeline,Txt_Timeline,NotCod);
|
||||
TL_ShowTimeline (Timeline,NotCod,Txt_Timeline);
|
||||
|
||||
/***** Free chained list of publications *****/
|
||||
TL_Pub_FreeListPubs (Timeline);
|
||||
|
@ -292,10 +294,9 @@ void TL_ShowTimelineUsrHighlightingNot (struct TL_Timeline *Timeline,
|
|||
TL_Pub_GetListPubsToShowInTimeline (Timeline);
|
||||
|
||||
/***** Show timeline *****/
|
||||
TL_ShowTimeline (Timeline,
|
||||
TL_ShowTimeline (Timeline,NotCod,
|
||||
Str_BuildStringStr (Txt_Timeline_OF_A_USER,
|
||||
Gbl.Usrs.Other.UsrDat.FrstName),
|
||||
NotCod);
|
||||
Gbl.Usrs.Other.UsrDat.FrstName));
|
||||
Str_FreeString ();
|
||||
|
||||
/***** Free chained list of publications *****/
|
||||
|
@ -417,13 +418,11 @@ static void TL_GetAndShowOldTimeline (struct TL_Timeline *Timeline)
|
|||
\ |_____|
|
||||
*/
|
||||
static void TL_ShowTimeline (struct TL_Timeline *Timeline,
|
||||
const char *Title,long NotCodToHighlight)
|
||||
long NotCodToHighlight,const char *Title)
|
||||
{
|
||||
extern const char *Hlp_START_Timeline;
|
||||
struct TL_Pub_Publication *Pub;
|
||||
struct TL_Not_Note Not;
|
||||
unsigned NumPubs;
|
||||
bool GlobalTimeline = (Gbl.Usrs.Other.UsrDat.UsrCod <= 0);
|
||||
unsigned NumNotesShown;
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Title,
|
||||
|
@ -435,8 +434,7 @@ static void TL_ShowTimeline (struct TL_Timeline *Timeline,
|
|||
TL_Who_PutFormWho (Timeline);
|
||||
|
||||
/***** Form to write a new post *****/
|
||||
if (GlobalTimeline ||
|
||||
Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod))
|
||||
if (GlobalTimeline || Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod))
|
||||
TL_Pst_PutPhotoAndFormToWriteNewPost (Timeline);
|
||||
|
||||
/***** New publications refreshed dynamically via AJAX *****/
|
||||
|
@ -457,33 +455,11 @@ static void TL_ShowTimeline (struct TL_Timeline *Timeline,
|
|||
}
|
||||
|
||||
/***** List recent publications in timeline *****/
|
||||
/* Begin list */
|
||||
HTM_UL_Begin ("id=\"timeline_list\" class=\"TL_LIST\"");
|
||||
|
||||
/* For each publication in list... */
|
||||
for (Pub = Timeline->Pubs.Top, NumPubs = 0;
|
||||
Pub;
|
||||
Pub = Pub->Next, NumPubs++)
|
||||
{
|
||||
/* Get data of note */
|
||||
Not.NotCod = Pub->NotCod;
|
||||
TL_Not_GetDataOfNoteByCod (&Not);
|
||||
|
||||
/* Write note */
|
||||
HTM_LI_Begin ("class=\"%s\"",Not.NotCod == NotCodToHighlight ? "TL_WIDTH TL_SEP TL_NEW_PUB" :
|
||||
"TL_WIDTH TL_SEP");
|
||||
TL_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not,
|
||||
TL_Pub_GetTopMessage (Pub->PubType),
|
||||
Pub->PublisherCod);
|
||||
HTM_LI_End ();
|
||||
}
|
||||
|
||||
/* End list */
|
||||
HTM_UL_End ();
|
||||
NumNotesShown = TL_ListRecentPubs (Timeline,NotCodToHighlight);
|
||||
|
||||
/***** If the number of publications shown is the maximum,
|
||||
probably there will be more, so show link to get more *****/
|
||||
if (NumPubs == TL_Pub_MAX_REC_PUBS_TO_GET_AND_SHOW)
|
||||
if (NumNotesShown == TL_Pub_MAX_REC_PUBS_TO_GET_AND_SHOW)
|
||||
{
|
||||
/* Link to view old publications via AJAX */
|
||||
TL_Pub_PutLinkToViewOldPubs ();
|
||||
|
@ -507,6 +483,45 @@ static void TL_PutIconsTimeline (__attribute__((unused)) void *Args)
|
|||
Fig_PutIconToShowFigure (Fig_TIMELINE);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* List recent publications in timeline ********************/
|
||||
/*****************************************************************************/
|
||||
// Returns number of notes shown
|
||||
|
||||
static unsigned TL_ListRecentPubs (struct TL_Timeline *Timeline,
|
||||
long NotCodToHighlight)
|
||||
{
|
||||
unsigned NumNotesShown;
|
||||
struct TL_Pub_Publication *Pub;
|
||||
struct TL_Not_Note Not;
|
||||
|
||||
/***** Begin list *****/
|
||||
HTM_UL_Begin ("id=\"timeline_list\" class=\"TL_LIST\"");
|
||||
|
||||
/***** For each publication in list... *****/
|
||||
for (Pub = Timeline->Pubs.Top, NumNotesShown = 0;
|
||||
Pub;
|
||||
Pub = Pub->Next, NumNotesShown++)
|
||||
{
|
||||
/* Get data of note */
|
||||
Not.NotCod = Pub->NotCod;
|
||||
TL_Not_GetDataOfNoteByCod (&Not);
|
||||
|
||||
/* Write list item (note) */
|
||||
HTM_LI_Begin ("class=\"%s\"",Not.NotCod == NotCodToHighlight ? "TL_WIDTH TL_SEP TL_NEW_PUB" :
|
||||
"TL_WIDTH TL_SEP");
|
||||
TL_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not,
|
||||
TL_Pub_GetTopMessage (Pub->PubType),
|
||||
Pub->PublisherCod);
|
||||
HTM_LI_End ();
|
||||
}
|
||||
|
||||
/***** End list *****/
|
||||
HTM_UL_End ();
|
||||
|
||||
return NumNotesShown;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Write the date of creation of a note ********************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -123,47 +123,42 @@ void TL_Usr_ShowSharersOrFavers (MYSQL_RES **mysql_res,
|
|||
{
|
||||
MYSQL_ROW row;
|
||||
unsigned NumUsr;
|
||||
unsigned NumUsrsShown = 0;
|
||||
struct UsrData UsrDat;
|
||||
|
||||
if (NumUsrs)
|
||||
/***** Trivial check 1: are there favers or sharers? *****/
|
||||
if (!NumUsrs)
|
||||
return;
|
||||
|
||||
/***** Trivial check 1: number of favers or sharers to show *****/
|
||||
if (!NumFirstUsrs)
|
||||
return;
|
||||
|
||||
/***** Initialize structure with user's data *****/
|
||||
Usr_UsrDataConstructor (&UsrDat);
|
||||
|
||||
/***** List users *****/
|
||||
for (NumUsr = 0;
|
||||
NumUsr < NumFirstUsrs;
|
||||
NumUsr++)
|
||||
{
|
||||
/***** A list of users has been got from database *****/
|
||||
if (NumFirstUsrs)
|
||||
/***** Get user's code *****/
|
||||
row = mysql_fetch_row (*mysql_res);
|
||||
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||
|
||||
/***** Get user's data and show user's photo *****/
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS))
|
||||
{
|
||||
/***** Initialize structure with user's data *****/
|
||||
Usr_UsrDataConstructor (&UsrDat);
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"TL_SHARER\"");
|
||||
|
||||
/***** List users *****/
|
||||
for (NumUsr = 0;
|
||||
NumUsr < NumFirstUsrs;
|
||||
NumUsr++)
|
||||
{
|
||||
/***** Get user *****/
|
||||
/* Get row */
|
||||
row = mysql_fetch_row (*mysql_res);
|
||||
/* User's photo */
|
||||
Pho_ShowUsrPhotoIfAllowed (&UsrDat,"PHOTO12x16",Pho_ZOOM,true); // Use unique id
|
||||
|
||||
/* Get user's code (row[0]) */
|
||||
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||
|
||||
/***** Get user's data and show user's photo *****/
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS))
|
||||
{
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"TL_SHARER\"");
|
||||
|
||||
/* User's photo */
|
||||
Pho_ShowUsrPhotoIfAllowed (&UsrDat,"PHOTO12x16",Pho_ZOOM,true); // Use unique id
|
||||
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
|
||||
NumUsrsShown++;
|
||||
}
|
||||
}
|
||||
|
||||
/***** Free memory used for user's data *****/
|
||||
Usr_UsrDataDestructor (&UsrDat);
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
}
|
||||
|
||||
/***** Free memory used for user's data *****/
|
||||
Usr_UsrDataDestructor (&UsrDat);
|
||||
}
|
||||
|
|
|
@ -76,32 +76,32 @@ void TL_Who_PutFormWho (struct TL_Timeline *Timeline)
|
|||
1 << Usr_WHO_ALL;
|
||||
|
||||
/***** Setting selector for which users *****/
|
||||
Set_StartSettingsHead ();
|
||||
Set_StartOneSettingSelector ();
|
||||
for (Who = (Usr_Who_t) 0;
|
||||
Who <= (Usr_Who_t) (Usr_NUM_WHO - 1);
|
||||
Who++)
|
||||
if (Mask & (1 << Who))
|
||||
{
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"%s\"",
|
||||
Who == Timeline->Who ? "PREF_ON" :
|
||||
"PREF_OFF");
|
||||
Set_BeginSettingsHead ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (Who = (Usr_Who_t) 0;
|
||||
Who <= (Usr_Who_t) (Usr_NUM_WHO - 1);
|
||||
Who++)
|
||||
if (Mask & (1 << Who))
|
||||
{
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"%s\"",
|
||||
Who == Timeline->Who ? "PREF_ON" :
|
||||
"PREF_OFF");
|
||||
|
||||
/* Begin form */
|
||||
Frm_BeginForm (ActSeeGblTL);
|
||||
Par_PutHiddenParamUnsigned (NULL,"Who",(unsigned) Who);
|
||||
/* Begin form */
|
||||
Frm_BeginForm (ActSeeGblTL);
|
||||
Par_PutHiddenParamUnsigned (NULL,"Who",(unsigned) Who);
|
||||
|
||||
/* Icon to select which users */
|
||||
Usr_PutWhoIcon (Who);
|
||||
/* Icon to select which users */
|
||||
Usr_PutWhoIcon (Who);
|
||||
|
||||
/* End form */
|
||||
Frm_EndForm ();
|
||||
/* End form */
|
||||
Frm_EndForm ();
|
||||
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
Set_EndOneSettingSelector ();
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
Set_EndOneSettingSelector ();
|
||||
Set_EndSettingsHead ();
|
||||
|
||||
/***** Show warning if I do not follow anyone *****/
|
||||
|
@ -210,7 +210,7 @@ static void TL_Who_ShowWarningYouDontFollowAnyUser (void)
|
|||
|
||||
/***** Contextual menu *****/
|
||||
Mnu_ContextMenuBegin ();
|
||||
Fol_PutLinkWhoToFollow (); // Users to follow
|
||||
Fol_PutLinkWhoToFollow (); // Users to follow
|
||||
Mnu_ContextMenuEnd ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ void TT_ShowClassTimeTable (void)
|
|||
else
|
||||
{
|
||||
/***** Setting selector *****/
|
||||
Set_StartSettingsHead ();
|
||||
Set_BeginSettingsHead ();
|
||||
|
||||
/* Select whether show only my groups or all groups */
|
||||
if ( Timetable.Type == TT_MY_TIMETABLE ||
|
||||
|
|
|
@ -6108,8 +6108,8 @@ void Usr_FreeListOtherRecipients (void)
|
|||
|
||||
void Usr_ShowFormsToSelectUsrListType (void (*FuncParams) (void *Args),void *Args)
|
||||
{
|
||||
Set_StartSettingsHead ();
|
||||
Set_StartOneSettingSelector ();
|
||||
Set_BeginSettingsHead ();
|
||||
Set_BeginOneSettingSelector ();
|
||||
|
||||
/***** Select Usr_LIST_AS_CLASS_PHOTO *****/
|
||||
HTM_DIV_Begin ("class=\"%s\"",
|
||||
|
|
Loading…
Reference in New Issue