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,"