mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-18 06:25:42 +02:00
Version 14.74.8
This commit is contained in:
parent
633e51ea3f
commit
6ec1b70761
|
@ -41,11 +41,12 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 14.74.7 (2015/02/08)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 14.74.8 (2015/02/10)"
|
||||
|
||||
// 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 | tail -1
|
||||
/*
|
||||
Version 14.74.8: Feb 10, 2015 Fixed bug in degree logo. (178039 lines)
|
||||
Version 14.74.7: Feb 08, 2015 Link to register/remove several users. (178029 lines)
|
||||
Version 14.74.6: Feb 08, 2015 Changes in layout of form to register/remove one user. (178009 lines)
|
||||
Version 14.74.5: Feb 08, 2015 Changes in layout of form to register/remove users. (178038 lines)
|
||||
|
|
49
swad_logo.c
49
swad_logo.c
|
@ -80,54 +80,62 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
|
|||
const char *Folder = NULL; // To avoid warning
|
||||
char PathLogo[PATH_MAX+1];
|
||||
bool LogoFound = false;
|
||||
long InsCod;
|
||||
long CtrCod;
|
||||
long DegCod;
|
||||
|
||||
/***** Path to logo *****/
|
||||
if (Cod > 0)
|
||||
if (Icon[Scope]) // Scope is correct
|
||||
{
|
||||
if (Cod > 0) // Institution, centre or degree exists
|
||||
{
|
||||
/* Degree */
|
||||
if (Scope == Sco_SCOPE_DEG)
|
||||
{
|
||||
Folder = Cfg_FOLDER_DEG;
|
||||
DegCod = Cod;
|
||||
sprintf (PathLogo,"%s/%s/%02u/%u/logo/%u.png",
|
||||
Cfg_PATH_SWAD_PUBLIC,Folder,
|
||||
(unsigned) (Cod % 100),
|
||||
(unsigned) Cod,
|
||||
(unsigned) Cod);
|
||||
(unsigned) (DegCod % 100),
|
||||
(unsigned) DegCod,
|
||||
(unsigned) DegCod);
|
||||
LogoFound = Fil_CheckIfPathExists (PathLogo);
|
||||
}
|
||||
|
||||
/* Centre */
|
||||
if (!LogoFound || Scope == Sco_SCOPE_CTR)
|
||||
if (!LogoFound && Scope != Sco_SCOPE_INS)
|
||||
{
|
||||
Folder = Cfg_FOLDER_CTR;
|
||||
if (Scope == Sco_SCOPE_DEG)
|
||||
Cod = Deg_GetCtrCodOfDegreeByCod (Cod);
|
||||
if (Scope == Sco_SCOPE_DEG) // && !LogoFound
|
||||
CtrCod = Deg_GetCtrCodOfDegreeByCod (Cod);
|
||||
else
|
||||
CtrCod = Cod;
|
||||
sprintf (PathLogo,"%s/%s/%02u/%u/logo/%u.png",
|
||||
Cfg_PATH_SWAD_PUBLIC,Folder,
|
||||
(unsigned) (Cod % 100),
|
||||
(unsigned) Cod,
|
||||
(unsigned) Cod);
|
||||
(unsigned) (CtrCod % 100),
|
||||
(unsigned) CtrCod,
|
||||
(unsigned) CtrCod);
|
||||
LogoFound = Fil_CheckIfPathExists (PathLogo);
|
||||
}
|
||||
|
||||
/* Institution */
|
||||
if (!LogoFound || Scope == Sco_SCOPE_INS)
|
||||
if (!LogoFound)
|
||||
{
|
||||
Folder = Cfg_FOLDER_INS;
|
||||
if (Scope == Sco_SCOPE_DEG)
|
||||
Cod = Deg_GetInsCodOfDegreeByCod (Cod);
|
||||
else if (Scope == Sco_SCOPE_CTR)
|
||||
Cod = Ctr_GetInsCodOfCentreByCod (Cod);
|
||||
if (Scope == Sco_SCOPE_DEG) // && !LogoFound
|
||||
InsCod = Deg_GetInsCodOfDegreeByCod (Cod);
|
||||
else if (Scope == Sco_SCOPE_CTR) // && !LogoFound
|
||||
InsCod = Ctr_GetInsCodOfCentreByCod (Cod);
|
||||
else
|
||||
InsCod = Cod;
|
||||
sprintf (PathLogo,"%s/%s/%02u/%u/logo/%u.png",
|
||||
Cfg_PATH_SWAD_PUBLIC,Folder,
|
||||
(unsigned) (Cod % 100),
|
||||
(unsigned) Cod,
|
||||
(unsigned) Cod);
|
||||
(unsigned) (InsCod % 100),
|
||||
(unsigned) InsCod,
|
||||
(unsigned) InsCod);
|
||||
LogoFound = Fil_CheckIfPathExists (PathLogo);
|
||||
}
|
||||
}
|
||||
else
|
||||
LogoFound = false;
|
||||
|
||||
if (LogoFound || PutIconIfNotExists)
|
||||
{
|
||||
|
@ -150,6 +158,7 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
|
|||
fprintf (Gbl.F.Out," />");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Put a link to the action used to request *******************/
|
||||
|
|
Loading…
Reference in New Issue
Block a user