diff --git a/swad_changelog.h b/swad_changelog.h index 9931ce732..044d1571c 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -172,14 +172,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.68.1 (2016-11-22)" +#define Log_PLATFORM_VERSION "SWAD 16.68.2 (2016-11-22)" #define CSS_FILE "swad16.68.css" #define JS_FILE "swad16.46.1.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* - Version 16.68.1: Nov 22, 2016 Code refactoringrelated to notifications and contextual checkbox. (207438 lines) + Version 16.68.2: Nov 22, 2016 Code refactoring related to file browser and contextual checkbox. (207438 lines) + Version 16.68.1: Nov 22, 2016 Code refactoring related to notifications and contextual checkbox. (207438 lines) Version 16.68: Nov 22, 2016 Change in text related to notifications. Changes in contextual links in notifications. (207406 lines) Version 16.67.3: Nov 22, 2016 Contextual help on notifications. (207355 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index b3cb9eb2b..c13ffd54d 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -1470,6 +1470,7 @@ static void Brw_StoreSizeOfFileTreeInDB (void); static void Brw_PutParamsContextualLink (void); static void Brw_WriteFormFullTree (void); +static void Brw_PutParamsFullTree (void); static bool Brw_GetFullTreeFromForm (void); static void Brw_GetAndUpdateDateLastAccFileBrowser (void); static long Brw_GetGrpLastAccZone (const char *FieldNameDB); @@ -4668,13 +4669,18 @@ static void Brw_PutParamsContextualLink (void) static void Brw_WriteFormFullTree (void) { - extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *Txt_Show_all_files; - /***** Start form depending on type of tree *****/ - fprintf (Gbl.F.Out,"
", - The_ClassForm[Gbl.Prefs.Theme]); - Act_FormStart (Brw_ActSeeAdm[Gbl.FileBrowser.Type]); + fprintf (Gbl.F.Out,"
"); + Lay_PutContextualCheckbox (Brw_ActSeeAdm[Gbl.FileBrowser.Type], + Brw_PutParamsFullTree, + "FullTree",Gbl.FileBrowser.FullTree, + Txt_Show_all_files,Txt_Show_all_files); + fprintf (Gbl.F.Out,"
"); + } + +static void Brw_PutParamsFullTree (void) + { switch (Gbl.FileBrowser.Type) { case Brw_SHOW_DOCUM_INS: @@ -4709,17 +4715,6 @@ static void Brw_WriteFormFullTree (void) default: break; } - - /***** End form *****/ - fprintf (Gbl.F.Out,"" - " %s", - Gbl.Form.Id, - Txt_Show_all_files); - Act_FormEnd (); - fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ diff --git a/swad_layout.c b/swad_layout.c index e18a0d96a..7defe599d 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1043,6 +1043,7 @@ void Lay_PutContextualLink (Act_Action_t NextAction, /*****************************************************************************/ void Lay_PutContextualCheckbox (Act_Action_t NextAction, + void (*FuncParams) (), const char *CheckboxName,bool Checked, const char *Title,const char *Text) { @@ -1055,6 +1056,8 @@ void Lay_PutContextualCheckbox (Act_Action_t NextAction, /***** Start form *****/ Act_FormStart (NextAction); + if (FuncParams) + FuncParams (); /***** Start container *****/ fprintf (Gbl.F.Out,"
", diff --git a/swad_layout.h b/swad_layout.h index 26049cc6c..5537a6f7c 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -77,6 +77,7 @@ void Lay_PutContextualLink (Act_Action_t NextAction, const char *Title,const char *Text, const char *OnSubmit); void Lay_PutContextualCheckbox (Act_Action_t NextAction, + void (*FuncParams) (), const char *CheckboxName,bool Checked, const char *Title,const char *Text); void Lay_PutIconLink (const char *Icon,const char *Title,const char *Text, diff --git a/swad_notification.c b/swad_notification.c index 408be1aca..2c1c0ca21 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -344,11 +344,10 @@ void Ntf_ShowMyNotifications (void) Gbl.Usrs.Me.UsrDat.UsrCod,SubQuery); NumNotifications = DB_QuerySELECT (Query,&mysql_res,"can not get your notifications"); - /***** Links to mark all notifications as read - and to change preferences *****/ + /***** Contextual links *****/ fprintf (Gbl.F.Out,"
"); - /***** Write form to show all notifications *****/ + /* Write form to show all notifications */ Ntf_WriteFormAllNotifications (AllNotifications); if (NumNotifications) @@ -659,7 +658,8 @@ static void Ntf_WriteFormAllNotifications (bool AllNotifications) extern const char *Txt_Show_all_notifications; extern const char *Txt_Show_all_NOTIFICATIONS; - Lay_PutContextualCheckbox (ActSeeNtf,"All",AllNotifications, + Lay_PutContextualCheckbox (ActSeeNtf,NULL, + "All",AllNotifications, Txt_Show_all_notifications, Txt_Show_all_NOTIFICATIONS); }