diff --git a/swad_centre.c b/swad_centre.c index 4be387d8c..764d97334 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -77,6 +77,7 @@ extern struct Globals Gbl; static void Ctr_Configuration (bool PrintView); static void Ctr_PutIconsToPrintAndUpload (void); +static void Ctr_PutIconToChangePhoto (void); static void Ctr_ListCentres (void); static void Ctr_PutIconToEditFrames (void); @@ -544,18 +545,12 @@ static void Ctr_Configuration (bool PrintView) } /*****************************************************************************/ -/************* Put icon to print the configuration of a centre ***************/ +/************ Put contextual icons in configuration of a centre **************/ /*****************************************************************************/ static void Ctr_PutIconsToPrintAndUpload (void) { extern const char *Txt_Print; - extern const char *Txt_Change_logo; - extern const char *Txt_Upload_logo; - extern const char *Txt_Change_photo; - extern const char *Txt_Upload_photo; - char Path[PATH_MAX+1]; - bool Exists; /***** Link to print info about centre *****/ Lay_PutContextualLink (ActPrnCtrInf,NULL,"print64x64.png",Txt_Print,NULL); @@ -563,32 +558,38 @@ static void Ctr_PutIconsToPrintAndUpload (void) if (Gbl.Usrs.Me.LoggedRole >= Rol_CTR_ADM) { /***** Link to upload logo of centre *****/ - sprintf (Path,"%s/%s/%02u/%u/logo/%u.png", - Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR, - (unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100), - (unsigned) Gbl.CurrentCtr.Ctr.CtrCod, - (unsigned) Gbl.CurrentCtr.Ctr.CtrCod); - Exists = Fil_CheckIfPathExists (Path); - Lay_PutContextualLink (ActReqCtrLog,NULL,"logo64x64.png", - Exists ? Txt_Change_logo : - Txt_Upload_logo, - NULL); + Log_PutIconToChangeLogo (Sco_SCOPE_CTR); /***** Link to upload photo of centre *****/ - sprintf (Path,"%s/%s/%02u/%u/%u.jpg", - Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR, - (unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100), - (unsigned) Gbl.CurrentCtr.Ctr.CtrCod, - (unsigned) Gbl.CurrentCtr.Ctr.CtrCod); - Exists = Fil_CheckIfPathExists (Path); - Lay_PutContextualLink (ActReqCtrPho,NULL, - "photo64x64.gif", - Exists ? Txt_Change_photo : - Txt_Upload_photo, - NULL); + Ctr_PutIconToChangePhoto (); } } +/*****************************************************************************/ +/************* Put contextual icons to upload photo of centre ****************/ +/*****************************************************************************/ + +static void Ctr_PutIconToChangePhoto (void) + { + extern const char *Txt_Change_photo; + extern const char *Txt_Upload_photo; + char PathPhoto[PATH_MAX+1]; + bool PhotoExists; + + /***** Link to upload photo of centre *****/ + sprintf (PathPhoto,"%s/%s/%02u/%u/%u.jpg", + Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR, + (unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100), + (unsigned) Gbl.CurrentCtr.Ctr.CtrCod, + (unsigned) Gbl.CurrentCtr.Ctr.CtrCod); + PhotoExists = Fil_CheckIfPathExists (PathPhoto); + Lay_PutContextualLink (ActReqCtrPho,NULL, + "photo64x64.gif", + PhotoExists ? Txt_Change_photo : + Txt_Upload_photo, + NULL); + } + /*****************************************************************************/ /*************** Show the centres of the current institution *****************/ /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 33d118bc4..60e3665cd 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -138,13 +138,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.210.3 (2016-05-05)" +#define Log_PLATFORM_VERSION "SWAD 15.210.4 (2016-05-05)" #define CSS_FILE "swad15.210.css" #define JS_FILE "swad15.197.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 15.210.4: May 05, 2016 Link to change logo of degree is moved to top of window. (201385 lines) Version 15.210.3: May 05, 2016 Link to change logo of centre is moved to top of window. (201407 lines) Version 15.210.2: May 05, 2016 Link to change logo of institution is moved to top of window. (201399 lines) Version 15.210.1: May 05, 2016 New icon to change logo of institution/centre/degree. (201388 lines) diff --git a/swad_degree.c b/swad_degree.c index 2be958936..cdf46e6b4 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -86,7 +86,7 @@ typedef enum /*****************************************************************************/ static void Deg_Configuration (bool PrintView); -static void Deg_PutIconToPrint (void); +static void Deg_PutIconsToPrintAndUpload (void); static void Deg_WriteSelectorOfDegree (void); @@ -300,21 +300,9 @@ static void Deg_Configuration (bool PrintView) if (Gbl.CurrentDeg.Deg.DegCod > 0) { - /***** Links to show courses, to print view and to upload logo *****/ - if (!PrintView && - Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM) - { - fprintf (Gbl.F.Out,"
"); - - /* Link to upload logo */ - Log_PutFormToChangeLogo (Sco_SCOPE_DEG); - - fprintf (Gbl.F.Out,"
"); - } - /***** Start frame *****/ Lay_StartRoundFrame (NULL,NULL,PrintView ? NULL : - Deg_PutIconToPrint); + Deg_PutIconsToPrintAndUpload); /***** Title *****/ fprintf (Gbl.F.Out,"
"); @@ -471,14 +459,19 @@ static void Deg_Configuration (bool PrintView) } /*****************************************************************************/ -/************* Put icon to print the configuration of a degree ***************/ +/************ Put contextual icons in configuration of a degree **************/ /*****************************************************************************/ -static void Deg_PutIconToPrint (void) +static void Deg_PutIconsToPrintAndUpload (void) { extern const char *Txt_Print; + /***** Link to print info about degree *****/ Lay_PutContextualLink (ActPrnDegInf,NULL,"print64x64.png",Txt_Print,NULL); + + if (Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM) + /***** Link to upload logo of degree *****/ + Log_PutIconToChangeLogo (Sco_SCOPE_DEG); } /*****************************************************************************/ diff --git a/swad_institution.c b/swad_institution.c index 3bf0e415f..8e099f78a 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -488,28 +488,13 @@ static void Ins_Configuration (bool PrintView) static void Ins_PutIconsToPrintAndUpload (void) { extern const char *Txt_Print; - extern const char *Txt_Change_logo; - extern const char *Txt_Upload_logo; - char Path[PATH_MAX+1]; - bool Exists; /***** Link to print info about institution *****/ Lay_PutContextualLink (ActPrnInsInf,NULL,"print64x64.png",Txt_Print,NULL); if (Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM) - { /***** Link to upload logo of institution *****/ - sprintf (Path,"%s/%s/%02u/%u/logo/%u.png", - Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_INS, - (unsigned) (Gbl.CurrentIns.Ins.InsCod % 100), - (unsigned) Gbl.CurrentIns.Ins.InsCod, - (unsigned) Gbl.CurrentIns.Ins.InsCod); - Exists = Fil_CheckIfPathExists (Path); - Lay_PutContextualLink (ActReqInsLog,NULL,"logo64x64.png", - Exists ? Txt_Change_logo : - Txt_Upload_logo, - NULL); - } + Log_PutIconToChangeLogo (Sco_SCOPE_INS); } /*****************************************************************************/ diff --git a/swad_logo.c b/swad_logo.c index 417b32283..63e8e2fbe 100644 --- a/swad_logo.c +++ b/swad_logo.c @@ -168,11 +168,11 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText, } /*****************************************************************************/ -/*************** Put a link to the action used to request *******************/ -/*************** the logo of institution, centre or degree *******************/ +/************* Put an icon to go to the action used to request ***************/ +/************* the logo of institution, centre or degree ***************/ /*****************************************************************************/ -void Log_PutFormToChangeLogo (Sco_Scope_t Scope) +void Log_PutIconToChangeLogo (Sco_Scope_t Scope) { extern const char *Txt_Change_logo; extern const char *Txt_Upload_logo; @@ -216,8 +216,7 @@ void Log_PutFormToChangeLogo (Sco_Scope_t Scope) Lay_PutContextualLink (Action,NULL,"logo64x64.png", LogoExists ? Txt_Change_logo : Txt_Upload_logo, - LogoExists ? Txt_Change_logo : - Txt_Upload_logo); + NULL); } /*****************************************************************************/ diff --git a/swad_logo.h b/swad_logo.h index 8b4b9bd32..38354c375 100644 --- a/swad_logo.h +++ b/swad_logo.h @@ -41,7 +41,7 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText, unsigned Size,const char *Class,bool PutIconIfNotExists); -void Log_PutFormToChangeLogo (Sco_Scope_t Scope); +void Log_PutIconToChangeLogo (Sco_Scope_t Scope); void Log_RequestLogo (Sco_Scope_t Scope); void Log_ReceiveLogo (Sco_Scope_t Scope); void Log_RemoveLogo (Sco_Scope_t Scope);