diff --git a/swad_assignment.c b/swad_assignment.c index 56a0d262..a95d8cf8 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -73,6 +73,7 @@ static void Asg_PutFormToCreateNewAsg (void); static void Asg_PutFormToCreateNewAsgParams (void); static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden); +static void Asg_PutParams (void); static void Asg_GetDataOfAssignment (struct Assignment *Asg,const char *Query); static void Asg_GetAssignmentTxtFromDB (long AsgCod,char *Txt); static void Asg_PutParamAsgCod (long AsgCod); @@ -495,38 +496,41 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) fprintf (Gbl.F.Out,"
"); + Gbl.Asgs.AsgCod = AsgCod; // Used as parameters in contextual links + /***** Put form to remove assignment *****/ - Act_FormStart (ActReqRemAsg); - Asg_PutParamAsgCod (AsgCod); - Asg_PutHiddenParamAsgOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Lay_PutIconLink ("remove-on64x64.png",Txt_Remove,NULL,NULL); - Act_FormEnd (); + Lay_PutContextualLink (ActReqRemAsg,Asg_PutParams, + "remove-on64x64.png", + Txt_Remove,NULL); /***** Put form to hide/show assignment *****/ - Act_FormStart (Hidden ? ActShoAsg : - ActHidAsg); - Asg_PutParamAsgCod (AsgCod); - Asg_PutHiddenParamAsgOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); if (Hidden) - Lay_PutIconLink ("eye-slash-on64x64.png",Txt_Show,NULL,NULL); + Lay_PutContextualLink (ActShoAsg,Asg_PutParams, + "eye-slash-on64x64.png", + Txt_Show,NULL); else - Lay_PutIconLink ("eye-on64x64.png",Txt_Hide,NULL,NULL); - Act_FormEnd (); + Lay_PutContextualLink (ActHidAsg,Asg_PutParams, + "eye-on64x64.png", + Txt_Hide,NULL); /***** Put form to edit assignment *****/ - Act_FormStart (ActEdiOneAsg); - Asg_PutParamAsgCod (AsgCod); + Lay_PutContextualLink (ActEdiOneAsg,Asg_PutParams, + "edit64x64.png", + Txt_Edit,NULL); + + fprintf (Gbl.F.Out,"
"); + } + +/*****************************************************************************/ +/********************** Params related to an assignment **********************/ +/*****************************************************************************/ + +static void Asg_PutParams (void) + { + Asg_PutParamAsgCod (Gbl.Asgs.AsgCod); Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Lay_PutIconLink ("edit64x64.png",Txt_Edit,NULL,NULL); - Act_FormEnd (); - - fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index cde2142a..60d09d05 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -117,12 +117,13 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.64.7 (2015/12/13)" +#define Log_PLATFORM_VERSION "SWAD 15.64.8 (2015/12/13)" #define CSS_FILE "swad15.64.5.css" // 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 15.64.8: Dec 13, 2015 Code refactoring in contextual links. (187066 lines) Version 15.64.7: Dec 13, 2015 Code refactoring in contextual links. (187063 lines) Version 15.64.6: Dec 13, 2015 Code refactoring in contextual links. (186974 lines) Version 15.64.5: Dec 13, 2015 Code refactoring in record card. (186944 lines) diff --git a/swad_global.h b/swad_global.h index b2e8fba5..7c3fce09 100644 --- a/swad_global.h +++ b/swad_global.h @@ -540,6 +540,7 @@ struct Globals unsigned Num; // Number of assignments long *LstAsgCods; // List of assigment codes tAsgsOrderType SelectedOrderType; + long AsgCod; // Used as parameter in contextual links } Asgs; struct {