diff --git a/css/swad20.45.css b/css/swad21.57.css similarity index 98% rename from css/swad20.45.css rename to css/swad21.57.css index 425a893d..417d81b9 100644 --- a/css/swad20.45.css +++ b/css/swad21.57.css @@ -3462,7 +3462,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} margin:0; padding:0; } -.TL_LIST +.Tml_LIST { list-style-type:none; padding:0; @@ -3473,32 +3473,32 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} @media only screen and (max-width: 590px) { /* For mobile-phones (maximum width visible on Moto G4 vertical) */ - .TL_WIDTH {width:316px;} /* 556-240 */ - .TL_RIGHT_WIDTH {width:260px;} /* 500-240 */ - .TL_RIGHT_AUTHOR_WIDTH {width:100px;} /* 340-240 */ - .TL_COMM_WIDTH {width:220px;} /* 460-240 */ - .TL_COMM_AUTHOR_WIDTH {width: 60px;} /* 300-240 */ - .TL_MED_INPUT_WIDTH {width:160px;} /* 400-240 */ - .TL_NOTE_FOOT_WIDTH {width:260px;} /* 500-240 */ - .TL_COMM_FOOT_WIDTH {width:220px;} /* 460-240 */ - .TL_FAV_NOT_WIDTH {width:120px;} /* (480-240)/2 */ - .TL_SHA_NOT_WIDTH {width:120px;} /* (480-240)/2 */ - .TL_FAV_COM_WIDTH {width:200px;} /* 440-240 */ + .Tml_WIDTH {width:316px;} /* 556-240 */ + .Tml_RIGHT_WIDTH {width:260px;} /* 500-240 */ + .Tml_RIGHT_AUTHOR_WIDTH {width:100px;} /* 340-240 */ + .Tml_COMM_WIDTH {width:220px;} /* 460-240 */ + .Tml_COMM_AUTHOR_WIDTH {width: 60px;} /* 300-240 */ + .Tml_MED_INPUT_WIDTH {width:160px;} /* 400-240 */ + .Tml_NOTE_FOOT_WIDTH {width:260px;} /* 500-240 */ + .Tml_COMM_FOOT_WIDTH {width:220px;} /* 460-240 */ + .Tml_FAV_NOT_WIDTH {width:120px;} /* (480-240)/2 */ + .Tml_SHA_NOT_WIDTH {width:120px;} /* (480-240)/2 */ + .Tml_FAV_COM_WIDTH {width:200px;} /* 440-240 */ } @media only screen and (min-width: 590px) { /* For tablets and desktop (maximum width visible on Moto G4 horizontal) */ - .TL_WIDTH {width:556px;} - .TL_RIGHT_WIDTH {width:500px;} - .TL_RIGHT_AUTHOR_WIDTH {width:340px;} - .TL_COMM_WIDTH {width:460px;} - .TL_COMM_AUTHOR_WIDTH {width:300px;} - .TL_MED_INPUT_WIDTH {width:400px;} - .TL_FAV_NOT_WIDTH {width:240px;} - .TL_SHA_NOT_WIDTH {width:240px;} - .TL_FAV_COM_WIDTH {width:440px;} + .Tml_WIDTH {width:556px;} + .Tml_RIGHT_WIDTH {width:500px;} + .Tml_RIGHT_AUTHOR_WIDTH {width:340px;} + .Tml_COMM_WIDTH {width:460px;} + .Tml_COMM_AUTHOR_WIDTH {width:300px;} + .Tml_MED_INPUT_WIDTH {width:400px;} + .Tml_FAV_NOT_WIDTH {width:240px;} + .Tml_SHA_NOT_WIDTH {width:240px;} + .Tml_FAV_COM_WIDTH {width:440px;} } -.TL_NEW_PUB +.Tml_NEW_PUB { background-color:#ddecf1; animation:fadein 2s linear forwards; @@ -3507,12 +3507,12 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} { to {background-color:white;} } -.TL_FORM_NEW_PST +.Tml_FORM_NEW_PST { padding:10px 0; text-align:center; } -.TL_SEP /* Separator (upper line between publications) */ +.Tml_SEP /* Separator (upper line between publications) */ { border-top:1px solid silver; } @@ -3530,7 +3530,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} color:#808080; font-size:13pt; } -.TL_LEFT_PHOTO +.Tml_LEFT_PHOTO { display:inline-block; box-sizing:border-box; @@ -3540,13 +3540,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} text-align:left; vertical-align:top; } -.TL_RIGHT_CONT +.Tml_RIGHT_CONT { display:inline-block; box-sizing:border-box; padding-top:10px; } -.TL_RIGHT_AUTHOR +.Tml_RIGHT_AUTHOR { display:inline-block; box-sizing:border-box; @@ -3556,7 +3556,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} overflow:hidden; text-overflow:ellipsis; } -.TL_RIGHT_TIME +.Tml_RIGHT_TIME { display:inline-block; box-sizing:border-box; @@ -3564,29 +3564,29 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} text-align:right; vertical-align:top; } -.TL_PST_TEXTAREA +.Tml_PST_TEXTAREA { box-sizing:border-box; margin:0; resize:none; } -.TL_PST_MED_CONT +.Tml_PST_MED_CONT { box-sizing:border-box; margin-top:10px; } -.TL_PST_MED +.Tml_PST_MED { box-sizing:border-box; border-radius:2px; } -.TL_COM_CONT +.Tml_COM_CONT { display:inline-block; box-sizing:border-box; padding-top:10px; } -.TL_COM_AUTHOR +.Tml_COM_AUTHOR { display:inline-block; box-sizing:border-box; @@ -3596,17 +3596,17 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} overflow:hidden; text-overflow:ellipsis; } -.TL_COM_MED_CONT +.Tml_COM_MED_CONT { box-sizing:border-box; margin-top:10px; } -.TL_COM_MED +.Tml_COM_MED { box-sizing:border-box; border-radius:2px; } -.TL_FORM_NEW_COM +.Tml_FORM_NEW_COM { display:inline-block; margin-left:56px; @@ -3614,13 +3614,13 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} padding-bottom:10px; text-align:center; } -.TL_COM_TEXTAREA +.Tml_COM_TEXTAREA { box-sizing:border-box; margin:0; resize:none; } -.TL_BOTTOM_LEFT /* Container for button used to toggle new comment form */ +.Tml_BOTTOM_LEFT /* Container for button used to toggle new comment form */ { display:inline-block; box-sizing:border-box; @@ -3629,20 +3629,20 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} text-align:center; vertical-align:bottom; } -.TL_BOTTOM_RIGHT /* Container for fav, share, remove and comments */ +.Tml_BOTTOM_RIGHT /* Container for fav, share, remove and comments */ { display:inline-block; box-sizing:border-box; vertical-align:top; } -.TL_FORM +.Tml_FORM { padding-top:8px; overflow:hidden; text-overflow:ellipsis; } -.TL_FORM_OFF, -.TL_LOC +.Tml_FORM_OFF, +.Tml_LOC { padding-top:8px; color:#808080; @@ -3650,7 +3650,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} overflow:hidden; text-overflow:ellipsis; } -.TL_TXT +.Tml_TXT { text-align:left; padding-top:5px; @@ -3660,12 +3660,12 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} overflow:hidden; text-overflow:ellipsis; } -.TL_EXPAND_COM +.Tml_EXPAND_COM { text-align:center; padding:10px 0; } -.TL_ICO_COM_OFF +.Tml_ICO_COM_OFF { display:inline-block; box-sizing:border-box; @@ -3675,7 +3675,7 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} border:solid 1px; border-color:transparent; } -.TL_ICO_COM_ON +.Tml_ICO_COM_ON { display:inline-block; box-sizing:border-box; @@ -3686,32 +3686,32 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} border-color:#C0DAE4; background-color:#DDECF1; } -.TL_FOOT /* Container for favs, shares and remove */ +.Tml_FOOT /* Container for favs, shares and remove */ { display:table; vertical-align:top; padding:7px 0; } -.TL_FAV_NOT, .TL_SHA_NOT +.Tml_FAV_NOT, .Tml_SHA_NOT { display:table-cell; text-align:left; vertical-align:top; } -.TL_FAV_COM +.Tml_FAV_COM { display:table-cell; text-align:left; vertical-align:top; } -.TL_REM +.Tml_REM { display:table-cell; width:20px; text-align:right; vertical-align:bottom; } -.TL_ICO +.Tml_ICO { display:table-cell; } @@ -3722,25 +3722,25 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;} font-size:12pt; font-weight:bold; } -.TL_USRS +.Tml_USRS { display:table-cell; } -.TL_ICO_DISABLED +.Tml_ICO_DISABLED { opacity:0.1; } -.TL_SHARER +.Tml_SHARER { display:inline-block; padding-left:4px; vertical-align:bottom; } -.TL_COM +.Tml_COM { border-top:1px solid silver; } -.TL_COM_PHOTO +.Tml_COM_PHOTO { display:inline-block; box-sizing:border-box; diff --git a/js/swad20.69.1.js b/js/swad21.57.js similarity index 99% rename from js/swad20.69.1.js rename to js/swad21.57.js index 5121a763..4ce8f051 100644 --- a/js/swad20.69.1.js +++ b/js/swad21.57.js @@ -987,7 +987,7 @@ function moveNewTimelineToTimeline () { if (mostRecentOcurrenceOfNote) { // Move node from new timeline to timeline timeline.insertBefore(newTimeline.lastChild, timeline.firstChild); - timeline.firstChild.className += " TL_NEW_PUB"; + timeline.firstChild.className += " Tml_NEW_PUB"; } else // Remove last child (because is repeated in more recent pubs) @@ -1397,10 +1397,10 @@ function toggleOffGIF (elem, staticURL) { function toggleNewComment (id) { var iconDiv = document.getElementById (id + '_ico'); - if (iconDiv.className == 'TL_ICO_COM_OFF') - iconDiv.className = 'TL_ICO_COM_ON'; + if (iconDiv.className == 'Tml_ICO_COM_OFF') + iconDiv.className = 'Tml_ICO_COM_ON'; else - iconDiv.className = 'TL_ICO_COM_OFF'; + iconDiv.className = 'Tml_ICO_COM_OFF'; toggleDisplay(id); } diff --git a/swad_action.c b/swad_action.c index c37f3d4b..1d1cb579 100644 --- a/swad_action.c +++ b/swad_action.c @@ -3835,7 +3835,7 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action) return false; } - return (bool) (Permission & (1 << Gbl.Usrs.Me.Role.Logged)); + return ((Permission & (1 << Gbl.Usrs.Me.Role.Logged)) != 0); } /*****************************************************************************/ diff --git a/swad_assignment.c b/swad_assignment.c index 8b18a7fa..eea62679 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -274,8 +274,8 @@ static void Asg_PutHeadForSeeing (struct Asg_Assignments *Assignments, static bool Asg_CheckIfICanCreateAssignments (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_TCH || - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); + return Gbl.Usrs.Me.Role.Logged == Rol_TCH || + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM; } /*****************************************************************************/ diff --git a/swad_browser.c b/swad_browser.c index 167f3c9a..04c81b72 100644 --- a/swad_browser.c +++ b/swad_browser.c @@ -6062,7 +6062,7 @@ static bool Brw_GetMyClipboard (void) if (NumRows > 1) Err_WrongCopySrcExit (); - return (bool) (NumRows == 1); + return NumRows == 1; } /*****************************************************************************/ @@ -8669,28 +8669,28 @@ void Brw_ChgFileMetadata (void) switch (Gbl.FileBrowser.Type) { case Brw_ADMI_DOC_INS: - Tml_Not_StoreAndPublishNote (TL_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod); break; case Brw_ADMI_SHR_INS: - Tml_Not_StoreAndPublishNote (TL_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod); break; case Brw_ADMI_DOC_CTR: - Tml_Not_StoreAndPublishNote (TL_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod); break; case Brw_ADMI_SHR_CTR: - Tml_Not_StoreAndPublishNote (TL_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod); break; case Brw_ADMI_DOC_DEG: - Tml_Not_StoreAndPublishNote (TL_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod); break; case Brw_ADMI_SHR_DEG: - Tml_Not_StoreAndPublishNote (TL_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod); break; case Brw_ADMI_DOC_CRS: - Tml_Not_StoreAndPublishNote (TL_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod); break; case Brw_ADMI_SHR_CRS: - Tml_Not_StoreAndPublishNote (TL_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod); break; default: break; diff --git a/swad_building.c b/swad_building.c index 426be3a5..b35b3216 100644 --- a/swad_building.c +++ b/swad_building.c @@ -201,7 +201,7 @@ static Bld_Order_t Bld_GetParamBuildingOrder (void) static bool Bld_CheckIfICanCreateBuildings (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM); + return Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM; } /*****************************************************************************/ diff --git a/swad_call_for_exam.c b/swad_call_for_exam.c index f427ba50..830113e5 100644 --- a/swad_call_for_exam.c +++ b/swad_call_for_exam.c @@ -358,7 +358,7 @@ void Cfe_ReceiveCallForExam2 (void) Cfe_DB_UpdateNumUsrsNotifiedByEMailAboutCallForExam (CallsForExams->HighlightExaCod,NumUsrsToBeNotifiedByEMail); /***** Create a new social note about the new call for exam *****/ - Tml_Not_StoreAndPublishNote (TL_NOTE_CALL_FOR_EXAM,CallsForExams->HighlightExaCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_CALL_FOR_EXAM,CallsForExams->HighlightExaCod); /***** Update RSS of current course *****/ RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs); @@ -457,7 +457,7 @@ void Cfe_RemoveCallForExam1 (void) Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_CALL_FOR_EXAM,ExaCod); /***** Mark possible social note as unavailable *****/ - Tml_DB_MarkNoteAsUnavailable (TL_NOTE_CALL_FOR_EXAM,ExaCod); + Tml_DB_MarkNoteAsUnavailable (Tml_NOTE_CALL_FOR_EXAM,ExaCod); /***** Update RSS of current course *****/ RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs); diff --git a/swad_center.c b/swad_center.c index 3f78bbcb..3932afef 100644 --- a/swad_center.c +++ b/swad_center.c @@ -289,7 +289,7 @@ static void Ctr_ListCenters (void) static bool Ctr_CheckIfICanCreateCenters (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_GST); + return Gbl.Usrs.Me.Role.Logged >= Rol_GST; } /*****************************************************************************/ @@ -925,9 +925,9 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places) static bool Ctr_CheckIfICanEditACenter (struct Ctr_Center *Ctr) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM || // I am an institution administrator or higher - ((Ctr->Status & Hie_STATUS_BIT_PENDING) != 0 && // Center is not yet activated - Gbl.Usrs.Me.UsrDat.UsrCod == Ctr->RequesterUsrCod)); // I am the requester + return Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM || // I am an institution administrator or higher + ((Ctr->Status & Hie_STATUS_BIT_PENDING) != 0 && // Center is not yet activated + Gbl.Usrs.Me.UsrDat.UsrCod == Ctr->RequesterUsrCod); // I am the requester } /*****************************************************************************/ @@ -1912,8 +1912,8 @@ static void Ctr_FormToGoToMap (struct Ctr_Center *Ctr) bool Ctr_GetIfMapIsAvailable (const struct Ctr_Center *Ctr) { /***** Coordinates 0, 0 means not set ==> don't show map *****/ - return (bool) (Ctr->Coord.Latitude || - Ctr->Coord.Longitude); + return Ctr->Coord.Latitude || + Ctr->Coord.Longitude; } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 82215cb4..fd7bbf58 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. */ -#define Log_PLATFORM_VERSION "SWAD 21.56.5 (2021-11-10)" -#define CSS_FILE "swad20.45.css" -#define JS_FILE "swad20.69.1.js" +#define Log_PLATFORM_VERSION "SWAD 21.57 (2021-11-11)" +#define CSS_FILE "swad21.57.css" +#define JS_FILE "swad21.57.js" /* TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams + Version 21.57: Nov 11, 2021 Code refactoring in timeline. (319208 lines) Version 21.56.5: Nov 10, 2021 Code refactoring in switch statements. (319181 lines) Version 21.56.4: Nov 10, 2021 Code refactoring in switch statements (until swad_network_database.c). (319362 lines) Version 21.56.3: Nov 10, 2021 Code refactoring in switch statements (until swad_logo.c). (319403 lines) diff --git a/swad_country.c b/swad_country.c index 39642ae3..f33e59b9 100644 --- a/swad_country.c +++ b/swad_country.c @@ -473,7 +473,7 @@ static void Cty_PutIconsListingCountries (__attribute__((unused)) void *Args) bool Cty_CheckIfICanEditCountries (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); + return Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM; } /*****************************************************************************/ diff --git a/swad_course.c b/swad_course.c index 2d25fbb1..5218b0d8 100644 --- a/swad_course.c +++ b/swad_course.c @@ -894,7 +894,7 @@ static void Crs_ListCourses (void) static bool Crs_CheckIfICanCreateCourses (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_GST); + return Gbl.Usrs.Me.Role.Logged >= Rol_GST; } /*****************************************************************************/ @@ -1292,9 +1292,9 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year) static bool Crs_CheckIfICanEdit (struct Crs_Course *Crs) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM || // I am a degree administrator or higher - ((Crs->Status & Hie_STATUS_BIT_PENDING) != 0 && // Course is not yet activated - Gbl.Usrs.Me.UsrDat.UsrCod == Crs->RequesterUsrCod)); // I am the requester + return Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM || // I am a degree administrator or higher + ((Crs->Status & Hie_STATUS_BIT_PENDING) != 0 && // Course is not yet activated + Gbl.Usrs.Me.UsrDat.UsrCod == Crs->RequesterUsrCod); // I am the requester } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index ff66a47a..2e5414e0 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -478,9 +478,9 @@ static void Deg_ListDegreesForEdition (void) static bool Deg_CheckIfICanEditADegree (struct Deg_Degree *Deg) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM || // I am a center administrator or higher - ((Deg->Status & Hie_STATUS_BIT_PENDING) != 0 && // Degree is not yet activated - Gbl.Usrs.Me.UsrDat.UsrCod == Deg->RequesterUsrCod)); // I am the requester + return Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM || // I am a center administrator or higher + ((Deg->Status & Hie_STATUS_BIT_PENDING) != 0 && // Degree is not yet activated + Gbl.Usrs.Me.UsrDat.UsrCod == Deg->RequesterUsrCod); // I am the requester } /*****************************************************************************/ @@ -729,7 +729,7 @@ static void Deg_ListDegrees (void) static bool Deg_CheckIfICanCreateDegrees (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_GST); + return Gbl.Usrs.Me.Role.Logged >= Rol_GST; } /*****************************************************************************/ diff --git a/swad_exam.c b/swad_exam.c index d6811c22..2d266cc2 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -1561,7 +1561,7 @@ bool Exa_CheckIfEditable (const struct Exa_Exam *Exam) { if (Exa_CheckIfICanEditExams ()) /***** Questions are editable only if exam has no sessions *****/ - return (bool) (Exam->NumSess == 0); // Exams with sessions should not be edited + return Exam->NumSess == 0; // Exams with sessions should not be edited else return false; // Questions are not editable } diff --git a/swad_figure.c b/swad_figure.c index ad84a6f6..d18abfdb 100644 --- a/swad_figure.c +++ b/swad_figure.c @@ -2230,7 +2230,7 @@ static void Fig_GetAndShowTimelineActivityStats (void) extern const char *Txt_Number_of_users; extern const char *Txt_PERCENT_of_users; extern const char *Txt_Number_of_posts_BR_per_user; - extern const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES]; + extern const char *Txt_TIMELINE_NOTE[Tml_NOT_NUM_NOTE_TYPES]; extern const char *Txt_Total; MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -2258,7 +2258,7 @@ static void Fig_GetAndShowTimelineActivityStats (void) /***** Get total number of timeline notes and users for each note type *****/ for (NoteType = (Tml_Not_Type_t) 0; - NoteType <= (Tml_Not_Type_t) (TL_NOT_NUM_NOTE_TYPES - 1); + NoteType <= (Tml_Not_Type_t) (Tml_NOT_NUM_NOTE_TYPES - 1); NoteType++) { /***** Get number of timeline notes and users for this type *****/ diff --git a/swad_forum.c b/swad_forum.c index 9bc77045..acf03815 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -2836,7 +2836,7 @@ void For_ReceiveForumPost (void) { case For_FORUM_GLOBAL_USRS: case For_FORUM__SWAD__USRS: - Tml_Not_StoreAndPublishNote (TL_NOTE_FORUM_POST,PstCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_FORUM_POST,PstCod); break; default: break; @@ -2911,7 +2911,7 @@ void For_RemovePost (void) { case For_FORUM_GLOBAL_USRS: case For_FORUM__SWAD__USRS: - Tml_DB_MarkNoteAsUnavailable (TL_NOTE_FORUM_POST,Forums.PstCod); + Tml_DB_MarkNoteAsUnavailable (Tml_NOTE_FORUM_POST,Forums.PstCod); break; default: break; diff --git a/swad_game.c b/swad_game.c index 6445364e..ffb33ecc 100644 --- a/swad_game.c +++ b/swad_game.c @@ -2196,9 +2196,9 @@ static bool Gam_CheckIfEditable (const struct Gam_Game *Game) { if (Gam_CheckIfICanEditGames ()) /***** Questions are editable only if game has no matches *****/ - return (bool) (Game->NumMchs == 0); // Games with matches should not be edited + return Game->NumMchs == 0; // Games with matches should not be edited else - return false; // Questions are not editable + return false; // Questions are not editable } /*****************************************************************************/ diff --git a/swad_icon.c b/swad_icon.c index c00eb6ec..c7d1a578 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -385,7 +385,7 @@ void Ico_PutContextualIconToZIP (Act_Action_t NextAction, void Ico_PutDivIcon (const char *DivClass,const char *Icon,const char *Title) { HTM_DIV_Begin ("class=\"%s\"",DivClass); - Ico_PutIcon (Icon,Title,"CONTEXT_ICO_16x16"); + Ico_PutIcon (Icon,Title,"CONTEXT_ICO_16x16"); HTM_DIV_End (); } @@ -396,7 +396,7 @@ void Ico_PutDivIcon (const char *DivClass,const char *Icon,const char *Title) void Ico_PutDivIconLink (const char *DivClass,const char *Icon,const char *Title) { HTM_DIV_Begin ("class=\"%s\"",DivClass); - Ico_PutIconLink (Icon,Title); + Ico_PutIconLink (Icon,Title); HTM_DIV_End (); } @@ -417,8 +417,8 @@ void Ico_PutIconTextLink (const char *Icon,const char *Text) { /***** Print icon and optional text *****/ HTM_DIV_Begin ("class=\"CONTEXT_OPT ICO_HIGHLIGHT\""); - Ico_PutIcon (Icon,Text,"CONTEXT_ICO_x16"); - HTM_TxtF (" %s",Text); + Ico_PutIcon (Icon,Text,"CONTEXT_ICO_x16"); + HTM_TxtF (" %s",Text); HTM_DIV_End (); } diff --git a/swad_institution.c b/swad_institution.c index 9465a150..c31be321 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -326,7 +326,7 @@ static void Ins_ListInstitutions (void) static bool Ins_CheckIfICanCreateInstitutions (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_GST); + return Gbl.Usrs.Me.Role.Logged >= Rol_GST; } /*****************************************************************************/ @@ -1069,9 +1069,9 @@ static void Ins_ListInstitutionsForEdition (void) static bool Ins_CheckIfICanEdit (struct Ins_Instit *Ins) { - return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM || // I am a superuser - ((Ins->Status & Hie_STATUS_BIT_PENDING) != 0 && // Institution is not yet activated - Gbl.Usrs.Me.UsrDat.UsrCod == Ins->RequesterUsrCod)); // I am the requester + return Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM || // I am a superuser + ((Ins->Status & Hie_STATUS_BIT_PENDING) != 0 && // Institution is not yet activated + Gbl.Usrs.Me.UsrDat.UsrCod == Ins->RequesterUsrCod); // I am the requester } /*****************************************************************************/ diff --git a/swad_notice.c b/swad_notice.c index ebbaf87b..b9bcd84e 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -160,7 +160,7 @@ void Not_ReceiveNotice (void) Not_DB_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail); /***** Create a new social note about the new notice *****/ - Tml_Not_StoreAndPublishNote (TL_NOTE_NOTICE,NotCod); + Tml_Not_StoreAndPublishNote (Tml_NOTE_NOTICE,NotCod); /***** Set notice to be highlighted *****/ Gbl.Crs.Notices.HighlightNotCod = NotCod; @@ -296,7 +296,7 @@ void Not_RemoveNotice (void) Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_NOTICE,NotCod); /***** Mark possible social note as unavailable *****/ - Tml_DB_MarkNoteAsUnavailable (TL_NOTE_NOTICE,NotCod); + Tml_DB_MarkNoteAsUnavailable (Tml_NOTE_NOTICE,NotCod); /***** Update RSS of current course *****/ RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs); @@ -440,8 +440,8 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,long HighlightNotCod) static bool Not_CheckIfICanEditNotices (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_TCH || - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); + return Gbl.Usrs.Me.Role.Logged == Rol_TCH || + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM; } /*****************************************************************************/ diff --git a/swad_notification.c b/swad_notification.c index e8d0e458..54e452b4 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -85,10 +85,10 @@ const char *Ntf_WSNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] = { [Ntf_EVENT_UNKNOWN ] = "unknown", /* Start tab */ - [Ntf_EVENT_TL_COMMENT ] = "timelineComment", - [Ntf_EVENT_TL_FAV ] = "timelineFav", - [Ntf_EVENT_TL_SHARE ] = "timelineShare", - [Ntf_EVENT_TL_MENTION ] = "timelineMention", + [Ntf_EVENT_TML_COMMENT ] = "timelineComment", + [Ntf_EVENT_TML_FAV ] = "timelineFav", + [Ntf_EVENT_TML_SHARE ] = "timelineShare", + [Ntf_EVENT_TML_MENTION ] = "timelineMention", [Ntf_EVENT_FOLLOWER ] = "follower", /* System tab */ /* Country tab */ @@ -123,10 +123,10 @@ static const Act_Action_t Ntf_DefaultActions[Ntf_NUM_NOTIFY_EVENTS] = { [Ntf_EVENT_UNKNOWN ] = ActUnk, /* Start tab */ - [Ntf_EVENT_TL_COMMENT ] = ActSeeGblTL, - [Ntf_EVENT_TL_FAV ] = ActSeeGblTL, - [Ntf_EVENT_TL_SHARE ] = ActSeeGblTL, - [Ntf_EVENT_TL_MENTION ] = ActSeeGblTL, + [Ntf_EVENT_TML_COMMENT ] = ActSeeGblTL, + [Ntf_EVENT_TML_FAV ] = ActSeeGblTL, + [Ntf_EVENT_TML_SHARE ] = ActSeeGblTL, + [Ntf_EVENT_TML_MENTION ] = ActSeeGblTL, [Ntf_EVENT_FOLLOWER ] = ActSeeFlr, /* System tab */ /* Country tab */ @@ -166,10 +166,10 @@ static const char *Ntf_ParamNotifMeAboutNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] = { [Ntf_EVENT_UNKNOWN ] = "NotifyNtfEventUnknown", /* Start tab */ - [Ntf_EVENT_TL_COMMENT ] = "NotifyNtfEventTimelineComment", - [Ntf_EVENT_TL_FAV ] = "NotifyNtfEventTimelineFav", - [Ntf_EVENT_TL_SHARE ] = "NotifyNtfEventTimelineShare", - [Ntf_EVENT_TL_MENTION ] = "NotifyNtfEventTimelineMention", + [Ntf_EVENT_TML_COMMENT ] = "NotifyNtfEventTimelineComment", + [Ntf_EVENT_TML_FAV ] = "NotifyNtfEventTimelineFav", + [Ntf_EVENT_TML_SHARE ] = "NotifyNtfEventTimelineShare", + [Ntf_EVENT_TML_MENTION ] = "NotifyNtfEventTimelineMention", [Ntf_EVENT_FOLLOWER ] = "NotifyNtfEventFollower", /* System tab */ /* Country tab */ @@ -205,10 +205,10 @@ static const char *Ntf_ParamEmailMeAboutNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] = { [Ntf_EVENT_UNKNOWN ] = "EmailNtfEventUnknown", /* Start tab */ - [Ntf_EVENT_TL_COMMENT ] = "EmailNtfEventTimelineComment", - [Ntf_EVENT_TL_FAV ] = "EmailNtfEventTimelineFav", - [Ntf_EVENT_TL_SHARE ] = "EmailNtfEventTimelineShare", - [Ntf_EVENT_TL_MENTION ] = "EmailNtfEventTimelineMention", + [Ntf_EVENT_TML_COMMENT ] = "EmailNtfEventTimelineComment", + [Ntf_EVENT_TML_FAV ] = "EmailNtfEventTimelineFav", + [Ntf_EVENT_TML_SHARE ] = "EmailNtfEventTimelineShare", + [Ntf_EVENT_TML_MENTION ] = "EmailNtfEventTimelineMention", [Ntf_EVENT_FOLLOWER ] = "EmailNtfEventSocialFollower", /* System tab */ /* Country tab */ @@ -244,10 +244,10 @@ static const char *Ntf_Icons[Ntf_NUM_NOTIFY_EVENTS] = { [Ntf_EVENT_UNKNOWN ] = "question.svg", /* Start tab */ - [Ntf_EVENT_TL_COMMENT ] = "comment-dots.svg", - [Ntf_EVENT_TL_FAV ] = "star.svg", - [Ntf_EVENT_TL_SHARE ] = "share-alt.svg", - [Ntf_EVENT_TL_MENTION ] = "at.svg", + [Ntf_EVENT_TML_COMMENT ] = "comment-dots.svg", + [Ntf_EVENT_TML_FAV ] = "star.svg", + [Ntf_EVENT_TML_SHARE ] = "share-alt.svg", + [Ntf_EVENT_TML_MENTION ] = "at.svg", [Ntf_EVENT_FOLLOWER ] = "user-plus.svg", /* System tab */ /* Country tab */ @@ -720,10 +720,10 @@ static bool Ntf_StartFormGoToAction (Ntf_NotifyEvent_t NotifyEvent, Brw_PutHiddenParamFilCod (FileMetadata.FilCod); } break; - case Ntf_EVENT_TL_COMMENT: - case Ntf_EVENT_TL_FAV: - case Ntf_EVENT_TL_SHARE: - case Ntf_EVENT_TL_MENTION: + case Ntf_EVENT_TML_COMMENT: + case Ntf_EVENT_TML_FAV: + case Ntf_EVENT_TML_SHARE: + case Ntf_EVENT_TML_MENTION: // Cod is the code of the social publishing Frm_BeginForm (ActSeeGblTL); Tml_Pub_PutHiddenParamPubCod (Cod); @@ -873,10 +873,10 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], case Ntf_EVENT_ENROLMENT_REQUEST: Enr_GetNotifEnrolmentRequest (SummaryStr,ContentStr,Cod,GetContent); break; - case Ntf_EVENT_TL_COMMENT: - case Ntf_EVENT_TL_FAV: - case Ntf_EVENT_TL_SHARE: - case Ntf_EVENT_TL_MENTION: + case Ntf_EVENT_TML_COMMENT: + case Ntf_EVENT_TML_FAV: + case Ntf_EVENT_TML_SHARE: + case Ntf_EVENT_TML_MENTION: // Cod is the code of the social publishing Tml_Ntf_GetNotifPublication (SummaryStr,ContentStr,Cod,GetContent); break; @@ -1040,13 +1040,13 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod) // ==> send notification to administrators or superusers NumUsrs = Adm_DB_GetAdmsCurrentScopeExceptMe (&mysql_res); break; - case Ntf_EVENT_TL_COMMENT: // New comment to one of my social notes or comments + case Ntf_EVENT_TML_COMMENT: // New comment to one of my social notes or comments // Cod is the code of the social publishing NumUsrs = Tml_DB_GetPublishersInNoteExceptMe (&mysql_res,Cod); break; - case Ntf_EVENT_TL_FAV: // New favourite to one of my social notes or comments - case Ntf_EVENT_TL_SHARE: // New sharing of one of my social notes - case Ntf_EVENT_TL_MENTION: + case Ntf_EVENT_TML_FAV: // New favourite to one of my social notes or comments + case Ntf_EVENT_TML_SHARE: // New sharing of one of my social notes + case Ntf_EVENT_TML_MENTION: case Ntf_EVENT_FOLLOWER: // This function should not be called in these cases return 0; @@ -1312,10 +1312,10 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign switch (NotifyEvent) { case Ntf_EVENT_UNKNOWN: - case Ntf_EVENT_TL_COMMENT: - case Ntf_EVENT_TL_FAV: - case Ntf_EVENT_TL_SHARE: - case Ntf_EVENT_TL_MENTION: + case Ntf_EVENT_TML_COMMENT: + case Ntf_EVENT_TML_FAV: + case Ntf_EVENT_TML_SHARE: + case Ntf_EVENT_TML_MENTION: case Ntf_EVENT_FOLLOWER: break; case Ntf_EVENT_DOCUMENT_FILE: diff --git a/swad_notification.h b/swad_notification.h index 478bb79a..1381065c 100644 --- a/swad_notification.h +++ b/swad_notification.h @@ -55,10 +55,10 @@ typedef enum // TODO: Change numbers (also in database)!!!!!!!!!!!!!! { Ntf_EVENT_UNKNOWN = 0, /* Start tab */ - Ntf_EVENT_TL_COMMENT = 10, // New comment to one of my social publishings (notes or comments) - Ntf_EVENT_TL_FAV = 11, // New fav of one of my social publishings (notes or comments) - Ntf_EVENT_TL_SHARE = 12, // New sharing of one of my social notes - Ntf_EVENT_TL_MENTION = 13, // New mention + Ntf_EVENT_TML_COMMENT = 10, // New comment to one of my social publishings (notes or comments) + Ntf_EVENT_TML_FAV = 11, // New fav of one of my social publishings (notes or comments) + Ntf_EVENT_TML_SHARE = 12, // New sharing of one of my social notes + Ntf_EVENT_TML_MENTION = 13, // New mention Ntf_EVENT_FOLLOWER = 14, /* System tab */ /* Country tab */ diff --git a/swad_place.c b/swad_place.c index 997550f4..de7b2041 100644 --- a/swad_place.c +++ b/swad_place.c @@ -237,7 +237,7 @@ static Plc_Order_t Plc_GetParamPlcOrder (void) static bool Plc_CheckIfICanCreatePlaces (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM); + return Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM; } /*****************************************************************************/ diff --git a/swad_profile.c b/swad_profile.c index 2e9823a6..913f383d 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -246,7 +246,7 @@ void Prf_GetUsrDatAndShowUserProfile (void) Tml_ResetTimeline (&Timeline); /* Show timeline */ - HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); + HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID); Tml_ShowTimelineUsr (&Timeline); HTM_SECTION_End (); } diff --git a/swad_program.c b/swad_program.c index d4f51859..4c757fce 100644 --- a/swad_program.c +++ b/swad_program.c @@ -317,8 +317,8 @@ static void Prg_ShowAllItems (Prg_CreateOrChangeItem_t CreateOrChangeItem, static bool Prg_CheckIfICanCreateItems (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_TCH || - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); + return Gbl.Usrs.Me.Role.Logged == Rol_TCH || + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM; } /*****************************************************************************/ diff --git a/swad_question.c b/swad_question.c index 4187fc8f..e29259be 100644 --- a/swad_question.c +++ b/swad_question.c @@ -429,8 +429,8 @@ void Qst_ShowFormRequestSelectQstsForGame (struct Gam_Games *Games, bool Qst_CheckIfICanEditQsts (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged == Rol_TCH || - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); + return Gbl.Usrs.Me.Role.Logged == Rol_TCH || + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM; } /*****************************************************************************/ diff --git a/swad_room.c b/swad_room.c index 3ba0df7a..b85d7518 100644 --- a/swad_room.c +++ b/swad_room.c @@ -371,7 +371,7 @@ static Roo_Order_t Roo_GetParamRoomOrder (void) static bool Roo_CheckIfICanCreateRooms (void) { - return (bool) (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM); + return Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM; } /*****************************************************************************/ diff --git a/swad_string.c b/swad_string.c index c6ec49cb..30d4d53e 100644 --- a/swad_string.c +++ b/swad_string.c @@ -745,11 +745,11 @@ void Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (long PubCod,const char *T Usr_DONT_GET_ROLE_IN_CURRENT_CRS); /* Create notification for the mentioned user *****/ - CreateNotif = (UsrDat.NtfEvents.CreateNotif & (1 << Ntf_EVENT_TL_MENTION)); + CreateNotif = (UsrDat.NtfEvents.CreateNotif & (1 << Ntf_EVENT_TML_MENTION)); if (CreateNotif) { - NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TL_MENTION)); - Ntf_DB_StoreNotifyEventToUsr (Ntf_EVENT_TL_MENTION,UsrDat.UsrCod,PubCod, + NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TML_MENTION)); + Ntf_DB_StoreNotifyEventToUsr (Ntf_EVENT_TML_MENTION,UsrDat.UsrCod,PubCod, (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : 0), Gbl.Hierarchy.Ins.InsCod, @@ -2641,7 +2641,7 @@ bool Str_Path1BeginsByPath2 (const char *Path1,const char *Path2) /* The string Path1 starts by the complete string Path2 */ /* Check that the next character of Path1 is '\0' or '/' */ - return (bool) (*Path1 == '\0' || *Path1 == '/'); + return *Path1 == '\0' || *Path1 == '/'; } /*****************************************************************************/ diff --git a/swad_text.c b/swad_text.c index 968761b4..d6f9d963 100644 --- a/swad_text.c +++ b/swad_text.c @@ -27899,7 +27899,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] = "Novos pedidos de inscrição" #endif , - [Ntf_EVENT_TL_COMMENT] = + [Ntf_EVENT_TML_COMMENT] = #if L==1 // ca "Nous comentaris als meus missatges socials" #elif L==2 // de @@ -27920,7 +27920,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] = "Novos comentário às minhos posts sociais" #endif , - [Ntf_EVENT_TL_FAV] = + [Ntf_EVENT_TML_FAV] = #if L==1 // ca "Nous favorits als meus missatges socials" #elif L==2 // de @@ -27941,7 +27941,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] = "Novos favoritos às minhos posts sociais" #endif , - [Ntf_EVENT_TL_SHARE] = + [Ntf_EVENT_TML_SHARE] = #if L==1 // ca "Noves comparticions dels meus missatges socials" #elif L==2 // de @@ -27962,7 +27962,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] = "Novas partilhas de minhos posts sociais" #endif , - [Ntf_EVENT_TL_MENTION] = + [Ntf_EVENT_TML_MENTION] = #if L==1 // ca "Noves mencions" #elif L==2 // de @@ -28343,7 +28343,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] = "Pedido de inscrição" #endif , - [Ntf_EVENT_TL_COMMENT] = + [Ntf_EVENT_TML_COMMENT] = #if L==1 // ca "Comentari a un missatge social" #elif L==2 // de @@ -28364,7 +28364,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] = "Comentário a um post sociais" #endif , - [Ntf_EVENT_TL_FAV] = + [Ntf_EVENT_TML_FAV] = #if L==1 // ca "Missatge social marcat com favorit" #elif L==2 // de @@ -28385,7 +28385,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] = "Post sociais marcado como favorito" #endif , - [Ntf_EVENT_TL_SHARE] = + [Ntf_EVENT_TML_SHARE] = #if L==1 // ca "Missatge social compartit" #elif L==2 // de @@ -28406,7 +28406,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] = "Post sociais compartido" #endif , - [Ntf_EVENT_TL_MENTION] = + [Ntf_EVENT_TML_MENTION] = #if L==1 // ca "Menció" #elif L==2 // de @@ -52601,9 +52601,9 @@ const char *Txt_TIMELINE_Not_shared_by_anyone = // No shared "Não compartilhado por qualquer pessoa"; #endif -const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = +const char *Txt_TIMELINE_NOTE[Tml_NOT_NUM_NOTE_TYPES] = { - [TL_NOTE_UNKNOWN] = + [Tml_NOTE_UNKNOWN] = #if L==1 // ca "Esdeveniment desconegut" #elif L==2 // de @@ -52624,7 +52624,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Evento desconhecido" #endif , - [TL_NOTE_INS_DOC_PUB_FILE] = + [Tml_NOTE_INS_DOC_PUB_FILE] = #if L==1 // ca "Document públic (institució)" #elif L==2 // de @@ -52645,7 +52645,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Arquivo de documento público (institução)" #endif , - [TL_NOTE_INS_SHA_PUB_FILE] = + [Tml_NOTE_INS_SHA_PUB_FILE] = #if L==1 // ca "Arxiu compartit públic (institució)" #elif L==2 // de @@ -52666,7 +52666,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Arquivo compartilhado público (institução)" #endif , - [TL_NOTE_CTR_DOC_PUB_FILE] = + [Tml_NOTE_CTR_DOC_PUB_FILE] = #if L==1 // ca "Document públic (center)" #elif L==2 // de @@ -52687,7 +52687,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Arquivo de documento público (centro)" #endif , - [TL_NOTE_CTR_SHA_PUB_FILE] = + [Tml_NOTE_CTR_SHA_PUB_FILE] = #if L==1 // ca "Arxiu compartit públic (center)" #elif L==2 // de @@ -52708,7 +52708,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Arquivo compartilhado público (centro)" #endif , - [TL_NOTE_DEG_DOC_PUB_FILE] = + [Tml_NOTE_DEG_DOC_PUB_FILE] = #if L==1 // ca "Document públic (titulació)" #elif L==2 // de @@ -52729,7 +52729,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Arquivo de documento público (grau)" #endif , - [TL_NOTE_DEG_SHA_PUB_FILE] = + [Tml_NOTE_DEG_SHA_PUB_FILE] = #if L==1 // ca "Arxiu compartit públic (titulació)" #elif L==2 // de @@ -52750,7 +52750,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Arquivo compartilhado público (grau)" #endif , - [TL_NOTE_CRS_DOC_PUB_FILE] = + [Tml_NOTE_CRS_DOC_PUB_FILE] = #if L==1 // ca "Document públic (assignatura)" #elif L==2 // de @@ -52771,7 +52771,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Arquivo de documento público (disciplina)" #endif , - [TL_NOTE_CRS_SHA_PUB_FILE] = + [Tml_NOTE_CRS_SHA_PUB_FILE] = #if L==1 // ca "Arxiu compartit públic (assignatura)" #elif L==2 // de @@ -52792,7 +52792,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Arquivo compartilhado público (disciplina)" #endif , - [TL_NOTE_CALL_FOR_EXAM] = + [Tml_NOTE_CALL_FOR_EXAM] = #if L==1 // ca "Convocatòria d'examen" #elif L==2 // de @@ -52813,7 +52813,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Chamada para exame" #endif , - [TL_NOTE_POST] = + [Tml_NOTE_POST] = #if L==1 // ca "Missatge social" #elif L==2 // de @@ -52834,7 +52834,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Post sociais" #endif , - [TL_NOTE_FORUM_POST] = + [Tml_NOTE_FORUM_POST] = #if L==1 // ca "Comentari en un fòrum" #elif L==2 // de @@ -52855,7 +52855,7 @@ const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES] = "Post em um fórum" #endif , - [TL_NOTE_NOTICE] = + [Tml_NOTE_NOTICE] = #if L==1 // ca "Avís" #elif L==2 // de diff --git a/swad_text_no_html.c b/swad_text_no_html.c index 36b96684..a184ede5 100644 --- a/swad_text_no_html.c +++ b/swad_text_no_html.c @@ -534,7 +534,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU [Lan_LANGUAGE_PL ] = "Nowe prosby o rejestracji", [Lan_LANGUAGE_PT ] = "Novo pedido de inscrição", }, -[Ntf_EVENT_TL_COMMENT] = +[Ntf_EVENT_TML_COMMENT] = { [Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_CA ] = "Nou comentari a un missatge social", @@ -547,7 +547,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU [Lan_LANGUAGE_PL ] = "Nowy komentarz do post spoleczna", [Lan_LANGUAGE_PT ] = "Novo comentário a um post sociais", }, -[Ntf_EVENT_TL_FAV] = +[Ntf_EVENT_TML_FAV] = { [Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_CA ] = "Nou favorit a un missatge social", @@ -560,7 +560,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU [Lan_LANGUAGE_PL ] = "Nowy ulubiony do post spoleczna", [Lan_LANGUAGE_PT ] = "Novo favorito a um post sociais", }, -[Ntf_EVENT_TL_SHARE] = +[Ntf_EVENT_TML_SHARE] = { [Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_CA ] = "Nova compartició de missatge social", @@ -573,7 +573,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU [Lan_LANGUAGE_PL ] = "Nowy podzial post spoleczna", [Lan_LANGUAGE_PT ] = "Nova partilha de post sociais", }, -[Ntf_EVENT_TL_MENTION] = +[Ntf_EVENT_TML_MENTION] = { [Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_CA ] = "Nova menció", diff --git a/swad_timeline.c b/swad_timeline.c index cc157e48..d495310b 100644 --- a/swad_timeline.c +++ b/swad_timeline.c @@ -376,7 +376,8 @@ static void Tml_GetAndShowOldTimeline (struct Tml_Timeline *Timeline) /*****************************************************************************/ /******************************* Show timeline *******************************/ /*****************************************************************************/ -/* _____ +/* + _____ / |_____| just_now_timeline_list (Posts retrieved automatically | |_____| via AJAX from time to time. | |_____| They are transferred inmediately @@ -479,7 +480,7 @@ static unsigned Tml_ListRecentPubs (struct Tml_Timeline *Timeline, struct Tml_Not_Note Not; /***** Begin list *****/ - HTM_UL_Begin ("id=\"timeline_list\" class=\"TL_LIST\""); + HTM_UL_Begin ("id=\"timeline_list\" class=\"Tml_LIST\""); /***** For each publication in list... *****/ for (Pub = Timeline->Pubs.Top, NumNotesShown = 0; @@ -492,8 +493,8 @@ static unsigned Tml_ListRecentPubs (struct Tml_Timeline *Timeline, /* Write list item (note) */ HTM_LI_Begin ("class=\"%s\"", - Not.NotCod == NotCodToHighlight ? "TL_WIDTH TL_SEP TL_NEW_PUB" : - "TL_WIDTH TL_SEP"); + Not.NotCod == NotCodToHighlight ? "Tml_WIDTH Tml_SEP Tml_NEW_PUB" : + "Tml_WIDTH Tml_SEP"); Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not, Tml_Pub_GetTopMessage (Pub->Type), Pub->PublisherCod); @@ -512,7 +513,7 @@ static unsigned Tml_ListRecentPubs (struct Tml_Timeline *Timeline, static void Tml_PutHiddenList (const char *Id) { - HTM_UL_Begin ("id=\"%s\" class=\"TL_LIST\"",Id); + HTM_UL_Begin ("id=\"%s\" class=\"Tml_LIST\"",Id); HTM_UL_End (); } @@ -529,7 +530,7 @@ void Tml_WriteDateTime (time_t TimeUTC) Frm_SetUniqueId (IdDateTime); /***** Container where the date-time is written *****/ - HTM_DIV_Begin ("id=\"%s\" class=\"TL_RIGHT_TIME DAT_LIGHT\"",IdDateTime); + HTM_DIV_Begin ("id=\"%s\" class=\"Tml_RIGHT_TIME DAT_LIGHT\"",IdDateTime); HTM_DIV_End (); /***** Script to write date and time in browser local time *****/ diff --git a/swad_timeline.h b/swad_timeline.h index d8e66d26..bda0c3ac 100644 --- a/swad_timeline.h +++ b/swad_timeline.h @@ -37,12 +37,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define TL_TIMELINE_SECTION_ID "timeline" +#define Tml_TIMELINE_SECTION_ID "timeline" /* Timeline images will be saved with: - · maximum width of TL_IMAGE_SAVED_MAX_HEIGHT - · maximum height of TL_IMAGE_SAVED_MAX_HEIGHT + · maximum width of Tml_IMAGE_SAVED_MAX_HEIGHT + · maximum height of Tml_IMAGE_SAVED_MAX_HEIGHT · maintaining the original aspect ratio (aspect ratio recommended: 3:2) */ #define Tml_IMAGE_SAVED_MAX_WIDTH 768 diff --git a/swad_timeline_comment.c b/swad_timeline_comment.c index e6b3cde4..7a5b900e 100644 --- a/swad_timeline_comment.c +++ b/swad_timeline_comment.c @@ -119,7 +119,7 @@ void Tml_Com_PutIconToToggleComm (const char UniqueId[Frm_MAX_BYTES_ID + 1]) /***** Link to toggle on/off the form to comment a note *****/ /* Begin container */ - HTM_DIV_Begin ("id=\"%s_ico\" class=\"TL_ICO_COM_OFF\"",UniqueId); + HTM_DIV_Begin ("id=\"%s_ico\" class=\"Tml_ICO_COM_OFF\"",UniqueId); /* Begin anchor */ HTM_A_Begin ("href=\"\" onclick=\"toggleNewComment ('%s');" @@ -146,7 +146,7 @@ void Tml_Com_PutIconCommDisabled (void) /***** Disabled icon to comment a note *****/ /* Begin container */ - HTM_DIV_Begin ("class=\"TL_ICO_COM_OFF TL_ICO_DISABLED\""); + HTM_DIV_Begin ("class=\"Tml_ICO_COM_OFF Tml_ICO_DISABLED\""); /* Disabled icon */ Ico_PutIcon ("edit.svg",Txt_Comment,"ICO16x16"); @@ -164,7 +164,7 @@ void Tml_Com_PutPhotoAndFormToWriteNewComm (const struct Tml_Timeline *Timeline, const char IdNewComm[Frm_MAX_BYTES_ID + 1]) { /***** Begin container *****/ - HTM_DIV_Begin ("id=\"%s\" class=\"TL_FORM_NEW_COM TL_RIGHT_WIDTH\"" + HTM_DIV_Begin ("id=\"%s\" class=\"Tml_FORM_NEW_COM Tml_RIGHT_WIDTH\"" " style=\"display:none;\"", IdNewComm); @@ -186,7 +186,7 @@ static void Tml_Com_ShowAuthorPhoto (struct UsrData *UsrDat) { /***** Show author's photo *****/ /* Begin container */ - HTM_DIV_Begin ("class=\"TL_COM_PHOTO\""); + HTM_DIV_Begin ("class=\"Tml_COM_PHOTO\""); /* Author's photo */ Pho_ShowUsrPhotoIfAllowed (UsrDat,"PHOTO30x40",Pho_ZOOM,true); // Use unique id @@ -205,7 +205,7 @@ static void Tml_Com_PutFormToWriteNewComm (const struct Tml_Timeline *Timeline, extern const char *Txt_New_TIMELINE_comment; /***** Begin container *****/ - HTM_DIV_Begin ("class=\"TL_COM_CONT TL_COMM_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_COM_CONT Tml_COMM_WIDTH\""); /***** Begin form to write the post *****/ Tml_Frm_BeginForm (Timeline,Tml_Frm_RECEIVE_COMM); @@ -213,7 +213,7 @@ static void Tml_Com_PutFormToWriteNewComm (const struct Tml_Timeline *Timeline, /***** Textarea and button *****/ Tml_Pst_PutTextarea (Txt_New_TIMELINE_comment, - "TL_COM_TEXTAREA TL_COMM_WIDTH"); + "Tml_COM_TEXTAREA Tml_COMM_WIDTH"); /***** End form *****/ Tml_Frm_EndForm (); @@ -283,7 +283,8 @@ void Tml_Com_WriteCommsInNote (const struct Tml_Timeline *Timeline, | | | |_____________________________| | | _____________________________ | | _____________________________ | | | div exp_ | | | | div exp_ | | - | | _________________________ | | | | (hidden) | | + | | (visible) | | | | (hidden) | | + | | _________________________ | | | | | | | | | form | | | | | | | | | | _____________________ | | | | | _____________________ | | | | | | ^ See prev.comments | | | | | | | ^ See prev.comments | | | @@ -319,7 +320,7 @@ void Tml_Com_WriteCommsInNote (const struct Tml_Timeline *Timeline, /***** List final visible comments *****/ if (NumFinalComms) { - HTM_UL_Begin ("class=\"TL_LIST\""); // Never hidden, always visible + HTM_UL_Begin ("class=\"Tml_LIST\""); // Never hidden, always visible Tml_Com_ListComms (Timeline,NumFinalComms,mysql_res); HTM_UL_End (); } @@ -385,7 +386,7 @@ static unsigned Tml_Com_WriteHiddenComms (struct Tml_Timeline *Timeline, &mysql_res); /***** List comments *****/ - HTM_UL_Begin ("id=\"com_%s\" class=\"TL_LIST\"",IdComms); + HTM_UL_Begin ("id=\"com_%s\" class=\"Tml_LIST\"",IdComms); Tml_Com_ListComms (Timeline,NumInitialCommsGot,mysql_res); HTM_UL_End (); @@ -429,7 +430,7 @@ static void Tml_Com_WriteOneCommInList (const struct Tml_Timeline *Timeline, Tml_Com_GetDataOfCommFromRow (row,&Com); /***** Write comment *****/ - HTM_LI_Begin ("class=\"TL_COM\""); + HTM_LI_Begin ("class=\"Tml_COM\""); Tml_Com_CheckAndWriteComm (Timeline,&Com); HTM_LI_End (); @@ -447,31 +448,36 @@ static void Tml_Com_LinkToShowComms (Tml_Com_ContractExpand_t ConExp, { extern const char *Txt_See_only_the_latest_X_COMMENTS; extern const char *Txt_See_the_previous_X_COMMENTS; - static const char *Id[Tml_Com_NUM_CONTRACT_EXPAND] = + static const struct { - "con", // contract - "exp", // expand - }; - static const char *Icon[Tml_Com_NUM_CONTRACT_EXPAND] = + const char *Id; + const char *Icon; + const char **Text; + } Link[Tml_Com_NUM_CONTRACT_EXPAND] = { - "angle-down.svg", // contract - "angle-up.svg", // expand - }; - const char *Text[Tml_Com_NUM_CONTRACT_EXPAND] = - { - Txt_See_only_the_latest_X_COMMENTS, // contract - Txt_See_the_previous_X_COMMENTS, // expand + [Tml_Com_CONTRACT] = + { + .Id = "con", + .Icon = "angle-down.svg", + .Text = &Txt_See_only_the_latest_X_COMMENTS, + }, + [Tml_Com_EXPAND] = + { + .Id = "exp", + .Icon = "angle-up.svg", + .Text = &Txt_See_the_previous_X_COMMENTS, + }, }; - /***** Icon and text to show only the latest comments ****/ + /***** Link (icon and text) to show comments ****/ /* Begin container */ - HTM_DIV_Begin ("id=\"%s_%s\" class=\"TL_EXPAND_COM TL_RIGHT_WIDTH\"" + HTM_DIV_Begin ("id=\"%s_%s\" class=\"Tml_EXPAND_COM Tml_RIGHT_WIDTH\"" " style=\"display:none;\"", // Hidden - Id[ConExp],IdComms); + Link[ConExp].Id,IdComms); /* Icon and text */ - Tml_Com_PutIconToToggleComms (IdComms,Icon[ConExp], - Str_BuildStringLong (Text[ConExp],(long) NumComms)); + Tml_Com_PutIconToToggleComms (IdComms,Link[ConExp].Icon, + Str_BuildStringLong (*Link[ConExp].Text,(long) NumComms)); Str_FreeString (); /* End container */ @@ -508,7 +514,8 @@ static void Tml_Com_PutIconToToggleComms (const char *UniqueId, static void Tml_Com_CheckAndWriteComm (const struct Tml_Timeline *Timeline, struct Tml_Com_Comment *Com) { - /*__________________________________________ + /* + ___________________________________________ | _____ | | | \ \ || | | Author's name | Date-time | | | ||Auth.| |______________________|___________| | | @@ -557,7 +564,7 @@ static void Tml_Com_WriteComm (const struct Tml_Timeline *Timeline, /***** Right: author's name, time, content, and buttons *****/ /* Begin container */ - HTM_DIV_Begin ("class=\"TL_COM_CONT TL_COMM_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_COM_CONT Tml_COMM_WIDTH\""); /* Right top: author's name, time, and content */ Tml_Com_WriteAuthorTimeAndContent (Com,&UsrDat); @@ -606,7 +613,7 @@ static void Tml_Com_WriteAuthorName (const struct UsrData *UsrDat) // Author /* Author's name */ HTM_BUTTON_SUBMIT_Begin (Usr_ItsMe (UsrDat->UsrCod) ? Txt_My_public_profile : Txt_Another_user_s_profile, - "BT_LINK TL_COM_AUTHOR TL_COMM_AUTHOR_WIDTH DAT_BOLD",NULL); + "BT_LINK Tml_COM_AUTHOR Tml_COMM_AUTHOR_WIDTH DAT_BOLD",NULL); HTM_Txt (UsrDat->FullName); HTM_BUTTON_End (); @@ -623,14 +630,14 @@ static void Tml_Com_WriteContent (struct Tml_Com_Comment *Com) /***** Write content of the comment *****/ if (Com->Content.Txt[0]) { - HTM_DIV_Begin ("class=\"TL_TXT\""); + HTM_DIV_Begin ("class=\"Tml_TXT\""); Msg_WriteMsgContent (Com->Content.Txt,Cns_MAX_BYTES_LONG_TEXT,true,false); HTM_DIV_End (); } /***** Show image *****/ - Med_ShowMedia (&Com->Content.Media,"TL_COM_MED_CONT TL_COMM_WIDTH", - "TL_COM_MED TL_COMM_WIDTH"); + Med_ShowMedia (&Com->Content.Media,"Tml_COM_MED_CONT Tml_COMM_WIDTH", + "Tml_COM_MED Tml_COMM_WIDTH"); } /*****************************************************************************/ @@ -646,10 +653,10 @@ static void Tml_Com_WriteButtons (const struct Tml_Timeline *Timeline, NumDiv++; /***** Begin buttons container *****/ - HTM_DIV_Begin ("class=\"TL_FOOT TL_COMM_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_FOOT Tml_COMM_WIDTH\""); /***** Foot column 1: fav zone *****/ - HTM_DIV_Begin ("id=\"fav_com_%s_%u\" class=\"TL_FAV_COM TL_FAV_WIDTH\"", + HTM_DIV_Begin ("id=\"fav_com_%s_%u\" class=\"Tml_FAV_COM Tml_FAV_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); Tml_Usr_PutIconFavSha (Tml_Usr_FAV_UNF_COMM, Com->PubCod,Com->UsrCod,Com->NumFavs, @@ -657,7 +664,7 @@ static void Tml_Com_WriteButtons (const struct Tml_Timeline *Timeline, HTM_DIV_End (); /***** Foot column 2: icon to remove this comment *****/ - HTM_DIV_Begin ("class=\"TL_REM\""); + HTM_DIV_Begin ("class=\"Tml_REM\""); if (Usr_ItsMe (UsrDat->UsrCod)) // I am the author Tml_Com_PutFormToRemoveComm (Timeline,Com->PubCod); HTM_DIV_End (); @@ -706,7 +713,7 @@ void Tml_Com_ReceiveCommUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Begin section *****/ - HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); + HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID); /***** Receive comment in a note and write updated timeline after commenting (user) *****/ @@ -774,14 +781,14 @@ static long Tml_Com_ReceiveComm (void) /* Insert into publications */ Pub.NotCod = Not.NotCod; Pub.PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; - Pub.Type = Tml_Pub_COMMENT_TO_NOTE; + Pub.Type = Tml_Pub_COMMENT_TO_NOTE; Tml_Pub_PublishPubInTimeline (&Pub); // Set Pub.PubCod /* Insert comment content in the database */ Tml_DB_InsertCommContent (Pub.PubCod,&Content); /***** Store notifications about the new comment *****/ - Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TL_COMMENT,Pub.PubCod); + Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TML_COMMENT,Pub.PubCod); /***** Analyze content and store notifications about mentions *****/ Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt); @@ -811,7 +818,7 @@ void Tml_Com_RequestRemComUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Begin section *****/ - HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); + HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID); /***** Request the removal of comment in note *****/ Tml_Com_RequestRemovalComm (&Timeline); @@ -866,11 +873,11 @@ static void Tml_Com_RequestRemovalComm (struct Tml_Timeline *Timeline) NULL,Box_NOT_CLOSABLE); /* Indent the comment */ - HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\""); + HTM_DIV_Begin ("class=\"Tml_LEFT_PHOTO\""); HTM_DIV_End (); /* Show the comment */ - HTM_DIV_Begin ("class=\"TL_RIGHT_CONT TL_RIGHT_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_RIGHT_CONT Tml_RIGHT_WIDTH\""); Tml_Com_CheckAndWriteComm (Timeline,&Com); HTM_DIV_End (); @@ -920,7 +927,7 @@ void Tml_Com_RemoveComUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Begin section *****/ - HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); + HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID); /***** Remove a comment *****/ Tml_Com_RemoveComm (); @@ -999,9 +1006,9 @@ void Tml_Com_RemoveCommMediaAndDBEntries (long PubCod) Med_RemoveMedia (Tml_DB_GetMedCodFromComm (PubCod)); /***** Mark possible notifications on this comment as removed *****/ - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_COMMENT,PubCod); - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod); - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_COMMENT,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_FAV ,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_MENTION,PubCod); /***** Remove favs for this comment *****/ Tml_DB_RemoveCommFavs (PubCod); diff --git a/swad_timeline_database.c b/swad_timeline_database.c index 7f99eef5..23e11d8c 100644 --- a/swad_timeline_database.c +++ b/swad_timeline_database.c @@ -640,7 +640,7 @@ void Tml_DB_RemoveAllPostsUsr (long UsrCod) " FROM tml_notes" " WHERE UsrCod=%ld" " AND NoteType=%u)", - UsrCod,(unsigned) TL_NOTE_POST); + UsrCod,(unsigned) Tml_NOTE_POST); } /*****************************************************************************/ diff --git a/swad_timeline_favourite.c b/swad_timeline_favourite.c index 804322fb..97db3328 100644 --- a/swad_timeline_favourite.c +++ b/swad_timeline_favourite.c @@ -151,9 +151,8 @@ static void Tml_Fav_FavNote (struct Tml_Not_Note *Not) /***** Create notification about favourite post for the author of the post *****/ - OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); - if (OriginalPubCod > 0) - Tml_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TL_FAV); + if ((OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod)) > 0) + Tml_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TML_FAV); } static void Tml_Fav_UnfNote (struct Tml_Not_Note *Not) @@ -181,9 +180,8 @@ static void Tml_Fav_UnfNote (struct Tml_Not_Note *Not) Not->NotCod,Not->UsrCod); /***** Mark possible notifications on this note as removed *****/ - OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); - if (OriginalPubCod > 0) - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,OriginalPubCod); + if ((OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod)) > 0) + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_FAV,OriginalPubCod); } /*****************************************************************************/ @@ -296,7 +294,7 @@ static void Tml_Fav_FavComm (struct Tml_Com_Comment *Com) /***** Create notification about favourite post for the author of the post *****/ - Tml_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,Ntf_EVENT_TL_FAV); + Tml_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,Ntf_EVENT_TML_FAV); /***** Free image *****/ Med_MediaDestructor (&Com->Content.Media); @@ -334,7 +332,7 @@ static void Tml_Fav_UnfComm (struct Tml_Com_Comment *Com) Com->PubCod,Com->UsrCod); /***** Mark possible notifications on this comment as removed *****/ - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,Com->PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_FAV,Com->PubCod); /***** Free image *****/ Med_MediaDestructor (&Com->Content.Media); diff --git a/swad_timeline_form.c b/swad_timeline_form.c index 20a136fe..31d37972 100644 --- a/swad_timeline_form.c +++ b/swad_timeline_form.c @@ -98,7 +98,7 @@ void Tml_Frm_PutFormToFavUnfShaUns (Tml_Usr_FavSha_t FavSha,long Cod) extern const char *Txt_TIMELINE_Favourite; extern const char *Txt_TIMELINE_Share; extern const char *Txt_TIMELINE_Shared; - struct TL_Form Form[Tml_Usr_NUM_FAV_SHA][2] = + struct Tml_Form Form[Tml_Usr_NUM_FAV_SHA][2] = { [Tml_Usr_FAV_UNF_NOTE] = { @@ -200,7 +200,7 @@ void Tml_Frm_PutFormToSeeAllFaversSharers (Tml_Frm_Action_t Action, Tml_Usr_HowManyUsrs_t HowManyUsrs) { extern const char *Txt_View_all_USERS; - struct TL_Form Form = + struct Tml_Form Form = { .Action = Action, .ParamFormat = ParamFormat, @@ -226,27 +226,28 @@ void Tml_Frm_PutFormToSeeAllFaversSharers (Tml_Frm_Action_t Action, /******* Form to fav/unfav or share/unshare in global or user timeline *******/ /*****************************************************************************/ -void Tml_Frm_FormFavSha (const struct TL_Form *Form) +void Tml_Frm_FormFavSha (const struct Tml_Form *Form) { char *OnSubmit; + const char *Anchor; char ParamStr[7 + Cns_MAX_DECIMAL_DIGITS_LONG + 1]; /***** Create parameter string *****/ sprintf (ParamStr,Form->ParamFormat,Form->ParamCod); /* - +---------------------------------------------------------------------------+ + ___________________________________________________________________________ | div which content will be updated (parent of parent of form) | - | +---------------------+ +-------+ +-------------------------------------+ | + | _____________________ _______ _____________________________________ | | | div (parent of form)| | div | | div for users | | - | | +-----------------+ | | for | | +------+ +------+ +------+ +------+ | | + | | _________________ | | for | | ______ ______ ______ ______ | | | | | this form | | | num. | | | | | | | | | form | | | - | | | +-------------+ | | | of | | | user | | user | | user | | to | | | + | | | _____________ | | | of | | | user | | user | | user | | to | | | | | | | fav icon | | | | users | | | 1 | | 2 | | 3 | | show | | | - | | | +-------------+ | | | | | | | | | | | | all | | | - | | +-----------------+ | | | | +------+ +------+ +------+ +------+ | | - | +---------------------+ +-------+ +-------------------------------------+ | - +---------------------------------------------------------------------------+ + | | | |_____________| | | | | | | | | | | | | all | | | + | | |_________________| | | | | |______| |______| |______| |______| | | + | |_____________________| |_______| |_____________________________________| | + |___________________________________________________________________________| */ /***** Form and icon to mark note as favourite *****/ @@ -261,7 +262,7 @@ void Tml_Frm_FormFavSha (const struct TL_Form *Form) ParamStr, Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0) Err_NotEnoughMemoryExit (); - Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,"timeline",OnSubmit); + Anchor = "timeline"; } else { @@ -272,13 +273,12 @@ void Tml_Frm_FormFavSha (const struct TL_Form *Form) Gbl.Session.Id, ParamStr) < 0) Err_NotEnoughMemoryExit (); - Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,NULL,OnSubmit); + Anchor = NULL; } - Ico_PutIconLink (Form->Icon,Form->Title); - Frm_EndForm (); - - /* Free allocated memory */ + Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,Anchor,OnSubmit); free (OnSubmit); + Ico_PutIconLink (Form->Icon,Form->Title); + Frm_EndForm (); } /*****************************************************************************/ @@ -292,12 +292,13 @@ void Tml_Frm_FormToShowHiddenComms (long NotCod, extern const char *The_ClassFormLinkInBox[The_NUM_THEMES]; extern const char *Txt_See_the_previous_X_COMMENTS; char *OnSubmit; + const char *Anchor; /***** Begin container which content will be updated via AJAX *****/ - HTM_DIV_Begin ("id=\"%s\" class=\"TL_RIGHT_WIDTH\"",IdComms); + HTM_DIV_Begin ("id=\"%s\" class=\"Tml_RIGHT_WIDTH\"",IdComms); /***** Begin container *****/ - HTM_DIV_Begin ("id=\"exp_%s\" class=\"TL_EXPAND_COM TL_RIGHT_WIDTH\"", + HTM_DIV_Begin ("id=\"exp_%s\" class=\"Tml_EXPAND_COM Tml_RIGHT_WIDTH\"", IdComms); /***** Form and icon-text to show hidden comments *****/ @@ -316,7 +317,7 @@ void Tml_Frm_FormToShowHiddenComms (long NotCod, NumInitialComms, Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0) Err_NotEnoughMemoryExit (); - Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,"timeline",OnSubmit); + Anchor = "timeline"; } else { @@ -331,23 +332,22 @@ void Tml_Frm_FormToShowHiddenComms (long NotCod, IdComms, NumInitialComms) < 0) Err_NotEnoughMemoryExit (); - Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,NULL,OnSubmit); + Anchor = NULL; } + Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,Anchor,OnSubmit); + free (OnSubmit); - /* Put icon and text with link to show the first hidden comments */ - HTM_BUTTON_SUBMIT_Begin (NULL,The_ClassFormLinkInBox[Gbl.Prefs.Theme],NULL); - Ico_PutIconTextLink ("angle-up.svg", - Str_BuildStringLong (Txt_See_the_previous_X_COMMENTS, - (long) NumInitialComms)); - Str_FreeString (); - HTM_BUTTON_End (); + /* Put icon and text with link to show the first hidden comments */ + HTM_BUTTON_SUBMIT_Begin (NULL,The_ClassFormLinkInBox[Gbl.Prefs.Theme],NULL); + Ico_PutIconTextLink ("angle-up.svg", + Str_BuildStringLong (Txt_See_the_previous_X_COMMENTS, + (long) NumInitialComms)); + Str_FreeString (); + HTM_BUTTON_End (); /* End form */ Frm_EndForm (); - /* Free allocated memory */ - free (OnSubmit); - /***** End container *****/ HTM_DIV_End (); diff --git a/swad_timeline_form.h b/swad_timeline_form.h index dd64561f..025031d4 100644 --- a/swad_timeline_form.h +++ b/swad_timeline_form.h @@ -56,7 +56,7 @@ typedef enum Tml_Frm_SHO_HID_COMM, // Show / hide comments } Tml_Frm_Action_t; -struct TL_Form +struct Tml_Form { Tml_Frm_Action_t Action; const char *ParamFormat; @@ -78,7 +78,7 @@ void Tml_Frm_EndForm (void); void Tml_Frm_PutFormToSeeAllFaversSharers (Tml_Frm_Action_t Action, const char *ParamFormat,long ParamCod, Tml_Usr_HowManyUsrs_t HowManyUsrs); -void Tml_Frm_FormFavSha (const struct TL_Form *Form); +void Tml_Frm_FormFavSha (const struct Tml_Form *Form); void Tml_Frm_FormToShowHiddenComms (long NotCod, char IdComms[Frm_MAX_BYTES_ID + 1], diff --git a/swad_timeline_note.c b/swad_timeline_note.c index 5f18135b..fdd46301 100644 --- a/swad_timeline_note.c +++ b/swad_timeline_note.c @@ -59,14 +59,14 @@ extern struct Globals Gbl; static const Tml_Not_Type_t Tml_Not_NoteType[Brw_NUM_TYPES_FILE_BROWSER] = { - [Brw_ADMI_DOC_INS] = TL_NOTE_INS_DOC_PUB_FILE, - [Brw_ADMI_SHR_INS] = TL_NOTE_INS_SHA_PUB_FILE, - [Brw_ADMI_DOC_CTR] = TL_NOTE_CTR_DOC_PUB_FILE, - [Brw_ADMI_SHR_CTR] = TL_NOTE_CTR_SHA_PUB_FILE, - [Brw_ADMI_DOC_DEG] = TL_NOTE_DEG_DOC_PUB_FILE, - [Brw_ADMI_SHR_DEG] = TL_NOTE_DEG_SHA_PUB_FILE, - [Brw_ADMI_DOC_CRS] = TL_NOTE_CRS_DOC_PUB_FILE, - [Brw_ADMI_SHR_CRS] = TL_NOTE_CRS_SHA_PUB_FILE, + [Brw_ADMI_DOC_INS] = Tml_NOTE_INS_DOC_PUB_FILE, + [Brw_ADMI_SHR_INS] = Tml_NOTE_INS_SHA_PUB_FILE, + [Brw_ADMI_DOC_CTR] = Tml_NOTE_CTR_DOC_PUB_FILE, + [Brw_ADMI_SHR_CTR] = Tml_NOTE_CTR_SHA_PUB_FILE, + [Brw_ADMI_DOC_DEG] = Tml_NOTE_DEG_DOC_PUB_FILE, + [Brw_ADMI_SHR_DEG] = Tml_NOTE_DEG_SHA_PUB_FILE, + [Brw_ADMI_DOC_CRS] = Tml_NOTE_CRS_DOC_PUB_FILE, + [Brw_ADMI_SHR_CRS] = Tml_NOTE_CRS_SHA_PUB_FILE, }; /*****************************************************************************/ @@ -131,10 +131,10 @@ void Tml_Not_ShowHighlightedNote (struct Tml_Timeline *Timeline, { [Ntf_EVENT_UNKNOWN ] = Tml_TOP_MESSAGE_NONE, /* Start tab */ - [Ntf_EVENT_TL_COMMENT ] = Tml_TOP_MESSAGE_COMMENTED, - [Ntf_EVENT_TL_FAV ] = Tml_TOP_MESSAGE_FAVED, - [Ntf_EVENT_TL_SHARE ] = Tml_TOP_MESSAGE_SHARED, - [Ntf_EVENT_TL_MENTION ] = Tml_TOP_MESSAGE_MENTIONED, + [Ntf_EVENT_TML_COMMENT ] = Tml_TOP_MESSAGE_COMMENTED, + [Ntf_EVENT_TML_FAV ] = Tml_TOP_MESSAGE_FAVED, + [Ntf_EVENT_TML_SHARE ] = Tml_TOP_MESSAGE_SHARED, + [Ntf_EVENT_TML_MENTION ] = Tml_TOP_MESSAGE_MENTIONED, [Ntf_EVENT_FOLLOWER ] = Tml_TOP_MESSAGE_NONE, /* System tab */ /* Country tab */ @@ -145,7 +145,7 @@ void Tml_Not_ShowHighlightedNote (struct Tml_Timeline *Timeline, /* Assessment tab */ [Ntf_EVENT_ASSIGNMENT ] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_SURVEY ] = Tml_TOP_MESSAGE_NONE, - [Ntf_EVENT_CALL_FOR_EXAM] = Tml_TOP_MESSAGE_NONE, + [Ntf_EVENT_CALL_FOR_EXAM ] = Tml_TOP_MESSAGE_NONE, /* Files tab */ [Ntf_EVENT_DOCUMENT_FILE ] = Tml_TOP_MESSAGE_NONE, [Ntf_EVENT_TEACHERS_FILE ] = Tml_TOP_MESSAGE_NONE, @@ -183,7 +183,7 @@ void Tml_Not_ShowHighlightedNote (struct Tml_Timeline *Timeline, NULL,Box_CLOSABLE); /* Begin container */ - HTM_DIV_Begin ("class=\"TL_WIDTH TL_NEW_PUB\""); + HTM_DIV_Begin ("class=\"Tml_WIDTH Tml_NEW_PUB\""); /* Check and write note with top message */ Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,Not, @@ -206,7 +206,8 @@ void Tml_Not_CheckAndWriteNoteWithTopMsg (const struct Tml_Timeline *Timeline, Tml_TopMessage_t TopMessage, long PublisherCod) // Who did the action (publication, commenting, faving, sharing, mentioning) { - /*__________________________________________ + /* + ___________________________________________ | | \ | Top message: | > top message |___________________________________________| / @@ -232,9 +233,9 @@ void Tml_Not_CheckAndWriteNoteWithTopMsg (const struct Tml_Timeline *Timeline, |__________________________________| / / */ /***** Trivial check: codes *****/ - if (Not->NotCod <= 0 || - Not->UsrCod <= 0 || - Not->Type == TL_NOTE_UNKNOWN) + if (Not->NotCod <= 0 || + Not->UsrCod <= 0 || + Not->Type == Tml_NOTE_UNKNOWN) { Ale_ShowAlert (Ale_ERROR,"Error in note."); return; @@ -267,7 +268,7 @@ static void Tml_Not_WriteTopMessage (Tml_TopMessage_t TopMessage,long PublisherC Usr_DONT_GET_ROLE_IN_CURRENT_CRS)) { /***** Begin container *****/ - HTM_DIV_Begin ("class=\"Tml_TOP_CONT Tml_TOP_PUBLISHER TL_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_TOP_CONT Tml_TOP_PUBLISHER Tml_WIDTH\""); /***** Show publisher's name inside form to go to user's public profile *****/ Tml_Not_WriteAuthorName (&PublisherDat, @@ -321,7 +322,7 @@ void Tml_Not_ShowAuthorPhoto (struct UsrData *UsrDat,bool FormUnique) { /***** Show author's photo *****/ /* Begin container */ - HTM_DIV_Begin ("class=\"TL_LEFT_PHOTO\""); + HTM_DIV_Begin ("class=\"Tml_LEFT_PHOTO\""); /* Photo */ Pho_ShowUsrPhotoIfAllowed (UsrDat,"PHOTO45x60",Pho_ZOOM,FormUnique); @@ -338,11 +339,11 @@ static void Tml_Not_WriteAuthorTimeAndContent (const struct Tml_Not_Note *Not, const struct UsrData *UsrDat) { /***** Begin top container *****/ - HTM_DIV_Begin ("class=\"TL_RIGHT_CONT TL_RIGHT_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_RIGHT_CONT Tml_RIGHT_WIDTH\""); /***** Write author's full name *****/ Tml_Not_WriteAuthorName (UsrDat, - "BT_LINK TL_RIGHT_AUTHOR TL_RIGHT_AUTHOR_WIDTH DAT_N_BOLD"); + "BT_LINK Tml_RIGHT_AUTHOR Tml_RIGHT_AUTHOR_WIDTH DAT_N_BOLD"); /***** Write date and time *****/ Tml_WriteDateTime (Not->DateTimeUTC); @@ -386,7 +387,7 @@ void Tml_Not_WriteAuthorName (const struct UsrData *UsrDat, static void Tml_Not_WriteContent (const struct Tml_Not_Note *Not) { - if (Not->Type == TL_NOTE_POST) // It's a post + if (Not->Type == Tml_NOTE_POST) // It's a post Tml_Pst_GetAndWritePost (Not->Cod); else // Not a post Tml_Not_GetAndWriteNoPost (Not); @@ -422,7 +423,7 @@ static void Tml_Not_GetAndWriteNoPost (const struct Tml_Not_Note *Not) Tml_Not_GetNoteSummary (Not,SummaryStr); /* Write note summary */ - HTM_DIV_Begin ("class=\"TL_TXT\""); + HTM_DIV_Begin ("class=\"Tml_TXT\""); HTM_Txt (SummaryStr); HTM_DIV_End (); } @@ -446,33 +447,33 @@ static void Tml_Not_GetLocationInHierarchy (const struct Tml_Not_Note *Not, /***** Get location in hierarchy *****/ switch (Not->Type) { - case TL_NOTE_INS_DOC_PUB_FILE: - case TL_NOTE_INS_SHA_PUB_FILE: + case Tml_NOTE_INS_DOC_PUB_FILE: + case Tml_NOTE_INS_SHA_PUB_FILE: /* Get institution data */ Hie->Ins.InsCod = Not->HieCod; Ins_GetDataOfInstitByCod (&Hie->Ins); break; - case TL_NOTE_CTR_DOC_PUB_FILE: - case TL_NOTE_CTR_SHA_PUB_FILE: + case Tml_NOTE_CTR_DOC_PUB_FILE: + case Tml_NOTE_CTR_SHA_PUB_FILE: /* Get center data */ Hie->Ctr.CtrCod = Not->HieCod; Ctr_GetDataOfCenterByCod (&Hie->Ctr); break; - case TL_NOTE_DEG_DOC_PUB_FILE: - case TL_NOTE_DEG_SHA_PUB_FILE: + case Tml_NOTE_DEG_DOC_PUB_FILE: + case Tml_NOTE_DEG_SHA_PUB_FILE: /* Get degree data */ Hie->Deg.DegCod = Not->HieCod; Deg_GetDataOfDegreeByCod (&Hie->Deg); break; - case TL_NOTE_CRS_DOC_PUB_FILE: - case TL_NOTE_CRS_SHA_PUB_FILE: - case TL_NOTE_CALL_FOR_EXAM: - case TL_NOTE_NOTICE: + case Tml_NOTE_CRS_DOC_PUB_FILE: + case Tml_NOTE_CRS_SHA_PUB_FILE: + case Tml_NOTE_CALL_FOR_EXAM: + case Tml_NOTE_NOTICE: /* Get course data */ Hie->Crs.CrsCod = Not->HieCod; Crs_GetDataOfCourseByCod (&Hie->Crs); break; - case TL_NOTE_FORUM_POST: + case Tml_NOTE_FORUM_POST: /* Get forum type of the post */ For_GetForumTypeAndLocationOfAPost (Not->Cod,Forum); @@ -499,42 +500,42 @@ static void Tml_Not_WriteLocationInHierarchy (const struct Tml_Not_Note *Not, extern const char *Txt_Forum; /***** Begin container *****/ - HTM_DIV_Begin ("class=\"TL_LOC\""); + HTM_DIV_Begin ("class=\"Tml_LOC\""); /***** Write location *****/ switch (Not->Type) { - case TL_NOTE_INS_DOC_PUB_FILE: - case TL_NOTE_INS_SHA_PUB_FILE: + case Tml_NOTE_INS_DOC_PUB_FILE: + case Tml_NOTE_INS_SHA_PUB_FILE: /* Write location (institution) in hierarchy */ HTM_TxtF ("%s: %s", Txt_Institution, Hie->Ins.ShrtName); break; - case TL_NOTE_CTR_DOC_PUB_FILE: - case TL_NOTE_CTR_SHA_PUB_FILE: + case Tml_NOTE_CTR_DOC_PUB_FILE: + case Tml_NOTE_CTR_SHA_PUB_FILE: /* Write location (center) in hierarchy */ HTM_TxtF ("%s: %s", Txt_Center, Hie->Ctr.ShrtName); break; - case TL_NOTE_DEG_DOC_PUB_FILE: - case TL_NOTE_DEG_SHA_PUB_FILE: + case Tml_NOTE_DEG_DOC_PUB_FILE: + case Tml_NOTE_DEG_SHA_PUB_FILE: /* Write location (degree) in hierarchy */ HTM_TxtF ("%s: %s", Txt_Degree, Hie->Deg.ShrtName); break; - case TL_NOTE_CRS_DOC_PUB_FILE: - case TL_NOTE_CRS_SHA_PUB_FILE: - case TL_NOTE_CALL_FOR_EXAM: - case TL_NOTE_NOTICE: + case Tml_NOTE_CRS_DOC_PUB_FILE: + case Tml_NOTE_CRS_SHA_PUB_FILE: + case Tml_NOTE_CALL_FOR_EXAM: + case Tml_NOTE_NOTICE: /* Write location (course) in hierarchy */ HTM_TxtF ("%s: %s", Txt_Course, Hie->Crs.ShrtName); break; - case TL_NOTE_FORUM_POST: + case Tml_NOTE_FORUM_POST: /* Write forum name */ HTM_TxtF ("%s: %s", Txt_Forum, @@ -557,58 +558,58 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not, { extern const Act_Action_t For_ActionsSeeFor[For_NUM_TYPES_FORUM]; extern const char *The_ClassFormInBoxBold[The_NUM_THEMES]; - extern const char *Txt_TIMELINE_NOTE[TL_NOT_NUM_NOTE_TYPES]; + extern const char *Txt_TIMELINE_NOTE[Tml_NOT_NUM_NOTE_TYPES]; extern const char *Txt_not_available; char *Anchor = NULL; - static const Act_Action_t TL_DefaultActions[TL_NOT_NUM_NOTE_TYPES] = + static const Act_Action_t Tml_DefaultActions[Tml_NOT_NUM_NOTE_TYPES] = { - [TL_NOTE_UNKNOWN ] = ActUnk, + [Tml_NOTE_UNKNOWN ] = ActUnk, /* Start tab */ - [TL_NOTE_POST ] = ActUnk, // action not used + [Tml_NOTE_POST ] = ActUnk, // action not used /* Institution tab */ - [TL_NOTE_INS_DOC_PUB_FILE ] = ActReqDatSeeDocIns, - [TL_NOTE_INS_SHA_PUB_FILE ] = ActReqDatShaIns, + [Tml_NOTE_INS_DOC_PUB_FILE ] = ActReqDatSeeDocIns, + [Tml_NOTE_INS_SHA_PUB_FILE ] = ActReqDatShaIns, /* Center tab */ - [TL_NOTE_CTR_DOC_PUB_FILE ] = ActReqDatSeeDocCtr, - [TL_NOTE_CTR_SHA_PUB_FILE ] = ActReqDatShaCtr, + [Tml_NOTE_CTR_DOC_PUB_FILE ] = ActReqDatSeeDocCtr, + [Tml_NOTE_CTR_SHA_PUB_FILE ] = ActReqDatShaCtr, /* Degree tab */ - [TL_NOTE_DEG_DOC_PUB_FILE ] = ActReqDatSeeDocDeg, - [TL_NOTE_DEG_SHA_PUB_FILE ] = ActReqDatShaDeg, + [Tml_NOTE_DEG_DOC_PUB_FILE ] = ActReqDatSeeDocDeg, + [Tml_NOTE_DEG_SHA_PUB_FILE ] = ActReqDatShaDeg, /* Course tab */ - [TL_NOTE_CRS_DOC_PUB_FILE ] = ActReqDatSeeDocCrs, - [TL_NOTE_CRS_SHA_PUB_FILE ] = ActReqDatShaCrs, + [Tml_NOTE_CRS_DOC_PUB_FILE ] = ActReqDatSeeDocCrs, + [Tml_NOTE_CRS_SHA_PUB_FILE ] = ActReqDatShaCrs, /* Assessment tab */ - [TL_NOTE_CALL_FOR_EXAM] = ActSeeOneCfe, + [Tml_NOTE_CALL_FOR_EXAM ] = ActSeeOneCfe, /* Users tab */ /* Messages tab */ - [TL_NOTE_NOTICE ] = ActSeeOneNot, - [TL_NOTE_FORUM_POST ] = ActSeeFor, + [Tml_NOTE_NOTICE ] = ActSeeOneNot, + [Tml_NOTE_FORUM_POST ] = ActSeeFor, /* Analytics tab */ /* Profile tab */ }; - static const char *TL_Icons[TL_NOT_NUM_NOTE_TYPES] = + static const char *Tml_Icons[Tml_NOT_NUM_NOTE_TYPES] = { - [TL_NOTE_UNKNOWN ] = NULL, + [Tml_NOTE_UNKNOWN ] = NULL, /* Start tab */ - [TL_NOTE_POST ] = NULL, // icon not used + [Tml_NOTE_POST ] = NULL, // icon not used /* Institution tab */ - [TL_NOTE_INS_DOC_PUB_FILE ] = "file.svg", - [TL_NOTE_INS_SHA_PUB_FILE ] = "file.svg", + [Tml_NOTE_INS_DOC_PUB_FILE ] = "file.svg", + [Tml_NOTE_INS_SHA_PUB_FILE ] = "file.svg", /* Center tab */ - [TL_NOTE_CTR_DOC_PUB_FILE ] = "file.svg", - [TL_NOTE_CTR_SHA_PUB_FILE ] = "file.svg", + [Tml_NOTE_CTR_DOC_PUB_FILE ] = "file.svg", + [Tml_NOTE_CTR_SHA_PUB_FILE ] = "file.svg", /* Degree tab */ - [TL_NOTE_DEG_DOC_PUB_FILE ] = "file.svg", - [TL_NOTE_DEG_SHA_PUB_FILE ] = "file.svg", + [Tml_NOTE_DEG_DOC_PUB_FILE ] = "file.svg", + [Tml_NOTE_DEG_SHA_PUB_FILE ] = "file.svg", /* Course tab */ - [TL_NOTE_CRS_DOC_PUB_FILE ] = "file.svg", - [TL_NOTE_CRS_SHA_PUB_FILE ] = "file.svg", + [Tml_NOTE_CRS_DOC_PUB_FILE ] = "file.svg", + [Tml_NOTE_CRS_SHA_PUB_FILE ] = "file.svg", /* Assessment tab */ - [TL_NOTE_CALL_FOR_EXAM] = "bullhorn.svg", + [Tml_NOTE_CALL_FOR_EXAM ] = "bullhorn.svg", /* Users tab */ /* Messages tab */ - [TL_NOTE_NOTICE ] = "sticky-note.svg", - [TL_NOTE_FORUM_POST ] = "comments.svg", + [Tml_NOTE_NOTICE ] = "sticky-note.svg", + [Tml_NOTE_FORUM_POST ] = "comments.svg", /* Analytics tab */ /* Profile tab */ }; @@ -618,7 +619,7 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not, { /***** Do not put form *****/ /* Begin container */ - HTM_DIV_Begin ("class=\"TL_FORM_OFF\""); + HTM_DIV_Begin ("class=\"Tml_FORM_OFF\""); /* Text ("not available") */ HTM_Txt (Txt_TIMELINE_NOTE[Not->Type]); @@ -631,51 +632,51 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not, else // Not inside another form { /***** Begin container *****/ - HTM_DIV_Begin ("class=\"TL_FORM\""); + HTM_DIV_Begin ("class=\"Tml_FORM\""); /***** Begin form with parameters depending on the type of note *****/ switch (Not->Type) { - case TL_NOTE_INS_DOC_PUB_FILE: - case TL_NOTE_INS_SHA_PUB_FILE: - Frm_BeginFormUnique (TL_DefaultActions[Not->Type]); + case Tml_NOTE_INS_DOC_PUB_FILE: + case Tml_NOTE_INS_SHA_PUB_FILE: + Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]); Brw_PutHiddenParamFilCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Ins.InsCod) // Not the current institution Ins_PutParamInsCod (Not->HieCod); // Go to another institution break; - case TL_NOTE_CTR_DOC_PUB_FILE: - case TL_NOTE_CTR_SHA_PUB_FILE: - Frm_BeginFormUnique (TL_DefaultActions[Not->Type]); + case Tml_NOTE_CTR_DOC_PUB_FILE: + case Tml_NOTE_CTR_SHA_PUB_FILE: + Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]); Brw_PutHiddenParamFilCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Ctr.CtrCod) // Not the current center Ctr_PutParamCtrCod (Not->HieCod); // Go to another center break; - case TL_NOTE_DEG_DOC_PUB_FILE: - case TL_NOTE_DEG_SHA_PUB_FILE: - Frm_BeginFormUnique (TL_DefaultActions[Not->Type]); + case Tml_NOTE_DEG_DOC_PUB_FILE: + case Tml_NOTE_DEG_SHA_PUB_FILE: + Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]); Brw_PutHiddenParamFilCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Deg.DegCod) // Not the current degree Deg_PutParamDegCod (Not->HieCod); // Go to another degree break; - case TL_NOTE_CRS_DOC_PUB_FILE: - case TL_NOTE_CRS_SHA_PUB_FILE: - Frm_BeginFormUnique (TL_DefaultActions[Not->Type]); + case Tml_NOTE_CRS_DOC_PUB_FILE: + case Tml_NOTE_CRS_SHA_PUB_FILE: + Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]); Brw_PutHiddenParamFilCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course Crs_PutParamCrsCod (Not->HieCod); // Go to another course break; - case TL_NOTE_CALL_FOR_EXAM: + case Tml_NOTE_CALL_FOR_EXAM: Frm_SetAnchorStr (Not->Cod,&Anchor); - Frm_BeginFormUniqueAnchor (TL_DefaultActions[Not->Type], + Frm_BeginFormUniqueAnchor (Tml_DefaultActions[Not->Type], Anchor); // Locate on this specific exam Frm_FreeAnchorStr (Anchor); Cfe_PutHiddenParamExaCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course Crs_PutParamCrsCod (Not->HieCod); // Go to another course break; - case TL_NOTE_POST: // Not applicable + case Tml_NOTE_POST: // Not applicable return; - case TL_NOTE_FORUM_POST: + case Tml_NOTE_FORUM_POST: Frm_BeginFormUnique (For_ActionsSeeFor[Forums->Forum.Type]); For_PutAllHiddenParamsForum (1, // Page of threads = first 1, // Page of posts = first @@ -687,9 +688,9 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not, if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course Crs_PutParamCrsCod (Not->HieCod); // Go to another course break; - case TL_NOTE_NOTICE: + case Tml_NOTE_NOTICE: Frm_SetAnchorStr (Not->Cod,&Anchor); - Frm_BeginFormUniqueAnchor (TL_DefaultActions[Not->Type], + Frm_BeginFormUniqueAnchor (Tml_DefaultActions[Not->Type], Anchor); Frm_FreeAnchorStr (Anchor); Not_PutHiddenParamNotCod (Not->Cod); @@ -709,7 +710,7 @@ static void Tml_Not_PutFormGoToAction (const struct Tml_Not_Note *Not, Str_FreeString (); /* Icon and text */ - Ico_PutIcon (TL_Icons[Not->Type], + Ico_PutIcon (Tml_Icons[Not->Type], Txt_TIMELINE_NOTE[Not->Type],"CONTEXT_ICO_x16"); HTM_TxtF (" %s",Txt_TIMELINE_NOTE[Not->Type]); @@ -735,28 +736,28 @@ void Tml_Not_GetNoteSummary (const struct Tml_Not_Note *Not, switch (Not->Type) { - case TL_NOTE_UNKNOWN: + case Tml_NOTE_UNKNOWN: break; - case TL_NOTE_INS_DOC_PUB_FILE: - case TL_NOTE_INS_SHA_PUB_FILE: - case TL_NOTE_CTR_DOC_PUB_FILE: - case TL_NOTE_CTR_SHA_PUB_FILE: - case TL_NOTE_DEG_DOC_PUB_FILE: - case TL_NOTE_DEG_SHA_PUB_FILE: - case TL_NOTE_CRS_DOC_PUB_FILE: - case TL_NOTE_CRS_SHA_PUB_FILE: + case Tml_NOTE_INS_DOC_PUB_FILE: + case Tml_NOTE_INS_SHA_PUB_FILE: + case Tml_NOTE_CTR_DOC_PUB_FILE: + case Tml_NOTE_CTR_SHA_PUB_FILE: + case Tml_NOTE_DEG_DOC_PUB_FILE: + case Tml_NOTE_DEG_SHA_PUB_FILE: + case Tml_NOTE_CRS_DOC_PUB_FILE: + case Tml_NOTE_CRS_SHA_PUB_FILE: Brw_GetSummaryAndContentOfFile (SummaryStr,NULL,Not->Cod,false); break; - case TL_NOTE_CALL_FOR_EXAM: + case Tml_NOTE_CALL_FOR_EXAM: Cfe_GetSummaryAndContentCallForExam (SummaryStr,NULL,Not->Cod,false); break; - case TL_NOTE_POST: + case Tml_NOTE_POST: // Not applicable break; - case TL_NOTE_FORUM_POST: + case Tml_NOTE_FORUM_POST: For_GetSummaryAndContentForumPst (SummaryStr,NULL,Not->Cod,false); break; - case TL_NOTE_NOTICE: + case Tml_NOTE_NOTICE: Not_GetSummaryAndContentNotice (SummaryStr,NULL,Not->Cod,false); break; } @@ -793,7 +794,7 @@ static void Tml_Not_WriteButtonToAddAComm (const struct Tml_Not_Note *Not, const char IdNewComm[Frm_MAX_BYTES_ID + 1]) { /***** Begin container *****/ - HTM_DIV_Begin ("class=\"TL_BOTTOM_LEFT\""); + HTM_DIV_Begin ("class=\"Tml_BOTTOM_LEFT\""); /***** Button to add a comment *****/ if (Not->Unavailable) // Unavailable notes can not be commented @@ -814,7 +815,7 @@ static void Tml_Not_WriteFavShaRemAndComms (const struct Tml_Timeline *Timeline, const struct UsrData *UsrDat) // Author { /***** Begin container *****/ - HTM_DIV_Begin ("class=\"TL_BOTTOM_RIGHT TL_RIGHT_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_BOTTOM_RIGHT Tml_RIGHT_WIDTH\""); /***** Write favs, shared and remove buttons int the foot of a note *****/ Tml_Not_WriteFavShaRem (Timeline,Not,UsrDat); @@ -839,11 +840,11 @@ static void Tml_Not_WriteFavShaRem (const struct Tml_Timeline *Timeline, NumDiv++; /***** Begin foot container *****/ - HTM_DIV_Begin ("class=\"TL_FOOT TL_RIGHT_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_FOOT Tml_RIGHT_WIDTH\""); /***** Foot column 1: fav zone *****/ HTM_DIV_Begin ("id=\"fav_not_%s_%u\"" - " class=\"TL_FAV_NOT TL_FAV_NOT_WIDTH\"", + " class=\"Tml_FAV_NOT Tml_FAV_NOT_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); Tml_Usr_PutIconFavSha (Tml_Usr_FAV_UNF_NOTE, Not->NotCod,Not->UsrCod,Not->NumFavs, @@ -852,7 +853,7 @@ static void Tml_Not_WriteFavShaRem (const struct Tml_Timeline *Timeline, /***** Foot column 2: share zone *****/ HTM_DIV_Begin ("id=\"sha_not_%s_%u\"" - " class=\"TL_SHA_NOT TL_SHA_NOT_WIDTH\"", + " class=\"Tml_SHA_NOT Tml_SHA_NOT_WIDTH\"", Gbl.UniqueNameEncrypted,NumDiv); Tml_Usr_PutIconFavSha (Tml_Usr_SHA_UNS_NOTE, Not->NotCod,Not->UsrCod,Not->NumShared, @@ -860,7 +861,7 @@ static void Tml_Not_WriteFavShaRem (const struct Tml_Timeline *Timeline, HTM_DIV_End (); /***** Foot column 3: icon to remove this note *****/ - HTM_DIV_Begin ("class=\"TL_REM\""); + HTM_DIV_Begin ("class=\"Tml_REM\""); if (Usr_ItsMe (UsrDat->UsrCod)) // I am the author Tml_Not_PutFormToRemoveNote (Timeline,Not->NotCod); HTM_DIV_End (); @@ -908,22 +909,22 @@ void Tml_Not_StoreAndPublishNoteInternal (Tml_Not_Type_t NoteType,long Cod, switch (NoteType) { - case TL_NOTE_INS_DOC_PUB_FILE: - case TL_NOTE_INS_SHA_PUB_FILE: + case Tml_NOTE_INS_DOC_PUB_FILE: + case Tml_NOTE_INS_SHA_PUB_FILE: HieCod = Gbl.Hierarchy.Ins.InsCod; break; - case TL_NOTE_CTR_DOC_PUB_FILE: - case TL_NOTE_CTR_SHA_PUB_FILE: + case Tml_NOTE_CTR_DOC_PUB_FILE: + case Tml_NOTE_CTR_SHA_PUB_FILE: HieCod = Gbl.Hierarchy.Ctr.CtrCod; break; - case TL_NOTE_DEG_DOC_PUB_FILE: - case TL_NOTE_DEG_SHA_PUB_FILE: + case Tml_NOTE_DEG_DOC_PUB_FILE: + case Tml_NOTE_DEG_SHA_PUB_FILE: HieCod = Gbl.Hierarchy.Deg.DegCod; break; - case TL_NOTE_CRS_DOC_PUB_FILE: - case TL_NOTE_CRS_SHA_PUB_FILE: - case TL_NOTE_CALL_FOR_EXAM: - case TL_NOTE_NOTICE: + case Tml_NOTE_CRS_DOC_PUB_FILE: + case Tml_NOTE_CRS_SHA_PUB_FILE: + case Tml_NOTE_CALL_FOR_EXAM: + case Tml_NOTE_NOTICE: HieCod = Gbl.Hierarchy.Crs.CrsCod; break; default: @@ -934,7 +935,7 @@ void Tml_Not_StoreAndPublishNoteInternal (Tml_Not_Type_t NoteType,long Cod, /***** Publish note in timeline *****/ Pub->PublisherCod = Gbl.Usrs.Me.UsrDat.UsrCod; Pub->NotCod = Tml_DB_CreateNewNote (NoteType,Cod,Pub->PublisherCod,HieCod); - Pub->Type = Tml_Pub_ORIGINAL_NOTE; + Pub->Type = Tml_Pub_ORIGINAL_NOTE; Tml_Pub_PublishPubInTimeline (Pub); } @@ -949,13 +950,11 @@ void Tml_Not_MarkNoteOneFileAsUnavailable (const char *Path) long FilCod; if (Tml_Not_NoteType[FileBrowser]) - { /***** Get file code *****/ - FilCod = Brw_DB_GetFilCodByPath (Path,true); // Only if file is public - if (FilCod > 0) + if ((FilCod = Brw_DB_GetFilCodByPath (Path, + true)) > 0) // Only public files /***** Mark possible note as unavailable *****/ Tml_DB_MarkNoteAsUnavailable (Tml_Not_NoteType[FileBrowser],FilCod); - } } /*****************************************************************************/ @@ -1010,7 +1009,7 @@ void Tml_Not_RequestRemNoteUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Begin section *****/ - HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); + HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID); /***** Request the removal of note *****/ Tml_Not_RequestRemovalNote (&Timeline); @@ -1057,7 +1056,7 @@ static void Tml_Not_RequestRemovalNote (struct Tml_Timeline *Timeline) Box_BoxBegin (NULL,NULL, NULL,NULL, NULL,Box_CLOSABLE); - HTM_DIV_Begin ("class=\"TL_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_WIDTH\""); Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not, Tml_TOP_MESSAGE_NONE, -1L); @@ -1104,7 +1103,7 @@ void Tml_Not_RemoveNoteUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Begin section *****/ - HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); + HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID); /***** Remove a note *****/ Tml_Not_RemoveNote (); @@ -1197,7 +1196,7 @@ static void Tml_Not_RemoveNoteMediaAndDBEntries (struct Tml_Not_Note *Not) DB_FreeMySQLResult (&mysql_res); /***** Remove media associated to post *****/ - if (Not->Type == TL_NOTE_POST) + if (Not->Type == Tml_NOTE_POST) if ((MedCod = Tml_DB_GetMedCodFromPost (Not->Cod)) > 0) Med_RemoveMedia (MedCod); @@ -1206,9 +1205,9 @@ static void Tml_Not_RemoveNoteMediaAndDBEntries (struct Tml_Not_Note *Not) PubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); if (PubCod > 0) { - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod); - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE ,PubCod); - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_FAV ,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_SHARE ,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_MENTION,PubCod); } /***** Remove favs for this note *****/ @@ -1220,7 +1219,7 @@ static void Tml_Not_RemoveNoteMediaAndDBEntries (struct Tml_Not_Note *Not) /***** Remove note *****/ Tml_DB_RemoveNote (Not->NotCod); - if (Not->Type == TL_NOTE_POST) + if (Not->Type == Tml_NOTE_POST) /***** Remove post *****/ Tml_DB_RemovePost (Not->Cod); } @@ -1244,15 +1243,13 @@ static void Tml_Not_GetDataOfNoteFromRow (MYSQL_ROW row,struct Tml_Not_Note *Not Not->NotCod = Str_ConvertStrCodToLongCod (row[0]); /***** Get note type (row[1]) *****/ - Not->Type = Tml_Not_GetNoteTypeFromStr (row[1]); + Not->Type = Tml_Not_GetNoteTypeFromStr (row[1]); - /***** Get file/post... code (row[2]) *****/ + /***** Get file/post... code (row[2]), + (from) user code (row[3]) + and hierarchy code (row[4]) *****/ Not->Cod = Str_ConvertStrCodToLongCod (row[2]); - - /***** Get (from) user code (row[3]) *****/ Not->UsrCod = Str_ConvertStrCodToLongCod (row[3]); - - /***** Get hierarchy code (row[4]) *****/ Not->HieCod = Str_ConvertStrCodToLongCod (row[4]); /***** File/post... unavailable (row[5]) *****/ @@ -1261,10 +1258,8 @@ static void Tml_Not_GetDataOfNoteFromRow (MYSQL_ROW row,struct Tml_Not_Note *Not /***** Get time of the note (row[6]) *****/ Not->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[6]); - /***** Get number of times this note has been shared *****/ + /***** Get number of times this note has been shared and favourited *****/ Not->NumShared = Tml_DB_GetNumSharers (Not->NotCod,Not->UsrCod); - - /***** Get number of times this note has been favourited *****/ Not->NumFavs = Tml_DB_GetNumFavers (Tml_Usr_FAV_UNF_NOTE, Not->NotCod,Not->UsrCod); } @@ -1278,10 +1273,10 @@ static Tml_Not_Type_t Tml_Not_GetNoteTypeFromStr (const char *Str) unsigned UnsignedNum; if (sscanf (Str,"%u",&UnsignedNum) == 1) - if (UnsignedNum < TL_NOT_NUM_NOTE_TYPES) + if (UnsignedNum < Tml_NOT_NUM_NOTE_TYPES) return (Tml_Not_Type_t) UnsignedNum; - return TL_NOTE_UNKNOWN; + return Tml_NOTE_UNKNOWN; } /*****************************************************************************/ @@ -1291,7 +1286,7 @@ static Tml_Not_Type_t Tml_Not_GetNoteTypeFromStr (const char *Str) static void Tml_Not_ResetNote (struct Tml_Not_Note *Not) { Not->NotCod = -1L; - Not->Type = TL_NOTE_UNKNOWN; + Not->Type = Tml_NOTE_UNKNOWN; Not->UsrCod = -1L; Not->HieCod = -1L; Not->Cod = -1L; diff --git a/swad_timeline_note.h b/swad_timeline_note.h index 7b3ee096..4e470965 100644 --- a/swad_timeline_note.h +++ b/swad_timeline_note.h @@ -33,32 +33,32 @@ /******************************** Public types *******************************/ /*****************************************************************************/ -#define TL_NOT_NUM_NOTE_TYPES 13 +#define Tml_NOT_NUM_NOTE_TYPES 13 // If the numbers assigned to each event type change, // it is necessary to change old numbers to new ones in database table tml_notes typedef enum { - TL_NOTE_UNKNOWN = 0, + Tml_NOTE_UNKNOWN = 0, /* Start tab */ - TL_NOTE_POST = 10, // Post written directly in timeline + Tml_NOTE_POST = 10, // Post written directly in timeline /* Institution tab */ - TL_NOTE_INS_DOC_PUB_FILE = 1, // Public file in documents of institution - TL_NOTE_INS_SHA_PUB_FILE = 2, // Public file in shared files of institution + Tml_NOTE_INS_DOC_PUB_FILE = 1, // Public file in documents of institution + Tml_NOTE_INS_SHA_PUB_FILE = 2, // Public file in shared files of institution /* Center tab */ - TL_NOTE_CTR_DOC_PUB_FILE = 3, // Public file in documents of center - TL_NOTE_CTR_SHA_PUB_FILE = 4, // Public file in shared files of center + Tml_NOTE_CTR_DOC_PUB_FILE = 3, // Public file in documents of center + Tml_NOTE_CTR_SHA_PUB_FILE = 4, // Public file in shared files of center /* Degree tab */ - TL_NOTE_DEG_DOC_PUB_FILE = 5, // Public file in documents of degree - TL_NOTE_DEG_SHA_PUB_FILE = 6, // Public file in shared files of degree + Tml_NOTE_DEG_DOC_PUB_FILE = 5, // Public file in documents of degree + Tml_NOTE_DEG_SHA_PUB_FILE = 6, // Public file in shared files of degree /* Course tab */ - TL_NOTE_CRS_DOC_PUB_FILE = 7, // Public file in documents of course - TL_NOTE_CRS_SHA_PUB_FILE = 8, // Public file in shared files of course + Tml_NOTE_CRS_DOC_PUB_FILE = 7, // Public file in documents of course + Tml_NOTE_CRS_SHA_PUB_FILE = 8, // Public file in shared files of course /* Assessment tab */ - TL_NOTE_CALL_FOR_EXAM = 9, // Exam announcement in a course + Tml_NOTE_CALL_FOR_EXAM = 9, // Call for exam in a course /* Users tab */ /* Messages tab */ - TL_NOTE_NOTICE = 12, // A public notice in a course - TL_NOTE_FORUM_POST = 11, // Post in global/swad forums + Tml_NOTE_NOTICE = 12, // A public notice in a course + Tml_NOTE_FORUM_POST = 11, // Post in global/swad forums /* Analytics tab */ /* Profile tab */ } Tml_Not_Type_t; diff --git a/swad_timeline_notification.c b/swad_timeline_notification.c index ba858ef8..d3668ee0 100644 --- a/swad_timeline_notification.c +++ b/swad_timeline_notification.c @@ -124,7 +124,7 @@ void Tml_Ntf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], Not.NotCod = Pub.NotCod; Tml_Not_GetDataOfNoteByCod (&Not); - if (Not.Type == TL_NOTE_POST) + if (Not.Type == Tml_NOTE_POST) { /***** Get post from database *****/ if (Tml_DB_GetPostByCod (Not.Cod,&mysql_res) == 1) // Result should have a unique row @@ -201,8 +201,8 @@ void Tml_Ntf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], void Tml_Ntf_MarkMyNotifAsSeen (void) { - Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TL_COMMENT); - Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TL_FAV ); - Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TL_SHARE ); - Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TL_MENTION); + Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TML_COMMENT); + Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TML_FAV ); + Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TML_SHARE ); + Ntf_DB_MarkNotifsAsSeen (Ntf_EVENT_TML_MENTION); } diff --git a/swad_timeline_post.c b/swad_timeline_post.c index 95bf761c..8dd90ba0 100644 --- a/swad_timeline_post.c +++ b/swad_timeline_post.c @@ -124,14 +124,14 @@ static void Tml_Pst_ShowPostContent (struct Tml_Pst_Content *Content) /***** Write content text *****/ if (Content->Txt[0]) { - HTM_DIV_Begin ("class=\"TL_TXT\""); + HTM_DIV_Begin ("class=\"Tml_TXT\""); Msg_WriteMsgContent (Content->Txt,Cns_MAX_BYTES_LONG_TEXT,true,false); HTM_DIV_End (); } /***** Show media *****/ - Med_ShowMedia (&Content->Media,"TL_PST_MED_CONT TL_RIGHT_WIDTH", - "TL_PST_MED TL_RIGHT_WIDTH"); + Med_ShowMedia (&Content->Media,"Tml_PST_MED_CONT Tml_RIGHT_WIDTH", + "Tml_PST_MED Tml_RIGHT_WIDTH"); } /*****************************************************************************/ @@ -141,10 +141,10 @@ static void Tml_Pst_ShowPostContent (struct Tml_Pst_Content *Content) void Tml_Pst_PutPhotoAndFormToWriteNewPost (struct Tml_Timeline *Timeline) { /***** Begin list *****/ - HTM_UL_Begin ("class=\"TL_LIST\""); + HTM_UL_Begin ("class=\"Tml_LIST\""); /***** Begin list item *****/ - HTM_LI_Begin ("class=\"TL_WIDTH\""); + HTM_LI_Begin ("class=\"Tml_WIDTH\""); /***** Left: write author's photo (my photo) *****/ Tml_Not_ShowAuthorPhoto (&Gbl.Usrs.Me.UsrDat,false); // Don't use unique id @@ -168,20 +168,20 @@ static void Tml_Pst_PutFormToWriteNewPost (struct Tml_Timeline *Timeline) extern const char *Txt_New_TIMELINE_post; /***** Begin container *****/ - HTM_DIV_Begin ("class=\"TL_RIGHT_CONT TL_RIGHT_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_RIGHT_CONT Tml_RIGHT_WIDTH\""); /***** Author name *****/ Tml_Not_WriteAuthorName (&Gbl.Usrs.Me.UsrDat, - "BT_LINK TL_RIGHT_AUTHOR TL_RIGHT_AUTHOR_WIDTH DAT_N_BOLD"); + "BT_LINK Tml_RIGHT_AUTHOR Tml_RIGHT_AUTHOR_WIDTH DAT_N_BOLD"); /***** Form to write the post *****/ /* Begin container */ - HTM_DIV_Begin ("class=\"TL_FORM_NEW_PST TL_RIGHT_WIDTH\""); + HTM_DIV_Begin ("class=\"Tml_FORM_NEW_PST Tml_RIGHT_WIDTH\""); /* Form with textarea */ Tml_Frm_BeginForm (Timeline,Tml_Frm_RECEIVE_POST); Tml_Pst_PutTextarea (Txt_New_TIMELINE_post, - "TL_PST_TEXTAREA TL_RIGHT_WIDTH"); + "Tml_PST_TEXTAREA Tml_RIGHT_WIDTH"); Tml_Frm_EndForm (); /* End container */ @@ -219,7 +219,7 @@ void Tml_Pst_PutTextarea (const char *Placeholder,const char *ClassTextArea) Lay_HelpPlainEditor (); /***** Attached image (optional) *****/ - Med_PutMediaUploader (-1,"TL_MED_INPUT_WIDTH"); + Med_PutMediaUploader (-1,"Tml_MED_INPUT_WIDTH"); /***** Submit button *****/ HTM_BUTTON_SUBMIT_Begin (NULL,"BT_SUBMIT_INLINE BT_CREATE",NULL); @@ -249,7 +249,7 @@ void Tml_Pst_ReceivePostUsr (void) Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat); /***** Begin section *****/ - HTM_SECTION_Begin (TL_TIMELINE_SECTION_ID); + HTM_SECTION_Begin (Tml_TIMELINE_SECTION_ID); /***** Receive and store post, and write updated timeline after publication (user) *****/ @@ -307,7 +307,7 @@ static long Tml_Pst_ReceivePost (void) PstCod = Tml_DB_CreateNewPost (&Content); /* Insert post in notes */ - Tml_Not_StoreAndPublishNoteInternal (TL_NOTE_POST,PstCod,&Pub); + Tml_Not_StoreAndPublishNoteInternal (Tml_NOTE_POST,PstCod,&Pub); /***** Analyze content and store notifications about mentions *****/ Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt); diff --git a/swad_timeline_publication.c b/swad_timeline_publication.c index 28e9ac01..ef295e9b 100644 --- a/swad_timeline_publication.c +++ b/swad_timeline_publication.c @@ -353,7 +353,7 @@ void Tml_Pub_InsertNewPubsInTimeline (struct Tml_Timeline *Timeline) Tml_Not_GetDataOfNoteByCod (&Not); /* Write note */ - HTM_LI_Begin ("class=\"TL_WIDTH TL_SEP TL_NEW_PUB\"" + HTM_LI_Begin ("class=\"Tml_WIDTH Tml_SEP Tml_NEW_PUB\"" " data-note-code=\"%ld\"", // Note code to be read later... Not.NotCod); // ...from JavaScript... // ...to avoid repeating notes @@ -384,7 +384,7 @@ void Tml_Pub_ShowOldPubsInTimeline (struct Tml_Timeline *Timeline) Tml_Not_GetDataOfNoteByCod (&Not); /* Write note */ - HTM_LI_Begin ("class=\"TL_WIDTH TL_SEP\""); + HTM_LI_Begin ("class=\"Tml_WIDTH Tml_SEP\""); Tml_Not_CheckAndWriteNoteWithTopMsg (Timeline,&Not, Tml_Pub_GetTopMessage (Pub->Type), Pub->PublisherCod); @@ -422,7 +422,7 @@ void Tml_Pub_PutLinkToViewNewPubs (void) /* Begin container */ // div is hidden. When new posts arrive to the client via AJAX, div is shown HTM_DIV_Begin ("id=\"view_new_posts_container\"" - " class=\"TL_WIDTH TL_SEP VERY_LIGHT_BLUE\"" + " class=\"Tml_WIDTH Tml_SEP VERY_LIGHT_BLUE\"" " style=\"display:none;\""); /* Begin anchor */ @@ -456,7 +456,7 @@ void Tml_Pub_PutLinkToViewOldPubs (void) /***** Animated link to view old publications *****/ /* Begin container */ HTM_DIV_Begin ("id=\"view_old_posts_container\"" - " class=\"TL_WIDTH TL_SEP VERY_LIGHT_BLUE\""); + " class=\"Tml_WIDTH Tml_SEP VERY_LIGHT_BLUE\""); /* Begin anchor */ HTM_A_Begin ("href=\"\" class=\"%s\" onclick=\"" @@ -497,7 +497,6 @@ void Tml_Pub_PutHiddenParamPubCod (long PubCod) long Tml_Pub_GetParamPubCod (void) { - /***** Get comment code *****/ return Par_GetParToLong ("PubCod"); } @@ -523,7 +522,7 @@ void Tml_Pub_GetDataOfPubFromNextRow (MYSQL_RES *mysql_res, Pub->PubCod = Str_ConvertStrCodToLongCod (row[0]); Pub->NotCod = Str_ConvertStrCodToLongCod (row[1]); Pub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]); - Pub->Type = Tml_Pub_GetPubTypeFromStr (row[3]); + Pub->Type = Tml_Pub_GetPubTypeFromStr (row[3]); } /*****************************************************************************/ diff --git a/swad_timeline_share.c b/swad_timeline_share.c index c845b816..024b73fc 100644 --- a/swad_timeline_share.c +++ b/swad_timeline_share.c @@ -131,7 +131,7 @@ static void Tml_Sha_ShaNote (struct Tml_Not_Note *Not) for the author of the post *****/ OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); if (OriginalPubCod > 0) - Tml_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TL_SHARE); + Tml_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TML_SHARE); } /*****************************************************************************/ @@ -181,5 +181,5 @@ static void Tml_Sha_UnsNote (struct Tml_Not_Note *Not) /***** Mark possible notifications on this note as removed *****/ OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); if (OriginalPubCod > 0) - Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE,OriginalPubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TML_SHARE,OriginalPubCod); } diff --git a/swad_timeline_user.c b/swad_timeline_user.c index c2bee63c..39d4e696 100644 --- a/swad_timeline_user.c +++ b/swad_timeline_user.c @@ -151,7 +151,7 @@ static void Tml_Usr_GetAndShowSharersOrFavers (Tml_Usr_FavSha_t FavSha, HTM_DIV_End (); /* List users one by one */ - HTM_DIV_Begin ("class=\"TL_USRS\""); + HTM_DIV_Begin ("class=\"Tml_USRS\""); Tml_Usr_ListSharersOrFavers (&mysql_res,NumUsrs,NumFirstUsrs); if (NumFirstUsrs < NumUsrs) // Not all are shown /* Clickable ellipsis to show all users */ @@ -207,7 +207,7 @@ static void Tml_Usr_ListSharersOrFavers (MYSQL_RES **mysql_res, Usr_DONT_GET_ROLE_IN_CURRENT_CRS)) { /* Begin container */ - HTM_DIV_Begin ("class=\"TL_SHARER\""); + HTM_DIV_Begin ("class=\"Tml_SHARER\""); /* User's photo */ Pho_ShowUsrPhotoIfAllowed (&UsrDat,"PHOTO12x16",Pho_ZOOM,true); // Use unique id @@ -273,7 +273,7 @@ void Tml_Usr_PutIconFavSha (Tml_Usr_FavSha_t FavSha, { /***** Put form to fav/unfav or share/unshare this note/comment *****/ /* Begin container */ - HTM_DIV_Begin ("class=\"TL_ICO\""); + HTM_DIV_Begin ("class=\"Tml_ICO\""); /* Icon to fav/unfav or share/unshare this note/comment */ if (Usr_ItsMe (UsrCod)) // I am the author ==> I can not fav/unfav or share/unshare @@ -299,34 +299,55 @@ static void Tml_Usr_PutDisabledIconFavSha (Tml_Usr_FavSha_t FavSha, extern const char *Txt_TIMELINE_Not_favourited_by_anyone; extern const char *Txt_TIMELINE_Shared_by_X_USERS; extern const char *Txt_TIMELINE_Not_shared_by_anyone; - static const char *Icon[Tml_Usr_NUM_FAV_SHA] = + static const struct { - [Tml_Usr_FAV_UNF_NOTE] = Tml_Fav_ICON_FAV, - [Tml_Usr_FAV_UNF_COMM] = Tml_Fav_ICON_FAV, - [Tml_Usr_SHA_UNS_NOTE] = Tml_Sha_ICON_SHARE, - }; - static const char **TitleWithUsrs[Tml_Usr_NUM_FAV_SHA] = + const char *Icon; + struct + { + const char **WithUsrs; + const char **WithoutUsrs; + } Title; + } Ico[Tml_Usr_NUM_FAV_SHA] = { - [Tml_Usr_FAV_UNF_NOTE] = &Txt_TIMELINE_Favourited_by_X_USERS, - [Tml_Usr_FAV_UNF_COMM] = &Txt_TIMELINE_Favourited_by_X_USERS, - [Tml_Usr_SHA_UNS_NOTE] = &Txt_TIMELINE_Shared_by_X_USERS, - }; - static const char **TitleWithoutUsrs[Tml_Usr_NUM_FAV_SHA] = - { - [Tml_Usr_FAV_UNF_NOTE] = &Txt_TIMELINE_Not_favourited_by_anyone, - [Tml_Usr_FAV_UNF_COMM] = &Txt_TIMELINE_Not_favourited_by_anyone, - [Tml_Usr_SHA_UNS_NOTE] = &Txt_TIMELINE_Not_shared_by_anyone, + [Tml_Usr_FAV_UNF_NOTE] = + { + .Icon = Tml_Fav_ICON_FAV, + .Title = + { + .WithUsrs = &Txt_TIMELINE_Favourited_by_X_USERS, + .WithoutUsrs = &Txt_TIMELINE_Not_favourited_by_anyone, + }, + }, + [Tml_Usr_FAV_UNF_COMM] = + { + .Icon = Tml_Fav_ICON_FAV, + .Title = + { + .WithUsrs = &Txt_TIMELINE_Favourited_by_X_USERS, + .WithoutUsrs = &Txt_TIMELINE_Not_favourited_by_anyone, + }, + }, + [Tml_Usr_SHA_UNS_NOTE] = + { + .Icon = Tml_Sha_ICON_SHARE, + .Title = + { + .WithUsrs = &Txt_TIMELINE_Shared_by_X_USERS, + .WithoutUsrs = &Txt_TIMELINE_Not_shared_by_anyone, + }, + }, }; /***** Disabled icon to fav/share *****/ if (NumUsrs) { - Ico_PutDivIcon ("TL_ICO_DISABLED",Icon[FavSha], - Str_BuildStringLong (*TitleWithUsrs[FavSha],(long) NumUsrs)); + Ico_PutDivIcon ("Tml_ICO_DISABLED",Ico[FavSha].Icon, + Str_BuildStringLong (*Ico[FavSha].Title.WithUsrs,(long) NumUsrs)); Str_FreeString (); } else - Ico_PutDivIcon ("TL_ICO_DISABLED",Icon[FavSha],*TitleWithoutUsrs[FavSha]); + Ico_PutDivIcon ("Tml_ICO_DISABLED",Ico[FavSha].Icon, + *Ico[FavSha].Title.WithoutUsrs); } /*****************************************************************************/ diff --git a/swad_timeline_who.c b/swad_timeline_who.c index b22fa659..9a93e92b 100644 --- a/swad_timeline_who.c +++ b/swad_timeline_who.c @@ -44,7 +44,7 @@ extern struct Globals Gbl; /************************* Private global variables **************************/ /*****************************************************************************/ -Usr_Who_t TL_GlobalWho; +Usr_Who_t Tml_GlobalWho; /*****************************************************************************/ /***************************** Private prototypes ****************************/ @@ -175,12 +175,12 @@ void Tml_Who_SaveWhoInDB (struct Tml_Timeline *Timeline) static void Tml_Who_SetGlobalWho (Usr_Who_t Who) { - TL_GlobalWho = Who; + Tml_GlobalWho = Who; } Usr_Who_t Tml_Who_GetGlobalWho (void) { - return TL_GlobalWho; + return Tml_GlobalWho; } /*****************************************************************************/