mirror of https://github.com/acanas/swad-core.git
Version18.83
This commit is contained in:
parent
69e82bded5
commit
ae81b75313
10
swad_RSS.c
10
swad_RSS.c
|
@ -66,8 +66,8 @@ void RSS_UpdateRSSFileForACrs (struct Course *Crs)
|
||||||
|
|
||||||
/***** Create RSS directory if not exists *****/
|
/***** Create RSS directory if not exists *****/
|
||||||
snprintf (PathRelPublRSSDir,sizeof (PathRelPublRSSDir),
|
snprintf (PathRelPublRSSDir,sizeof (PathRelPublRSSDir),
|
||||||
"%s/%s/%ld/%s",
|
"%s/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CRS,Crs->CrsCod,Cfg_RSS_FOLDER);
|
Cfg_PATH_CRS_PUBLIC,Crs->CrsCod,Cfg_RSS_FOLDER);
|
||||||
Fil_CreateDirIfNotExists (PathRelPublRSSDir);
|
Fil_CreateDirIfNotExists (PathRelPublRSSDir);
|
||||||
|
|
||||||
/***** Create RSS file *****/
|
/***** Create RSS file *****/
|
||||||
|
@ -101,7 +101,7 @@ void RSS_UpdateRSSFileForACrs (struct Course *Crs)
|
||||||
|
|
||||||
fprintf (FileRSS,"<image>\n");
|
fprintf (FileRSS,"<image>\n");
|
||||||
fprintf (FileRSS,"<url>%s/swad112x32.png</url>\n",
|
fprintf (FileRSS,"<url>%s/swad112x32.png</url>\n",
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
fprintf (FileRSS,"<title>%s: %s</title>\n",
|
fprintf (FileRSS,"<title>%s: %s</title>\n",
|
||||||
Cfg_PLATFORM_SHORT_NAME,Crs->ShrtName);
|
Cfg_PLATFORM_SHORT_NAME,Crs->ShrtName);
|
||||||
fprintf (FileRSS,"<link>%s/?crs=%ld</link>\n",
|
fprintf (FileRSS,"<link>%s/?crs=%ld</link>\n",
|
||||||
|
@ -324,6 +324,6 @@ static void RSS_WriteExamAnnouncements (FILE *FileRSS,struct Course *Crs)
|
||||||
|
|
||||||
void RSS_WriteRSSLink (FILE *FileTgt,long CrsCod)
|
void RSS_WriteRSSLink (FILE *FileTgt,long CrsCod)
|
||||||
{
|
{
|
||||||
fprintf (FileTgt,"%s/%s/%ld/%s/%s",
|
fprintf (FileTgt,"%s/%ld/%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_CRS,CrsCod,Cfg_RSS_FOLDER,Cfg_RSS_FILE);
|
Cfg_URL_CRS_PUBLIC,CrsCod,Cfg_RSS_FOLDER,Cfg_RSS_FILE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,14 +411,14 @@ static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Tx
|
||||||
"</a>"
|
"</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
IdAlert,
|
IdAlert,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Close,Txt_Close);
|
Txt_Close,Txt_Close);
|
||||||
|
|
||||||
/***** Write message *****/
|
/***** Write message *****/
|
||||||
fprintf (Gbl.F.Out,"<div class=\"ALERT_TXT\"");
|
fprintf (Gbl.F.Out,"<div class=\"ALERT_TXT\"");
|
||||||
if (AlertType != Ale_NONE)
|
if (AlertType != Ale_NONE)
|
||||||
fprintf (Gbl.F.Out," style=\"background-image:url('%s/%s');\"",
|
fprintf (Gbl.F.Out," style=\"background-image:url('%s/%s');\"",
|
||||||
Gbl.Prefs.URLIcons,Ale_AlertIcons[AlertType]);
|
Cfg_URL_ICON_PUBLIC,Ale_AlertIcons[AlertType]);
|
||||||
fprintf (Gbl.F.Out,">%s"
|
fprintf (Gbl.F.Out,">%s"
|
||||||
"</div>",
|
"</div>",
|
||||||
Txt);
|
Txt);
|
||||||
|
|
|
@ -146,14 +146,14 @@ static void Ban_WriteListOfBanners (void)
|
||||||
/* Write data of this banner */
|
/* Write data of this banner */
|
||||||
fprintf (Gbl.F.Out,"<li>"
|
fprintf (Gbl.F.Out,"<li>"
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">"
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">"
|
||||||
"<img src=\"%s/%s/%s\""
|
"<img src=\"%s/%s\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"BANNER\" />"
|
" class=\"BANNER\" />"
|
||||||
"</a>"
|
"</a>"
|
||||||
"</li>",
|
"</li>",
|
||||||
Gbl.Banners.Lst[NumBan].WWW,
|
Gbl.Banners.Lst[NumBan].WWW,
|
||||||
Gbl.Banners.Lst[NumBan].FullName,
|
Gbl.Banners.Lst[NumBan].FullName,
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_BANNER,
|
Cfg_URL_BANNER_PUBLIC,
|
||||||
Gbl.Banners.Lst[NumBan].Img,
|
Gbl.Banners.Lst[NumBan].Img,
|
||||||
Gbl.Banners.Lst[NumBan].ShrtName,
|
Gbl.Banners.Lst[NumBan].ShrtName,
|
||||||
Gbl.Banners.Lst[NumBan].FullName);
|
Gbl.Banners.Lst[NumBan].FullName);
|
||||||
|
@ -998,11 +998,11 @@ void Ban_WriteMenuWithBanners (void)
|
||||||
Ban_PutParamBanCod (Gbl.Banners.Lst[NumBan].BanCod);
|
Ban_PutParamBanCod (Gbl.Banners.Lst[NumBan].BanCod);
|
||||||
Par_PutHiddenParamString ("URL",Gbl.Banners.Lst[NumBan].WWW);
|
Par_PutHiddenParamString ("URL",Gbl.Banners.Lst[NumBan].WWW);
|
||||||
Frm_LinkFormSubmit (Gbl.Banners.Lst[NumBan].FullName,"BANNER",NULL);
|
Frm_LinkFormSubmit (Gbl.Banners.Lst[NumBan].FullName,"BANNER",NULL);
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/%s\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"BANNER\" />"
|
" class=\"BANNER\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_BANNER,
|
Cfg_URL_BANNER_PUBLIC,
|
||||||
Gbl.Banners.Lst[NumBan].Img,
|
Gbl.Banners.Lst[NumBan].Img,
|
||||||
Gbl.Banners.Lst[NumBan].ShrtName,
|
Gbl.Banners.Lst[NumBan].ShrtName,
|
||||||
Gbl.Banners.Lst[NumBan].FullName);
|
Gbl.Banners.Lst[NumBan].FullName);
|
||||||
|
|
|
@ -312,8 +312,8 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
{
|
{
|
||||||
/***** Path to photo *****/
|
/***** Path to photo *****/
|
||||||
snprintf (PathPhoto,sizeof (PathPhoto),
|
snprintf (PathPhoto,sizeof (PathPhoto),
|
||||||
"%s/%s/%02u/%u/%u.jpg",
|
"%s/%02u/%u/%u.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
|
Cfg_PATH_CTR_PUBLIC,
|
||||||
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
|
@ -352,10 +352,10 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
if (PutLink)
|
if (PutLink)
|
||||||
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"DAT_N\">",
|
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"DAT_N\">",
|
||||||
Gbl.CurrentCtr.Ctr.WWW);
|
Gbl.CurrentCtr.Ctr.WWW);
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%02u/%u/%u.jpg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/%02u/%u/%u.jpg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"%s\" />",
|
" class=\"%s\" />",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_CTR,
|
Cfg_URL_CTR_PUBLIC,
|
||||||
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
|
@ -717,8 +717,8 @@ static void Ctr_PutIconToChangePhoto (void)
|
||||||
|
|
||||||
/***** Link to upload photo of centre *****/
|
/***** Link to upload photo of centre *****/
|
||||||
snprintf (PathPhoto,sizeof (PathPhoto),
|
snprintf (PathPhoto,sizeof (PathPhoto),
|
||||||
"%s/%s/%02u/%u/%u.jpg",
|
"%s/%02u/%u/%u.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
|
Cfg_PATH_CTR_PUBLIC,
|
||||||
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
|
@ -1781,8 +1781,8 @@ void Ctr_RemoveCentre (void)
|
||||||
|
|
||||||
/***** Remove directories of the centre *****/
|
/***** Remove directories of the centre *****/
|
||||||
snprintf (PathCtr,sizeof (PathCtr),
|
snprintf (PathCtr,sizeof (PathCtr),
|
||||||
"%s/%s/%02u/%u",
|
"%s/%02u/%u",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
|
Cfg_PATH_CTR_PUBLIC,
|
||||||
(unsigned) (Ctr.CtrCod % 100),
|
(unsigned) (Ctr.CtrCod % 100),
|
||||||
(unsigned) Ctr.CtrCod);
|
(unsigned) Ctr.CtrCod);
|
||||||
Fil_RemoveTree (PathCtr);
|
Fil_RemoveTree (PathCtr);
|
||||||
|
@ -2335,8 +2335,6 @@ void Ctr_ReceivePhoto (void)
|
||||||
char *PtrExtension;
|
char *PtrExtension;
|
||||||
size_t LengthExtension;
|
size_t LengthExtension;
|
||||||
char MIMEType[Brw_MAX_BYTES_MIME_TYPE + 1];
|
char MIMEType[Brw_MAX_BYTES_MIME_TYPE + 1];
|
||||||
char PathImgPriv[PATH_MAX + 1];
|
|
||||||
char PathImgPrivTmp[PATH_MAX + 1];
|
|
||||||
char PathFileImgTmp[PATH_MAX + 1]; // Full name (including path and .jpg) of the destination temporary file
|
char PathFileImgTmp[PATH_MAX + 1]; // Full name (including path and .jpg) of the destination temporary file
|
||||||
char PathFileImg[PATH_MAX + 1]; // Full name (including path and .jpg) of the destination file
|
char PathFileImg[PATH_MAX + 1]; // Full name (including path and .jpg) of the destination file
|
||||||
bool WrongType = false;
|
bool WrongType = false;
|
||||||
|
@ -2362,16 +2360,10 @@ void Ctr_ReceivePhoto (void)
|
||||||
|
|
||||||
/***** Create private directories if not exist *****/
|
/***** Create private directories if not exist *****/
|
||||||
/* Create private directory for images if it does not exist */
|
/* Create private directory for images if it does not exist */
|
||||||
snprintf (PathImgPriv,sizeof (PathImgPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_MEDIA_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_MEDIA);
|
|
||||||
Fil_CreateDirIfNotExists (PathImgPriv);
|
|
||||||
|
|
||||||
/* Create temporary private directory for images if it does not exist */
|
/* Create temporary private directory for images if it does not exist */
|
||||||
snprintf (PathImgPrivTmp,sizeof (PathImgPrivTmp),
|
Fil_CreateDirIfNotExists (Cfg_PATH_MEDIA_TMP_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
PathImgPriv,Cfg_FOLDER_IMG_TMP);
|
|
||||||
Fil_CreateDirIfNotExists (PathImgPrivTmp);
|
|
||||||
|
|
||||||
/* Get filename extension */
|
/* Get filename extension */
|
||||||
if ((PtrExtension = strrchr (FileNameImgSrc,(int) '.')) == NULL)
|
if ((PtrExtension = strrchr (FileNameImgSrc,(int) '.')) == NULL)
|
||||||
|
@ -2390,7 +2382,7 @@ void Ctr_ReceivePhoto (void)
|
||||||
/* End the reception of image in a temporary file */
|
/* End the reception of image in a temporary file */
|
||||||
snprintf (PathFileImgTmp,sizeof (PathFileImgTmp),
|
snprintf (PathFileImgTmp,sizeof (PathFileImgTmp),
|
||||||
"%s/%s.%s",
|
"%s/%s.%s",
|
||||||
PathImgPrivTmp,Gbl.UniqueNameEncrypted,PtrExtension);
|
Cfg_PATH_MEDIA_TMP_PRIVATE,Gbl.UniqueNameEncrypted,PtrExtension);
|
||||||
if (!Fil_EndReceptionOfFile (PathFileImgTmp,Param))
|
if (!Fil_EndReceptionOfFile (PathFileImgTmp,Param))
|
||||||
{
|
{
|
||||||
Ale_ShowAlert (Ale_WARNING,"Error copying file.");
|
Ale_ShowAlert (Ale_WARNING,"Error copying file.");
|
||||||
|
@ -2398,26 +2390,23 @@ void Ctr_ReceivePhoto (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Creates public directories if not exist *****/
|
/***** Creates public directories if not exist *****/
|
||||||
|
Fil_CreateDirIfNotExists (Cfg_PATH_CTR_PUBLIC);
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (Path,sizeof (Path),
|
||||||
"%s/%s",
|
"%s/%02u",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR);
|
Cfg_PATH_CTR_PUBLIC,
|
||||||
Fil_CreateDirIfNotExists (Path);
|
|
||||||
snprintf (Path,sizeof (Path),
|
|
||||||
"%s/%s/%02u",
|
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
|
|
||||||
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100));
|
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100));
|
||||||
Fil_CreateDirIfNotExists (Path);
|
Fil_CreateDirIfNotExists (Path);
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (Path,sizeof (Path),
|
||||||
"%s/%s/%02u/%u",
|
"%s/%02u/%u",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
|
Cfg_PATH_CTR_PUBLIC,
|
||||||
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
Fil_CreateDirIfNotExists (Path);
|
Fil_CreateDirIfNotExists (Path);
|
||||||
|
|
||||||
/***** Convert temporary file to public JPEG file *****/
|
/***** Convert temporary file to public JPEG file *****/
|
||||||
snprintf (PathFileImg,sizeof (PathFileImg),
|
snprintf (PathFileImg,sizeof (PathFileImg),
|
||||||
"%s/%s/%02u/%u/%u.jpg",
|
"%s/%02u/%u/%u.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
|
Cfg_PATH_CTR_PUBLIC,
|
||||||
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
|
|
|
@ -438,6 +438,8 @@ Lo de mutear anuncios, en principio prefiero hacer una opci
|
||||||
|
|
||||||
// TODO: Allow timeline posting only for users belonging to courses or admins to avoid user who create accounts only to post
|
// TODO: Allow timeline posting only for users belonging to courses or admins to avoid user who create accounts only to post
|
||||||
|
|
||||||
|
// TODO: Ver cómo recibir un fichero desde el cliente (SWADroid) en gsoap
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -457,10 +459,13 @@ En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 18.82 (2019-03-19)"
|
#define Log_PLATFORM_VERSION "SWAD 18.83 (2019-03-19)"
|
||||||
#define CSS_FILE "swad18.80.css"
|
#define CSS_FILE "swad18.80.css"
|
||||||
#define JS_FILE "swad18.80.js"
|
#define JS_FILE "swad18.80.js"
|
||||||
/*
|
/*
|
||||||
|
Version 18.83: Mar 19, 2019 Important optimization on removing of temporary files to increase speed.
|
||||||
|
Code refactoring related to paths and URL.
|
||||||
|
Fixing in CSS to hide overflow in timeline. (240536 lines)
|
||||||
Version 18.82: Mar 19, 2019 User preferences are retrieved from database only when they are needed. (240630 lines)
|
Version 18.82: Mar 19, 2019 User preferences are retrieved from database only when they are needed. (240630 lines)
|
||||||
Version 18.81.5: Mar 19, 2019 Code refactoring related to media. (240594 lines)
|
Version 18.81.5: Mar 19, 2019 Code refactoring related to media. (240594 lines)
|
||||||
Version 18.81.4: Mar 19, 2019 Code refactoring related to media. (240586 lines)
|
Version 18.81.4: Mar 19, 2019 Code refactoring related to media. (240586 lines)
|
||||||
|
|
18
swad_chat.c
18
swad_chat.c
|
@ -134,7 +134,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
" %s"
|
" %s"
|
||||||
"</li>",
|
"</li>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Chat_rooms,
|
Txt_Chat_rooms,
|
||||||
Txt_Chat_rooms,
|
Txt_Chat_rooms,
|
||||||
Txt_Chat_rooms);
|
Txt_Chat_rooms);
|
||||||
|
@ -149,7 +149,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
ThisRoomFullName,
|
ThisRoomFullName,
|
||||||
ThisRoomFullName);
|
ThisRoomFullName);
|
||||||
Cht_WriteLinkToChat2 ("GBL_USR",ThisRoomFullName);
|
Cht_WriteLinkToChat2 ("GBL_USR",ThisRoomFullName);
|
||||||
|
@ -165,7 +165,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
ThisRoomFullName,ThisRoomFullName);
|
ThisRoomFullName,ThisRoomFullName);
|
||||||
Cht_WriteLinkToChat2 ("GBL_STD",ThisRoomFullName);
|
Cht_WriteLinkToChat2 ("GBL_STD",ThisRoomFullName);
|
||||||
break;
|
break;
|
||||||
|
@ -178,7 +178,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
ThisRoomFullName,ThisRoomFullName);
|
ThisRoomFullName,ThisRoomFullName);
|
||||||
Cht_WriteLinkToChat2 ("GBL_TCH",ThisRoomFullName);
|
Cht_WriteLinkToChat2 ("GBL_TCH",ThisRoomFullName);
|
||||||
break;
|
break;
|
||||||
|
@ -241,7 +241,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/list-ol.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/list-ol.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
ThisRoomFullName,ThisRoomFullName);
|
ThisRoomFullName,ThisRoomFullName);
|
||||||
Cht_WriteLinkToChat2 (ThisRoomCode,ThisRoomFullName);
|
Cht_WriteLinkToChat2 (ThisRoomCode,ThisRoomFullName);
|
||||||
}
|
}
|
||||||
|
@ -624,10 +624,10 @@ void Cht_OpenChatWindow (void)
|
||||||
fprintf (Gbl.F.Out,"\n<param name=\"server_name\" value=\"%s\">",
|
fprintf (Gbl.F.Out,"\n<param name=\"server_name\" value=\"%s\">",
|
||||||
Cfg_PLATFORM_SERVER);
|
Cfg_PLATFORM_SERVER);
|
||||||
fprintf (Gbl.F.Out,"\n<param name=\"port\" value=\"5000\">");
|
fprintf (Gbl.F.Out,"\n<param name=\"port\" value=\"5000\">");
|
||||||
fprintf (Gbl.F.Out,"\n<param name=\"image_bl\" value=\"%s/%s/usr_bl.jpg\">",
|
fprintf (Gbl.F.Out,"\n<param name=\"image_bl\" value=\"%s/usr_bl.jpg\">",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PUBLIC_ICON);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
fprintf (Gbl.F.Out,"\n<param name=\"image_url\" value=\"%s/%s/%s.jpg\">",
|
fprintf (Gbl.F.Out,"\n<param name=\"image_url\" value=\"%s/%s.jpg\">",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,Gbl.Usrs.Me.UsrDat.Photo);
|
Cfg_URL_PHOTO_PUBLIC,Gbl.Usrs.Me.UsrDat.Photo);
|
||||||
fprintf (Gbl.F.Out,"\n<param name=\"channel_name\" value=\"%s\">",
|
fprintf (Gbl.F.Out,"\n<param name=\"channel_name\" value=\"%s\">",
|
||||||
ListRoomCodes);
|
ListRoomCodes);
|
||||||
fprintf (Gbl.F.Out,"\n<param name=\"tab\" value=\"%s\">",
|
fprintf (Gbl.F.Out,"\n<param name=\"tab\" value=\"%s\">",
|
||||||
|
|
|
@ -326,69 +326,108 @@
|
||||||
|
|
||||||
/* Folders for institutions, inside public and private swad directories */
|
/* Folders for institutions, inside public and private swad directories */
|
||||||
#define Cfg_FOLDER_INS "ins" // If not exists, it should be created during installation inside swad private and public directory!
|
#define Cfg_FOLDER_INS "ins" // If not exists, it should be created during installation inside swad private and public directory!
|
||||||
|
#define Cfg_PATH_INS_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_INS
|
||||||
|
#define Cfg_PATH_INS_PUBLIC Cfg_PATH_SWAD_PUBLIC "/" Cfg_FOLDER_INS
|
||||||
|
|
||||||
/* Folders for centres, inside public and private swad directories */
|
/* Folders for centres, inside public and private swad directories */
|
||||||
#define Cfg_FOLDER_CTR "ctr" // If not exists, it should be created during installation inside swad private and public directory!
|
#define Cfg_FOLDER_CTR "ctr" // If not exists, it should be created during installation inside swad private and public directory!
|
||||||
|
#define Cfg_PATH_CTR_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_CTR
|
||||||
|
#define Cfg_PATH_CTR_PUBLIC Cfg_PATH_SWAD_PUBLIC "/" Cfg_FOLDER_CTR
|
||||||
|
#define Cfg_URL_CTR_PUBLIC Cfg_URL_SWAD_PUBLIC "/" Cfg_FOLDER_CTR
|
||||||
|
|
||||||
/* Folders for centres, inside public and private swad directories */
|
/* Folders for centres, inside public and private swad directories */
|
||||||
#define Cfg_FOLDER_DEG "deg" // If not exists, it should be created during installation inside swad private and public directory!
|
#define Cfg_FOLDER_DEG "deg" // If not exists, it should be created during installation inside swad private and public directory!
|
||||||
|
#define Cfg_PATH_DEG_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_DEG
|
||||||
|
#define Cfg_PATH_DEG_PUBLIC Cfg_PATH_SWAD_PUBLIC "/" Cfg_FOLDER_DEG
|
||||||
|
|
||||||
/* Folders for courses, inside public and private swad directories */
|
/* Folders for courses, inside public and private swad directories */
|
||||||
#define Cfg_FOLDER_CRS "crs" // If not exists, it should be created during installation inside swad private and public directory!
|
#define Cfg_FOLDER_CRS "crs" // If not exists, it should be created during installation inside swad private and public directory!
|
||||||
|
#define Cfg_PATH_CRS_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_CRS
|
||||||
|
#define Cfg_PATH_CRS_PUBLIC Cfg_PATH_SWAD_PUBLIC "/" Cfg_FOLDER_CRS
|
||||||
|
#define Cfg_URL_CRS_PUBLIC Cfg_URL_SWAD_PUBLIC "/" Cfg_FOLDER_CRS
|
||||||
|
|
||||||
/* Folders for groups, inside public and private swad directories */
|
/* Folders for groups, inside public and private swad directories */
|
||||||
#define Cfg_FOLDER_GRP "grp" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_GRP "grp" // Created automatically the first time it is accessed
|
||||||
|
|
||||||
/* Folder for users, inside private swad directory */
|
/* Folder for users, inside private swad directory */
|
||||||
#define Cfg_FOLDER_USR "usr" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_USR "usr" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_USR_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_USR
|
||||||
|
|
||||||
/* Folders for projects, inside public and private swad directories */
|
/* Folders for projects, inside public and private swad directories */
|
||||||
#define Cfg_FOLDER_PRJ "prj" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_PRJ "prj" // Created automatically the first time it is accessed
|
||||||
|
|
||||||
/* Folder for temporary HTML output of this CGI, inside private swad directory */
|
/* Folder for temporary HTML output of this CGI, inside private swad directory */
|
||||||
#define Cfg_FOLDER_OUT "out" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_OUT "out" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_OUT_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_OUT
|
||||||
|
|
||||||
/* Folder for temporary public links to file zones, used when displaying file browsers, inside public swad directory */
|
/* Folder for temporary public links to file zones, used when displaying file browsers, inside public swad directory */
|
||||||
#define Cfg_FOLDER_FILE_BROWSER_TMP "tmp" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_FILE_BROWSER_TMP "tmp" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_FILE_BROWSER_TMP_PUBLIC Cfg_PATH_SWAD_PUBLIC "/" Cfg_FOLDER_FILE_BROWSER_TMP
|
||||||
|
#define Cfg_URL_FILE_BROWSER_TMP_PUBLIC Cfg_URL_SWAD_PUBLIC "/" Cfg_FOLDER_FILE_BROWSER_TMP
|
||||||
|
|
||||||
/* Folder where temporary files are created for students' marks, inside private swad directory */
|
/* Folder where temporary files are created for students' marks, inside private swad directory */
|
||||||
#define Cfg_FOLDER_MARK "mark" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_MARK "mark" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_MARK_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_MARK
|
||||||
/* Folder where temporary files are created for passing parameters to commands, inside private swad directory */
|
|
||||||
#define Cfg_FOLDER_PARAM "param" // Created automatically the first time it is accessed
|
|
||||||
|
|
||||||
/* Folder for temporary XML files received to import test questions, inside private swad directory */
|
/* Folder for temporary XML files received to import test questions, inside private swad directory */
|
||||||
#define Cfg_FOLDER_TEST "test" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_TEST "test" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_TEST_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_TEST
|
||||||
|
|
||||||
/* Folder for compression of assignments and works into a zip files, inside private swad directory */
|
/* Folder for compression of assignments and works into a zip files, inside private swad directory */
|
||||||
#define Cfg_FOLDER_ZIP "zip" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_ZIP "zip" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_ZIP_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_ZIP
|
||||||
|
|
||||||
/* Folders for images/videos inside public and private swad directories */
|
/* Folders for images/videos inside public and private swad directories */
|
||||||
#define Cfg_FOLDER_MEDIA "med" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_MEDIA "med" // Created automatically the first time it is accessed
|
||||||
/* Folders for temporary users' photos inside photos directories */
|
#define Cfg_PATH_MEDIA_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_MEDIA
|
||||||
#define Cfg_FOLDER_IMG_TMP "tmp" // Created automatically the first time it is accessed
|
/* Folders for temporary images/videos inside media directories */
|
||||||
|
#define Cfg_FOLDER_MEDIA_TMP "tmp" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_MEDIA_TMP_PRIVATE Cfg_PATH_MEDIA_PRIVATE "/" Cfg_FOLDER_MEDIA_TMP
|
||||||
|
|
||||||
/* Folders for users' photos inside public and private swad directories */
|
/* Folders for users' photos inside public and private swad directories */
|
||||||
#define Cfg_FOLDER_PHOTO "photo" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_PHOTO "photo" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_PHOTO_PRIVATE Cfg_PATH_SWAD_PRIVATE "/" Cfg_FOLDER_PHOTO
|
||||||
|
#define Cfg_PATH_PHOTO_PUBLIC Cfg_PATH_SWAD_PUBLIC "/" Cfg_FOLDER_PHOTO
|
||||||
|
#define Cfg_URL_PHOTO_PUBLIC Cfg_URL_SWAD_PUBLIC "/" Cfg_FOLDER_PHOTO
|
||||||
/* Folders for temporary users' photos inside photos directories */
|
/* Folders for temporary users' photos inside photos directories */
|
||||||
#define Cfg_FOLDER_PHOTO_TMP "tmp" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_PHOTO_TMP "tmp" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_PHOTO_TMP_PRIVATE Cfg_PATH_PHOTO_PRIVATE "/" Cfg_FOLDER_PHOTO_TMP
|
||||||
|
#define Cfg_PATH_PHOTO_TMP_PUBLIC Cfg_PATH_PHOTO_PUBLIC "/" Cfg_FOLDER_PHOTO_TMP
|
||||||
|
#define Cfg_URL_PHOTO_TMP_PUBLIC Cfg_URL_PHOTO_PUBLIC "/" Cfg_FOLDER_PHOTO_TMP
|
||||||
|
|
||||||
/* Folder for reports, inside public swad directory */
|
/* Folder for reports, inside public swad directory */
|
||||||
#define Cfg_FOLDER_REP "rep" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_REP "rep" // Created automatically the first time it is accessed
|
||||||
|
#define Cfg_PATH_REP_PUBLIC Cfg_PATH_SWAD_PUBLIC "/" Cfg_FOLDER_REP
|
||||||
|
#define Cfg_URL_REP_PUBLIC Cfg_URL_SWAD_PUBLIC "/" Cfg_FOLDER_REP
|
||||||
|
|
||||||
/* Folder for banners, inside public swad directory */
|
/* Folder for banners, inside public swad directory */
|
||||||
#define Cfg_FOLDER_BANNER "banner" // If not exists, it should be created during installation inside swad public directory!
|
#define Cfg_FOLDER_BANNER "banner" // If not exists, it should be created during installation inside swad public directory!
|
||||||
|
#define Cfg_URL_BANNER_PUBLIC Cfg_URL_SWAD_PUBLIC "/" Cfg_FOLDER_BANNER
|
||||||
|
|
||||||
#define Cfg_FOLDER_DEGREE_PHOTO_MEDIAN "mdn_all"
|
#define Cfg_FOLDER_DEGREE_PHOTO_MEDIAN "mdn_all"
|
||||||
#define Cfg_FOLDER_DEGREE_PHOTO_AVERAGE "avg_all"
|
#define Cfg_FOLDER_DEGREE_PHOTO_AVERAGE "avg_all"
|
||||||
|
|
||||||
/* Folders with icons. They should be created with icons during installation */
|
/* Folders with icons. They should be created with icons during installation */
|
||||||
#define Cfg_FOLDER_PUBLIC_ICON "icon"
|
#define Cfg_FOLDER_PUBLIC_ICON "icon"
|
||||||
|
#define Cfg_PATH_ICON_PUBLIC Cfg_PATH_SWAD_PUBLIC "/" Cfg_FOLDER_PUBLIC_ICON
|
||||||
|
#define Cfg_URL_ICON_PUBLIC Cfg_URL_SWAD_PUBLIC "/" Cfg_FOLDER_PUBLIC_ICON
|
||||||
|
|
||||||
#define Cfg_ICON_FOLDER_THEMES "theme" // Directory with all the images for each theme
|
#define Cfg_ICON_FOLDER_THEMES "theme" // Directory with all the images for each theme
|
||||||
#define Cfg_ICON_FOLDER_ICON_SETS "iconset" // Directory with all the icons for each icon set
|
#define Cfg_URL_ICON_THEMES_PUBLIC Cfg_URL_ICON_PUBLIC "/" Cfg_ICON_FOLDER_THEMES
|
||||||
|
|
||||||
|
#define Cfg_ICON_FOLDER_SETS "iconset" // Directory with all the icons for each icon set
|
||||||
|
#define Cfg_PATH_ICON_SETS_PUBLIC Cfg_PATH_ICON_PUBLIC "/" Cfg_ICON_FOLDER_SETS
|
||||||
|
#define Cfg_URL_ICON_SETS_PUBLIC Cfg_URL_ICON_PUBLIC "/" Cfg_ICON_FOLDER_SETS
|
||||||
|
|
||||||
#define Cfg_ICON_FOLDER_COUNTRIES "country" // Directory with icons for countries
|
#define Cfg_ICON_FOLDER_COUNTRIES "country" // Directory with icons for countries
|
||||||
|
#define Cfg_PATH_ICON_COUNTRIES_PUBLIC Cfg_PATH_ICON_PUBLIC "/" Cfg_ICON_FOLDER_COUNTRIES
|
||||||
|
#define Cfg_URL_ICON_COUNTRIES_PUBLIC Cfg_URL_ICON_PUBLIC "/" Cfg_ICON_FOLDER_COUNTRIES
|
||||||
|
|
||||||
#define Cfg_ICON_FOLDER_FILEXT "filext" // Directory with icons for file extensions
|
#define Cfg_ICON_FOLDER_FILEXT "filext" // Directory with icons for file extensions
|
||||||
|
#define CfG_URL_ICON_FILEXT_PUBLIC Cfg_URL_ICON_PUBLIC "/" Cfg_ICON_FOLDER_FILEXT
|
||||||
|
|
||||||
#define Cfg_ICON_FOLDER_PLUGINS "plugin" // Directory with icons for plugins
|
#define Cfg_ICON_FOLDER_PLUGINS "plugin" // Directory with icons for plugins
|
||||||
|
#define Cfg_URL_ICON_PLUGINS_PUBLIC Cfg_URL_ICON_PUBLIC "/" Cfg_ICON_FOLDER_PLUGINS
|
||||||
|
|
||||||
/* Folders and file used to store syllabus */
|
/* Folders and file used to store syllabus */
|
||||||
#define Cfg_SYLLABUS_FOLDER_LECTURES "lec"
|
#define Cfg_SYLLABUS_FOLDER_LECTURES "lec"
|
||||||
|
@ -413,6 +452,7 @@
|
||||||
/* Data protection policy folder
|
/* Data protection policy folder
|
||||||
This folder, and an index.html file inside it, must be created during installation */
|
This folder, and an index.html file inside it, must be created during installation */
|
||||||
#define Cfg_DATA_PROTECTION_FOLDER "data_protection"
|
#define Cfg_DATA_PROTECTION_FOLDER "data_protection"
|
||||||
|
#define Cfg_URL_DATA_PROTECTION_PUBLIC Cfg_URL_SWAD_PUBLIC "/" Cfg_DATA_PROTECTION_FOLDER
|
||||||
|
|
||||||
/* HTML file weitten at foot of page */
|
/* HTML file weitten at foot of page */
|
||||||
#define Cfg_PATH_AND_FILE_REL_HTML_PRIVATE "./foot.html"
|
#define Cfg_PATH_AND_FILE_REL_HTML_PRIVATE "./foot.html"
|
||||||
|
@ -476,7 +516,7 @@
|
||||||
|
|
||||||
#define Cfg_TIME_TO_DELETE_PARAMS_TO_COMMANDS ((time_t)( 15UL * 60UL)) // Temporary files with params to commands are deleted after these seconds
|
#define Cfg_TIME_TO_DELETE_PARAMS_TO_COMMANDS ((time_t)( 15UL * 60UL)) // Temporary files with params to commands are deleted after these seconds
|
||||||
|
|
||||||
#define Cfg_TIME_TO_DELETE_IMAGES_TMP_FILES ((time_t)( 2UL * 60UL * 60UL)) // Temporary files related to images after these seconds
|
#define Cfg_TIME_TO_DELETE_MEDIA_TMP_FILES ((time_t)( 2UL * 60UL * 60UL)) // Temporary files related to images after these seconds
|
||||||
#define Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES ((time_t)( 2UL * 60UL * 60UL)) // Temporary files related to photos after these seconds
|
#define Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES ((time_t)( 2UL * 60UL * 60UL)) // Temporary files related to photos after these seconds
|
||||||
|
|
||||||
#define Cfg_TIME_TO_DELETE_TEST_TMP_FILES ((time_t)( 2UL * 60UL * 60UL)) // Temporary files related to imported test questions after these seconds
|
#define Cfg_TIME_TO_DELETE_TEST_TMP_FILES ((time_t)( 2UL * 60UL * 60UL)) // Temporary files related to imported test questions after these seconds
|
||||||
|
|
|
@ -414,7 +414,7 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Ro
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/ellipsis-h.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/ellipsis-h.svg\""
|
||||||
" alt=\"%s\" title=\"%s\" class=\"ICO40x40\" />"
|
" alt=\"%s\" title=\"%s\" class=\"ICO40x40\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Connected_users,Txt_Connected_users);
|
Txt_Connected_users,Txt_Connected_users);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
|
|
@ -841,13 +841,13 @@ void Cty_DrawCountryMap (struct Country *Cty,const char *Class)
|
||||||
/***** Draw country map *****/
|
/***** Draw country map *****/
|
||||||
fprintf (Gbl.F.Out,"<img src=\"");
|
fprintf (Gbl.F.Out,"<img src=\"");
|
||||||
if (Cty_CheckIfCountryMapExists (Cty))
|
if (Cty_CheckIfCountryMapExists (Cty))
|
||||||
fprintf (Gbl.F.Out,"%s/%s/%s/%s.png",
|
fprintf (Gbl.F.Out,"%s/%s/%s.png",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_COUNTRIES,
|
Cfg_URL_ICON_COUNTRIES_PUBLIC,
|
||||||
Cty->Alpha2,
|
Cty->Alpha2,
|
||||||
Cty->Alpha2);
|
Cty->Alpha2);
|
||||||
else
|
else
|
||||||
fprintf (Gbl.F.Out,"%s/tr16x16.gif", // TODO: Change for a 1x1 image or a generic image
|
fprintf (Gbl.F.Out,"%s/tr16x16.gif", // TODO: Change for a 1x1 image or a generic image
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
fprintf (Gbl.F.Out,"\" alt=\"%s\" title=\"%s\" class=\"%s\" />",
|
fprintf (Gbl.F.Out,"\" alt=\"%s\" title=\"%s\" class=\"%s\" />",
|
||||||
Cty->Alpha2,
|
Cty->Alpha2,
|
||||||
Cty->Name[Gbl.Prefs.Language],
|
Cty->Name[Gbl.Prefs.Language],
|
||||||
|
@ -863,10 +863,8 @@ bool Cty_CheckIfCountryMapExists (struct Country *Cty)
|
||||||
char PathMap[PATH_MAX + 1];
|
char PathMap[PATH_MAX + 1];
|
||||||
|
|
||||||
snprintf (PathMap,sizeof (PathMap),
|
snprintf (PathMap,sizeof (PathMap),
|
||||||
"%s/%s/%s/%s/%s.png",
|
"%s/%s/%s.png",
|
||||||
Cfg_PATH_SWAD_PUBLIC,
|
Cfg_PATH_ICON_COUNTRIES_PUBLIC,
|
||||||
Cfg_FOLDER_PUBLIC_ICON,
|
|
||||||
Cfg_ICON_FOLDER_COUNTRIES,
|
|
||||||
Cty->Alpha2,
|
Cty->Alpha2,
|
||||||
Cty->Alpha2);
|
Cty->Alpha2);
|
||||||
return Fil_CheckIfPathExists (PathMap);
|
return Fil_CheckIfPathExists (PathMap);
|
||||||
|
|
|
@ -461,7 +461,7 @@ static void Crs_Configuration (bool PrintView)
|
||||||
"<img src=\"%s/%s\" alt=\"%s\""
|
"<img src=\"%s/%s\" alt=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
(Indicators.NumIndicators == Ind_NUM_INDICATORS) ? "check-circle.svg" :
|
(Indicators.NumIndicators == Ind_NUM_INDICATORS) ? "check-circle.svg" :
|
||||||
"exclamation-triangle.svg",
|
"exclamation-triangle.svg",
|
||||||
Gbl.Title);
|
Gbl.Title);
|
||||||
|
@ -572,7 +572,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/sitemap.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/sitemap.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" /> %s</a>",
|
" class=\"ICO16x16\" /> %s</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_System,
|
Txt_System,
|
||||||
Txt_System,
|
Txt_System,
|
||||||
Txt_System);
|
Txt_System);
|
||||||
|
@ -607,10 +607,10 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Highlight ? ClassHighlight :
|
Highlight ? ClassHighlight :
|
||||||
ClassNormal,NULL);
|
ClassNormal,NULL);
|
||||||
/* Country map */
|
/* Country map */
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s/%s.png\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s.png\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" /> %s</a>",
|
" class=\"ICO16x16\" /> %s</a>",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_COUNTRIES,
|
Cfg_URL_ICON_COUNTRIES_PUBLIC,
|
||||||
Cty.Alpha2,
|
Cty.Alpha2,
|
||||||
Cty.Alpha2,
|
Cty.Alpha2,
|
||||||
Cty.Alpha2,
|
Cty.Alpha2,
|
||||||
|
@ -753,7 +753,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
" %s"
|
" %s"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Crs.ShrtName,
|
Crs.ShrtName,
|
||||||
Crs.FullName,
|
Crs.FullName,
|
||||||
Crs.FullName);
|
Crs.FullName);
|
||||||
|
@ -2289,12 +2289,12 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
|
||||||
|
|
||||||
/***** Remove directories of the course *****/
|
/***** Remove directories of the course *****/
|
||||||
snprintf (PathRelCrs,sizeof (PathRelCrs),
|
snprintf (PathRelCrs,sizeof (PathRelCrs),
|
||||||
"%s/%s/%ld",
|
"%s/%ld",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod);
|
Cfg_PATH_CRS_PRIVATE,CrsCod);
|
||||||
Fil_RemoveTree (PathRelCrs);
|
Fil_RemoveTree (PathRelCrs);
|
||||||
snprintf (PathRelCrs,sizeof (PathRelCrs),
|
snprintf (PathRelCrs,sizeof (PathRelCrs),
|
||||||
"%s/%s/%ld",
|
"%s/%ld",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CRS,CrsCod);
|
Cfg_PATH_CRS_PUBLIC,CrsCod);
|
||||||
Fil_RemoveTree (PathRelCrs);
|
Fil_RemoveTree (PathRelCrs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1881,8 +1881,8 @@ void Deg_RemoveDegreeCompletely (long DegCod)
|
||||||
|
|
||||||
/***** Remove directories of the degree *****/
|
/***** Remove directories of the degree *****/
|
||||||
snprintf (PathDeg,sizeof (PathDeg),
|
snprintf (PathDeg,sizeof (PathDeg),
|
||||||
"%s/%s/%02u/%u",
|
"%s/%02u/%u",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_DEG,
|
Cfg_PATH_DEG_PUBLIC,
|
||||||
(unsigned) (DegCod % 100),
|
(unsigned) (DegCod % 100),
|
||||||
(unsigned) DegCod);
|
(unsigned) DegCod);
|
||||||
Fil_RemoveTree (PathDeg);
|
Fil_RemoveTree (PathDeg);
|
||||||
|
@ -2460,7 +2460,7 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan)
|
||||||
" alt=\"\" title=\"\""
|
" alt=\"\" title=\"\""
|
||||||
" class=\"ICO25x25\" />"
|
" class=\"ICO25x25\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Gbl.RowEvenOdd,Gbl.Prefs.URLIcons,
|
Gbl.RowEvenOdd,Cfg_URL_ICON_PUBLIC,
|
||||||
NumRow == NumRows ? "subend" :
|
NumRow == NumRows ? "subend" :
|
||||||
"submid");
|
"submid");
|
||||||
|
|
||||||
|
@ -2480,7 +2480,7 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan)
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
" %s",
|
" %s",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_all_degrees,
|
Txt_all_degrees,
|
||||||
Txt_all_degrees,
|
Txt_all_degrees,
|
||||||
Txt_all_degrees);
|
Txt_all_degrees);
|
||||||
|
|
|
@ -643,11 +643,11 @@ static void Fig_WriteHeadHierarchy (void)
|
||||||
"%s"
|
"%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,Txt_Countries ,Txt_Countries ,Txt_Countries,
|
Cfg_URL_ICON_PUBLIC,Txt_Countries ,Txt_Countries ,Txt_Countries,
|
||||||
Gbl.Prefs.URLIcons,Txt_Institutions,Txt_Institutions,Txt_Institutions,
|
Cfg_URL_ICON_PUBLIC,Txt_Institutions,Txt_Institutions,Txt_Institutions,
|
||||||
Gbl.Prefs.URLIcons,Txt_Centres ,Txt_Centres ,Txt_Centres,
|
Cfg_URL_ICON_PUBLIC,Txt_Centres ,Txt_Centres ,Txt_Centres,
|
||||||
Gbl.Prefs.URLIcons,Txt_Degrees ,Txt_Degrees ,Txt_Degrees,
|
Cfg_URL_ICON_PUBLIC,Txt_Degrees ,Txt_Degrees ,Txt_Degrees,
|
||||||
Gbl.Prefs.URLIcons,Txt_Courses ,Txt_Courses ,Txt_Courses);
|
Cfg_URL_ICON_PUBLIC,Txt_Courses ,Txt_Courses ,Txt_Courses);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -3996,7 +3996,7 @@ static void Fig_GetAndShowForumStats (void)
|
||||||
"%s"
|
"%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Scope,
|
Txt_Scope,
|
||||||
Txt_Scope,
|
Txt_Scope,
|
||||||
Txt_Forums,
|
Txt_Forums,
|
||||||
|
@ -4224,7 +4224,7 @@ static void Fig_WriteForumTitleAndStats (For_ForumType_t ForumType,
|
||||||
"%.2f"
|
"%.2f"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,Icon,
|
Cfg_URL_ICON_PUBLIC,Icon,
|
||||||
ForumName1,ForumName2,
|
ForumName1,ForumName2,
|
||||||
ForumName1,ForumName2,
|
ForumName1,ForumName2,
|
||||||
ForumName1,ForumName2,
|
ForumName1,ForumName2,
|
||||||
|
@ -5138,7 +5138,7 @@ static void Fig_GetAndShowNumUsrsPerFirstDayOfWeek (void)
|
||||||
"%5.2f%%"
|
"%5.2f%%"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,FirstDayOfWeek,
|
Cfg_URL_ICON_PUBLIC,FirstDayOfWeek,
|
||||||
Txt_DAYS_SMALL[FirstDayOfWeek],
|
Txt_DAYS_SMALL[FirstDayOfWeek],
|
||||||
Txt_First_day_of_the_week,Txt_DAYS_SMALL[FirstDayOfWeek],
|
Txt_First_day_of_the_week,Txt_DAYS_SMALL[FirstDayOfWeek],
|
||||||
NumUsrs[FirstDayOfWeek],
|
NumUsrs[FirstDayOfWeek],
|
||||||
|
@ -5289,7 +5289,7 @@ static void Fig_GetAndShowNumUsrsPerIconSet (void)
|
||||||
IconSet++)
|
IconSet++)
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"LEFT_MIDDLE\">"
|
"<td class=\"LEFT_MIDDLE\">"
|
||||||
"<img src=\"%s/%s/%s/cog.svg\""
|
"<img src=\"%s/%s/cog.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO40x40\" />"
|
" class=\"ICO40x40\" />"
|
||||||
"</td>"
|
"</td>"
|
||||||
|
@ -5300,8 +5300,7 @@ static void Fig_GetAndShowNumUsrsPerIconSet (void)
|
||||||
"%5.2f%%"
|
"%5.2f%%"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_SETS_PUBLIC,
|
||||||
Cfg_ICON_FOLDER_ICON_SETS,
|
|
||||||
Ico_IconSetId[IconSet],
|
Ico_IconSetId[IconSet],
|
||||||
Ico_IconSetNames[IconSet],
|
Ico_IconSetNames[IconSet],
|
||||||
Ico_IconSetNames[IconSet],
|
Ico_IconSetNames[IconSet],
|
||||||
|
@ -5385,7 +5384,7 @@ static void Fig_GetAndShowNumUsrsPerMenu (void)
|
||||||
"%5.2f%%"
|
"%5.2f%%"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,Mnu_MenuIcons[Menu],
|
Cfg_URL_ICON_PUBLIC,Mnu_MenuIcons[Menu],
|
||||||
Txt_MENU_NAMES[Menu],
|
Txt_MENU_NAMES[Menu],
|
||||||
Txt_MENU_NAMES[Menu],
|
Txt_MENU_NAMES[Menu],
|
||||||
NumUsrs[Menu],
|
NumUsrs[Menu],
|
||||||
|
@ -5457,7 +5456,7 @@ static void Fig_GetAndShowNumUsrsPerTheme (void)
|
||||||
Theme++)
|
Theme++)
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"CENTER_MIDDLE\">"
|
"<td class=\"CENTER_MIDDLE\">"
|
||||||
"<img src=\"%s/%s/%s/theme_32x20.gif\""
|
"<img src=\"%s/%s/theme_32x20.gif\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" style=\"width:40px; height:25px;\" />"
|
" style=\"width:40px; height:25px;\" />"
|
||||||
"</td>"
|
"</td>"
|
||||||
|
@ -5468,7 +5467,7 @@ static void Fig_GetAndShowNumUsrsPerTheme (void)
|
||||||
"%5.2f%%"
|
"%5.2f%%"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_THEMES,The_ThemeId[Theme],
|
Cfg_URL_ICON_THEMES_PUBLIC,The_ThemeId[Theme],
|
||||||
The_ThemeNames[Theme],
|
The_ThemeNames[Theme],
|
||||||
The_ThemeNames[Theme],
|
The_ThemeNames[Theme],
|
||||||
NumUsrs[Theme],
|
NumUsrs[Theme],
|
||||||
|
@ -5550,7 +5549,7 @@ static void Fig_GetAndShowNumUsrsPerSideColumns (void)
|
||||||
"%5.2f%%"
|
"%5.2f%%"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,SideCols >> 1,SideCols & 1,
|
Cfg_URL_ICON_PUBLIC,SideCols >> 1,SideCols & 1,
|
||||||
Txt_LAYOUT_SIDE_COLUMNS[SideCols],
|
Txt_LAYOUT_SIDE_COLUMNS[SideCols],
|
||||||
Txt_LAYOUT_SIDE_COLUMNS[SideCols],
|
Txt_LAYOUT_SIDE_COLUMNS[SideCols],
|
||||||
NumUsrs[SideCols],
|
NumUsrs[SideCols],
|
||||||
|
|
12
swad_file.c
12
swad_file.c
|
@ -72,21 +72,13 @@ extern struct Globals Gbl;
|
||||||
|
|
||||||
void Fil_CreateFileForHTMLOutput (void)
|
void Fil_CreateFileForHTMLOutput (void)
|
||||||
{
|
{
|
||||||
char PathHTMLOutputPriv[PATH_MAX + 1];
|
|
||||||
|
|
||||||
/***** Check if exists the directory for HTML output. If not exists, create it *****/
|
/***** Check if exists the directory for HTML output. If not exists, create it *****/
|
||||||
snprintf (PathHTMLOutputPriv,sizeof (PathHTMLOutputPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_OUT_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT);
|
|
||||||
Fil_CreateDirIfNotExists (PathHTMLOutputPriv);
|
|
||||||
|
|
||||||
/***** Remove old files *****/
|
|
||||||
Fil_RemoveOldTmpFiles (PathHTMLOutputPriv,Cfg_TIME_TO_DELETE_HTML_OUTPUT,false);
|
|
||||||
|
|
||||||
/***** Create a unique name for the file *****/
|
/***** Create a unique name for the file *****/
|
||||||
snprintf (Gbl.HTMLOutput.FileName,sizeof (Gbl.HTMLOutput.FileName),
|
snprintf (Gbl.HTMLOutput.FileName,sizeof (Gbl.HTMLOutput.FileName),
|
||||||
"%s/%s.html",
|
"%s/%s.html",
|
||||||
PathHTMLOutputPriv,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_OUT_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
|
|
||||||
/***** Open file for writing and reading *****/
|
/***** Open file for writing and reading *****/
|
||||||
if ((Gbl.F.Out = fopen (Gbl.HTMLOutput.FileName,"w+t")) == NULL)
|
if ((Gbl.F.Out = fopen (Gbl.HTMLOutput.FileName,"w+t")) == NULL)
|
||||||
|
|
|
@ -2417,24 +2417,21 @@ static void Brw_SetPathFileBrowser (void)
|
||||||
case Brw_ADMI_DOC_INS:
|
case Brw_ADMI_DOC_INS:
|
||||||
case Brw_ADMI_SHR_INS:
|
case Brw_ADMI_SHR_INS:
|
||||||
/* Create a directory for institutions */
|
/* Create a directory for institutions */
|
||||||
snprintf (Path,sizeof (Path),
|
Fil_CreateDirIfNotExists (Cfg_PATH_INS_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_INS);
|
|
||||||
Fil_CreateDirIfNotExists (Path);
|
|
||||||
|
|
||||||
/* Create a directory for all institutions which codes end in
|
/* Create a directory for all institutions which codes end in
|
||||||
institution-code mod 100 */
|
institution-code mod 100 */
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (Path,sizeof (Path),
|
||||||
"%s/%s/%02u",
|
"%s/%02u",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_INS,
|
Cfg_PATH_INS_PRIVATE,
|
||||||
(unsigned) (Gbl.CurrentIns.Ins.InsCod % 100));
|
(unsigned) (Gbl.CurrentIns.Ins.InsCod % 100));
|
||||||
Fil_CreateDirIfNotExists (Path);
|
Fil_CreateDirIfNotExists (Path);
|
||||||
|
|
||||||
/* Create path to the current institution */
|
/* Create path to the current institution */
|
||||||
snprintf (Gbl.FileBrowser.Priv.PathAboveRootFolder,
|
snprintf (Gbl.FileBrowser.Priv.PathAboveRootFolder,
|
||||||
sizeof (Gbl.FileBrowser.Priv.PathAboveRootFolder),
|
sizeof (Gbl.FileBrowser.Priv.PathAboveRootFolder),
|
||||||
"%s/%s/%02u/%u",
|
"%s/%02u/%u",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_INS,
|
Cfg_PATH_INS_PRIVATE,
|
||||||
(unsigned) (Gbl.CurrentIns.Ins.InsCod % 100),
|
(unsigned) (Gbl.CurrentIns.Ins.InsCod % 100),
|
||||||
(unsigned) Gbl.CurrentIns.Ins.InsCod);
|
(unsigned) Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
|
@ -2442,24 +2439,21 @@ static void Brw_SetPathFileBrowser (void)
|
||||||
case Brw_ADMI_DOC_CTR:
|
case Brw_ADMI_DOC_CTR:
|
||||||
case Brw_ADMI_SHR_CTR:
|
case Brw_ADMI_SHR_CTR:
|
||||||
/* Create a directory for centres */
|
/* Create a directory for centres */
|
||||||
snprintf (Path,sizeof (Path),
|
Fil_CreateDirIfNotExists (Cfg_PATH_CTR_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CTR);
|
|
||||||
Fil_CreateDirIfNotExists (Path);
|
|
||||||
|
|
||||||
/* Create a directory for all centres which codes end in
|
/* Create a directory for all centres which codes end in
|
||||||
centre-code mod 100 */
|
centre-code mod 100 */
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (Path,sizeof (Path),
|
||||||
"%s/%s/%02u",
|
"%s/%02u",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CTR,
|
Cfg_PATH_CTR_PRIVATE,
|
||||||
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100));
|
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100));
|
||||||
Fil_CreateDirIfNotExists (Path);
|
Fil_CreateDirIfNotExists (Path);
|
||||||
|
|
||||||
/* Create path to the current centre */
|
/* Create path to the current centre */
|
||||||
snprintf (Gbl.FileBrowser.Priv.PathAboveRootFolder,
|
snprintf (Gbl.FileBrowser.Priv.PathAboveRootFolder,
|
||||||
sizeof (Gbl.FileBrowser.Priv.PathAboveRootFolder),
|
sizeof (Gbl.FileBrowser.Priv.PathAboveRootFolder),
|
||||||
"%s/%s/%02u/%u",
|
"%s/%02u/%u",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CTR,
|
Cfg_PATH_CTR_PRIVATE,
|
||||||
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
(unsigned) (Gbl.CurrentCtr.Ctr.CtrCod % 100),
|
||||||
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
(unsigned) Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
|
@ -2467,24 +2461,21 @@ static void Brw_SetPathFileBrowser (void)
|
||||||
case Brw_ADMI_DOC_DEG:
|
case Brw_ADMI_DOC_DEG:
|
||||||
case Brw_ADMI_SHR_DEG:
|
case Brw_ADMI_SHR_DEG:
|
||||||
/* Create a directory for degrees */
|
/* Create a directory for degrees */
|
||||||
snprintf (Path,sizeof (Path),
|
Fil_CreateDirIfNotExists (Cfg_PATH_DEG_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_DEG);
|
|
||||||
Fil_CreateDirIfNotExists (Path);
|
|
||||||
|
|
||||||
/* Create a directory for all degrees which codes end in
|
/* Create a directory for all degrees which codes end in
|
||||||
degree-code mod 100 */
|
degree-code mod 100 */
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (Path,sizeof (Path),
|
||||||
"%s/%s/%02u",
|
"%s/%02u",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_DEG,
|
Cfg_PATH_DEG_PRIVATE,
|
||||||
(unsigned) (Gbl.CurrentDeg.Deg.DegCod % 100));
|
(unsigned) (Gbl.CurrentDeg.Deg.DegCod % 100));
|
||||||
Fil_CreateDirIfNotExists (Path);
|
Fil_CreateDirIfNotExists (Path);
|
||||||
|
|
||||||
/* Create path to the current degree */
|
/* Create path to the current degree */
|
||||||
snprintf (Gbl.FileBrowser.Priv.PathAboveRootFolder,
|
snprintf (Gbl.FileBrowser.Priv.PathAboveRootFolder,
|
||||||
sizeof (Gbl.FileBrowser.Priv.PathAboveRootFolder),
|
sizeof (Gbl.FileBrowser.Priv.PathAboveRootFolder),
|
||||||
"%s/%s/%02u/%u",
|
"%s/%02u/%u",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_DEG,
|
Cfg_PATH_DEG_PRIVATE,
|
||||||
(unsigned) (Gbl.CurrentDeg.Deg.DegCod % 100),
|
(unsigned) (Gbl.CurrentDeg.Deg.DegCod % 100),
|
||||||
(unsigned) Gbl.CurrentDeg.Deg.DegCod);
|
(unsigned) Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
|
@ -3366,7 +3357,7 @@ static void Brw_FormToChangeCrsGrpZone (void)
|
||||||
(IsGroupZone &&
|
(IsGroupZone &&
|
||||||
GrpDat.GrpCod == Gbl.CurrentCrs.Grps.GrpCod) ? "BROWSER_TITLE" :
|
GrpDat.GrpCod == Gbl.CurrentCrs.Grps.GrpCod) ? "BROWSER_TITLE" :
|
||||||
"BROWSER_TITLE_LIGHT",
|
"BROWSER_TITLE_LIGHT",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
NumGrp < LstMyGrps.NumGrps - 1 ? "submid" :
|
NumGrp < LstMyGrps.NumGrps - 1 ? "submid" :
|
||||||
"subend",
|
"subend",
|
||||||
GrpDat.GrpCod);
|
GrpDat.GrpCod);
|
||||||
|
@ -5130,23 +5121,13 @@ void Brw_CreateDirDownloadTmp (void)
|
||||||
{
|
{
|
||||||
static unsigned NumDir = 0; // When this function is called several times in the same execution of the program, each time a new directory is created
|
static unsigned NumDir = 0; // When this function is called several times in the same execution of the program, each time a new directory is created
|
||||||
// This happens when the trees of assignments and works of several users are being listed
|
// This happens when the trees of assignments and works of several users are being listed
|
||||||
char PathFileBrowserTmpPubl[PATH_MAX + 1];
|
// char PathFileBrowserTmpPubl[PATH_MAX + 1];
|
||||||
char PathPubDirTmp[PATH_MAX + 1];
|
char PathPubDirTmp[PATH_MAX + 1];
|
||||||
|
|
||||||
/* Example: /var/www/html/swad/tmp/SSujCNWsy4ZOdmgMKYBe0sKPAJu6szaZOQlIlJs_QIY */
|
/* Example: /var/www/html/swad/tmp/SSujCNWsy4ZOdmgMKYBe0sKPAJu6szaZOQlIlJs_QIY */
|
||||||
|
|
||||||
/***** If the public directory does not exist, create it *****/
|
/***** If the public directory does not exist, create it *****/
|
||||||
snprintf (PathFileBrowserTmpPubl,sizeof (PathFileBrowserTmpPubl),
|
Fil_CreateDirIfNotExists (Cfg_PATH_FILE_BROWSER_TMP_PUBLIC);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP);
|
|
||||||
Fil_CreateDirIfNotExists (PathFileBrowserTmpPubl);
|
|
||||||
|
|
||||||
/***** First of all, we remove the oldest temporary directories.
|
|
||||||
Such temporary directories have been created by me or by other users.
|
|
||||||
This is a bit sloppy, but they must be removed by someone.
|
|
||||||
Here "oldest" means more than x time from their creation *****/
|
|
||||||
if (NumDir == 0) // Only in the first call to this function
|
|
||||||
Fil_RemoveOldTmpFiles (PathFileBrowserTmpPubl,Cfg_TIME_TO_DELETE_BROWSER_TMP_FILES,false);
|
|
||||||
|
|
||||||
/***** Create a new temporary directory.
|
/***** Create a new temporary directory.
|
||||||
Important: number of directories inside a directory is limited to 32K in Linux *****/
|
Important: number of directories inside a directory is limited to 32K in Linux *****/
|
||||||
|
@ -5159,7 +5140,7 @@ void Brw_CreateDirDownloadTmp (void)
|
||||||
NAME_MAX);
|
NAME_MAX);
|
||||||
snprintf (PathPubDirTmp,sizeof (PathPubDirTmp),
|
snprintf (PathPubDirTmp,sizeof (PathPubDirTmp),
|
||||||
"%s/%s",
|
"%s/%s",
|
||||||
PathFileBrowserTmpPubl,Gbl.FileBrowser.TmpPubDir);
|
Cfg_PATH_FILE_BROWSER_TMP_PUBLIC,Gbl.FileBrowser.TmpPubDir);
|
||||||
if (mkdir (PathPubDirTmp,(mode_t) 0xFFF))
|
if (mkdir (PathPubDirTmp,(mode_t) 0xFFF))
|
||||||
Lay_ShowErrorAndExit ("Can not create a temporary folder for download.");
|
Lay_ShowErrorAndExit ("Can not create a temporary folder for download.");
|
||||||
NumDir++;
|
NumDir++;
|
||||||
|
@ -5965,7 +5946,7 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/tr16x16.gif\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/tr16x16.gif\""
|
||||||
" alt=\"\" title=\"\""
|
" alt=\"\" title=\"\""
|
||||||
" class=\"ICO20x20\" />",
|
" class=\"ICO20x20\" />",
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
break;
|
break;
|
||||||
case Brw_ICON_TREE_EXPAND:
|
case Brw_ICON_TREE_EXPAND:
|
||||||
/***** Visible icon to expand folder *****/
|
/***** Visible icon to expand folder *****/
|
||||||
|
@ -6014,7 +5995,7 @@ static void Brw_IndentDependingOnLevel (unsigned Level)
|
||||||
" class=\"ICO20x20\" />"
|
" class=\"ICO20x20\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Gbl.RowEvenOdd,
|
Gbl.RowEvenOdd,
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -6116,7 +6097,7 @@ static void Brw_PutIconShow (unsigned Level,const char *PathInTree,const char *F
|
||||||
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/eye-slash.svg\""
|
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/eye-slash.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_OPT %s CONTEXT_ICO_16x16\" />",
|
" class=\"CONTEXT_OPT %s CONTEXT_ICO_16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
Brw_CheckIfAnyUpperLevelIsHidden (Level) ? "ICO_HIDDEN" :
|
Brw_CheckIfAnyUpperLevelIsHidden (Level) ? "ICO_HIDDEN" :
|
||||||
|
@ -6144,7 +6125,7 @@ static void Brw_PutIconHide (unsigned Level,const char *PathInTree,const char *F
|
||||||
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/eye.svg\""
|
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/eye.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_OPT %s CONTEXT_ICO_16x16\" />",
|
" class=\"CONTEXT_OPT %s CONTEXT_ICO_16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
Brw_CheckIfAnyUpperLevelIsHidden (Level) ? "ICO_HIDDEN" :
|
Brw_CheckIfAnyUpperLevelIsHidden (Level) ? "ICO_HIDDEN" :
|
||||||
|
@ -6273,7 +6254,7 @@ static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/%s\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_OPT CONTEXT_ICO_16x16\" />",
|
" class=\"CONTEXT_OPT CONTEXT_ICO_16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Open ? "folder-open-yellow.png" :
|
Open ? "folder-open-yellow.png" :
|
||||||
"folder-yellow.png",
|
"folder-yellow.png",
|
||||||
Txt_Folder,
|
Txt_Folder,
|
||||||
|
@ -6335,7 +6316,7 @@ static void Brw_PutIconNewFileOrFolder (void)
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO20x20\" />"
|
" class=\"ICO20x20\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Gbl.RowEvenOdd,Gbl.Prefs.URLIcons,
|
Gbl.RowEvenOdd,Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_New_FILE_OR_FOLDER,
|
Txt_New_FILE_OR_FOLDER,
|
||||||
Txt_New_FILE_OR_FOLDER);
|
Txt_New_FILE_OR_FOLDER);
|
||||||
}
|
}
|
||||||
|
@ -6390,12 +6371,12 @@ static void Brw_PutIconFile (unsigned Size,Brw_FileType_t FileType,const char *F
|
||||||
if (FileType == Brw_IS_LINK)
|
if (FileType == Brw_IS_LINK)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/link.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/link.svg\""
|
||||||
" alt=\"%s\" title=\"%s\"",
|
" alt=\"%s\" title=\"%s\"",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Link,Txt_Link);
|
Txt_Link,Txt_Link);
|
||||||
else // FileType == Brw_IS_FILE
|
else // FileType == Brw_IS_FILE
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s%ux%u/",
|
fprintf (Gbl.F.Out,"<img src=\"%s%ux%u/",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_FILEXT,
|
CfG_URL_ICON_FILEXT_PUBLIC,
|
||||||
Size,Size);
|
Size,Size);
|
||||||
for (DocType = 0, NotFound = true;
|
for (DocType = 0, NotFound = true;
|
||||||
DocType < Ext_NUM_FILE_EXT_ALLOWED && NotFound;
|
DocType < Ext_NUM_FILE_EXT_ALLOWED && NotFound;
|
||||||
|
@ -6562,8 +6543,8 @@ void Brw_CreateTmpPublicLinkToPrivateFile (const char *FullPathIncludingFile,
|
||||||
|
|
||||||
/***** Create, into temporary public directory, a symbolic link to file *****/
|
/***** Create, into temporary public directory, a symbolic link to file *****/
|
||||||
snprintf (Link,sizeof (Link),
|
snprintf (Link,sizeof (Link),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
|
Cfg_PATH_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Gbl.FileBrowser.TmpPubDir,FileName);
|
Gbl.FileBrowser.TmpPubDir,FileName);
|
||||||
if (symlink (FullPathIncludingFile,Link) != 0)
|
if (symlink (FullPathIncludingFile,Link) != 0)
|
||||||
Lay_ShowErrorAndExit ("Can not create temporary link.");
|
Lay_ShowErrorAndExit ("Can not create temporary link.");
|
||||||
|
@ -6692,7 +6673,7 @@ static void Brw_WriteFileOrFolderPublisher (unsigned Level,unsigned long UsrCod)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/usr_bl.jpg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/usr_bl.jpg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"PHOTO15x20B\" />",
|
" class=\"PHOTO15x20B\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Unknown_or_without_photo,
|
Txt_Unknown_or_without_photo,
|
||||||
Txt_Unknown_or_without_photo);
|
Txt_Unknown_or_without_photo);
|
||||||
|
|
||||||
|
@ -8060,8 +8041,8 @@ static void Brw_PasteClipboard (void)
|
||||||
Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
|
Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
if (Ins_GetDataOfInstitutionByCod (&Ins,false))
|
if (Ins_GetDataOfInstitutionByCod (&Ins,false))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%s/%02u/%u/%s",
|
"%s/%02u/%u/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_INS,
|
Cfg_PATH_INS_PRIVATE,
|
||||||
(unsigned) (Ins.InsCod % 100),
|
(unsigned) (Ins.InsCod % 100),
|
||||||
(unsigned) Ins.InsCod,
|
(unsigned) Ins.InsCod,
|
||||||
Gbl.FileBrowser.Clipboard.Path);
|
Gbl.FileBrowser.Clipboard.Path);
|
||||||
|
@ -8073,8 +8054,8 @@ static void Brw_PasteClipboard (void)
|
||||||
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
|
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
if (Ctr_GetDataOfCentreByCod (&Ctr))
|
if (Ctr_GetDataOfCentreByCod (&Ctr))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%s/%02u/%u/%s",
|
"%s/%02u/%u/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CTR,
|
Cfg_PATH_CTR_PRIVATE,
|
||||||
(unsigned) (Ctr.CtrCod % 100),
|
(unsigned) (Ctr.CtrCod % 100),
|
||||||
(unsigned) Ctr.CtrCod,
|
(unsigned) Ctr.CtrCod,
|
||||||
Gbl.FileBrowser.Clipboard.Path);
|
Gbl.FileBrowser.Clipboard.Path);
|
||||||
|
@ -8086,8 +8067,8 @@ static void Brw_PasteClipboard (void)
|
||||||
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
|
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
if (Deg_GetDataOfDegreeByCod (&Deg))
|
if (Deg_GetDataOfDegreeByCod (&Deg))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%s/%02u/%u/%s",
|
"%s/%02u/%u/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_DEG,
|
Cfg_PATH_DEG_PRIVATE,
|
||||||
(unsigned) (Deg.DegCod % 100),
|
(unsigned) (Deg.DegCod % 100),
|
||||||
(unsigned) Deg.DegCod,
|
(unsigned) Deg.DegCod,
|
||||||
Gbl.FileBrowser.Clipboard.Path);
|
Gbl.FileBrowser.Clipboard.Path);
|
||||||
|
@ -8101,8 +8082,8 @@ static void Brw_PasteClipboard (void)
|
||||||
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
|
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
if (Crs_GetDataOfCourseByCod (&Crs))
|
if (Crs_GetDataOfCourseByCod (&Crs))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%s/%ld/%s",
|
"%s/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,
|
Cfg_PATH_CRS_PRIVATE,Crs.CrsCod,
|
||||||
Gbl.FileBrowser.Clipboard.Path);
|
Gbl.FileBrowser.Clipboard.Path);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
||||||
|
@ -8116,8 +8097,8 @@ static void Brw_PasteClipboard (void)
|
||||||
Crs.CrsCod = GrpDat.CrsCod;
|
Crs.CrsCod = GrpDat.CrsCod;
|
||||||
if (Crs_GetDataOfCourseByCod (&Crs))
|
if (Crs_GetDataOfCourseByCod (&Crs))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%s/%ld/%s/%ld/%s",
|
"%s/%ld/%s/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_GRP,
|
Cfg_PATH_CRS_PRIVATE,Crs.CrsCod,Cfg_FOLDER_GRP,
|
||||||
GrpDat.GrpCod,
|
GrpDat.GrpCod,
|
||||||
Gbl.FileBrowser.Clipboard.Path);
|
Gbl.FileBrowser.Clipboard.Path);
|
||||||
else
|
else
|
||||||
|
@ -8132,8 +8113,8 @@ static void Brw_PasteClipboard (void)
|
||||||
UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod;
|
UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod;
|
||||||
Usr_GetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS); // Check that user exists
|
Usr_GetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS); // Check that user exists
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%s/%ld/%s/%02u/%ld/%s",
|
"%s/%ld/%s/%02u/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_USR,
|
Cfg_PATH_CRS_PRIVATE,Crs.CrsCod,Cfg_FOLDER_USR,
|
||||||
(unsigned) (Gbl.FileBrowser.Clipboard.WorksUsrCod % 100),
|
(unsigned) (Gbl.FileBrowser.Clipboard.WorksUsrCod % 100),
|
||||||
Gbl.FileBrowser.Clipboard.WorksUsrCod,
|
Gbl.FileBrowser.Clipboard.WorksUsrCod,
|
||||||
Gbl.FileBrowser.Clipboard.Path);
|
Gbl.FileBrowser.Clipboard.Path);
|
||||||
|
@ -8147,8 +8128,8 @@ static void Brw_PasteClipboard (void)
|
||||||
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
|
Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
if (Crs_GetDataOfCourseByCod (&Crs))
|
if (Crs_GetDataOfCourseByCod (&Crs))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%s/%ld/%s/%02u/%ld/%s",
|
"%s/%ld/%s/%02u/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_USR,
|
Cfg_PATH_CRS_PRIVATE,Crs.CrsCod,Cfg_FOLDER_USR,
|
||||||
(unsigned) (Gbl.Usrs.Me.UsrDat.UsrCod % 100),
|
(unsigned) (Gbl.Usrs.Me.UsrDat.UsrCod % 100),
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.FileBrowser.Clipboard.Path);
|
Gbl.FileBrowser.Clipboard.Path);
|
||||||
|
@ -8161,8 +8142,8 @@ static void Brw_PasteClipboard (void)
|
||||||
Crs.CrsCod = Prj_GetCourseOfProject (PrjCod);
|
Crs.CrsCod = Prj_GetCourseOfProject (PrjCod);
|
||||||
if (Crs_GetDataOfCourseByCod (&Crs))
|
if (Crs_GetDataOfCourseByCod (&Crs))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%s/%ld/%s/%02u/%ld/%s",
|
"%s/%ld/%s/%02u/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs.CrsCod,Cfg_FOLDER_PRJ,
|
Cfg_PATH_CRS_PRIVATE,Crs.CrsCod,Cfg_FOLDER_PRJ,
|
||||||
(unsigned) (PrjCod % 100),
|
(unsigned) (PrjCod % 100),
|
||||||
PrjCod,
|
PrjCod,
|
||||||
Gbl.FileBrowser.Clipboard.Path);
|
Gbl.FileBrowser.Clipboard.Path);
|
||||||
|
@ -8617,7 +8598,7 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
|
||||||
" background:url('%s/upload320x320.gif') no-repeat center;\">",
|
" background:url('%s/upload320x320.gif') no-repeat center;\">",
|
||||||
Cfg_URL_SWAD_CGI,
|
Cfg_URL_SWAD_CGI,
|
||||||
Lan_STR_LANG_ID[Gbl.Prefs.Language],
|
Lan_STR_LANG_ID[Gbl.Prefs.Language],
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
Par_PutHiddenParamLong ("act",Act_GetActCod (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type]));
|
Par_PutHiddenParamLong ("act",Act_GetActCod (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type]));
|
||||||
Par_PutHiddenParamString ("ses",Gbl.Session.Id);
|
Par_PutHiddenParamString ("ses",Gbl.Session.Id);
|
||||||
Brw_PutParamsFileBrowser (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type],
|
Brw_PutParamsFileBrowser (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type],
|
||||||
|
@ -10286,7 +10267,7 @@ static void Brw_WriteBigLinkToDownloadFile (const char *URL,
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO40x40\" />"
|
" class=\"ICO40x40\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
FileNameToShow,Gbl.Prefs.URLIcons,
|
FileNameToShow,Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Title,Gbl.Title);
|
Gbl.Title,Gbl.Title);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -10305,7 +10286,7 @@ static void Brw_WriteBigLinkToDownloadFile (const char *URL,
|
||||||
" class=\"ICO40x40\" />"
|
" class=\"ICO40x40\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
FileNameToShow,
|
FileNameToShow,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Download,Txt_Download);
|
Txt_Download,Txt_Download);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10384,8 +10365,8 @@ void Brw_GetLinkToDownloadFile (const char *PathInTree,const char *FileName,char
|
||||||
|
|
||||||
/***** Create URL pointing to symbolic link *****/
|
/***** Create URL pointing to symbolic link *****/
|
||||||
snprintf (URLWithSpaces,sizeof (URLWithSpaces),
|
snprintf (URLWithSpaces,sizeof (URLWithSpaces),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
|
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Gbl.FileBrowser.TmpPubDir,
|
Gbl.FileBrowser.TmpPubDir,
|
||||||
FileName);
|
FileName);
|
||||||
}
|
}
|
||||||
|
@ -11916,8 +11897,8 @@ void Brw_RemoveGrpZones (long CrsCod,long GrpCod)
|
||||||
|
|
||||||
/***** Remove group zones *****/
|
/***** Remove group zones *****/
|
||||||
snprintf (PathGrpFileZones,sizeof (PathGrpFileZones),
|
snprintf (PathGrpFileZones,sizeof (PathGrpFileZones),
|
||||||
"%s/%s/%ld/grp/%ld",
|
"%s/%ld/grp/%ld",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod,GrpCod);
|
Cfg_PATH_CRS_PRIVATE,CrsCod,GrpCod);
|
||||||
Fil_RemoveTree (PathGrpFileZones);
|
Fil_RemoveTree (PathGrpFileZones);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11934,8 +11915,8 @@ void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Course *Crs)
|
||||||
|
|
||||||
/***** Remove the folder for this user inside the course *****/
|
/***** Remove the folder for this user inside the course *****/
|
||||||
snprintf (PathUsrInCrs,sizeof (PathUsrInCrs),
|
snprintf (PathUsrInCrs,sizeof (PathUsrInCrs),
|
||||||
"%s/%s/%ld/usr/%02u/%ld",
|
"%s/%ld/usr/%02u/%ld",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Crs->CrsCod,
|
Cfg_PATH_CRS_PRIVATE,Crs->CrsCod,
|
||||||
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
||||||
Fil_RemoveTree (PathUsrInCrs);
|
Fil_RemoveTree (PathUsrInCrs);
|
||||||
// If this was the last user in his/her subfolder ==> the subfolder will be empty
|
// If this was the last user in his/her subfolder ==> the subfolder will be empty
|
||||||
|
@ -12382,7 +12363,7 @@ static void Brw_WriteRowDocData (unsigned long *NumDocsNotHidden,MYSQL_ROW row)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/folder-yellow.png\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/folder-yellow.png\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_ICO_16x16\" />",
|
" class=\"CONTEXT_ICO_16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Folder,Txt_Folder);
|
Txt_Folder,Txt_Folder);
|
||||||
else
|
else
|
||||||
/* Icon with file type or link */
|
/* Icon with file type or link */
|
||||||
|
|
|
@ -566,7 +566,7 @@ void Fol_ShowFollowingAndFollowers (const struct UsrData *UsrDat,
|
||||||
" class=\"ICO40x40\" />"
|
" class=\"ICO40x40\" />"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Unfollow,Txt_Following_unfollow);
|
Txt_Unfollow,Txt_Following_unfollow);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -582,7 +582,7 @@ void Fol_ShowFollowingAndFollowers (const struct UsrData *UsrDat,
|
||||||
" class=\"ICO40x40\" />"
|
" class=\"ICO40x40\" />"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Follow,Txt_Follow);
|
Txt_Follow,Txt_Follow);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -966,7 +966,7 @@ static void Fol_PutInactiveIconToFollowUnfollow (void)
|
||||||
" alt=\"\""
|
" alt=\"\""
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -987,7 +987,7 @@ static void Fol_PutIconToFollow (struct UsrData *UsrDat)
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Follow,Txt_Follow);
|
Txt_Follow,Txt_Follow);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -1010,7 +1010,7 @@ static void Fol_PutIconToUnfollow (struct UsrData *UsrDat)
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Unfollow,Txt_Unfollow);
|
Txt_Unfollow,Txt_Unfollow);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
|
16
swad_forum.c
16
swad_forum.c
|
@ -1183,7 +1183,7 @@ static void For_ShowAForumPost (unsigned PstNum,long PstCod,
|
||||||
"</td>",
|
"</td>",
|
||||||
NewPst ? "MSG_TIT_BG_NEW" :
|
NewPst ? "MSG_TIT_BG_NEW" :
|
||||||
"MSG_TIT_BG",
|
"MSG_TIT_BG",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
NewPst ? "envelope.svg" :
|
NewPst ? "envelope.svg" :
|
||||||
"envelope-open-text.svg",
|
"envelope-open-text.svg",
|
||||||
NewPst ? Txt_MSG_New :
|
NewPst ? Txt_MSG_New :
|
||||||
|
@ -1251,7 +1251,7 @@ static void For_ShowAForumPost (unsigned PstNum,long PstCod,
|
||||||
" class=\"ICO_HIDDEN ICO16x16\" />"
|
" class=\"ICO_HIDDEN ICO16x16\" />"
|
||||||
"</span>",
|
"</span>",
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Enabled ? "eye.svg" :
|
Enabled ? "eye.svg" :
|
||||||
"eye-slash.svg",
|
"eye-slash.svg",
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
|
@ -2063,7 +2063,7 @@ static void For_WriteLinkToForum (struct Forum *Forum,
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/paste.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/paste.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_OPT ICO_HIDDEN ICO16x16\" />",
|
" class=\"CONTEXT_OPT ICO_HIDDEN ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Copy_not_allowed,Txt_Copy_not_allowed);
|
Txt_Copy_not_allowed,Txt_Copy_not_allowed);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2101,14 +2101,14 @@ static void For_WriteLinkToForum (struct Forum *Forum,
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/comments.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,ForumName,ForumName);
|
Cfg_URL_ICON_PUBLIC,ForumName,ForumName);
|
||||||
break;
|
break;
|
||||||
case For_FORUM__SWAD__USRS:
|
case For_FORUM__SWAD__USRS:
|
||||||
case For_FORUM__SWAD__TCHS:
|
case For_FORUM__SWAD__TCHS:
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/swad64x64.png\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/swad64x64.png\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,ForumName,ForumName);
|
Cfg_URL_ICON_PUBLIC,ForumName,ForumName);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_INSTIT_USRS:
|
case For_FORUM_INSTIT_USRS:
|
||||||
case For_FORUM_INSTIT_TCHS:
|
case For_FORUM_INSTIT_TCHS:
|
||||||
|
@ -2127,7 +2127,7 @@ static void For_WriteLinkToForum (struct Forum *Forum,
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/list-ol.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/list-ol.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,ForumName,ForumName);
|
Cfg_URL_ICON_PUBLIC,ForumName,ForumName);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -3414,7 +3414,7 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],
|
||||||
Gbl.Usrs.Me.PhotoURL);
|
Gbl.Usrs.Me.PhotoURL);
|
||||||
else
|
else
|
||||||
fprintf (Gbl.F.Out,"%s/usr_bl.jpg",
|
fprintf (Gbl.F.Out,"%s/usr_bl.jpg",
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
fprintf (Gbl.F.Out,"\" alt=\"%s\" title=\"",
|
fprintf (Gbl.F.Out,"\" alt=\"%s\" title=\"",
|
||||||
Txt_Thread_with_posts_from_you);
|
Txt_Thread_with_posts_from_you);
|
||||||
if (Thr.NumMyPosts == 1)
|
if (Thr.NumMyPosts == 1)
|
||||||
|
@ -3432,7 +3432,7 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
BgColor,
|
BgColor,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Thr.NumUnreadPosts ? "envelope.svg" :
|
Thr.NumUnreadPosts ? "envelope.svg" :
|
||||||
"envelope-open-text.svg",
|
"envelope-open-text.svg",
|
||||||
Thr.NumUnreadPosts ? Txt_There_are_new_posts :
|
Thr.NumUnreadPosts ? Txt_There_are_new_posts :
|
||||||
|
|
|
@ -3173,7 +3173,7 @@ static void Gam_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs)
|
||||||
" class=\"LEFT_TOP\""
|
" class=\"LEFT_TOP\""
|
||||||
" style=\"width:%upx; height:20px;\" />"
|
" style=\"width:%upx; height:20px;\" />"
|
||||||
" ",
|
" ",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
BarWidth);
|
BarWidth);
|
||||||
|
@ -3482,7 +3482,7 @@ static void Gam_PutBigButtonToStartGame (long GamCod)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/play.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/play.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO64x64\" />",
|
" class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO64x64\" />",
|
||||||
Gbl.Prefs.URLIcons,Txt_Play,Txt_Play);
|
Cfg_URL_ICON_PUBLIC,Txt_Play,Txt_Play);
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
|
||||||
/***** End form *****/
|
/***** End form *****/
|
||||||
|
@ -3625,7 +3625,7 @@ static void Gam_PutBigButtonToContinue (Act_Action_t NextAction,
|
||||||
" alt=\"%s\" title=\"%s\" class=\"ICO64x64\" />"
|
" alt=\"%s\" title=\"%s\" class=\"ICO64x64\" />"
|
||||||
"<br />"
|
"<br />"
|
||||||
"%s",
|
"%s",
|
||||||
Gbl.Prefs.URLIcons,Txt_Continue,Txt_Continue,
|
Cfg_URL_ICON_PUBLIC,Txt_Continue,Txt_Continue,
|
||||||
Txt_Continue);
|
Txt_Continue);
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
|
||||||
|
|
|
@ -138,18 +138,13 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Prefs.Menu = Mnu_MENU_DEFAULT; // Default menu
|
Gbl.Prefs.Menu = Mnu_MENU_DEFAULT; // Default menu
|
||||||
Gbl.Prefs.Theme = The_THEME_DEFAULT; // Default theme
|
Gbl.Prefs.Theme = The_THEME_DEFAULT; // Default theme
|
||||||
Gbl.Prefs.IconSet = Ico_ICON_SET_DEFAULT; // Default icon set
|
Gbl.Prefs.IconSet = Ico_ICON_SET_DEFAULT; // Default icon set
|
||||||
snprintf (Gbl.Prefs.URLIcons,sizeof (Gbl.Prefs.URLIcons),
|
|
||||||
"%s/%s",
|
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PUBLIC_ICON);
|
|
||||||
snprintf (Gbl.Prefs.URLTheme,sizeof (Gbl.Prefs.URLTheme),
|
snprintf (Gbl.Prefs.URLTheme,sizeof (Gbl.Prefs.URLTheme),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PUBLIC_ICON,
|
Cfg_URL_ICON_THEMES_PUBLIC,
|
||||||
Cfg_ICON_FOLDER_THEMES,
|
|
||||||
The_ThemeId[Gbl.Prefs.Theme]);
|
The_ThemeId[Gbl.Prefs.Theme]);
|
||||||
snprintf (Gbl.Prefs.URLIconSet,sizeof (Gbl.Prefs.URLIconSet),
|
snprintf (Gbl.Prefs.URLIconSet,sizeof (Gbl.Prefs.URLIconSet),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PUBLIC_ICON,
|
Cfg_URL_ICON_SETS_PUBLIC,
|
||||||
Cfg_ICON_FOLDER_ICON_SETS,
|
|
||||||
Ico_IconSetId[Gbl.Prefs.IconSet]);
|
Ico_IconSetId[Gbl.Prefs.IconSet]);
|
||||||
|
|
||||||
Gbl.Session.NumSessions = 0;
|
Gbl.Session.NumSessions = 0;
|
||||||
|
|
|
@ -170,7 +170,6 @@ struct Globals
|
||||||
unsigned SideCols;
|
unsigned SideCols;
|
||||||
The_Theme_t Theme;
|
The_Theme_t Theme;
|
||||||
Ico_IconSet_t IconSet;
|
Ico_IconSet_t IconSet;
|
||||||
char URLIcons[PATH_MAX + 1];
|
|
||||||
char URLTheme[PATH_MAX + 1];
|
char URLTheme[PATH_MAX + 1];
|
||||||
char URLIconSet[PATH_MAX + 1];
|
char URLIconSet[PATH_MAX + 1];
|
||||||
} Prefs;
|
} Prefs;
|
||||||
|
|
|
@ -1370,7 +1370,7 @@ static void Grp_ListGroupTypesForEdition (void)
|
||||||
" class=\"%sCONTEXT_ICO_16x16\" />"
|
" class=\"%sCONTEXT_ICO_16x16\" />"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"LEFT_MIDDLE\">",
|
"<td class=\"LEFT_MIDDLE\">",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MustBeOpened ? Txt_The_groups_will_automatically_open :
|
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MustBeOpened ? Txt_The_groups_will_automatically_open :
|
||||||
Txt_The_groups_will_not_automatically_open,
|
Txt_The_groups_will_not_automatically_open,
|
||||||
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MustBeOpened ? Txt_The_groups_will_automatically_open :
|
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MustBeOpened ? Txt_The_groups_will_automatically_open :
|
||||||
|
@ -2576,7 +2576,7 @@ static void Grp_PutFormToCreateGroupType (void)
|
||||||
" class=\"%sCONTEXT_ICO_16x16\" />"
|
" class=\"%sCONTEXT_ICO_16x16\" />"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"LEFT_MIDDLE\">",
|
"<td class=\"LEFT_MIDDLE\">",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.CurrentCrs.Grps.GrpTyp.MustBeOpened ? Txt_The_groups_will_automatically_open :
|
Gbl.CurrentCrs.Grps.GrpTyp.MustBeOpened ? Txt_The_groups_will_automatically_open :
|
||||||
Txt_The_groups_will_not_automatically_open,
|
Txt_The_groups_will_not_automatically_open,
|
||||||
Gbl.CurrentCrs.Grps.GrpTyp.MustBeOpened ? Txt_The_groups_will_automatically_open :
|
Gbl.CurrentCrs.Grps.GrpTyp.MustBeOpened ? Txt_The_groups_will_automatically_open :
|
||||||
|
|
|
@ -407,7 +407,7 @@ void Hie_WriteBigNameCtyInsCtrDegCrs (void)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/swad64x64.png\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/swad64x64.png\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO40x40 TOP_LOGO\" />",
|
" class=\"ICO40x40 TOP_LOGO\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Cfg_PLATFORM_SHORT_NAME,Cfg_PLATFORM_FULL_NAME);
|
Cfg_PLATFORM_SHORT_NAME,Cfg_PLATFORM_FULL_NAME);
|
||||||
|
|
||||||
/***** Text *****/
|
/***** Text *****/
|
||||||
|
@ -545,14 +545,14 @@ void Hie_InitHierarchy (void)
|
||||||
{
|
{
|
||||||
/***** Paths of course directories *****/
|
/***** Paths of course directories *****/
|
||||||
snprintf (Gbl.CurrentCrs.PathPriv,sizeof (Gbl.CurrentCrs.PathPriv),
|
snprintf (Gbl.CurrentCrs.PathPriv,sizeof (Gbl.CurrentCrs.PathPriv),
|
||||||
"%s/%s/%ld",
|
"%s/%ld",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Gbl.CurrentCrs.Crs.CrsCod);
|
Cfg_PATH_CRS_PRIVATE,Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
snprintf (Gbl.CurrentCrs.PathRelPubl,sizeof (Gbl.CurrentCrs.PathRelPubl),
|
snprintf (Gbl.CurrentCrs.PathRelPubl,sizeof (Gbl.CurrentCrs.PathRelPubl),
|
||||||
"%s/%s/%ld",
|
"%s/%ld",
|
||||||
Cfg_PATH_SWAD_PUBLIC ,Cfg_FOLDER_CRS,Gbl.CurrentCrs.Crs.CrsCod);
|
Cfg_PATH_CRS_PUBLIC,Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
snprintf (Gbl.CurrentCrs.PathURLPubl,sizeof (Gbl.CurrentCrs.PathURLPubl),
|
snprintf (Gbl.CurrentCrs.PathURLPubl,sizeof (Gbl.CurrentCrs.PathURLPubl),
|
||||||
"%s/%s/%ld",
|
"%s/%ld",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_CRS,Gbl.CurrentCrs.Crs.CrsCod);
|
Cfg_URL_CRS_PUBLIC,Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
|
|
||||||
/***** If any of the course directories does not exist, create it *****/
|
/***** If any of the course directories does not exist, create it *****/
|
||||||
if (!Fil_CheckIfPathExists (Gbl.CurrentCrs.PathPriv))
|
if (!Fil_CheckIfPathExists (Gbl.CurrentCrs.PathPriv))
|
||||||
|
|
31
swad_icon.c
31
swad_icon.c
|
@ -93,9 +93,9 @@ const char *Ico_GetIcon (const char *IconWithoutExtension)
|
||||||
"%s.%s",
|
"%s.%s",
|
||||||
IconWithoutExtension,Ico_IconExtensions[NumExt]);
|
IconWithoutExtension,Ico_IconExtensions[NumExt]);
|
||||||
snprintf (PathIcon,sizeof (PathIcon),
|
snprintf (PathIcon,sizeof (PathIcon),
|
||||||
"%s/%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PUBLIC_ICON,
|
Cfg_PATH_ICON_SETS_PUBLIC,
|
||||||
Cfg_ICON_FOLDER_ICON_SETS,Ico_IconSetId[Gbl.Prefs.IconSet],
|
Ico_IconSetId[Gbl.Prefs.IconSet],
|
||||||
IconWithExtension);
|
IconWithExtension);
|
||||||
if (Fil_CheckIfPathExists (PathIcon))
|
if (Fil_CheckIfPathExists (PathIcon))
|
||||||
return IconWithExtension;
|
return IconWithExtension;
|
||||||
|
@ -130,7 +130,7 @@ void Ico_PutIconsToSelectIconSet (void)
|
||||||
Par_PutHiddenParamString ("IconSet",Ico_IconSetId[IconSet]);
|
Par_PutHiddenParamString ("IconSet",Ico_IconSetId[IconSet]);
|
||||||
snprintf (Icon,sizeof (Icon),
|
snprintf (Icon,sizeof (Icon),
|
||||||
"%s/%s/cog.svg",
|
"%s/%s/cog.svg",
|
||||||
Cfg_ICON_FOLDER_ICON_SETS,
|
Cfg_ICON_FOLDER_SETS,
|
||||||
Ico_IconSetId[IconSet]);
|
Ico_IconSetId[IconSet]);
|
||||||
Ico_PutPrefIconLink (Icon,Ico_IconSetNames[IconSet]);
|
Ico_PutPrefIconLink (Icon,Ico_IconSetNames[IconSet]);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
@ -161,9 +161,8 @@ void Ico_ChangeIconSet (void)
|
||||||
/***** Get param with icon set *****/
|
/***** Get param with icon set *****/
|
||||||
Gbl.Prefs.IconSet = Ico_GetParamIconSet ();
|
Gbl.Prefs.IconSet = Ico_GetParamIconSet ();
|
||||||
snprintf (Gbl.Prefs.URLIconSet,sizeof (Gbl.Prefs.URLIconSet),
|
snprintf (Gbl.Prefs.URLIconSet,sizeof (Gbl.Prefs.URLIconSet),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PUBLIC_ICON,
|
Cfg_URL_ICON_SETS_PUBLIC,
|
||||||
Cfg_ICON_FOLDER_ICON_SETS,
|
|
||||||
Ico_IconSetId[Gbl.Prefs.IconSet]);
|
Ico_IconSetId[Gbl.Prefs.IconSet]);
|
||||||
|
|
||||||
/***** Store icon set in database *****/
|
/***** Store icon set in database *****/
|
||||||
|
@ -301,7 +300,7 @@ void Ico_PutDivIcon (const char *DivClass,const char *Icon,const char *Title)
|
||||||
" class=\"CONTEXT_ICO_16x16\" />"
|
" class=\"CONTEXT_ICO_16x16\" />"
|
||||||
"</div>",
|
"</div>",
|
||||||
DivClass,
|
DivClass,
|
||||||
Gbl.Prefs.URLIcons,Icon,
|
Cfg_URL_ICON_PUBLIC,Icon,
|
||||||
Title,Title);
|
Title,Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +324,7 @@ void Ico_PutIconLink (const char *Icon,const char *Title)
|
||||||
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/%s\""
|
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/%s\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16\" />",
|
" class=\"CONTEXT_OPT ICO_HIGHLIGHT CONTEXT_ICO_16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,Icon,
|
Cfg_URL_ICON_PUBLIC,Icon,
|
||||||
Title,Title);
|
Title,Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +340,7 @@ void Ico_PutIconTextLink (const char *Icon,const char *Text)
|
||||||
" class=\"CONTEXT_ICO_x16\" />"
|
" class=\"CONTEXT_ICO_x16\" />"
|
||||||
" %s"
|
" %s"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons,Icon,Text,Text,
|
Cfg_URL_ICON_PUBLIC,Icon,Text,Text,
|
||||||
Text);
|
Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +353,7 @@ void Ico_PutPrefIconLink (const char *Icon,const char *Title)
|
||||||
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/%s\""
|
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/%s\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO_HIGHLIGHT ICOx20\" />",
|
" class=\"ICO_HIGHLIGHT ICOx20\" />",
|
||||||
Gbl.Prefs.URLIcons,Icon,
|
Cfg_URL_ICON_PUBLIC,Icon,
|
||||||
Title,Title);
|
Title,Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,7 +365,7 @@ void Ico_PutIconOff (const char *Icon,const char *Title)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s\" alt=\"%s\" title=\"%s\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/%s\" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_OPT ICO_HIDDEN CONTEXT_ICO_16x16\" />",
|
" class=\"CONTEXT_OPT ICO_HIDDEN CONTEXT_ICO_16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,Icon,Title,Title);
|
Cfg_URL_ICON_PUBLIC,Icon,Title,Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -385,8 +384,8 @@ void Ico_PutCalculateIcon (const char *Title)
|
||||||
" class=\"CONTEXT_ICO_16x16\" style=\"display:none;\" />" // Animated icon hidden
|
" class=\"CONTEXT_ICO_16x16\" style=\"display:none;\" />" // Animated icon hidden
|
||||||
"</div>"
|
"</div>"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Form.Num,Gbl.Prefs.URLIcons,Title,Title,
|
Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Title,Title,
|
||||||
Gbl.Form.Num,Gbl.Prefs.URLIcons,Title,Title);
|
Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Title,Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -407,8 +406,8 @@ void Ico_PutCalculateIconWithText (const char *Text)
|
||||||
" %s"
|
" %s"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Form.Num,Gbl.Prefs.URLIcons,Text,Text,
|
Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Text,Text,
|
||||||
Gbl.Form.Num,Gbl.Prefs.URLIcons,Text,Text,
|
Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Text,Text,
|
||||||
Text);
|
Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
28
swad_info.c
28
swad_info.c
|
@ -805,8 +805,8 @@ static bool Inf_CheckAndShowPage (void)
|
||||||
if (Fil_CheckIfPathExists (PathRelFileHTML)) // TODO: Check if not empty?
|
if (Fil_CheckIfPathExists (PathRelFileHTML)) // TODO: Check if not empty?
|
||||||
{
|
{
|
||||||
snprintf (URL,sizeof (URL),
|
snprintf (URL,sizeof (URL),
|
||||||
"%s/%s/%ld/%s/index.html",
|
"%s/%ld/%s/index.html",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_CRS,Gbl.CurrentCrs.Crs.CrsCod,
|
Cfg_URL_CRS_PUBLIC,Gbl.CurrentCrs.Crs.CrsCod,
|
||||||
Inf_FileNamesForInfoType[Gbl.CurrentCrs.Info.Type]);
|
Inf_FileNamesForInfoType[Gbl.CurrentCrs.Info.Type]);
|
||||||
Inf_ShowPage (URL);
|
Inf_ShowPage (URL);
|
||||||
|
|
||||||
|
@ -820,8 +820,8 @@ static bool Inf_CheckAndShowPage (void)
|
||||||
if (Fil_CheckIfPathExists (PathRelFileHTML)) // TODO: Check if not empty?
|
if (Fil_CheckIfPathExists (PathRelFileHTML)) // TODO: Check if not empty?
|
||||||
{
|
{
|
||||||
snprintf (URL,sizeof (URL),
|
snprintf (URL,sizeof (URL),
|
||||||
"%s/%s/%ld/%s/index.htm",
|
"%s/%ld/%s/index.htm",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_CRS,Gbl.CurrentCrs.Crs.CrsCod,
|
Cfg_URL_CRS_PUBLIC,Gbl.CurrentCrs.Crs.CrsCod,
|
||||||
Inf_FileNamesForInfoType[Gbl.CurrentCrs.Info.Type]);
|
Inf_FileNamesForInfoType[Gbl.CurrentCrs.Info.Type]);
|
||||||
Inf_ShowPage (URL);
|
Inf_ShowPage (URL);
|
||||||
|
|
||||||
|
@ -838,8 +838,8 @@ static bool Inf_CheckAndShowPage (void)
|
||||||
static void Inf_BuildPathPage (long CrsCod,Inf_InfoType_t InfoType,char PathDir[PATH_MAX + 1])
|
static void Inf_BuildPathPage (long CrsCod,Inf_InfoType_t InfoType,char PathDir[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
snprintf (PathDir,PATH_MAX + 1,
|
snprintf (PathDir,PATH_MAX + 1,
|
||||||
"%s/%s/%ld/%s",
|
"%s/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CRS,CrsCod,
|
Cfg_PATH_CRS_PUBLIC,CrsCod,
|
||||||
Inf_FileNamesForInfoType[InfoType]);
|
Inf_FileNamesForInfoType[InfoType]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -985,8 +985,8 @@ static void Inf_BuildPathURL (long CrsCod,Inf_InfoType_t InfoType,
|
||||||
char PathFile[PATH_MAX + 1])
|
char PathFile[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
snprintf (PathFile,PATH_MAX + 1,
|
snprintf (PathFile,PATH_MAX + 1,
|
||||||
"%s/%s/%ld/%s.url",
|
"%s/%ld/%s.url",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod,
|
Cfg_PATH_CRS_PRIVATE,CrsCod,
|
||||||
Inf_FileNamesForInfoType[InfoType]);
|
Inf_FileNamesForInfoType[InfoType]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1885,11 +1885,11 @@ static bool Inf_CheckAndShowRichTxt (void)
|
||||||
// TODO: change to another directory?
|
// TODO: change to another directory?
|
||||||
/* Create a unique name for the .md file */
|
/* Create a unique name for the .md file */
|
||||||
snprintf (PathFileMD,sizeof (PathFileMD),
|
snprintf (PathFileMD,sizeof (PathFileMD),
|
||||||
"%s/%s/%s.md",
|
"%s/%s.md",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_OUT_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
snprintf (PathFileHTML,sizeof (PathFileHTML),
|
snprintf (PathFileHTML,sizeof (PathFileHTML),
|
||||||
"%s/%s/%s.md.html", // Do not use only .html because that is the output temporary file
|
"%s/%s.md.html", // Do not use only .html because that is the output temporary file
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_OUT_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
|
|
||||||
/* Open Markdown file for writing */
|
/* Open Markdown file for writing */
|
||||||
if ((FileMD = fopen (PathFileMD,"wb")) == NULL)
|
if ((FileMD = fopen (PathFileMD,"wb")) == NULL)
|
||||||
|
@ -1976,8 +1976,8 @@ int Inf_WritePlainTextIntoHTMLBuffer (char **HTMLBuffer)
|
||||||
{
|
{
|
||||||
/***** Create a unique name for the file *****/
|
/***** Create a unique name for the file *****/
|
||||||
snprintf (FileNameHTMLTmp,sizeof (FileNameHTMLTmp),
|
snprintf (FileNameHTMLTmp,sizeof (FileNameHTMLTmp),
|
||||||
"%s/%s/%s_info.html",
|
"%s/%s_info.html",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_OUT_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
|
|
||||||
/***** Create a new temporary file for writing and reading *****/
|
/***** Create a new temporary file for writing and reading *****/
|
||||||
if ((FileHTMLTmp = fopen (FileNameHTMLTmp,"w+b")) == NULL)
|
if ((FileHTMLTmp = fopen (FileNameHTMLTmp,"w+b")) == NULL)
|
||||||
|
|
|
@ -1746,8 +1746,8 @@ void Ins_RemoveInstitution (void)
|
||||||
|
|
||||||
/***** Remove directories of the institution *****/
|
/***** Remove directories of the institution *****/
|
||||||
snprintf (PathIns,sizeof (PathIns),
|
snprintf (PathIns,sizeof (PathIns),
|
||||||
"%s/%s/%02u/%u",
|
"%s/%02u/%u",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_INS,
|
Cfg_PATH_INS_PUBLIC,
|
||||||
(unsigned) (Ins.InsCod % 100),
|
(unsigned) (Ins.InsCod % 100),
|
||||||
(unsigned) Ins.InsCod);
|
(unsigned) Ins.InsCod);
|
||||||
Fil_RemoveTree (PathIns);
|
Fil_RemoveTree (PathIns);
|
||||||
|
|
|
@ -190,8 +190,8 @@ void Lay_WriteStartOfPage (void)
|
||||||
/* Favicon */
|
/* Favicon */
|
||||||
fprintf (Gbl.F.Out,"<link type=\"image/x-icon\" href=\"%s/favicon.ico\" rel=\"icon\" />\n"
|
fprintf (Gbl.F.Out,"<link type=\"image/x-icon\" href=\"%s/favicon.ico\" rel=\"icon\" />\n"
|
||||||
"<link type=\"image/x-icon\" href=\"%s/favicon.ico\" rel=\"shortcut icon\" />\n",
|
"<link type=\"image/x-icon\" href=\"%s/favicon.ico\" rel=\"shortcut icon\" />\n",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
|
|
||||||
/* Style sheet for SWAD */
|
/* Style sheet for SWAD */
|
||||||
fprintf (Gbl.F.Out,"<link rel=\"StyleSheet\" href=\"%s/%s\" type=\"text/css\" />\n",
|
fprintf (Gbl.F.Out,"<link rel=\"StyleSheet\" href=\"%s/%s\" type=\"text/css\" />\n",
|
||||||
|
@ -261,7 +261,7 @@ void Lay_WriteStartOfPage (void)
|
||||||
"<div id=\"zoomTxt\" class=\"CENTER_MIDDLE\">"
|
"<div id=\"zoomTxt\" class=\"CENTER_MIDDLE\">"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<body>\n");
|
fprintf (Gbl.F.Out,"<body>\n");
|
||||||
|
@ -852,7 +852,7 @@ static void Lay_WritePageTopHeading (void)
|
||||||
" class=\"CENTER_MIDDLE\""
|
" class=\"CENTER_MIDDLE\""
|
||||||
" style=\"width:%upx; height:%upx;\" />"
|
" style=\"width:%upx; height:%upx;\" />"
|
||||||
"</a>", // head_row_1_logo_small
|
"</a>", // head_row_1_logo_small
|
||||||
Gbl.Prefs.URLIcons,Cfg_PLATFORM_LOGO_SMALL_FILENAME,
|
Cfg_URL_ICON_PUBLIC,Cfg_PLATFORM_LOGO_SMALL_FILENAME,
|
||||||
Cfg_PLATFORM_SHORT_NAME,Cfg_PLATFORM_FULL_NAME,
|
Cfg_PLATFORM_SHORT_NAME,Cfg_PLATFORM_FULL_NAME,
|
||||||
Cfg_PLATFORM_LOGO_SMALL_WIDTH,Cfg_PLATFORM_LOGO_SMALL_HEIGHT);
|
Cfg_PLATFORM_LOGO_SMALL_WIDTH,Cfg_PLATFORM_LOGO_SMALL_HEIGHT);
|
||||||
fprintf (Gbl.F.Out,"</div>"
|
fprintf (Gbl.F.Out,"</div>"
|
||||||
|
@ -862,7 +862,7 @@ static void Lay_WritePageTopHeading (void)
|
||||||
" class=\"CENTER_MIDDLE\""
|
" class=\"CENTER_MIDDLE\""
|
||||||
" style=\"width:%upx; height:%upx;\" />"
|
" style=\"width:%upx; height:%upx;\" />"
|
||||||
"</a>", // head_row_1_logo_big
|
"</a>", // head_row_1_logo_big
|
||||||
Gbl.Prefs.URLIcons,Cfg_PLATFORM_LOGO_BIG_FILENAME,
|
Cfg_URL_ICON_PUBLIC,Cfg_PLATFORM_LOGO_BIG_FILENAME,
|
||||||
Cfg_PLATFORM_SHORT_NAME,Cfg_PLATFORM_FULL_NAME,
|
Cfg_PLATFORM_SHORT_NAME,Cfg_PLATFORM_FULL_NAME,
|
||||||
Cfg_PLATFORM_LOGO_BIG_WIDTH,Cfg_PLATFORM_LOGO_BIG_HEIGHT);
|
Cfg_PLATFORM_LOGO_BIG_WIDTH,Cfg_PLATFORM_LOGO_BIG_HEIGHT);
|
||||||
fprintf (Gbl.F.Out,"</div>"
|
fprintf (Gbl.F.Out,"</div>"
|
||||||
|
@ -1061,7 +1061,7 @@ static void Lay_ShowRightColumn (void)
|
||||||
"</a>"
|
"</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
Txt_If_you_have_an_Android_device_try_SWADroid,
|
Txt_If_you_have_an_Android_device_try_SWADroid,
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1355,7 +1355,7 @@ static void Lay_WriteAboutZone (void)
|
||||||
"<div>%s</div>"
|
"<div>%s</div>"
|
||||||
"</a>",
|
"</a>",
|
||||||
Cfg_ABOUT_URL,
|
Cfg_ABOUT_URL,
|
||||||
Gbl.Prefs.URLIcons,Cfg_ABOUT_LOGO,
|
Cfg_URL_ICON_PUBLIC,Cfg_ABOUT_LOGO,
|
||||||
Cfg_ABOUT_NAME,Cfg_ABOUT_NAME,
|
Cfg_ABOUT_NAME,Cfg_ABOUT_NAME,
|
||||||
Cfg_ABOUT_LOGO_WIDTH,Cfg_ABOUT_LOGO_HEIGHT,
|
Cfg_ABOUT_LOGO_WIDTH,Cfg_ABOUT_LOGO_HEIGHT,
|
||||||
Cfg_ABOUT_NAME);
|
Cfg_ABOUT_NAME);
|
||||||
|
@ -1399,16 +1399,33 @@ void Lay_RefreshNotifsAndConnected (void)
|
||||||
|
|
||||||
/***** Sometimes, someone must do this work,
|
/***** Sometimes, someone must do this work,
|
||||||
so who best than processes that refresh via AJAX? *****/
|
so who best than processes that refresh via AJAX? *****/
|
||||||
if (!(Gbl.PID % 11)) // Do this only one of 11 times ( 11 is prime)
|
// We use (PID % prime-number) to do only one action as much
|
||||||
|
if (!(Gbl.PID % 11))
|
||||||
Ntf_SendPendingNotifByEMailToAllUsrs (); // Send pending notifications by email
|
Ntf_SendPendingNotifByEMailToAllUsrs (); // Send pending notifications by email
|
||||||
else if (!(Gbl.PID % 19)) // Do this only one of 19 times ( 19 is prime)
|
else if (!(Gbl.PID % 19))
|
||||||
FW_PurgeFirewall ();
|
FW_PurgeFirewall (); // Remove old clicks from firewall
|
||||||
else if (!(Gbl.PID % 1013)) // Do this only one of 1013 times (1013 is prime)
|
else if (!(Gbl.PID % 101))
|
||||||
Brw_RemoveExpiredExpandedFolders (); // Remove old expanded folders (from all users)
|
Brw_RemoveExpiredExpandedFolders (); // Remove old expanded folders (from all users)
|
||||||
else if (!(Gbl.PID % 1019)) // Do this only one of 1019 times (1019 is prime)
|
else if (!(Gbl.PID % 103))
|
||||||
Pre_RemoveOldPrefsFromIP (); // Remove old preferences from IP
|
Pre_RemoveOldPrefsFromIP (); // Remove old preferences from IP
|
||||||
else if (!(Gbl.PID % 1021)) // Do this only one of 1021 times (1021 is prime)
|
else if (!(Gbl.PID % 107))
|
||||||
Sta_RemoveOldEntriesRecentLog (); // Remove old entries in recent log table, it's a slow query
|
Sta_RemoveOldEntriesRecentLog (); // Remove old entries in recent log table, it's a slow query
|
||||||
|
else if (!(Gbl.PID % 109))
|
||||||
|
Fil_RemoveOldTmpFiles (Cfg_PATH_OUT_PRIVATE ,Cfg_TIME_TO_DELETE_HTML_OUTPUT ,false);
|
||||||
|
else if (!(Gbl.PID % 113))
|
||||||
|
Fil_RemoveOldTmpFiles (Cfg_PATH_FILE_BROWSER_TMP_PUBLIC ,Cfg_TIME_TO_DELETE_BROWSER_TMP_FILES ,false); // Remove the oldest temporary public directories used for downloading
|
||||||
|
else if (!(Gbl.PID % 127))
|
||||||
|
Fil_RemoveOldTmpFiles (Cfg_PATH_PHOTO_TMP_PUBLIC ,Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES ,false);
|
||||||
|
else if (!(Gbl.PID % 131))
|
||||||
|
Fil_RemoveOldTmpFiles (Cfg_PATH_PHOTO_TMP_PRIVATE ,Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES ,false);
|
||||||
|
else if (!(Gbl.PID % 137))
|
||||||
|
Fil_RemoveOldTmpFiles (Cfg_PATH_MEDIA_TMP_PRIVATE ,Cfg_TIME_TO_DELETE_MEDIA_TMP_FILES ,false);
|
||||||
|
else if (!(Gbl.PID % 139))
|
||||||
|
Fil_RemoveOldTmpFiles (Cfg_PATH_ZIP_PRIVATE ,Cfg_TIME_TO_DELETE_BROWSER_ZIP_FILES ,false);
|
||||||
|
else if (!(Gbl.PID % 149))
|
||||||
|
Fil_RemoveOldTmpFiles (Cfg_PATH_MARK_PRIVATE ,Cfg_TIME_TO_DELETE_MARKS_TMP_FILES ,false);
|
||||||
|
else if (!(Gbl.PID % 151))
|
||||||
|
Fil_RemoveOldTmpFiles (Cfg_PATH_TEST_PRIVATE ,Cfg_TIME_TO_DELETE_TEST_TMP_FILES ,false);
|
||||||
|
|
||||||
/***** Send, before the HTML, the refresh time *****/
|
/***** Send, before the HTML, the refresh time *****/
|
||||||
fprintf (Gbl.F.Out,"%lu|",Gbl.Usrs.Connected.TimeToRefreshInMs);
|
fprintf (Gbl.F.Out,"%lu|",Gbl.Usrs.Connected.TimeToRefreshInMs);
|
||||||
|
@ -1601,7 +1618,7 @@ void Lay_AdvertisementMobile (void)
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_Stay_connected_with_SWADroid,
|
Txt_Stay_connected_with_SWADroid,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Stay_connected_with_SWADroid);
|
Txt_Stay_connected_with_SWADroid);
|
||||||
|
|
||||||
/***** End table and box *****/
|
/***** End table and box *****/
|
||||||
|
@ -1627,7 +1644,7 @@ void Lay_IndentDependingOnLevel (unsigned Level,bool IsLastItemInLevel[])
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s20x20.gif\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/%s20x20.gif\""
|
||||||
" alt=\"\" title=\"\""
|
" alt=\"\" title=\"\""
|
||||||
" class=\"ICO25x25\" />",
|
" class=\"ICO25x25\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
IsLastItemInLevel[i] ? "tr" :
|
IsLastItemInLevel[i] ? "tr" :
|
||||||
"subleft");
|
"subleft");
|
||||||
|
|
||||||
|
@ -1636,7 +1653,7 @@ void Lay_IndentDependingOnLevel (unsigned Level,bool IsLastItemInLevel[])
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s20x20.gif\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/%s20x20.gif\""
|
||||||
" alt=\"\" title=\"\""
|
" alt=\"\" title=\"\""
|
||||||
" class=\"ICO25x25\" />",
|
" class=\"ICO25x25\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
IsLastItemInLevel[Level] ? "subend" :
|
IsLastItemInLevel[Level] ? "subend" :
|
||||||
"submid");
|
"submid");
|
||||||
}
|
}
|
||||||
|
|
14
swad_logo.c
14
swad_logo.c
|
@ -95,8 +95,8 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
|
||||||
Folder = Cfg_FOLDER_DEG;
|
Folder = Cfg_FOLDER_DEG;
|
||||||
DegCod = Cod;
|
DegCod = Cod;
|
||||||
snprintf (PathLogo,sizeof (PathLogo),
|
snprintf (PathLogo,sizeof (PathLogo),
|
||||||
"%s/%s/%02u/%u/logo/%u.png",
|
"%s/%02u/%u/logo/%u.png",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Folder,
|
Cfg_PATH_DEG_PRIVATE,
|
||||||
(unsigned) (DegCod % 100),
|
(unsigned) (DegCod % 100),
|
||||||
(unsigned) DegCod,
|
(unsigned) DegCod,
|
||||||
(unsigned) DegCod);
|
(unsigned) DegCod);
|
||||||
|
@ -114,8 +114,8 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
|
||||||
else
|
else
|
||||||
CtrCod = Cod;
|
CtrCod = Cod;
|
||||||
snprintf (PathLogo,sizeof (PathLogo),
|
snprintf (PathLogo,sizeof (PathLogo),
|
||||||
"%s/%s/%02u/%u/logo/%u.png",
|
"%s/%02u/%u/logo/%u.png",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Folder,
|
Cfg_PATH_CTR_PUBLIC,
|
||||||
(unsigned) (CtrCod % 100),
|
(unsigned) (CtrCod % 100),
|
||||||
(unsigned) CtrCod,
|
(unsigned) CtrCod,
|
||||||
(unsigned) CtrCod);
|
(unsigned) CtrCod);
|
||||||
|
@ -135,8 +135,8 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
|
||||||
else
|
else
|
||||||
InsCod = Cod;
|
InsCod = Cod;
|
||||||
snprintf (PathLogo,sizeof (PathLogo),
|
snprintf (PathLogo,sizeof (PathLogo),
|
||||||
"%s/%s/%02u/%u/logo/%u.png",
|
"%s/%02u/%u/logo/%u.png",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Folder,
|
Cfg_PATH_INS_PUBLIC,
|
||||||
(unsigned) (InsCod % 100),
|
(unsigned) (InsCod % 100),
|
||||||
(unsigned) InsCod,
|
(unsigned) InsCod,
|
||||||
(unsigned) InsCod);
|
(unsigned) InsCod);
|
||||||
|
@ -157,7 +157,7 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
|
||||||
(unsigned) Cod);
|
(unsigned) Cod);
|
||||||
else if (Icon[Scope])
|
else if (Icon[Scope])
|
||||||
fprintf (Gbl.F.Out,"%s/%s",
|
fprintf (Gbl.F.Out,"%s/%s",
|
||||||
Gbl.Prefs.URLIcons,Icon[Scope]);
|
Cfg_URL_ICON_PUBLIC,Icon[Scope]);
|
||||||
fprintf (Gbl.F.Out,"\""
|
fprintf (Gbl.F.Out,"\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO%ux%u",
|
" class=\"ICO%ux%u",
|
||||||
|
|
|
@ -1297,7 +1297,7 @@ static void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe,
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/check-circle.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/check-circle.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />",
|
" class=\"ICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Title,Gbl.Title);
|
Gbl.Title,Gbl.Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1805,8 +1805,8 @@ void Mai_ConfirmEmail (void)
|
||||||
void Mai_CreateFileNameMail (void)
|
void Mai_CreateFileNameMail (void)
|
||||||
{
|
{
|
||||||
snprintf (Gbl.Msg.FileNameMail,sizeof (Gbl.Msg.FileNameMail),
|
snprintf (Gbl.Msg.FileNameMail,sizeof (Gbl.Msg.FileNameMail),
|
||||||
"%s/%s/%s_mail.txt",
|
"%s/%s_mail.txt",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_OUT_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
if ((Gbl.Msg.FileMail = fopen (Gbl.Msg.FileNameMail,"wb")) == NULL)
|
if ((Gbl.Msg.FileMail = fopen (Gbl.Msg.FileNameMail,"wb")) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Can not open file to send email.");
|
Lay_ShowErrorAndExit ("Can not open file to send email.");
|
||||||
}
|
}
|
||||||
|
|
36
swad_mark.c
36
swad_mark.c
|
@ -606,7 +606,6 @@ void Mrk_ShowMyMarks (void)
|
||||||
struct MarksProperties Marks;
|
struct MarksProperties Marks;
|
||||||
char FileNameUsrMarks[PATH_MAX + 1];
|
char FileNameUsrMarks[PATH_MAX + 1];
|
||||||
FILE *FileUsrMarks;
|
FILE *FileUsrMarks;
|
||||||
char PathMarksPriv[PATH_MAX + 1];
|
|
||||||
char PathPrivate[PATH_MAX + 1 +
|
char PathPrivate[PATH_MAX + 1 +
|
||||||
PATH_MAX + 1];
|
PATH_MAX + 1];
|
||||||
struct UsrData *UsrDat;
|
struct UsrData *UsrDat;
|
||||||
|
@ -661,21 +660,12 @@ void Mrk_ShowMyMarks (void)
|
||||||
|
|
||||||
/***** Create temporal file to store my marks (in HTML) *****/
|
/***** Create temporal file to store my marks (in HTML) *****/
|
||||||
/* If the private directory does not exist, create it */
|
/* If the private directory does not exist, create it */
|
||||||
snprintf (PathMarksPriv,sizeof (PathMarksPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_MARK_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_MARK);
|
|
||||||
Fil_CreateDirIfNotExists (PathMarksPriv);
|
|
||||||
|
|
||||||
/* First of all, we remove the oldest temporary files.
|
|
||||||
Such temporary files have been created by me or by other users.
|
|
||||||
This is a bit sloppy, but they must be removed by someone.
|
|
||||||
Here "oldest" means more than x time from their creation */
|
|
||||||
Fil_RemoveOldTmpFiles (PathMarksPriv,Cfg_TIME_TO_DELETE_MARKS_TMP_FILES,false);
|
|
||||||
|
|
||||||
/* Create a new temporary file *****/
|
/* Create a new temporary file *****/
|
||||||
snprintf (FileNameUsrMarks,sizeof (FileNameUsrMarks),
|
snprintf (FileNameUsrMarks,sizeof (FileNameUsrMarks),
|
||||||
"%s/%s.html",
|
"%s/%s.html",
|
||||||
PathMarksPriv,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_MARK_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
if ((FileUsrMarks = fopen (FileNameUsrMarks,"wb")) == NULL)
|
if ((FileUsrMarks = fopen (FileNameUsrMarks,"wb")) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Can not open file for my marks.");
|
Lay_ShowErrorAndExit ("Can not open file for my marks.");
|
||||||
|
|
||||||
|
@ -736,7 +726,6 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
||||||
char FullPathInTreeFromDBMarksTable[PATH_MAX + 1];
|
char FullPathInTreeFromDBMarksTable[PATH_MAX + 1];
|
||||||
char PathUntilFileName[PATH_MAX + 1];
|
char PathUntilFileName[PATH_MAX + 1];
|
||||||
char FileName[NAME_MAX + 1];
|
char FileName[NAME_MAX + 1];
|
||||||
char PathMarksPriv[PATH_MAX + 1];
|
|
||||||
char PathMarks[PATH_MAX + 1];
|
char PathMarks[PATH_MAX + 1];
|
||||||
char FileNameUsrMarks[PATH_MAX + 1];
|
char FileNameUsrMarks[PATH_MAX + 1];
|
||||||
FILE *FileUsrMarks;
|
FILE *FileUsrMarks;
|
||||||
|
@ -802,32 +791,23 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
||||||
{
|
{
|
||||||
if (GrpCod > 0)
|
if (GrpCod > 0)
|
||||||
snprintf (PathMarks,sizeof (PathMarks),
|
snprintf (PathMarks,sizeof (PathMarks),
|
||||||
"%s/%s/%ld/grp/%ld/%s",
|
"%s/%ld/grp/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod,GrpCod,
|
Cfg_PATH_CRS_PRIVATE,CrsCod,GrpCod,
|
||||||
FullPathInTreeFromDBMarksTable);
|
FullPathInTreeFromDBMarksTable);
|
||||||
else
|
else
|
||||||
snprintf (PathMarks,sizeof (PathMarks),
|
snprintf (PathMarks,sizeof (PathMarks),
|
||||||
"%s/%s/%ld/%s",
|
"%s/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod,
|
Cfg_PATH_CRS_PRIVATE,CrsCod,
|
||||||
FullPathInTreeFromDBMarksTable);
|
FullPathInTreeFromDBMarksTable);
|
||||||
|
|
||||||
/***** Create temporal file to store my marks (in HTML) *****/
|
/***** Create temporal file to store my marks (in HTML) *****/
|
||||||
/* If the private directory does not exist, create it */
|
/* If the private directory does not exist, create it */
|
||||||
snprintf (PathMarksPriv,sizeof (PathMarksPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_MARK_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_MARK);
|
|
||||||
Fil_CreateDirIfNotExists (PathMarksPriv);
|
|
||||||
|
|
||||||
/* First of all, we remove the oldest temporary files.
|
|
||||||
Such temporary files have been created by me or by other users.
|
|
||||||
This is a bit sloppy, but they must be removed by someone.
|
|
||||||
Here "oldest" means more than x time from their creation */
|
|
||||||
Fil_RemoveOldTmpFiles (PathMarksPriv,Cfg_TIME_TO_DELETE_MARKS_TMP_FILES,false);
|
|
||||||
|
|
||||||
/* Create a new temporary file *****/
|
/* Create a new temporary file *****/
|
||||||
snprintf (FileNameUsrMarks,sizeof (FileNameUsrMarks),
|
snprintf (FileNameUsrMarks,sizeof (FileNameUsrMarks),
|
||||||
"%s/%s.html",
|
"%s/%s.html",
|
||||||
PathMarksPriv,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_MARK_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
if ((FileUsrMarks = fopen (FileNameUsrMarks,"wb")))
|
if ((FileUsrMarks = fopen (FileNameUsrMarks,"wb")))
|
||||||
{
|
{
|
||||||
/***** Get user's marks *****/
|
/***** Get user's marks *****/
|
||||||
|
|
89
swad_media.c
89
swad_media.c
|
@ -116,17 +116,13 @@ static void Usr_GetTitleFromForm (const char *ParamName,struct Media *Media);
|
||||||
static void Med_GetAndProcessFileFromForm (const char *ParamFile,
|
static void Med_GetAndProcessFileFromForm (const char *ParamFile,
|
||||||
struct Media *Media);
|
struct Media *Media);
|
||||||
static bool Med_DetectIfAnimated (struct Media *Media,
|
static bool Med_DetectIfAnimated (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathFileOrg[PATH_MAX + 1]);
|
const char PathFileOrg[PATH_MAX + 1]);
|
||||||
|
|
||||||
static void Med_ProcessJPG (struct Media *Media,
|
static void Med_ProcessJPG (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathFileOrg[PATH_MAX + 1]);
|
const char PathFileOrg[PATH_MAX + 1]);
|
||||||
static void Med_ProcessGIF (struct Media *Media,
|
static void Med_ProcessGIF (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathFileOrg[PATH_MAX + 1]);
|
const char PathFileOrg[PATH_MAX + 1]);
|
||||||
static void Med_ProcessVideo (struct Media *Media,
|
static void Med_ProcessVideo (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathFileOrg[PATH_MAX + 1]);
|
const char PathFileOrg[PATH_MAX + 1]);
|
||||||
|
|
||||||
static int Med_ResizeImage (struct Media *Media,
|
static int Med_ResizeImage (struct Media *Media,
|
||||||
|
@ -139,7 +135,6 @@ static void Med_GetAndProcessEmbedFromForm (const char *ParamURL,
|
||||||
struct Media *Media);
|
struct Media *Media);
|
||||||
|
|
||||||
static bool Med_MoveTmpFileToDefDir (struct Media *Media,
|
static bool Med_MoveTmpFileToDefDir (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathMedPriv[PATH_MAX + 1],
|
const char PathMedPriv[PATH_MAX + 1],
|
||||||
const char *Extension);
|
const char *Extension);
|
||||||
|
|
||||||
|
@ -353,7 +348,7 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
||||||
" onclick=\"mediaClickOnActivateUpload('%s');\" />"
|
" onclick=\"mediaClickOnActivateUpload('%s');\" />"
|
||||||
"</div>", // <id>_ico_upl
|
"</div>", // <id>_ico_upl
|
||||||
Id,
|
Id,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Image_video,Txt_Image_video,
|
Txt_Image_video,Txt_Image_video,
|
||||||
Id);
|
Id);
|
||||||
|
|
||||||
|
@ -374,7 +369,7 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
||||||
" onclick=\"mediaClickOnActivateEmbed('%s');\" />"
|
" onclick=\"mediaClickOnActivateEmbed('%s');\" />"
|
||||||
"</div>", // <id>_ico_emb
|
"</div>", // <id>_ico_emb
|
||||||
Id,
|
Id,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
"YouTube","YouTube",
|
"YouTube","YouTube",
|
||||||
Id);
|
Id);
|
||||||
|
|
||||||
|
@ -650,8 +645,6 @@ static void Med_GetAndProcessFileFromForm (const char *ParamFile,
|
||||||
char *PtrExtension;
|
char *PtrExtension;
|
||||||
size_t LengthExtension;
|
size_t LengthExtension;
|
||||||
char MIMEType[Brw_MAX_BYTES_MIME_TYPE + 1];
|
char MIMEType[Brw_MAX_BYTES_MIME_TYPE + 1];
|
||||||
char PathMedPriv[PATH_MAX + 1];
|
|
||||||
char PathMedPrivTmp[PATH_MAX + 1];
|
|
||||||
char PathFileOrg[PATH_MAX + 1]; // Full name of original uploaded file
|
char PathFileOrg[PATH_MAX + 1]; // Full name of original uploaded file
|
||||||
|
|
||||||
/***** Set media status *****/
|
/***** Set media status *****/
|
||||||
|
@ -685,47 +678,38 @@ static void Med_GetAndProcessFileFromForm (const char *ParamFile,
|
||||||
|
|
||||||
/***** Create private directories if not exist *****/
|
/***** Create private directories if not exist *****/
|
||||||
/* Create private directory for images/videos if it does not exist */
|
/* Create private directory for images/videos if it does not exist */
|
||||||
snprintf (PathMedPriv,sizeof (PathMedPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_MEDIA_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_MEDIA);
|
|
||||||
Fil_CreateDirIfNotExists (PathMedPriv);
|
|
||||||
|
|
||||||
/* Create temporary private directory for images/videos if it does not exist */
|
/* Create temporary private directory for images/videos if it does not exist */
|
||||||
snprintf (PathMedPrivTmp,sizeof (PathMedPrivTmp),
|
Fil_CreateDirIfNotExists (Cfg_PATH_MEDIA_TMP_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
PathMedPriv,Cfg_FOLDER_IMG_TMP);
|
|
||||||
Fil_CreateDirIfNotExists (PathMedPrivTmp);
|
|
||||||
|
|
||||||
/***** Remove old temporary private files *****/
|
|
||||||
Fil_RemoveOldTmpFiles (PathMedPrivTmp,Cfg_TIME_TO_DELETE_IMAGES_TMP_FILES,false);
|
|
||||||
|
|
||||||
/***** End the reception of original not processed media
|
/***** End the reception of original not processed media
|
||||||
(it may be very big) into a temporary file *****/
|
(it may be very big) into a temporary file *****/
|
||||||
Media->Status = Med_STATUS_NONE;
|
Media->Status = Med_STATUS_NONE;
|
||||||
snprintf (PathFileOrg,sizeof (PathFileOrg),
|
snprintf (PathFileOrg,sizeof (PathFileOrg),
|
||||||
"%s/%s_original.%s",
|
"%s/%s_original.%s",
|
||||||
PathMedPrivTmp,Media->Name,PtrExtension);
|
Cfg_PATH_MEDIA_TMP_PRIVATE,Media->Name,PtrExtension);
|
||||||
|
|
||||||
if (Fil_EndReceptionOfFile (PathFileOrg,Param)) // Success
|
if (Fil_EndReceptionOfFile (PathFileOrg,Param)) // Success
|
||||||
{
|
{
|
||||||
/***** Detect if animated GIF *****/
|
/***** Detect if animated GIF *****/
|
||||||
if (Media->Type == Med_GIF)
|
if (Media->Type == Med_GIF)
|
||||||
if (!Med_DetectIfAnimated (Media,PathMedPrivTmp,PathFileOrg))
|
if (!Med_DetectIfAnimated (Media,PathFileOrg))
|
||||||
Media->Type = Med_JPG;
|
Media->Type = Med_JPG;
|
||||||
|
|
||||||
/***** Process media depending on the media file extension *****/
|
/***** Process media depending on the media file extension *****/
|
||||||
switch (Media->Type)
|
switch (Media->Type)
|
||||||
{
|
{
|
||||||
case Med_JPG:
|
case Med_JPG:
|
||||||
Med_ProcessJPG (Media,PathMedPrivTmp,PathFileOrg);
|
Med_ProcessJPG (Media,PathFileOrg);
|
||||||
break;
|
break;
|
||||||
case Med_GIF:
|
case Med_GIF:
|
||||||
Med_ProcessGIF (Media,PathMedPrivTmp,PathFileOrg);
|
Med_ProcessGIF (Media,PathFileOrg);
|
||||||
break;
|
break;
|
||||||
case Med_MP4:
|
case Med_MP4:
|
||||||
case Med_WEBM:
|
case Med_WEBM:
|
||||||
case Med_OGG:
|
case Med_OGG:
|
||||||
Med_ProcessVideo (Media,PathMedPrivTmp,PathFileOrg);
|
Med_ProcessVideo (Media,PathFileOrg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -744,7 +728,6 @@ static void Med_GetAndProcessFileFromForm (const char *ParamFile,
|
||||||
// Return false if static or error
|
// Return false if static or error
|
||||||
|
|
||||||
static bool Med_DetectIfAnimated (struct Media *Media,
|
static bool Med_DetectIfAnimated (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathFileOrg[PATH_MAX + 1])
|
const char PathFileOrg[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
char PathFileTxtTmp[PATH_MAX + 1];
|
char PathFileTxtTmp[PATH_MAX + 1];
|
||||||
|
@ -756,7 +739,7 @@ static bool Med_DetectIfAnimated (struct Media *Media,
|
||||||
/***** Build path to temporary text file *****/
|
/***** Build path to temporary text file *****/
|
||||||
snprintf (PathFileTxtTmp,sizeof (PathFileTxtTmp),
|
snprintf (PathFileTxtTmp,sizeof (PathFileTxtTmp),
|
||||||
"%s/%s.txt",
|
"%s/%s.txt",
|
||||||
PathMedPrivTmp,Media->Name);
|
Cfg_PATH_MEDIA_TMP_PRIVATE,Media->Name);
|
||||||
|
|
||||||
/***** Execute system command to get number of frames in GIF *****/
|
/***** Execute system command to get number of frames in GIF *****/
|
||||||
snprintf (Command,sizeof (Command),
|
snprintf (Command,sizeof (Command),
|
||||||
|
@ -787,7 +770,6 @@ static bool Med_DetectIfAnimated (struct Media *Media,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Med_ProcessJPG (struct Media *Media,
|
static void Med_ProcessJPG (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathFileOrg[PATH_MAX + 1])
|
const char PathFileOrg[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_file_could_not_be_processed_successfully;
|
extern const char *Txt_The_file_could_not_be_processed_successfully;
|
||||||
|
@ -797,7 +779,7 @@ static void Med_ProcessJPG (struct Media *Media,
|
||||||
by calling to program that makes the conversion *****/
|
by calling to program that makes the conversion *****/
|
||||||
snprintf (PathFileJPGTmp,sizeof (PathFileJPGTmp),
|
snprintf (PathFileJPGTmp,sizeof (PathFileJPGTmp),
|
||||||
"%s/%s.%s",
|
"%s/%s.%s",
|
||||||
PathMedPrivTmp,Media->Name,Med_Extensions[Med_JPG]);
|
Cfg_PATH_MEDIA_TMP_PRIVATE,Media->Name,Med_Extensions[Med_JPG]);
|
||||||
if (Med_ResizeImage (Media,PathFileOrg,PathFileJPGTmp) == 0) // On success ==> 0 is returned
|
if (Med_ResizeImage (Media,PathFileOrg,PathFileJPGTmp) == 0) // On success ==> 0 is returned
|
||||||
/* Success */
|
/* Success */
|
||||||
Media->Status = Med_PROCESSED;
|
Media->Status = Med_PROCESSED;
|
||||||
|
@ -817,7 +799,6 @@ static void Med_ProcessJPG (struct Media *Media,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Med_ProcessGIF (struct Media *Media,
|
static void Med_ProcessGIF (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathFileOrg[PATH_MAX + 1])
|
const char PathFileOrg[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_file_could_not_be_processed_successfully;
|
extern const char *Txt_The_file_could_not_be_processed_successfully;
|
||||||
|
@ -838,14 +819,14 @@ static void Med_ProcessGIF (struct Media *Media,
|
||||||
and save it on temporary PNG file */
|
and save it on temporary PNG file */
|
||||||
snprintf (PathFilePNGTmp,sizeof (PathFilePNGTmp),
|
snprintf (PathFilePNGTmp,sizeof (PathFilePNGTmp),
|
||||||
"%s/%s.png",
|
"%s/%s.png",
|
||||||
PathMedPrivTmp,Media->Name);
|
Cfg_PATH_MEDIA_TMP_PRIVATE,Media->Name);
|
||||||
if (Med_GetFirstFrame (PathFileOrg,PathFilePNGTmp) == 0) // On success ==> 0 is returned
|
if (Med_GetFirstFrame (PathFileOrg,PathFilePNGTmp) == 0) // On success ==> 0 is returned
|
||||||
{
|
{
|
||||||
/* Success */
|
/* Success */
|
||||||
/***** Move original GIF file to temporary GIF file *****/
|
/***** Move original GIF file to temporary GIF file *****/
|
||||||
snprintf (PathFileGIFTmp,sizeof (PathFileGIFTmp),
|
snprintf (PathFileGIFTmp,sizeof (PathFileGIFTmp),
|
||||||
"%s/%s.%s",
|
"%s/%s.%s",
|
||||||
PathMedPrivTmp,Media->Name,Med_Extensions[Med_GIF]);
|
Cfg_PATH_MEDIA_TMP_PRIVATE,Media->Name,Med_Extensions[Med_GIF]);
|
||||||
if (rename (PathFileOrg,PathFileGIFTmp)) // Fail
|
if (rename (PathFileOrg,PathFileGIFTmp)) // Fail
|
||||||
{
|
{
|
||||||
/* Remove temporary PNG file */
|
/* Remove temporary PNG file */
|
||||||
|
@ -887,7 +868,6 @@ static void Med_ProcessGIF (struct Media *Media,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Med_ProcessVideo (struct Media *Media,
|
static void Med_ProcessVideo (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathFileOrg[PATH_MAX + 1])
|
const char PathFileOrg[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_file_could_not_be_processed_successfully;
|
extern const char *Txt_The_file_could_not_be_processed_successfully;
|
||||||
|
@ -906,7 +886,7 @@ static void Med_ProcessVideo (struct Media *Media,
|
||||||
/***** Move original video file to temporary MP4 file *****/
|
/***** Move original video file to temporary MP4 file *****/
|
||||||
snprintf (PathFileTmp,sizeof (PathFileTmp),
|
snprintf (PathFileTmp,sizeof (PathFileTmp),
|
||||||
"%s/%s.%s",
|
"%s/%s.%s",
|
||||||
PathMedPrivTmp,Media->Name,Med_Extensions[Media->Type]);
|
Cfg_PATH_MEDIA_TMP_PRIVATE,Media->Name,Med_Extensions[Media->Type]);
|
||||||
if (rename (PathFileOrg,PathFileTmp)) // Fail
|
if (rename (PathFileOrg,PathFileTmp)) // Fail
|
||||||
/* Show error alert */
|
/* Show error alert */
|
||||||
Ale_ShowAlert (Ale_ERROR,Txt_The_file_could_not_be_processed_successfully);
|
Ale_ShowAlert (Ale_ERROR,Txt_The_file_could_not_be_processed_successfully);
|
||||||
|
@ -1187,7 +1167,6 @@ void Med_RemoveKeepOrStoreMedia (long CurrentMedCodInDB,struct Media *Media)
|
||||||
|
|
||||||
void Med_MoveMediaToDefinitiveDir (struct Media *Media)
|
void Med_MoveMediaToDefinitiveDir (struct Media *Media)
|
||||||
{
|
{
|
||||||
char PathMedPrivTmp[PATH_MAX + 1];
|
|
||||||
char PathMedPriv[PATH_MAX + 1];
|
char PathMedPriv[PATH_MAX + 1];
|
||||||
|
|
||||||
/***** Check trivial case *****/
|
/***** Check trivial case *****/
|
||||||
|
@ -1198,15 +1177,10 @@ void Med_MoveMediaToDefinitiveDir (struct Media *Media)
|
||||||
Media->Status = Med_MOVED; // Success
|
Media->Status = Med_MOVED; // Success
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/***** Build temporary path *****/
|
|
||||||
snprintf (PathMedPrivTmp,sizeof (PathMedPrivTmp),
|
|
||||||
"%s/%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_MEDIA,Cfg_FOLDER_IMG_TMP);
|
|
||||||
|
|
||||||
/***** Create private subdirectory for media if it does not exist *****/
|
/***** Create private subdirectory for media if it does not exist *****/
|
||||||
snprintf (PathMedPriv,sizeof (PathMedPriv),
|
snprintf (PathMedPriv,sizeof (PathMedPriv),
|
||||||
"%s/%s/%c%c",
|
"%s/%c%c",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_MEDIA,
|
Cfg_PATH_MEDIA_PRIVATE,
|
||||||
Media->Name[0],
|
Media->Name[0],
|
||||||
Media->Name[1]);
|
Media->Name[1]);
|
||||||
Fil_CreateDirIfNotExists (PathMedPriv);
|
Fil_CreateDirIfNotExists (PathMedPriv);
|
||||||
|
@ -1216,16 +1190,16 @@ void Med_MoveMediaToDefinitiveDir (struct Media *Media)
|
||||||
{
|
{
|
||||||
case Med_JPG:
|
case Med_JPG:
|
||||||
/* Move JPG */
|
/* Move JPG */
|
||||||
if (Med_MoveTmpFileToDefDir (Media,PathMedPrivTmp,PathMedPriv,
|
if (Med_MoveTmpFileToDefDir (Media,PathMedPriv,
|
||||||
Med_Extensions[Med_JPG]))
|
Med_Extensions[Med_JPG]))
|
||||||
Media->Status = Med_MOVED; // Success
|
Media->Status = Med_MOVED; // Success
|
||||||
break;
|
break;
|
||||||
case Med_GIF:
|
case Med_GIF:
|
||||||
/* Move PNG */
|
/* Move PNG */
|
||||||
if (Med_MoveTmpFileToDefDir (Media,PathMedPrivTmp,PathMedPriv,
|
if (Med_MoveTmpFileToDefDir (Media,PathMedPriv,
|
||||||
"png"))
|
"png"))
|
||||||
/* Move GIF */
|
/* Move GIF */
|
||||||
if (Med_MoveTmpFileToDefDir (Media,PathMedPrivTmp,PathMedPriv,
|
if (Med_MoveTmpFileToDefDir (Media,PathMedPriv,
|
||||||
Med_Extensions[Med_GIF]))
|
Med_Extensions[Med_GIF]))
|
||||||
Media->Status = Med_MOVED; // Success
|
Media->Status = Med_MOVED; // Success
|
||||||
break;
|
break;
|
||||||
|
@ -1233,7 +1207,7 @@ void Med_MoveMediaToDefinitiveDir (struct Media *Media)
|
||||||
case Med_WEBM:
|
case Med_WEBM:
|
||||||
case Med_OGG:
|
case Med_OGG:
|
||||||
/* Move MP4 or WEBM or OGG */
|
/* Move MP4 or WEBM or OGG */
|
||||||
if (Med_MoveTmpFileToDefDir (Media,PathMedPrivTmp,PathMedPriv,
|
if (Med_MoveTmpFileToDefDir (Media,PathMedPriv,
|
||||||
Med_Extensions[Media->Type]))
|
Med_Extensions[Media->Type]))
|
||||||
Media->Status = Med_MOVED; // Success
|
Media->Status = Med_MOVED; // Success
|
||||||
break;
|
break;
|
||||||
|
@ -1256,7 +1230,6 @@ void Med_MoveMediaToDefinitiveDir (struct Media *Media)
|
||||||
// Return false on error
|
// Return false on error
|
||||||
|
|
||||||
static bool Med_MoveTmpFileToDefDir (struct Media *Media,
|
static bool Med_MoveTmpFileToDefDir (struct Media *Media,
|
||||||
const char PathMedPrivTmp[PATH_MAX + 1],
|
|
||||||
const char PathMedPriv[PATH_MAX + 1],
|
const char PathMedPriv[PATH_MAX + 1],
|
||||||
const char *Extension)
|
const char *Extension)
|
||||||
{
|
{
|
||||||
|
@ -1266,7 +1239,7 @@ static bool Med_MoveTmpFileToDefDir (struct Media *Media,
|
||||||
/***** Temporary processed media file *****/
|
/***** Temporary processed media file *****/
|
||||||
snprintf (PathFileTmp,sizeof (PathFileTmp),
|
snprintf (PathFileTmp,sizeof (PathFileTmp),
|
||||||
"%s/%s.%s",
|
"%s/%s.%s",
|
||||||
PathMedPrivTmp,Media->Name,Extension);
|
Cfg_PATH_MEDIA_TMP_PRIVATE,Media->Name,Extension);
|
||||||
|
|
||||||
/***** Definitive processed media file *****/
|
/***** Definitive processed media file *****/
|
||||||
snprintf (PathFile,sizeof (PathFile),
|
snprintf (PathFile,sizeof (PathFile),
|
||||||
|
@ -1352,8 +1325,8 @@ void Med_ShowMedia (struct Media *Media,
|
||||||
|
|
||||||
/***** Build path to private directory with the media *****/
|
/***** Build path to private directory with the media *****/
|
||||||
snprintf (PathMedPriv,sizeof (PathMedPriv),
|
snprintf (PathMedPriv,sizeof (PathMedPriv),
|
||||||
"%s/%s/%c%c",
|
"%s/%c%c",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_MEDIA,
|
Cfg_PATH_MEDIA_PRIVATE,
|
||||||
Media->Name[0],
|
Media->Name[0],
|
||||||
Media->Name[1]);
|
Media->Name[1]);
|
||||||
|
|
||||||
|
@ -1415,8 +1388,8 @@ static void Med_ShowJPG (struct Media *Media,
|
||||||
|
|
||||||
/***** Build temporary public URL *****/
|
/***** Build temporary public URL *****/
|
||||||
snprintf (URLTmp,sizeof (URLTmp),
|
snprintf (URLTmp,sizeof (URLTmp),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
|
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Gbl.FileBrowser.TmpPubDir);
|
Gbl.FileBrowser.TmpPubDir);
|
||||||
|
|
||||||
/***** Create URL pointing to symbolic link *****/
|
/***** Create URL pointing to symbolic link *****/
|
||||||
|
@ -1467,8 +1440,8 @@ static void Med_ShowGIF (struct Media *Media,
|
||||||
|
|
||||||
/***** Build temporary public URL *****/
|
/***** Build temporary public URL *****/
|
||||||
snprintf (URLTmp,sizeof (URLTmp),
|
snprintf (URLTmp,sizeof (URLTmp),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
|
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Gbl.FileBrowser.TmpPubDir);
|
Gbl.FileBrowser.TmpPubDir);
|
||||||
|
|
||||||
/***** Create URL pointing to symbolic link *****/
|
/***** Create URL pointing to symbolic link *****/
|
||||||
|
@ -1558,8 +1531,8 @@ static void Med_ShowVideo (struct Media *Media,
|
||||||
|
|
||||||
/***** Build temporary public URL *****/
|
/***** Build temporary public URL *****/
|
||||||
snprintf (URLTmp,sizeof (URLTmp),
|
snprintf (URLTmp,sizeof (URLTmp),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
|
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Gbl.FileBrowser.TmpPubDir);
|
Gbl.FileBrowser.TmpPubDir);
|
||||||
|
|
||||||
/***** Create URL pointing to symbolic link *****/
|
/***** Create URL pointing to symbolic link *****/
|
||||||
|
@ -1690,8 +1663,8 @@ void Med_RemoveMedia (long MedCod)
|
||||||
{
|
{
|
||||||
/***** Build path to private directory with the media *****/
|
/***** Build path to private directory with the media *****/
|
||||||
snprintf (PathMedPriv,sizeof (PathMedPriv),
|
snprintf (PathMedPriv,sizeof (PathMedPriv),
|
||||||
"%s/%s/%c%c",
|
"%s/%c%c",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_MEDIA,
|
Cfg_PATH_MEDIA_PRIVATE,
|
||||||
Media.Name[0],
|
Media.Name[0],
|
||||||
Media.Name[1]);
|
Media.Name[1]);
|
||||||
|
|
||||||
|
|
|
@ -2936,7 +2936,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod)
|
||||||
"BG_MSG_GREEN") :
|
"BG_MSG_GREEN") :
|
||||||
"BG_MSG_BLUE",
|
"BG_MSG_BLUE",
|
||||||
|
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Msg.TypeOfMessages == Msg_MESSAGES_RECEIVED ? (Open ? (Replied ? "reply.svg" :
|
Gbl.Msg.TypeOfMessages == Msg_MESSAGES_RECEIVED ? (Open ? (Replied ? "reply.svg" :
|
||||||
"envelope-open-text.svg") :
|
"envelope-open-text.svg") :
|
||||||
"envelope.svg") :
|
"envelope.svg") :
|
||||||
|
@ -3206,7 +3206,7 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,bool Enabled,const char *BgColor
|
||||||
" class=\"PHOTO30x40\" />"
|
" class=\"PHOTO30x40\" />"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"LEFT_MIDDLE",
|
"<td class=\"LEFT_MIDDLE",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Unknown_or_without_photo,Txt_Unknown_or_without_photo);
|
Txt_Unknown_or_without_photo,Txt_Unknown_or_without_photo);
|
||||||
if (BgColor)
|
if (BgColor)
|
||||||
fprintf (Gbl.F.Out," %s",BgColor);
|
fprintf (Gbl.F.Out," %s",BgColor);
|
||||||
|
@ -3332,7 +3332,7 @@ static void Msg_WriteMsgFrom (struct UsrData *UsrDat,bool Deleted)
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Deleted ? "share-red.svg" :
|
Deleted ? "share-red.svg" :
|
||||||
"share.svg",
|
"share.svg",
|
||||||
Deleted ? Txt_MSG_Sent_and_deleted :
|
Deleted ? Txt_MSG_Sent_and_deleted :
|
||||||
|
@ -3493,7 +3493,7 @@ static void Msg_WriteMsgTo (long MsgCod)
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
OpenByDst ? (Deleted ? "envelope-open-text-red.svg" :
|
OpenByDst ? (Deleted ? "envelope-open-text-red.svg" :
|
||||||
"envelope-open-text.svg") :
|
"envelope-open-text.svg") :
|
||||||
(Deleted ? "envelope-red.svg" :
|
(Deleted ? "envelope-red.svg" :
|
||||||
|
|
|
@ -260,7 +260,7 @@ static void Net_ShowAWebOrSocialNet (const char *URL,
|
||||||
"</a>"
|
"</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
URL,Title,
|
URL,Title,
|
||||||
Gbl.Prefs.URLIcons,Icon,
|
Cfg_URL_ICON_PUBLIC,Icon,
|
||||||
Title,Title);
|
Title,Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ void Net_ShowFormMyWebsAndSocialNets (void)
|
||||||
|
|
||||||
"</tr>",
|
"</tr>",
|
||||||
(unsigned) NumURL,The_ClassFormInBox[Gbl.Prefs.Theme],
|
(unsigned) NumURL,The_ClassFormInBox[Gbl.Prefs.Theme],
|
||||||
Gbl.Prefs.URLIcons,Net_WebsAndSocialNetworksIcons[NumURL],
|
Cfg_URL_ICON_PUBLIC,Net_WebsAndSocialNetworksIcons[NumURL],
|
||||||
Net_WebsAndSocialNetworksTitle[NumURL],
|
Net_WebsAndSocialNetworksTitle[NumURL],
|
||||||
Net_WebsAndSocialNetworksTitle[NumURL],
|
Net_WebsAndSocialNetworksTitle[NumURL],
|
||||||
Net_WebsAndSocialNetworksTitle[NumURL],
|
Net_WebsAndSocialNetworksTitle[NumURL],
|
||||||
|
@ -606,7 +606,7 @@ void Net_ShowWebAndSocialNetworksStats (void)
|
||||||
"%.2f%%"
|
"%.2f%%"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Gbl.Prefs.URLIcons,Net_WebsAndSocialNetworksIcons[Web],
|
Cfg_URL_ICON_PUBLIC,Net_WebsAndSocialNetworksIcons[Web],
|
||||||
Net_WebsAndSocialNetworksTitle[Web],
|
Net_WebsAndSocialNetworksTitle[Web],
|
||||||
Net_WebsAndSocialNetworksTitle[Web],
|
Net_WebsAndSocialNetworksTitle[Web],
|
||||||
Net_WebsAndSocialNetworksTitle[Web],
|
Net_WebsAndSocialNetworksTitle[Web],
|
||||||
|
|
|
@ -446,8 +446,8 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing)
|
||||||
/***** Link to RSS file *****/
|
/***** Link to RSS file *****/
|
||||||
/* Create RSS file if not exists */
|
/* Create RSS file if not exists */
|
||||||
snprintf (PathRelRSSFile,sizeof (PathRelRSSFile),
|
snprintf (PathRelRSSFile,sizeof (PathRelRSSFile),
|
||||||
"%s/%s/%ld/%s/%s",
|
"%s/%ld/%s/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CRS,
|
Cfg_PATH_CRS_PUBLIC,
|
||||||
Gbl.CurrentCrs.Crs.CrsCod,Cfg_RSS_FOLDER,Cfg_RSS_FILE);
|
Gbl.CurrentCrs.Crs.CrsCod,Cfg_RSS_FOLDER,Cfg_RSS_FILE);
|
||||||
if (!Fil_CheckIfPathExists (PathRelRSSFile))
|
if (!Fil_CheckIfPathExists (PathRelRSSFile))
|
||||||
RSS_UpdateRSSFileForACrs (&Gbl.CurrentCrs.Crs);
|
RSS_UpdateRSSFileForACrs (&Gbl.CurrentCrs.Crs);
|
||||||
|
@ -462,7 +462,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing)
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</a>"
|
"</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
break;
|
break;
|
||||||
case Not_LIST_FULL_NOTICES:
|
case Not_LIST_FULL_NOTICES:
|
||||||
/***** Button to add new notice *****/
|
/***** Button to add new notice *****/
|
||||||
|
@ -671,7 +671,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
|
||||||
" class=\"ICO_HIDDEN ICO16x16\" />"
|
" class=\"ICO_HIDDEN ICO16x16\" />"
|
||||||
"</span>",
|
"</span>",
|
||||||
Txt_NOTICE_Active_SINGULAR,
|
Txt_NOTICE_Active_SINGULAR,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_NOTICE_Active_SINGULAR,
|
Txt_NOTICE_Active_SINGULAR,
|
||||||
Txt_NOTICE_Active_SINGULAR);
|
Txt_NOTICE_Active_SINGULAR);
|
||||||
break;
|
break;
|
||||||
|
@ -682,7 +682,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
|
||||||
" class=\"ICO_HIDDEN ICO16x16\" />"
|
" class=\"ICO_HIDDEN ICO16x16\" />"
|
||||||
"</span>",
|
"</span>",
|
||||||
Txt_NOTICE_Obsolete_SINGULAR,
|
Txt_NOTICE_Obsolete_SINGULAR,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_NOTICE_Obsolete_SINGULAR,
|
Txt_NOTICE_Obsolete_SINGULAR,
|
||||||
Txt_NOTICE_Obsolete_SINGULAR);
|
Txt_NOTICE_Obsolete_SINGULAR);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -658,9 +658,7 @@ void Par_GetMainParameters (void)
|
||||||
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
|
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
|
||||||
long ActCod;
|
long ActCod;
|
||||||
char Nickname[Nck_MAX_BYTES_NICKNAME_FROM_FORM + 1];
|
char Nickname[Nck_MAX_BYTES_NICKNAME_FROM_FORM + 1];
|
||||||
char Path[PATH_MAX + 1 +
|
char URL[PATH_MAX + 1];
|
||||||
NAME_MAX + 1 +
|
|
||||||
NAME_MAX + 2];
|
|
||||||
char LongStr[1 + 10 + 1];
|
char LongStr[1 + 10 + 1];
|
||||||
|
|
||||||
/***** Reset codes of country, institution, centre, degree and course *****/
|
/***** Reset codes of country, institution, centre, degree and course *****/
|
||||||
|
@ -806,18 +804,17 @@ void Par_GetMainParameters (void)
|
||||||
Gbl.Prefs.Theme = The_THEME_DEFAULT;
|
Gbl.Prefs.Theme = The_THEME_DEFAULT;
|
||||||
|
|
||||||
/***** Set path of theme *****/
|
/***** Set path of theme *****/
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (URL,sizeof (URL),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_THEMES,The_ThemeId[Gbl.Prefs.Theme]);
|
Cfg_URL_ICON_THEMES_PUBLIC,The_ThemeId[Gbl.Prefs.Theme]);
|
||||||
Str_Copy (Gbl.Prefs.URLTheme,Path,
|
Str_Copy (Gbl.Prefs.URLTheme,URL,
|
||||||
PATH_MAX);
|
PATH_MAX);
|
||||||
|
|
||||||
/***** Set path of icon set *****/
|
/***** Set path of icon set *****/
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (URL,sizeof (URL),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_ICON_SETS,
|
Cfg_URL_ICON_SETS_PUBLIC,Ico_IconSetId[Gbl.Prefs.IconSet]);
|
||||||
Ico_IconSetId[Gbl.Prefs.IconSet]);
|
Str_Copy (Gbl.Prefs.URLIconSet,URL,
|
||||||
Str_Copy (Gbl.Prefs.URLIconSet,Path,
|
|
||||||
PATH_MAX);
|
PATH_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
131
swad_photo.c
131
swad_photo.c
|
@ -574,7 +574,6 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
|
||||||
extern const char *Txt_X_faces_have_been_detected_in_front_position_Y_Z_;
|
extern const char *Txt_X_faces_have_been_detected_in_front_position_Y_Z_;
|
||||||
extern const char *Txt_Faces_detected;
|
extern const char *Txt_Faces_detected;
|
||||||
char PathPhotosPriv[PATH_MAX + 1];
|
char PathPhotosPriv[PATH_MAX + 1];
|
||||||
char PathPhotosPubl[PATH_MAX + 1];
|
|
||||||
struct Param *Param;
|
struct Param *Param;
|
||||||
char FileNamePhotoSrc[PATH_MAX + 1];
|
char FileNamePhotoSrc[PATH_MAX + 1];
|
||||||
char FileNamePhotoTmp[PATH_MAX + 1]; // Full name (including path and .jpg) of the destination temporary file
|
char FileNamePhotoTmp[PATH_MAX + 1]; // Full name (including path and .jpg) of the destination temporary file
|
||||||
|
@ -601,32 +600,20 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
|
||||||
char ErrorTxt[256];
|
char ErrorTxt[256];
|
||||||
|
|
||||||
/***** Creates directories if not exist *****/
|
/***** Creates directories if not exist *****/
|
||||||
|
Fil_CreateDirIfNotExists (Cfg_PATH_PHOTO_PRIVATE);
|
||||||
snprintf (PathPhotosPriv,sizeof (PathPhotosPriv),
|
snprintf (PathPhotosPriv,sizeof (PathPhotosPriv),
|
||||||
"%s/%s",
|
"%s/%02u",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO);
|
Cfg_PATH_PHOTO_PRIVATE,
|
||||||
Fil_CreateDirIfNotExists (PathPhotosPriv);
|
|
||||||
snprintf (PathPhotosPriv,sizeof (PathPhotosPriv),
|
|
||||||
"%s/%s/%02u",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,
|
|
||||||
(unsigned) (UsrDat->UsrCod % 100));
|
(unsigned) (UsrDat->UsrCod % 100));
|
||||||
Fil_CreateDirIfNotExists (PathPhotosPriv);
|
Fil_CreateDirIfNotExists (PathPhotosPriv);
|
||||||
|
|
||||||
/***** Create directories if not exists
|
/***** Create directories if not exists
|
||||||
and remove old temporary files *****/
|
and remove old temporary files *****/
|
||||||
/* Create public directory for photos */
|
/* Create public directory for photos */
|
||||||
snprintf (PathPhotosPubl,sizeof (PathPhotosPubl),
|
Fil_CreateDirIfNotExists (Cfg_PATH_PHOTO_PUBLIC);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO);
|
|
||||||
Fil_CreateDirIfNotExists (PathPhotosPubl);
|
|
||||||
|
|
||||||
/* Create temporary directory for photos */
|
/* Create temporary directory for photos */
|
||||||
snprintf (PathPhotosPubl,sizeof (PathPhotosPubl),
|
Fil_CreateDirIfNotExists (Cfg_PATH_PHOTO_TMP_PUBLIC);
|
||||||
"%s/%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,Cfg_FOLDER_PHOTO_TMP);
|
|
||||||
Fil_CreateDirIfNotExists (PathPhotosPubl);
|
|
||||||
|
|
||||||
/* Remove old temporary files */
|
|
||||||
Fil_RemoveOldTmpFiles (PathPhotosPubl,Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES,false);
|
|
||||||
|
|
||||||
/***** First of all, copy in disk the file received from stdin (really from Gbl.F.Tmp) *****/
|
/***** First of all, copy in disk the file received from stdin (really from Gbl.F.Tmp) *****/
|
||||||
Param = Fil_StartReceptionOfFile (Fil_NAME_OF_PARAM_FILENAME_ORG,
|
Param = Fil_StartReceptionOfFile (Fil_NAME_OF_PARAM_FILENAME_ORG,
|
||||||
|
@ -648,9 +635,9 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
|
||||||
|
|
||||||
/* End the reception of photo in a temporary file */
|
/* End the reception of photo in a temporary file */
|
||||||
snprintf (FileNamePhotoTmp,sizeof (FileNamePhotoTmp),
|
snprintf (FileNamePhotoTmp,sizeof (FileNamePhotoTmp),
|
||||||
"%s/%s/%s/%s.jpg",
|
"%s/%s.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_TMP_PUBLIC,
|
||||||
Cfg_FOLDER_PHOTO_TMP,Gbl.UniqueNameEncrypted);
|
Gbl.UniqueNameEncrypted);
|
||||||
if (!Fil_EndReceptionOfFile (FileNamePhotoTmp,Param))
|
if (!Fil_EndReceptionOfFile (FileNamePhotoTmp,Param))
|
||||||
{
|
{
|
||||||
Ale_ShowAlert (Ale_ERROR,"Error copying file.");
|
Ale_ShowAlert (Ale_ERROR,"Error copying file.");
|
||||||
|
@ -660,8 +647,8 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
|
||||||
/* Copy the original photo received to private directory.
|
/* Copy the original photo received to private directory.
|
||||||
The purpose of this copy is only to have a backup used for researching better methods to detect faces in images */
|
The purpose of this copy is only to have a backup used for researching better methods to detect faces in images */
|
||||||
snprintf (PathRelPhoto,sizeof (PathRelPhoto),
|
snprintf (PathRelPhoto,sizeof (PathRelPhoto),
|
||||||
"%s/%s/%02u/%ld_original.jpg",
|
"%s/%02u/%ld_original.jpg",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_PRIVATE,
|
||||||
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
||||||
Fil_FastCopyOfFiles (FileNamePhotoTmp,PathRelPhoto);
|
Fil_FastCopyOfFiles (FileNamePhotoTmp,PathRelPhoto);
|
||||||
|
|
||||||
|
@ -680,9 +667,9 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
|
||||||
case 0: // Faces detected
|
case 0: // Faces detected
|
||||||
/***** Open text file with text for image map *****/
|
/***** Open text file with text for image map *****/
|
||||||
snprintf (FileNameTxtMap,sizeof (FileNameTxtMap),
|
snprintf (FileNameTxtMap,sizeof (FileNameTxtMap),
|
||||||
"%s/%s/%s/%s_map.txt",
|
"%s/%s_map.txt",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_TMP_PUBLIC,
|
||||||
Cfg_FOLDER_PHOTO_TMP,Gbl.UniqueNameEncrypted);
|
Gbl.UniqueNameEncrypted);
|
||||||
if ((FileTxtMap = fopen (FileNameTxtMap,"rb")) == NULL)
|
if ((FileTxtMap = fopen (FileNameTxtMap,"rb")) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Can not read text file with coordinates of detected faces.");
|
Lay_ShowErrorAndExit ("Can not read text file with coordinates of detected faces.");
|
||||||
|
|
||||||
|
@ -794,15 +781,15 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct UsrData *Usr
|
||||||
|
|
||||||
/***** Show map photo *****/
|
/***** Show map photo *****/
|
||||||
snprintf (FileNamePhotoMap,sizeof (FileNamePhotoMap),
|
snprintf (FileNamePhotoMap,sizeof (FileNamePhotoMap),
|
||||||
"%s/%s/%s/%s_map.jpg",
|
"%s/%s_map.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,Cfg_FOLDER_PHOTO_TMP,
|
Cfg_PATH_PHOTO_TMP_PUBLIC,
|
||||||
Gbl.UniqueNameEncrypted);
|
Gbl.UniqueNameEncrypted);
|
||||||
fprintf (Gbl.F.Out,"<div class=\"TIT CENTER_MIDDLE\">"
|
fprintf (Gbl.F.Out,"<div class=\"TIT CENTER_MIDDLE\">"
|
||||||
"<img src=\"%s/%s/%s/%s_map.jpg\""
|
"<img src=\"%s/%s_map.jpg\""
|
||||||
" usemap=\"#faces_map\""
|
" usemap=\"#faces_map\""
|
||||||
" alt=\"%s\" title=\"%s\" />"
|
" alt=\"%s\" title=\"%s\" />"
|
||||||
"</div>",
|
"</div>",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,Cfg_FOLDER_PHOTO_TMP,
|
Cfg_URL_PHOTO_TMP_PUBLIC,
|
||||||
Gbl.UniqueNameEncrypted,
|
Gbl.UniqueNameEncrypted,
|
||||||
Txt_Faces_detected,Txt_Faces_detected);
|
Txt_Faces_detected,Txt_Faces_detected);
|
||||||
|
|
||||||
|
@ -869,14 +856,15 @@ static void Pho_UpdatePhoto1 (struct UsrData *UsrDat)
|
||||||
|
|
||||||
/***** Convert the temporary photo resulting of the processing to the current photo of the user *****/
|
/***** Convert the temporary photo resulting of the processing to the current photo of the user *****/
|
||||||
snprintf (PathPhotoTmp,sizeof (PathPhotoTmp),
|
snprintf (PathPhotoTmp,sizeof (PathPhotoTmp),
|
||||||
"%s/%s/%s/%s_paso3.jpg",
|
"%s/%s_paso3.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,Cfg_FOLDER_PHOTO_TMP,Gbl.Usrs.FileNamePhoto);
|
Cfg_PATH_PHOTO_TMP_PUBLIC,
|
||||||
|
Gbl.Usrs.FileNamePhoto);
|
||||||
if (Fil_CheckIfPathExists (PathPhotoTmp)) // The file with the selected photo exists
|
if (Fil_CheckIfPathExists (PathPhotoTmp)) // The file with the selected photo exists
|
||||||
{
|
{
|
||||||
/* Copy the temporary file of the third (last) step resulting of the processing to the directory of private photos */
|
/* Copy the temporary file of the third (last) step resulting of the processing to the directory of private photos */
|
||||||
snprintf (PathRelPhoto,sizeof (PathRelPhoto),
|
snprintf (PathRelPhoto,sizeof (PathRelPhoto),
|
||||||
"%s/%s/%02u/%ld.jpg",
|
"%s/%02u/%ld.jpg",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_PRIVATE,
|
||||||
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
||||||
Fil_FastCopyOfFiles (PathPhotoTmp,PathRelPhoto);
|
Fil_FastCopyOfFiles (PathPhotoTmp,PathRelPhoto);
|
||||||
|
|
||||||
|
@ -909,12 +897,12 @@ static void Pho_UpdatePhoto2 (void)
|
||||||
NumPhoto < 3;
|
NumPhoto < 3;
|
||||||
NumPhoto++)
|
NumPhoto++)
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT CENTER_TOP\" style=\"width:33%%;\">"
|
fprintf (Gbl.F.Out,"<td class=\"DAT CENTER_TOP\" style=\"width:33%%;\">"
|
||||||
"<img src=\"%s/%s/%s/%s_paso%u.jpg\""
|
"<img src=\"%s/%s_paso%u.jpg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" style=\"width:%upx; height:%upx;\" />"
|
" style=\"width:%upx; height:%upx;\" />"
|
||||||
"<br />%s"
|
"<br />%s"
|
||||||
"</td>",
|
"</td>",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,Cfg_FOLDER_PHOTO_TMP,
|
Cfg_URL_PHOTO_TMP_PUBLIC,
|
||||||
Gbl.Usrs.FileNamePhoto,NumPhoto + 1,
|
Gbl.Usrs.FileNamePhoto,NumPhoto + 1,
|
||||||
Txt_PHOTO_PROCESSING_CAPTIONS[NumPhoto],
|
Txt_PHOTO_PROCESSING_CAPTIONS[NumPhoto],
|
||||||
Txt_PHOTO_PROCESSING_CAPTIONS[NumPhoto],
|
Txt_PHOTO_PROCESSING_CAPTIONS[NumPhoto],
|
||||||
|
@ -1025,13 +1013,13 @@ bool Pho_BuildLinkToPhoto (const struct UsrData *UsrDat,char PhotoURL[PATH_MAX +
|
||||||
{
|
{
|
||||||
/***** Make path to public photo *****/
|
/***** Make path to public photo *****/
|
||||||
snprintf (PathPublPhoto,sizeof (PathPublPhoto),
|
snprintf (PathPublPhoto,sizeof (PathPublPhoto),
|
||||||
"%s/%s/%s.jpg",
|
"%s/%s.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,UsrDat->Photo);
|
Cfg_PATH_PHOTO_PUBLIC,UsrDat->Photo);
|
||||||
|
|
||||||
/***** Make path to private photo from public directory *****/
|
/***** Make path to private photo from public directory *****/
|
||||||
snprintf (PathPrivPhoto,sizeof (PathPrivPhoto),
|
snprintf (PathPrivPhoto,sizeof (PathPrivPhoto),
|
||||||
"%s/%s/%02u/%ld.jpg",
|
"%s/%02u/%ld.jpg",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_PRIVATE,
|
||||||
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
||||||
|
|
||||||
/***** Create a symbolic link to the private photo, if not exists *****/
|
/***** Create a symbolic link to the private photo, if not exists *****/
|
||||||
|
@ -1042,8 +1030,8 @@ bool Pho_BuildLinkToPhoto (const struct UsrData *UsrDat,char PhotoURL[PATH_MAX +
|
||||||
|
|
||||||
/***** Create the public URL of the photo *****/
|
/***** Create the public URL of the photo *****/
|
||||||
snprintf (PhotoURL,PATH_MAX + 1,
|
snprintf (PhotoURL,PATH_MAX + 1,
|
||||||
"%s/%s/%s.jpg",
|
"%s/%s.jpg",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,UsrDat->Photo);
|
Cfg_URL_PHOTO_PUBLIC,UsrDat->Photo);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1064,8 +1052,8 @@ bool Pho_CheckIfPrivPhotoExists (long UsrCod,char PathPrivRelPhoto[PATH_MAX + 1]
|
||||||
{
|
{
|
||||||
/***** Make path to private photo *****/
|
/***** Make path to private photo *****/
|
||||||
snprintf (PathPrivRelPhoto,PATH_MAX + 1,
|
snprintf (PathPrivRelPhoto,PATH_MAX + 1,
|
||||||
"%s/%s/%02u/%ld.jpg",
|
"%s/%02u/%ld.jpg",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_PRIVATE,
|
||||||
(unsigned) (UsrCod % 100),UsrCod);
|
(unsigned) (UsrCod % 100),UsrCod);
|
||||||
|
|
||||||
return Fil_CheckIfPathExists (PathPrivRelPhoto);
|
return Fil_CheckIfPathExists (PathPrivRelPhoto);
|
||||||
|
@ -1090,16 +1078,16 @@ bool Pho_RemovePhoto (struct UsrData *UsrDat)
|
||||||
|
|
||||||
/***** Remove public link *****/
|
/***** Remove public link *****/
|
||||||
snprintf (PathPublPhoto,sizeof (PathPublPhoto),
|
snprintf (PathPublPhoto,sizeof (PathPublPhoto),
|
||||||
"%s/%s/%s.jpg",
|
"%s/%s.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,UsrDat->Photo);
|
Cfg_PATH_PHOTO_PUBLIC,UsrDat->Photo);
|
||||||
if (Fil_CheckIfPathExists (PathPublPhoto)) // Public link exists
|
if (Fil_CheckIfPathExists (PathPublPhoto)) // Public link exists
|
||||||
if (unlink (PathPublPhoto)) // Remove public link
|
if (unlink (PathPublPhoto)) // Remove public link
|
||||||
NumErrors++;
|
NumErrors++;
|
||||||
|
|
||||||
/***** Remove photo *****/
|
/***** Remove photo *****/
|
||||||
snprintf (PathPrivRelPhoto,sizeof (PathPrivRelPhoto),
|
snprintf (PathPrivRelPhoto,sizeof (PathPrivRelPhoto),
|
||||||
"%s/%s/%02u/%ld.jpg",
|
"%s/%02u/%ld.jpg",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_PRIVATE,
|
||||||
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
||||||
if (Fil_CheckIfPathExists (PathPrivRelPhoto)) // Photo exists
|
if (Fil_CheckIfPathExists (PathPrivRelPhoto)) // Photo exists
|
||||||
{
|
{
|
||||||
|
@ -1109,8 +1097,8 @@ bool Pho_RemovePhoto (struct UsrData *UsrDat)
|
||||||
|
|
||||||
/***** Remove original photo *****/
|
/***** Remove original photo *****/
|
||||||
snprintf (PathPrivRelPhoto,sizeof (PathPrivRelPhoto),
|
snprintf (PathPrivRelPhoto,sizeof (PathPrivRelPhoto),
|
||||||
"%s/%s/%02u/%ld_original.jpg",
|
"%s/%02u/%ld_original.jpg",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_PRIVATE,
|
||||||
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
(unsigned) (UsrDat->UsrCod % 100),UsrDat->UsrCod);
|
||||||
if (Fil_CheckIfPathExists (PathPrivRelPhoto)) // Original photo exists
|
if (Fil_CheckIfPathExists (PathPrivRelPhoto)) // Original photo exists
|
||||||
if (unlink (PathPrivRelPhoto)) // Remove original photo
|
if (unlink (PathPrivRelPhoto)) // Remove original photo
|
||||||
|
@ -1161,8 +1149,8 @@ void Pho_UpdatePhotoName (struct UsrData *UsrDat)
|
||||||
|
|
||||||
/***** Remove the old symbolic link to photo *****/
|
/***** Remove the old symbolic link to photo *****/
|
||||||
snprintf (PathPublPhoto,sizeof (PathPublPhoto),
|
snprintf (PathPublPhoto,sizeof (PathPublPhoto),
|
||||||
"%s/%s/%s.jpg",
|
"%s/%s.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,UsrDat->Photo);
|
Cfg_PATH_PHOTO_PUBLIC,UsrDat->Photo);
|
||||||
unlink (PathPublPhoto); // Remove public link
|
unlink (PathPublPhoto); // Remove public link
|
||||||
|
|
||||||
/***** Update photo name in user's data *****/
|
/***** Update photo name in user's data *****/
|
||||||
|
@ -1255,7 +1243,7 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
|
||||||
"%s"
|
"%s"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons,Rol_Icons[MaxRole],
|
Cfg_URL_ICON_PUBLIC,Rol_Icons[MaxRole],
|
||||||
MainDegreeShrtName);
|
MainDegreeShrtName);
|
||||||
|
|
||||||
/* Following and followers */
|
/* Following and followers */
|
||||||
|
@ -1284,7 +1272,7 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
|
||||||
if (PhotoExists)
|
if (PhotoExists)
|
||||||
fprintf (Gbl.F.Out,"%s",PhotoURL);
|
fprintf (Gbl.F.Out,"%s",PhotoURL);
|
||||||
else
|
else
|
||||||
fprintf (Gbl.F.Out,"%s/usr_bl.jpg",Gbl.Prefs.URLIcons);
|
fprintf (Gbl.F.Out,"%s/usr_bl.jpg",Cfg_URL_ICON_PUBLIC);
|
||||||
fprintf (Gbl.F.Out,"\" alt=\"%s\" title=\"%s\""
|
fprintf (Gbl.F.Out,"\" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"%s\"",
|
" class=\"%s\"",
|
||||||
UsrDat->FullName,UsrDat->FullName,
|
UsrDat->FullName,UsrDat->FullName,
|
||||||
|
@ -1297,7 +1285,7 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
|
||||||
if (PhotoExists)
|
if (PhotoExists)
|
||||||
fprintf (Gbl.F.Out,"%s",PhotoURL);
|
fprintf (Gbl.F.Out,"%s",PhotoURL);
|
||||||
else
|
else
|
||||||
fprintf (Gbl.F.Out,"%s/usr_bl.jpg",Gbl.Prefs.URLIcons);
|
fprintf (Gbl.F.Out,"%s/usr_bl.jpg",Cfg_URL_ICON_PUBLIC);
|
||||||
fprintf (Gbl.F.Out,"','%s');\" onmouseout=\"noZoom();\"",
|
fprintf (Gbl.F.Out,"','%s');\" onmouseout=\"noZoom();\"",
|
||||||
IdCaption);
|
IdCaption);
|
||||||
}
|
}
|
||||||
|
@ -1340,8 +1328,6 @@ void Pho_ChangePhotoVisibility (void)
|
||||||
|
|
||||||
void Pho_CalcPhotoDegree (void)
|
void Pho_CalcPhotoDegree (void)
|
||||||
{
|
{
|
||||||
char PathPhotosPublic[PATH_MAX + 1];
|
|
||||||
char PathPhotosTmpPriv[PATH_MAX + 1];
|
|
||||||
Pho_AvgPhotoTypeOfAverage_t TypeOfAverage;
|
Pho_AvgPhotoTypeOfAverage_t TypeOfAverage;
|
||||||
long DegCod = -1L;
|
long DegCod = -1L;
|
||||||
char DirAvgPhotosRelPath[Pho_NUM_AVERAGE_PHOTO_TYPES][PATH_MAX + 1];
|
char DirAvgPhotosRelPath[Pho_NUM_AVERAGE_PHOTO_TYPES][PATH_MAX + 1];
|
||||||
|
@ -1353,29 +1339,20 @@ void Pho_CalcPhotoDegree (void)
|
||||||
Gbl.Stat.DegPhotos.TypeOfAverage = Pho_GetPhotoAvgTypeFromForm ();
|
Gbl.Stat.DegPhotos.TypeOfAverage = Pho_GetPhotoAvgTypeFromForm ();
|
||||||
|
|
||||||
/***** Create public directories for average photos if not exist *****/
|
/***** Create public directories for average photos if not exist *****/
|
||||||
snprintf (PathPhotosPublic,sizeof (PathPhotosPublic),
|
Fil_CreateDirIfNotExists (Cfg_PATH_PHOTO_PUBLIC);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO);
|
|
||||||
Fil_CreateDirIfNotExists (PathPhotosPublic);
|
|
||||||
for (TypeOfAverage = (Pho_AvgPhotoTypeOfAverage_t) 0;
|
for (TypeOfAverage = (Pho_AvgPhotoTypeOfAverage_t) 0;
|
||||||
TypeOfAverage < Pho_NUM_AVERAGE_PHOTO_TYPES;
|
TypeOfAverage < Pho_NUM_AVERAGE_PHOTO_TYPES;
|
||||||
TypeOfAverage++)
|
TypeOfAverage++)
|
||||||
{
|
{
|
||||||
snprintf (DirAvgPhotosRelPath[TypeOfAverage],
|
snprintf (DirAvgPhotosRelPath[TypeOfAverage],
|
||||||
sizeof (DirAvgPhotosRelPath[TypeOfAverage]),
|
sizeof (DirAvgPhotosRelPath[TypeOfAverage]),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,Pho_StrAvgPhotoDirs[TypeOfAverage]);
|
Cfg_PATH_PHOTO_PUBLIC,Pho_StrAvgPhotoDirs[TypeOfAverage]);
|
||||||
Fil_CreateDirIfNotExists (DirAvgPhotosRelPath[TypeOfAverage]);
|
Fil_CreateDirIfNotExists (DirAvgPhotosRelPath[TypeOfAverage]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Creates private directory for lists of users' photos if not exists *****/
|
/***** Creates private directory for lists of users' photos if not exists *****/
|
||||||
snprintf (PathPhotosTmpPriv,sizeof (PathPhotosTmpPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_PHOTO_TMP_PRIVATE);
|
||||||
"%s/%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,Cfg_FOLDER_PHOTO_TMP);
|
|
||||||
Fil_CreateDirIfNotExists (PathPhotosTmpPriv);
|
|
||||||
|
|
||||||
/***** Remove old private files used for lists *****/
|
|
||||||
Fil_RemoveOldTmpFiles (PathPhotosTmpPriv,Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES,false);
|
|
||||||
|
|
||||||
/***** Get the degree which photo will be computed *****/
|
/***** Get the degree which photo will be computed *****/
|
||||||
DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||||
|
@ -1627,8 +1604,8 @@ static void Pho_ComputeAveragePhoto (long DegCod,Usr_Sex_t Sex,Rol_Role_t Role,
|
||||||
|
|
||||||
/***** Build names for text file with photo paths *****/
|
/***** Build names for text file with photo paths *****/
|
||||||
snprintf (FileNamePhotoNames,sizeof (FileNamePhotoNames),
|
snprintf (FileNamePhotoNames,sizeof (FileNamePhotoNames),
|
||||||
"%s/%s/%s/%ld.txt",
|
"%s/%ld.txt",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_PHOTO,Cfg_FOLDER_PHOTO_TMP,DegCod);
|
Cfg_PATH_PHOTO_TMP_PRIVATE,DegCod);
|
||||||
if ((FilePhotoNames = fopen (FileNamePhotoNames,"wb")) == NULL)
|
if ((FilePhotoNames = fopen (FileNamePhotoNames,"wb")) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Can not open file to compute average photo.");
|
Lay_ShowErrorAndExit ("Can not open file to compute average photo.");
|
||||||
|
|
||||||
|
@ -2469,15 +2446,15 @@ static void Pho_ShowDegreeAvgPhotoAndStat (struct Degree *Deg,
|
||||||
if (ShowDegPhoto)
|
if (ShowDegPhoto)
|
||||||
{
|
{
|
||||||
snprintf (PathRelAvgPhoto,sizeof (PathRelAvgPhoto),
|
snprintf (PathRelAvgPhoto,sizeof (PathRelAvgPhoto),
|
||||||
"%s/%s/%s/%ld_%s.jpg",
|
"%s/%s/%ld_%s.jpg",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,
|
Cfg_PATH_PHOTO_PUBLIC,
|
||||||
Pho_StrAvgPhotoDirs[Gbl.Stat.DegPhotos.TypeOfAverage],
|
Pho_StrAvgPhotoDirs[Gbl.Stat.DegPhotos.TypeOfAverage],
|
||||||
Deg->DegCod,Usr_StringsSexDB[Sex]);
|
Deg->DegCod,Usr_StringsSexDB[Sex]);
|
||||||
if (Fil_CheckIfPathExists (PathRelAvgPhoto))
|
if (Fil_CheckIfPathExists (PathRelAvgPhoto))
|
||||||
{
|
{
|
||||||
snprintf (PhotoURL,sizeof (PhotoURL),
|
snprintf (PhotoURL,sizeof (PhotoURL),
|
||||||
"%s/%s/%s/%ld_%s.jpg",
|
"%s/%s/%ld_%s.jpg",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_PHOTO,
|
Cfg_URL_PHOTO_PUBLIC,
|
||||||
Pho_StrAvgPhotoDirs[Gbl.Stat.DegPhotos.TypeOfAverage],
|
Pho_StrAvgPhotoDirs[Gbl.Stat.DegPhotos.TypeOfAverage],
|
||||||
Deg->DegCod,Usr_StringsSexDB[Sex]);
|
Deg->DegCod,Usr_StringsSexDB[Sex]);
|
||||||
if (SeeOrPrint == Pho_DEGREES_SEE)
|
if (SeeOrPrint == Pho_DEGREES_SEE)
|
||||||
|
@ -2514,7 +2491,7 @@ static void Pho_ShowDegreeAvgPhotoAndStat (struct Degree *Deg,
|
||||||
PhotoURL,IdCaption);
|
PhotoURL,IdCaption);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintf (Gbl.F.Out,"%s/usr_bl.jpg\"",Gbl.Prefs.URLIcons);
|
fprintf (Gbl.F.Out,"%s/usr_bl.jpg\"",Cfg_URL_ICON_PUBLIC);
|
||||||
fprintf (Gbl.F.Out," alt=\"%s\""
|
fprintf (Gbl.F.Out," alt=\"%s\""
|
||||||
" style=\"width:%upx; height:%upx;\" />",
|
" style=\"width:%upx; height:%upx;\" />",
|
||||||
Deg->ShrtName,
|
Deg->ShrtName,
|
||||||
|
|
|
@ -124,7 +124,7 @@ void Plg_ListPlugins (void)
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"DAT LEFT_MIDDLE\" style=\"width:45px;\">"
|
"<td class=\"DAT LEFT_MIDDLE\" style=\"width:45px;\">"
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">"
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">"
|
||||||
"<img src=\"%s/%s/%s24x24.gif\""
|
"<img src=\"%s/%s24x24.gif\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO40x40\" />"
|
" class=\"ICO40x40\" />"
|
||||||
"</a>"
|
"</a>"
|
||||||
|
@ -136,7 +136,7 @@ void Plg_ListPlugins (void)
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
URL,Plg->Name,
|
URL,Plg->Name,
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_PLUGINS,Gbl.Plugins.Lst[NumPlg].Logo,
|
Cfg_URL_ICON_PLUGINS_PUBLIC,Gbl.Plugins.Lst[NumPlg].Logo,
|
||||||
Plg->Name,Plg->Name,
|
Plg->Name,Plg->Name,
|
||||||
URL,Plg->Name,
|
URL,Plg->Name,
|
||||||
Plg->Name);
|
Plg->Name);
|
||||||
|
@ -378,11 +378,11 @@ static void Plg_ListPluginsForEdition (void)
|
||||||
/* Plugin logo */
|
/* Plugin logo */
|
||||||
// TODO: Change plugin icons to 32x32
|
// TODO: Change plugin icons to 32x32
|
||||||
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\" style=\"width:45px;\">"
|
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\" style=\"width:45px;\">"
|
||||||
"<img src=\"%s/%s/%s24x24.gif\""
|
"<img src=\"%s/%s24x24.gif\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO40x40\" />"
|
" class=\"ICO40x40\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_PLUGINS,
|
Cfg_URL_ICON_PLUGINS_PUBLIC,
|
||||||
Gbl.Plugins.Lst[NumPlg].Logo,
|
Gbl.Plugins.Lst[NumPlg].Logo,
|
||||||
Gbl.Plugins.Lst[NumPlg].Name,
|
Gbl.Plugins.Lst[NumPlg].Name,
|
||||||
Gbl.Plugins.Lst[NumPlg].Name);
|
Gbl.Plugins.Lst[NumPlg].Name);
|
||||||
|
|
|
@ -763,7 +763,7 @@ static void Prf_StartListItem (const char *Title,const char *Icon)
|
||||||
fprintf (Gbl.F.Out,"<li title=\"%s\" class=\"PRF_FIG_LI\""
|
fprintf (Gbl.F.Out,"<li title=\"%s\" class=\"PRF_FIG_LI\""
|
||||||
" style=\"background-image:url('%s/%s');\">",
|
" style=\"background-image:url('%s/%s');\">",
|
||||||
Title,
|
Title,
|
||||||
Gbl.Prefs.URLIcons,Icon);
|
Cfg_URL_ICON_PUBLIC,Icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Prf_EndListItem (void)
|
static void Prf_EndListItem (void)
|
||||||
|
|
|
@ -2739,8 +2739,8 @@ void Prj_RemoveProject (void)
|
||||||
|
|
||||||
/***** Remove directory of the project *****/
|
/***** Remove directory of the project *****/
|
||||||
snprintf (PathRelPrj,sizeof (PathRelPrj),
|
snprintf (PathRelPrj,sizeof (PathRelPrj),
|
||||||
"%s/%s/%ld/%s/%02u/%ld",
|
"%s/%ld/%s/%02u/%ld",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Prj.CrsCod,Cfg_FOLDER_PRJ,
|
Cfg_PATH_CRS_PRIVATE,Prj.CrsCod,Cfg_FOLDER_PRJ,
|
||||||
(unsigned) (Prj.PrjCod % 100),Prj.PrjCod);
|
(unsigned) (Prj.PrjCod % 100),Prj.PrjCod);
|
||||||
Fil_RemoveTree (PathRelPrj);
|
Fil_RemoveTree (PathRelPrj);
|
||||||
|
|
||||||
|
|
|
@ -3719,9 +3719,9 @@ static void Rec_WriteLinkToDataProtectionClause (void)
|
||||||
extern const char *Txt_DATA_PROTECTION_CLAUSE;
|
extern const char *Txt_DATA_PROTECTION_CLAUSE;
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">"
|
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">"
|
||||||
"<a class=\"TIT\" href=\"%s/%s/\" target=\"_blank\">%s</a>"
|
"<a class=\"TIT\" href=\"%s/\" target=\"_blank\">%s</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_DATA_PROTECTION_FOLDER,
|
Cfg_URL_DATA_PROTECTION_PUBLIC,
|
||||||
Txt_DATA_PROTECTION_CLAUSE);
|
Txt_DATA_PROTECTION_CLAUSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ static void Rep_PutLinkToMyUsageReport (struct Rep_Report *Report)
|
||||||
"</div>",
|
"</div>",
|
||||||
Report->Permalink,
|
Report->Permalink,
|
||||||
Txt_Report,
|
Txt_Report,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Report,
|
Txt_Report,
|
||||||
Report->FilenameReport);
|
Report->FilenameReport);
|
||||||
fprintf (Gbl.F.Out,"<div class=\"DAT_LIGHT\">%s</div>",
|
fprintf (Gbl.F.Out,"<div class=\"DAT_LIGHT\">%s</div>",
|
||||||
|
@ -367,7 +367,6 @@ static void Rep_GetCurrentDateTimeUTC (struct Rep_Report *Report)
|
||||||
|
|
||||||
static void Rep_CreateNewReportFile (struct Rep_Report *Report)
|
static void Rep_CreateNewReportFile (struct Rep_Report *Report)
|
||||||
{
|
{
|
||||||
char PathReports[PATH_MAX + 1];
|
|
||||||
char PathUniqueDirL[PATH_MAX + 1];
|
char PathUniqueDirL[PATH_MAX + 1];
|
||||||
char PathUniqueDirR[PATH_MAX + 1];
|
char PathUniqueDirR[PATH_MAX + 1];
|
||||||
char PathFileReport[PATH_MAX + 1];
|
char PathFileReport[PATH_MAX + 1];
|
||||||
|
@ -376,16 +375,13 @@ static void Rep_CreateNewReportFile (struct Rep_Report *Report)
|
||||||
NAME_MAX];
|
NAME_MAX];
|
||||||
|
|
||||||
/***** Path for reports *****/
|
/***** Path for reports *****/
|
||||||
snprintf (PathReports,sizeof (PathReports),
|
Fil_CreateDirIfNotExists (Cfg_PATH_REP_PUBLIC);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_REP);
|
|
||||||
Fil_CreateDirIfNotExists (PathReports);
|
|
||||||
|
|
||||||
/***** Unique directory for the file with the report *****/
|
/***** Unique directory for the file with the report *****/
|
||||||
/* 1. Create a directory using the leftmost 2 chars of a unique name */
|
/* 1. Create a directory using the leftmost 2 chars of a unique name */
|
||||||
snprintf (PathUniqueDirL,sizeof (PathUniqueDirL),
|
snprintf (PathUniqueDirL,sizeof (PathUniqueDirL),
|
||||||
"%s/%s/%c%c",
|
"%s/%c%c",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_REP,
|
Cfg_PATH_REP_PUBLIC,
|
||||||
Gbl.UniqueNameEncrypted[0],
|
Gbl.UniqueNameEncrypted[0],
|
||||||
Gbl.UniqueNameEncrypted[1]);
|
Gbl.UniqueNameEncrypted[1]);
|
||||||
Fil_CreateDirIfNotExists (PathUniqueDirL);
|
Fil_CreateDirIfNotExists (PathUniqueDirL);
|
||||||
|
@ -410,9 +406,8 @@ static void Rep_CreateNewReportFile (struct Rep_Report *Report)
|
||||||
|
|
||||||
/***** Permalink *****/
|
/***** Permalink *****/
|
||||||
snprintf (Permalink,sizeof (Permalink),
|
snprintf (Permalink,sizeof (Permalink),
|
||||||
"%s/%s/%c%c/%s/%s",
|
"%s/%c%c/%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,
|
Cfg_URL_REP_PUBLIC,
|
||||||
Cfg_FOLDER_REP,
|
|
||||||
Gbl.UniqueNameEncrypted[0],
|
Gbl.UniqueNameEncrypted[0],
|
||||||
Gbl.UniqueNameEncrypted[1],
|
Gbl.UniqueNameEncrypted[1],
|
||||||
&Gbl.UniqueNameEncrypted[2],
|
&Gbl.UniqueNameEncrypted[2],
|
||||||
|
@ -1424,8 +1419,8 @@ static void Rep_RemoveUsrReportsFiles (long UsrCod)
|
||||||
|
|
||||||
/* Remove report directory and file */
|
/* Remove report directory and file */
|
||||||
snprintf (PathUniqueDirReport,sizeof (PathUniqueDirReport),
|
snprintf (PathUniqueDirReport,sizeof (PathUniqueDirReport),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_REP,row[0],row[1]);
|
Cfg_PATH_REP_PUBLIC,row[0],row[1]);
|
||||||
Fil_RemoveTree (PathUniqueDirReport);
|
Fil_RemoveTree (PathUniqueDirReport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1909,7 +1909,7 @@ static void Sta_ShowNumHitsPerUsr (unsigned long NumRows,MYSQL_RES *mysql_res)
|
||||||
" class=\"LEFT_TOP\""
|
" class=\"LEFT_TOP\""
|
||||||
" style=\"width:%upx; height:10px; padding-top:4px;\" />"
|
" style=\"width:%upx; height:10px; padding-top:4px;\" />"
|
||||||
" ",
|
" ",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
UsrDat.Roles.InCurrentCrs.Role == Rol_STD ? 'o' : // Student
|
UsrDat.Roles.InCurrentCrs.Role == Rol_STD ? 'o' : // Student
|
||||||
'r', // Non-editing teacher or teacher
|
'r', // Non-editing teacher or teacher
|
||||||
BarWidth);
|
BarWidth);
|
||||||
|
@ -2409,7 +2409,7 @@ static void Sta_DrawBarColors (Sta_ColorType_t ColorType,float HitsMax)
|
||||||
"<img src=\"%s/tr1x14.gif\""
|
"<img src=\"%s/tr1x14.gif\""
|
||||||
" alt=\"\" title=\"\" />"
|
" alt=\"\" title=\"\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
R,G,B,Gbl.Prefs.URLIcons);
|
R,G,B,Cfg_URL_ICON_PUBLIC);
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"</tr>");
|
fprintf (Gbl.F.Out,"</tr>");
|
||||||
Tbl_EndTable ();
|
Tbl_EndTable ();
|
||||||
|
@ -2907,7 +2907,7 @@ static void Sta_WriteAccessHour (unsigned Hour,struct Sta_Hits *Hits,unsigned Co
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/o1x1.png\"" // Orange background
|
fprintf (Gbl.F.Out,"<img src=\"%s/o1x1.png\"" // Orange background
|
||||||
" alt=\"\" title=\"\""
|
" alt=\"\" title=\"\""
|
||||||
" style=\"width:10px; height:%upx;\" />",
|
" style=\"width:10px; height:%upx;\" />",
|
||||||
Gbl.Prefs.URLIcons,BarHeight);
|
Cfg_URL_ICON_PUBLIC,BarHeight);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintf (Gbl.F.Out,"0%%<br />0");
|
fprintf (Gbl.F.Out,"0%%<br />0");
|
||||||
|
@ -3009,7 +3009,7 @@ static void Sta_ShowAverageAccessesPerMinute (unsigned long NumRows,MYSQL_RES *m
|
||||||
" alt=\"\" title=\"\""
|
" alt=\"\" title=\"\""
|
||||||
" style=\"display:block; width:%upx; height:1px;\" />"
|
" style=\"display:block; width:%upx; height:1px;\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Gbl.Prefs.URLIcons,
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Cfg_URL_ICON_PUBLIC,
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC);
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC);
|
||||||
/* All the intermediate divisions */
|
/* All the intermediate divisions */
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
|
@ -3021,7 +3021,7 @@ static void Sta_ShowAverageAccessesPerMinute (unsigned long NumRows,MYSQL_RES *m
|
||||||
" style=\"display:block;"
|
" style=\"display:block;"
|
||||||
" width:%upx; height:1px;\" />"
|
" width:%upx; height:1px;\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Gbl.Prefs.URLIcons,
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Cfg_URL_ICON_PUBLIC,
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC);
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC);
|
||||||
/* Last division (right) */
|
/* Last division (right) */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\" style=\"width:%upx;\">"
|
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\" style=\"width:%upx;\">"
|
||||||
|
@ -3030,7 +3030,7 @@ static void Sta_ShowAverageAccessesPerMinute (unsigned long NumRows,MYSQL_RES *m
|
||||||
" style=\"display:block; width:%upx; height:1px;\" />"
|
" style=\"display:block; width:%upx; height:1px;\" />"
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Gbl.Prefs.URLIcons,
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Cfg_URL_ICON_PUBLIC,
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC);
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC);
|
||||||
|
|
||||||
/***** Write again the labels of the X axis *****/
|
/***** Write again the labels of the X axis *****/
|
||||||
|
@ -3086,7 +3086,7 @@ static void Sta_WriteAccessMinute (unsigned Minute,float HitsNum,float MaxX)
|
||||||
" background-repeat:repeat;\">"
|
" background-repeat:repeat;\">"
|
||||||
"00h"
|
"00h"
|
||||||
"</td>",
|
"</td>",
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Gbl.Prefs.URLIcons);
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Cfg_URL_ICON_PUBLIC);
|
||||||
else if (Minute == (Sta_NUM_MINUTES_PER_DAY - 30))
|
else if (Minute == (Sta_NUM_MINUTES_PER_DAY - 30))
|
||||||
// If 23:30
|
// If 23:30
|
||||||
fprintf (Gbl.F.Out,"<td rowspan=\"30\" class=\"LOG LEFT_BOTTOM\""
|
fprintf (Gbl.F.Out,"<td rowspan=\"30\" class=\"LOG LEFT_BOTTOM\""
|
||||||
|
@ -3096,7 +3096,7 @@ static void Sta_WriteAccessMinute (unsigned Minute,float HitsNum,float MaxX)
|
||||||
" background-repeat:repeat;\">"
|
" background-repeat:repeat;\">"
|
||||||
"24h"
|
"24h"
|
||||||
"</td>",
|
"</td>",
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Gbl.Prefs.URLIcons);
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Cfg_URL_ICON_PUBLIC);
|
||||||
else if (!(Minute % 30) && (Minute % 60))
|
else if (!(Minute % 30) && (Minute % 60))
|
||||||
// If minute is multiple of 30 but not of 60 (i.e.: 30, 90, 150...)
|
// If minute is multiple of 30 but not of 60 (i.e.: 30, 90, 150...)
|
||||||
fprintf (Gbl.F.Out,"<td rowspan=\"60\" class=\"LOG LEFT_MIDDLE\""
|
fprintf (Gbl.F.Out,"<td rowspan=\"60\" class=\"LOG LEFT_MIDDLE\""
|
||||||
|
@ -3106,7 +3106,7 @@ static void Sta_WriteAccessMinute (unsigned Minute,float HitsNum,float MaxX)
|
||||||
" background-repeat:repeat;\">"
|
" background-repeat:repeat;\">"
|
||||||
"%02uh"
|
"%02uh"
|
||||||
"</td>",
|
"</td>",
|
||||||
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Gbl.Prefs.URLIcons,(Minute + 30) / 60);
|
Sta_WIDTH_SEMIDIVISION_GRAPHIC,Cfg_URL_ICON_PUBLIC,(Minute + 30) / 60);
|
||||||
|
|
||||||
/***** Start cell for the graphic *****/
|
/***** Start cell for the graphic *****/
|
||||||
fprintf (Gbl.F.Out,"<td colspan=\"%u\" class=\"LEFT_BOTTOM\""
|
fprintf (Gbl.F.Out,"<td colspan=\"%u\" class=\"LEFT_BOTTOM\""
|
||||||
|
@ -3114,7 +3114,7 @@ static void Sta_WriteAccessMinute (unsigned Minute,float HitsNum,float MaxX)
|
||||||
" background-image:url('%s/malla%c48x1.gif');"
|
" background-image:url('%s/malla%c48x1.gif');"
|
||||||
" background-size:60px 1px;"
|
" background-size:60px 1px;"
|
||||||
" background-repeat:repeat;\">",
|
" background-repeat:repeat;\">",
|
||||||
Sta_NUM_DIVISIONS_X * 2,Sta_WIDTH_GRAPHIC,Gbl.Prefs.URLIcons,
|
Sta_NUM_DIVISIONS_X * 2,Sta_WIDTH_GRAPHIC,Cfg_URL_ICON_PUBLIC,
|
||||||
(Minute % 60) == 0 ? 'v' :
|
(Minute % 60) == 0 ? 'v' :
|
||||||
'h');
|
'h');
|
||||||
|
|
||||||
|
@ -3125,7 +3125,7 @@ static void Sta_WriteAccessMinute (unsigned Minute,float HitsNum,float MaxX)
|
||||||
" alt=\"\" title=\"\""
|
" alt=\"\" title=\"\""
|
||||||
" style=\"display:block;"
|
" style=\"display:block;"
|
||||||
" width:%upx; height:1px;\" />",
|
" width:%upx; height:1px;\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
(Minute % 60) == 0 ? 'r' : // red background
|
(Minute % 60) == 0 ? 'r' : // red background
|
||||||
'o', // orange background
|
'o', // orange background
|
||||||
BarWidth);
|
BarWidth);
|
||||||
|
@ -3360,14 +3360,14 @@ static void Sta_ShowNumHitsPerBanner (unsigned long NumRows,
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td class=\"LOG LEFT_TOP\">"
|
"<td class=\"LOG LEFT_TOP\">"
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">"
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">"
|
||||||
"<img src=\"%s/%s/%s\""
|
"<img src=\"%s/%s\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"BANNER_SMALL\""
|
" class=\"BANNER_SMALL\""
|
||||||
" style=\"margin:0 10px 5px 0;\" />"
|
" style=\"margin:0 10px 5px 0;\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
Ban.WWW,
|
Ban.WWW,
|
||||||
Ban.FullName,
|
Ban.FullName,
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_BANNER,
|
Cfg_URL_BANNER_PUBLIC,
|
||||||
Ban.Img,
|
Ban.Img,
|
||||||
Ban.ShrtName,
|
Ban.ShrtName,
|
||||||
Ban.FullName);
|
Ban.FullName);
|
||||||
|
@ -3926,7 +3926,7 @@ static void Sta_DrawBarNumHits (char Color,
|
||||||
" class=\"LEFT_MIDDLE\""
|
" class=\"LEFT_MIDDLE\""
|
||||||
" style=\"width:%upx; height:10px;\" />"
|
" style=\"width:%upx; height:10px;\" />"
|
||||||
" ",
|
" ",
|
||||||
Gbl.Prefs.URLIcons,Color,BarWidth);
|
Cfg_URL_ICON_PUBLIC,Color,BarWidth);
|
||||||
|
|
||||||
/***** Write the number of hits *****/
|
/***** Write the number of hits *****/
|
||||||
Str_WriteFloatNum (Gbl.F.Out,HitsNum);
|
Str_WriteFloatNum (Gbl.F.Out,HitsNum);
|
||||||
|
|
|
@ -3493,7 +3493,7 @@ static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs)
|
||||||
" class=\"LEFT_TOP\""
|
" class=\"LEFT_TOP\""
|
||||||
" style=\"width:%upx; height:20px;\" />"
|
" style=\"width:%upx; height:20px;\" />"
|
||||||
" ",
|
" ",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
Gbl.Title,
|
Gbl.Title,
|
||||||
BarWidth);
|
BarWidth);
|
||||||
|
|
|
@ -353,8 +353,8 @@ void Syl_LoadListItemsSyllabusIntoMemory (long CrsCod)
|
||||||
|
|
||||||
/* Path of the private directory for the XML file with the syllabus */
|
/* Path of the private directory for the XML file with the syllabus */
|
||||||
snprintf (Gbl.Syllabus.PathDir,sizeof (Gbl.Syllabus.PathDir),
|
snprintf (Gbl.Syllabus.PathDir,sizeof (Gbl.Syllabus.PathDir),
|
||||||
"%s/%s/%ld/%s",
|
"%s/%ld/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,CrsCod,
|
Cfg_PATH_CRS_PRIVATE,CrsCod,
|
||||||
Gbl.Syllabus.WhichSyllabus == Syl_LECTURES ? Cfg_SYLLABUS_FOLDER_LECTURES :
|
Gbl.Syllabus.WhichSyllabus == Syl_LECTURES ? Cfg_SYLLABUS_FOLDER_LECTURES :
|
||||||
Cfg_SYLLABUS_FOLDER_PRACTICALS);
|
Cfg_SYLLABUS_FOLDER_PRACTICALS);
|
||||||
|
|
||||||
|
@ -752,8 +752,8 @@ int Syl_WriteSyllabusIntoHTMLBuffer (char **HTMLBuffer)
|
||||||
{
|
{
|
||||||
/***** Create a unique name for the file *****/
|
/***** Create a unique name for the file *****/
|
||||||
snprintf (FileNameHTMLTmp,sizeof (FileNameHTMLTmp),
|
snprintf (FileNameHTMLTmp,sizeof (FileNameHTMLTmp),
|
||||||
"%s/%s/%s_syllabus.html",
|
"%s/%s_syllabus.html",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_OUT_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
|
|
||||||
/***** Create a new temporary file for writing and reading *****/
|
/***** Create a new temporary file for writing and reading *****/
|
||||||
if ((FileHTMLTmp = fopen (FileNameHTMLTmp,"w+b")) == NULL)
|
if ((FileHTMLTmp = fopen (FileNameHTMLTmp,"w+b")) == NULL)
|
||||||
|
|
|
@ -1743,7 +1743,7 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res,
|
||||||
TagHidden = (row[2][0] == 'Y');
|
TagHidden = (row[2][0] == 'Y');
|
||||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
|
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
|
||||||
"<img src=\"%s/",
|
"<img src=\"%s/",
|
||||||
Gbl.Prefs.URLIcons);
|
Cfg_URL_ICON_PUBLIC);
|
||||||
if (TagHidden)
|
if (TagHidden)
|
||||||
fprintf (Gbl.F.Out,"eye-slash.svg\" alt=\"%s\" title=\"%s",
|
fprintf (Gbl.F.Out,"eye-slash.svg\" alt=\"%s\" title=\"%s",
|
||||||
Txt_Tag_not_allowed,
|
Txt_Tag_not_allowed,
|
||||||
|
@ -3395,7 +3395,7 @@ static void Tst_WriteAnswersEdit (long QstCod)
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/check.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/check.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"CONTEXT_ICO_16x16\" />",
|
" class=\"CONTEXT_ICO_16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_TST_Answer_given_by_the_teachers,
|
Txt_TST_Answer_given_by_the_teachers,
|
||||||
Txt_TST_Answer_given_by_the_teachers);
|
Txt_TST_Answer_given_by_the_teachers);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
@ -5234,7 +5234,7 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
|
||||||
"<img src=\"%s/caret-right.svg\""
|
"<img src=\"%s/caret-right.svg\""
|
||||||
" alt=\"%s\" title=\"%s\" class=\"ICO16x16\" />"
|
" alt=\"%s\" title=\"%s\" class=\"ICO16x16\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
NumOpt,Gbl.Prefs.URLIcons,
|
NumOpt,Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Title,Gbl.Title);
|
Gbl.Title,Gbl.Title);
|
||||||
|
|
||||||
/* Icon to contract (hide the answer) */
|
/* Icon to contract (hide the answer) */
|
||||||
|
@ -5248,7 +5248,7 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
|
||||||
"<img src=\"%s/caret-down.svg\""
|
"<img src=\"%s/caret-down.svg\""
|
||||||
" alt=\"%s\" title=\"%s\" class=\"ICO16x16\" />"
|
" alt=\"%s\" title=\"%s\" class=\"ICO16x16\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
NumOpt,Gbl.Prefs.URLIcons,
|
NumOpt,Cfg_URL_ICON_PUBLIC,
|
||||||
Gbl.Title,Gbl.Title);
|
Gbl.Title,Gbl.Title);
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
|
@ -177,8 +177,8 @@ void TsI_CreateXML (unsigned long NumRows,MYSQL_RES *mysql_res)
|
||||||
|
|
||||||
/***** Create public XML file with the questions *****/
|
/***** Create public XML file with the questions *****/
|
||||||
snprintf (PathPubFile,sizeof (PathPubFile),
|
snprintf (PathPubFile,sizeof (PathPubFile),
|
||||||
"%s/%s/%s/test.xml",
|
"%s/%s/test.xml",
|
||||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
|
Cfg_PATH_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Gbl.FileBrowser.TmpPubDir);
|
Gbl.FileBrowser.TmpPubDir);
|
||||||
if ((Gbl.Test.XML.FileXML = fopen (PathPubFile,"wb")) == NULL)
|
if ((Gbl.Test.XML.FileXML = fopen (PathPubFile,"wb")) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Can not open target file.");
|
Lay_ShowErrorAndExit ("Can not open target file.");
|
||||||
|
@ -256,8 +256,9 @@ void TsI_CreateXML (unsigned long NumRows,MYSQL_RES *mysql_res)
|
||||||
mysql_data_seek (mysql_res,0);
|
mysql_data_seek (mysql_res,0);
|
||||||
|
|
||||||
/***** Write the link to XML file *****/
|
/***** Write the link to XML file *****/
|
||||||
fprintf (Gbl.F.Out,"<a href=\"%s/%s/%s/test.xml\" class=\"%s\" target=\"_blank\">",
|
fprintf (Gbl.F.Out,"<a href=\"%s/%s/test.xml\""
|
||||||
Cfg_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
|
" class=\"%s\" target=\"_blank\">",
|
||||||
|
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Gbl.FileBrowser.TmpPubDir,
|
Gbl.FileBrowser.TmpPubDir,
|
||||||
The_ClassFormOutBoxBold[Gbl.Prefs.Theme]);
|
The_ClassFormOutBoxBold[Gbl.Prefs.Theme]);
|
||||||
Ico_PutIconTextLink ("file.svg",
|
Ico_PutIconTextLink ("file.svg",
|
||||||
|
@ -393,7 +394,6 @@ static void TsI_WriteAnswersOfAQstXML (long QstCod)
|
||||||
void TsI_ImportQstsFromXML (void)
|
void TsI_ImportQstsFromXML (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_file_is_not_X;
|
extern const char *Txt_The_file_is_not_X;
|
||||||
char PathTestPriv[PATH_MAX + 1];
|
|
||||||
struct Param *Param;
|
struct Param *Param;
|
||||||
char FileNameXMLSrc[PATH_MAX + 1];
|
char FileNameXMLSrc[PATH_MAX + 1];
|
||||||
char FileNameXMLTmp[PATH_MAX + 1]; // Full name (including path and .xml) of the destination temporary file
|
char FileNameXMLTmp[PATH_MAX + 1]; // Full name (including path and .xml) of the destination temporary file
|
||||||
|
@ -401,13 +401,7 @@ void TsI_ImportQstsFromXML (void)
|
||||||
bool WrongType = false;
|
bool WrongType = false;
|
||||||
|
|
||||||
/***** Creates directory if not exists *****/
|
/***** Creates directory if not exists *****/
|
||||||
snprintf (PathTestPriv,sizeof (PathTestPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_TEST_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_TEST);
|
|
||||||
Fil_CreateDirIfNotExists (PathTestPriv);
|
|
||||||
|
|
||||||
/***** Remove old files *****/
|
|
||||||
Fil_RemoveOldTmpFiles (PathTestPriv,Cfg_TIME_TO_DELETE_TEST_TMP_FILES,false);
|
|
||||||
|
|
||||||
/***** First of all, copy in disk the file received from stdin (really from Gbl.F.Tmp) *****/
|
/***** First of all, copy in disk the file received from stdin (really from Gbl.F.Tmp) *****/
|
||||||
Param = Fil_StartReceptionOfFile (Fil_NAME_OF_PARAM_FILENAME_ORG,
|
Param = Fil_StartReceptionOfFile (Fil_NAME_OF_PARAM_FILENAME_ORG,
|
||||||
|
@ -429,7 +423,7 @@ void TsI_ImportQstsFromXML (void)
|
||||||
/* End the reception of XML in a temporary file */
|
/* End the reception of XML in a temporary file */
|
||||||
snprintf (FileNameXMLTmp,sizeof (FileNameXMLTmp),
|
snprintf (FileNameXMLTmp,sizeof (FileNameXMLTmp),
|
||||||
"%s/%s.xml",
|
"%s/%s.xml",
|
||||||
PathTestPriv,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_TEST_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
if (Fil_EndReceptionOfFile (FileNameXMLTmp,Param))
|
if (Fil_EndReceptionOfFile (FileNameXMLTmp,Param))
|
||||||
/***** Get questions from XML file and store them in database *****/
|
/***** Get questions from XML file and store them in database *****/
|
||||||
TsI_ReadQuestionsFromXMLFileAndStoreInDB (FileNameXMLTmp);
|
TsI_ReadQuestionsFromXMLFileAndStoreInDB (FileNameXMLTmp);
|
||||||
|
@ -1023,7 +1017,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
|
||||||
" class=\"CONTEXT_ICO_16x16\" />"
|
" class=\"CONTEXT_ICO_16x16\" />"
|
||||||
"</td>",
|
"</td>",
|
||||||
Gbl.RowEvenOdd,
|
Gbl.RowEvenOdd,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
QuestionExists ? "tr16x16.gif" :
|
QuestionExists ? "tr16x16.gif" :
|
||||||
"check-circle.svg",
|
"check-circle.svg",
|
||||||
QuestionExists ? Txt_Existing_question :
|
QuestionExists ? Txt_Existing_question :
|
||||||
|
@ -1083,7 +1077,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/check.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/check.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"%sICO16x16\" />",
|
" class=\"%sICO16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_TST_Answer_given_by_the_teachers,
|
Txt_TST_Answer_given_by_the_teachers,
|
||||||
Txt_TST_Answer_given_by_the_teachers,
|
Txt_TST_Answer_given_by_the_teachers,
|
||||||
QuestionExists ? "ICO_HIDDEN " :
|
QuestionExists ? "ICO_HIDDEN " :
|
||||||
|
@ -1153,7 +1147,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem,
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/check.svg\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/check.svg\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"%sCONTEXT_ICO_16x16\" />",
|
" class=\"%sCONTEXT_ICO_16x16\" />",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_TST_Answer_given_by_the_teachers,
|
Txt_TST_Answer_given_by_the_teachers,
|
||||||
Txt_TST_Answer_given_by_the_teachers,
|
Txt_TST_Answer_given_by_the_teachers,
|
||||||
QuestionExists ? "ICO_HIDDEN " :
|
QuestionExists ? "ICO_HIDDEN " :
|
||||||
|
|
|
@ -316,9 +316,8 @@ void The_ChangeTheme (void)
|
||||||
/***** Get param theme *****/
|
/***** Get param theme *****/
|
||||||
Gbl.Prefs.Theme = The_GetParamTheme ();
|
Gbl.Prefs.Theme = The_GetParamTheme ();
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (Path,sizeof (Path),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_THEMES_PUBLIC,
|
||||||
Cfg_ICON_FOLDER_THEMES,
|
|
||||||
The_ThemeId[Gbl.Prefs.Theme]);
|
The_ThemeId[Gbl.Prefs.Theme]);
|
||||||
Str_Copy (Gbl.Prefs.URLTheme,Path,
|
Str_Copy (Gbl.Prefs.URLTheme,Path,
|
||||||
PATH_MAX);
|
PATH_MAX);
|
||||||
|
|
|
@ -697,6 +697,7 @@ static void TL_BuildQueryToGetTimeline (char **Query,
|
||||||
" GROUP BY NotCod ORDER BY NewestPubCod DESC LIMIT ..."
|
" GROUP BY NotCod ORDER BY NewestPubCod DESC LIMIT ..."
|
||||||
but this query is slow (several seconds) with a big table.
|
but this query is slow (several seconds) with a big table.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (NumPub = 0;
|
for (NumPub = 0;
|
||||||
NumPub < MaxPubsToGet[WhatToGetFromTimeline];
|
NumPub < MaxPubsToGet[WhatToGetFromTimeline];
|
||||||
NumPub++)
|
NumPub++)
|
||||||
|
@ -981,7 +982,6 @@ static void TL_ShowTimeline (char *Query,
|
||||||
NumPubsGot = DB_QuerySELECT (&mysql_res,"can not get timeline",
|
NumPubsGot = DB_QuerySELECT (&mysql_res,"can not get timeline",
|
||||||
"%s",
|
"%s",
|
||||||
Query);
|
Query);
|
||||||
|
|
||||||
/***** Start box *****/
|
/***** Start box *****/
|
||||||
Box_StartBox (NULL,Title,TL_PutIconsTimeline,
|
Box_StartBox (NULL,Title,TL_PutIconsTimeline,
|
||||||
Hlp_START_Timeline,Box_NOT_CLOSABLE);
|
Hlp_START_Timeline,Box_NOT_CLOSABLE);
|
||||||
|
@ -1402,8 +1402,8 @@ static void TL_PutLinkToViewOldPublications (void)
|
||||||
"</a>"
|
"</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
The_ClassFormInBoxBold[Gbl.Prefs.Theme],
|
The_ClassFormInBoxBold[Gbl.Prefs.Theme],
|
||||||
Gbl.Prefs.URLIcons,Txt_See_more,Txt_See_more,
|
Cfg_URL_ICON_PUBLIC,Txt_See_more,Txt_See_more,
|
||||||
Gbl.Prefs.URLIcons,Txt_See_more,Txt_See_more,
|
Cfg_URL_ICON_PUBLIC,Txt_See_more,Txt_See_more,
|
||||||
Txt_See_more);
|
Txt_See_more);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2039,7 +2039,7 @@ static void TL_PutFormGoToAction (const struct TL_Note *SocNot)
|
||||||
" class=\"CONTEXT_ICO_x16\" />"
|
" class=\"CONTEXT_ICO_x16\" />"
|
||||||
" %s"
|
" %s"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.URLIcons,TL_Icons[SocNot->NoteType],
|
Cfg_URL_ICON_PUBLIC,TL_Icons[SocNot->NoteType],
|
||||||
Txt_TIMELINE_NOTE[SocNot->NoteType],
|
Txt_TIMELINE_NOTE[SocNot->NoteType],
|
||||||
Txt_TIMELINE_NOTE[SocNot->NoteType],
|
Txt_TIMELINE_NOTE[SocNot->NoteType],
|
||||||
Txt_TIMELINE_NOTE[SocNot->NoteType]);
|
Txt_TIMELINE_NOTE[SocNot->NoteType]);
|
||||||
|
@ -2519,7 +2519,7 @@ static void TL_PutIconToToggleCommentNote (const char UniqueId[Frm_MAX_BYTES_ID
|
||||||
"</a>"
|
"</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
UniqueId,
|
UniqueId,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Comment,Txt_Comment);
|
Txt_Comment,Txt_Comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2537,7 +2537,7 @@ static void TL_PutIconCommentDisabled (void)
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Comment,Txt_Comment);
|
Txt_Comment,Txt_Comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4578,7 +4578,7 @@ static void TL_ShowSharersOrFavers (MYSQL_RES **mysql_res,
|
||||||
" alt=\"%u\" title=\"%u\""
|
" alt=\"%u\" title=\"%u\""
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
NumUsrs - NumUsrsShown,
|
NumUsrs - NumUsrsShown,
|
||||||
NumUsrs - NumUsrsShown);
|
NumUsrs - NumUsrsShown);
|
||||||
}
|
}
|
||||||
|
|
36
swad_user.c
36
swad_user.c
|
@ -2538,7 +2538,7 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) ())
|
||||||
" value=\"%s\""
|
" value=\"%s\""
|
||||||
" autofocus=\"autofocus\" required=\"required\" />"
|
" autofocus=\"autofocus\" required=\"required\" />"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_User[Usr_SEX_UNKNOWN],
|
Txt_User[Usr_SEX_UNKNOWN],
|
||||||
Txt_User[Usr_SEX_UNKNOWN],
|
Txt_User[Usr_SEX_UNKNOWN],
|
||||||
Cns_MAX_CHARS_EMAIL_ADDRESS,
|
Cns_MAX_CHARS_EMAIL_ADDRESS,
|
||||||
|
@ -2554,7 +2554,7 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) ())
|
||||||
"<input type=\"password\" id=\"UsrPwd\" name=\"UsrPwd\""
|
"<input type=\"password\" id=\"UsrPwd\" name=\"UsrPwd\""
|
||||||
" size=\"18\" maxlength=\"%u\" placeholder=\"%s\" />"
|
" size=\"18\" maxlength=\"%u\" placeholder=\"%s\" />"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Password,
|
Txt_Password,
|
||||||
Txt_Password,
|
Txt_Password,
|
||||||
Pwd_MAX_CHARS_PLAIN_PASSWORD,
|
Pwd_MAX_CHARS_PLAIN_PASSWORD,
|
||||||
|
@ -3317,9 +3317,7 @@ static void Usr_SetMyPrefsAndRoles (void)
|
||||||
{
|
{
|
||||||
extern const char *The_ThemeId[The_NUM_THEMES];
|
extern const char *The_ThemeId[The_NUM_THEMES];
|
||||||
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
|
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
|
||||||
char Path[PATH_MAX + 1 +
|
char URL[PATH_MAX + 1];
|
||||||
NAME_MAX + 1 +
|
|
||||||
NAME_MAX + 1];
|
|
||||||
|
|
||||||
// In this point I am logged
|
// In this point I am logged
|
||||||
|
|
||||||
|
@ -3334,19 +3332,17 @@ static void Usr_SetMyPrefsAndRoles (void)
|
||||||
Gbl.Prefs.SideCols = Gbl.Usrs.Me.UsrDat.Prefs.SideCols;
|
Gbl.Prefs.SideCols = Gbl.Usrs.Me.UsrDat.Prefs.SideCols;
|
||||||
|
|
||||||
Gbl.Prefs.Theme = Gbl.Usrs.Me.UsrDat.Prefs.Theme;
|
Gbl.Prefs.Theme = Gbl.Usrs.Me.UsrDat.Prefs.Theme;
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (URL,sizeof (URL),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_THEMES,
|
Cfg_URL_ICON_THEMES_PUBLIC,The_ThemeId[Gbl.Prefs.Theme]);
|
||||||
The_ThemeId[Gbl.Prefs.Theme]);
|
Str_Copy (Gbl.Prefs.URLTheme,URL,
|
||||||
Str_Copy (Gbl.Prefs.URLTheme,Path,
|
|
||||||
PATH_MAX);
|
PATH_MAX);
|
||||||
|
|
||||||
Gbl.Prefs.IconSet = Gbl.Usrs.Me.UsrDat.Prefs.IconSet;
|
Gbl.Prefs.IconSet = Gbl.Usrs.Me.UsrDat.Prefs.IconSet;
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (URL,sizeof (URL),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_ICON_SETS,
|
Cfg_URL_ICON_SETS_PUBLIC,Ico_IconSetId[Gbl.Prefs.IconSet]);
|
||||||
Ico_IconSetId[Gbl.Prefs.IconSet]);
|
Str_Copy (Gbl.Prefs.URLIconSet,URL,
|
||||||
Str_Copy (Gbl.Prefs.URLIconSet,Path,
|
|
||||||
PATH_MAX);
|
PATH_MAX);
|
||||||
|
|
||||||
/***** Construct the path to my directory *****/
|
/***** Construct the path to my directory *****/
|
||||||
|
@ -6011,7 +6007,7 @@ static void Usr_FormToSelectUsrListType (Act_Action_t NextAction,Usr_ShowUsrsTyp
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO20x20\" />"
|
" class=\"ICO20x20\" />"
|
||||||
" %s</a>",
|
" %s</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Usr_IconsClassPhotoOrList[ListType],
|
Usr_IconsClassPhotoOrList[ListType],
|
||||||
Txt_USR_LIST_TYPES[ListType],
|
Txt_USR_LIST_TYPES[ListType],
|
||||||
Txt_USR_LIST_TYPES[ListType],
|
Txt_USR_LIST_TYPES[ListType],
|
||||||
|
@ -8828,19 +8824,15 @@ void Usr_PutSelectorNumColsClassPhoto (void)
|
||||||
|
|
||||||
void Usr_ConstructPathUsr (long UsrCod,char PathUsr[PATH_MAX + 1])
|
void Usr_ConstructPathUsr (long UsrCod,char PathUsr[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
char PathUsrs[PATH_MAX + 1];
|
|
||||||
char PathAboveUsr[PATH_MAX + 1];
|
char PathAboveUsr[PATH_MAX + 1];
|
||||||
|
|
||||||
/***** Path for users *****/
|
/***** Path for users *****/
|
||||||
snprintf (PathUsrs,sizeof (PathUsrs),
|
Fil_CreateDirIfNotExists (Cfg_PATH_USR_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_USR);
|
|
||||||
Fil_CreateDirIfNotExists (PathUsrs);
|
|
||||||
|
|
||||||
/***** Path above user's ID *****/
|
/***** Path above user's ID *****/
|
||||||
snprintf (PathAboveUsr,sizeof (PathAboveUsr),
|
snprintf (PathAboveUsr,sizeof (PathAboveUsr),
|
||||||
"%s/%02u",
|
"%s/%02u",
|
||||||
PathUsrs,(unsigned) (UsrCod % 100));
|
Cfg_PATH_USR_PRIVATE,(unsigned) (UsrCod % 100));
|
||||||
Fil_CreateDirIfNotExists (PathAboveUsr);
|
Fil_CreateDirIfNotExists (PathAboveUsr);
|
||||||
|
|
||||||
/***** Path for user *****/
|
/***** Path for user *****/
|
||||||
|
|
|
@ -4324,7 +4324,6 @@ int swad__getDirectoryTree (struct soap *soap,
|
||||||
{
|
{
|
||||||
extern const char *Brw_RootFolderInternalNames[Brw_NUM_TYPES_FILE_BROWSER];
|
extern const char *Brw_RootFolderInternalNames[Brw_NUM_TYPES_FILE_BROWSER];
|
||||||
int ReturnCode;
|
int ReturnCode;
|
||||||
char PathXMLPriv[PATH_MAX + 1];
|
|
||||||
char XMLFileName[PATH_MAX + 1];
|
char XMLFileName[PATH_MAX + 1];
|
||||||
unsigned long FileSize;
|
unsigned long FileSize;
|
||||||
unsigned long NumBytesRead;
|
unsigned long NumBytesRead;
|
||||||
|
@ -4418,21 +4417,18 @@ int swad__getDirectoryTree (struct soap *soap,
|
||||||
-1L;
|
-1L;
|
||||||
|
|
||||||
snprintf (Gbl.CurrentCrs.PathPriv,sizeof (Gbl.CurrentCrs.PathPriv),
|
snprintf (Gbl.CurrentCrs.PathPriv,sizeof (Gbl.CurrentCrs.PathPriv),
|
||||||
"%s/%s/%ld",
|
"%s/%ld",
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_CRS,Gbl.CurrentCrs.Crs.CrsCod);
|
Cfg_PATH_CRS_PRIVATE,Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
Brw_InitializeFileBrowser ();
|
Brw_InitializeFileBrowser ();
|
||||||
Brw_SetFullPathInTree (Brw_RootFolderInternalNames[Gbl.FileBrowser.Type],".");
|
Brw_SetFullPathInTree (Brw_RootFolderInternalNames[Gbl.FileBrowser.Type],".");
|
||||||
|
|
||||||
/* Check if exists the directory for HTML output. If not exists, create it */
|
/* Check if exists the directory for HTML output. If not exists, create it */
|
||||||
snprintf (PathXMLPriv,sizeof (PathXMLPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_OUT_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT);
|
|
||||||
Fil_CreateDirIfNotExists (PathXMLPriv);
|
|
||||||
|
|
||||||
/* Create a unique name for the file */
|
/* Create a unique name for the file */
|
||||||
snprintf (XMLFileName,sizeof (XMLFileName),
|
snprintf (XMLFileName,sizeof (XMLFileName),
|
||||||
"%s/%s.xml",
|
"%s/%s.xml",
|
||||||
PathXMLPriv,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_OUT_PRIVATE,Gbl.UniqueNameEncrypted);
|
||||||
|
|
||||||
/* Open file for writing and reading */
|
/* Open file for writing and reading */
|
||||||
if ((Gbl.F.XML = fopen (XMLFileName,"w+t")) == NULL)
|
if ((Gbl.F.XML = fopen (XMLFileName,"w+t")) == NULL)
|
||||||
|
|
57
swad_zip.c
57
swad_zip.c
|
@ -202,9 +202,8 @@ void ZIP_CreateZIPAsgWrk (void)
|
||||||
|
|
||||||
/***** Relative path of the directory with the works to compress *****/
|
/***** Relative path of the directory with the works to compress *****/
|
||||||
snprintf (Path,sizeof (Path),
|
snprintf (Path,sizeof (Path),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,
|
Cfg_PATH_ZIP_PRIVATE,
|
||||||
Cfg_FOLDER_ZIP,
|
|
||||||
Gbl.FileBrowser.ZIP.TmpDir);
|
Gbl.FileBrowser.ZIP.TmpDir);
|
||||||
|
|
||||||
/***** Change to directory of the assignments and works
|
/***** Change to directory of the assignments and works
|
||||||
|
@ -217,9 +216,8 @@ void ZIP_CreateZIPAsgWrk (void)
|
||||||
"%s.zip",
|
"%s.zip",
|
||||||
Txt_works_ZIP_FILE_NAME);
|
Txt_works_ZIP_FILE_NAME);
|
||||||
snprintf (PathFileZIP,sizeof (PathFileZIP),
|
snprintf (PathFileZIP,sizeof (PathFileZIP),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,
|
Cfg_PATH_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Cfg_FOLDER_FILE_BROWSER_TMP,
|
|
||||||
Gbl.FileBrowser.TmpPubDir,
|
Gbl.FileBrowser.TmpPubDir,
|
||||||
FileNameZIP);
|
FileNameZIP);
|
||||||
snprintf (StrZip,sizeof (StrZip),
|
snprintf (StrZip,sizeof (StrZip),
|
||||||
|
@ -241,9 +239,8 @@ void ZIP_CreateZIPAsgWrk (void)
|
||||||
{
|
{
|
||||||
/***** Create URL pointing to ZIP file *****/
|
/***** Create URL pointing to ZIP file *****/
|
||||||
snprintf (URLWithSpaces,sizeof (URLWithSpaces),
|
snprintf (URLWithSpaces,sizeof (URLWithSpaces),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,
|
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Cfg_FOLDER_FILE_BROWSER_TMP,
|
|
||||||
Gbl.FileBrowser.TmpPubDir,
|
Gbl.FileBrowser.TmpPubDir,
|
||||||
FileNameZIP);
|
FileNameZIP);
|
||||||
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces
|
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces
|
||||||
|
@ -265,27 +262,17 @@ void ZIP_CreateZIPAsgWrk (void)
|
||||||
|
|
||||||
static void ZIP_CreateTmpDirForCompression (void)
|
static void ZIP_CreateTmpDirForCompression (void)
|
||||||
{
|
{
|
||||||
char PathZipPriv[PATH_MAX + 1];
|
|
||||||
char PathDirTmp[PATH_MAX + 1];
|
char PathDirTmp[PATH_MAX + 1];
|
||||||
|
|
||||||
/***** If the private directory does not exist, create it *****/
|
/***** If the private directory does not exist, create it *****/
|
||||||
snprintf (PathZipPriv,sizeof (PathZipPriv),
|
Fil_CreateDirIfNotExists (Cfg_PATH_ZIP_PRIVATE);
|
||||||
"%s/%s",
|
|
||||||
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_ZIP);
|
|
||||||
Fil_CreateDirIfNotExists (PathZipPriv);
|
|
||||||
|
|
||||||
/***** First of all, we remove the oldest temporary directories.
|
|
||||||
Such temporary directories have been created by me or by other users.
|
|
||||||
This is a bit sloppy, but they must be removed by someone.
|
|
||||||
Here "oldest" means more than x time from their creation *****/
|
|
||||||
Fil_RemoveOldTmpFiles (PathZipPriv,Cfg_TIME_TO_DELETE_BROWSER_ZIP_FILES,false);
|
|
||||||
|
|
||||||
/***** Create a new temporary directory *****/
|
/***** Create a new temporary directory *****/
|
||||||
Str_Copy (Gbl.FileBrowser.ZIP.TmpDir,Gbl.UniqueNameEncrypted,
|
Str_Copy (Gbl.FileBrowser.ZIP.TmpDir,Gbl.UniqueNameEncrypted,
|
||||||
NAME_MAX);
|
NAME_MAX);
|
||||||
snprintf (PathDirTmp,sizeof (PathDirTmp),
|
snprintf (PathDirTmp,sizeof (PathDirTmp),
|
||||||
"%s/%s",
|
"%s/%s",
|
||||||
PathZipPriv,Gbl.FileBrowser.ZIP.TmpDir);
|
Cfg_PATH_ZIP_PRIVATE,Gbl.FileBrowser.ZIP.TmpDir);
|
||||||
if (mkdir (PathDirTmp,(mode_t) 0xFFF))
|
if (mkdir (PathDirTmp,(mode_t) 0xFFF))
|
||||||
Lay_ShowErrorAndExit ("Can not create temporary folder for compression.");
|
Lay_ShowErrorAndExit ("Can not create temporary folder for compression.");
|
||||||
}
|
}
|
||||||
|
@ -341,9 +328,8 @@ static void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat)
|
||||||
(unsigned) (UsrDat->UsrCod % 100),
|
(unsigned) (UsrDat->UsrCod % 100),
|
||||||
UsrDat->UsrCod);
|
UsrDat->UsrCod);
|
||||||
snprintf (LinkTmpUsr,sizeof (LinkTmpUsr),
|
snprintf (LinkTmpUsr,sizeof (LinkTmpUsr),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,
|
Cfg_PATH_ZIP_PRIVATE,
|
||||||
Cfg_FOLDER_ZIP,
|
|
||||||
Gbl.FileBrowser.ZIP.TmpDir,
|
Gbl.FileBrowser.ZIP.TmpDir,
|
||||||
FullNameAndUsrID);
|
FullNameAndUsrID);
|
||||||
|
|
||||||
|
@ -386,7 +372,7 @@ void ZIP_PutButtonToDownloadZIPOfAFolder (const char *PathInTree,const char *Fil
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO16x16\" />"
|
" class=\"ICO16x16\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Create_ZIP_file,
|
Txt_Create_ZIP_file,
|
||||||
Txt_Create_ZIP_file);
|
Txt_Create_ZIP_file);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
@ -446,9 +432,8 @@ static void ZIP_CompressFolderIntoZIP (void)
|
||||||
Gbl.FileBrowser.Priv.PathAboveRootFolder,
|
Gbl.FileBrowser.Priv.PathAboveRootFolder,
|
||||||
Gbl.FileBrowser.Priv.FullPathInTree);
|
Gbl.FileBrowser.Priv.FullPathInTree);
|
||||||
snprintf (PathCompression,sizeof (PathCompression),
|
snprintf (PathCompression,sizeof (PathCompression),
|
||||||
"%s/%s/%s",
|
"%s/%s",
|
||||||
Cfg_PATH_SWAD_PRIVATE,
|
Cfg_PATH_ZIP_PRIVATE,
|
||||||
Cfg_FOLDER_ZIP,
|
|
||||||
Gbl.FileBrowser.ZIP.TmpDir); // Example: /var/www/swad/zip/<temporary_dir>
|
Gbl.FileBrowser.ZIP.TmpDir); // Example: /var/www/swad/zip/<temporary_dir>
|
||||||
|
|
||||||
UncompressedSize = ZIP_CloneDir (Path,PathCompression,Gbl.FileBrowser.Priv.FullPathInTree);
|
UncompressedSize = ZIP_CloneDir (Path,PathCompression,Gbl.FileBrowser.Priv.FullPathInTree);
|
||||||
|
@ -470,9 +455,8 @@ static void ZIP_CompressFolderIntoZIP (void)
|
||||||
strcmp (Gbl.FileBrowser.FilFolLnkName,".") ? Gbl.FileBrowser.FilFolLnkName :
|
strcmp (Gbl.FileBrowser.FilFolLnkName,".") ? Gbl.FileBrowser.FilFolLnkName :
|
||||||
Txt_ROOT_FOLDER_EXTERNAL_NAMES[Gbl.FileBrowser.Type]);
|
Txt_ROOT_FOLDER_EXTERNAL_NAMES[Gbl.FileBrowser.Type]);
|
||||||
snprintf (PathFileZIP,sizeof (PathFileZIP),
|
snprintf (PathFileZIP,sizeof (PathFileZIP),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_PATH_SWAD_PUBLIC,
|
Cfg_PATH_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Cfg_FOLDER_FILE_BROWSER_TMP,
|
|
||||||
Gbl.FileBrowser.TmpPubDir,
|
Gbl.FileBrowser.TmpPubDir,
|
||||||
FileNameZIP);
|
FileNameZIP);
|
||||||
snprintf (StrZip,sizeof (StrZip),
|
snprintf (StrZip,sizeof (StrZip),
|
||||||
|
@ -494,9 +478,8 @@ static void ZIP_CompressFolderIntoZIP (void)
|
||||||
{
|
{
|
||||||
/***** Create URL pointing to ZIP file *****/
|
/***** Create URL pointing to ZIP file *****/
|
||||||
snprintf (URLWithSpaces,sizeof (URLWithSpaces),
|
snprintf (URLWithSpaces,sizeof (URLWithSpaces),
|
||||||
"%s/%s/%s/%s",
|
"%s/%s/%s",
|
||||||
Cfg_URL_SWAD_PUBLIC,
|
Cfg_URL_FILE_BROWSER_TMP_PUBLIC,
|
||||||
Cfg_FOLDER_FILE_BROWSER_TMP,
|
|
||||||
Gbl.FileBrowser.TmpPubDir,
|
Gbl.FileBrowser.TmpPubDir,
|
||||||
FileNameZIP);
|
FileNameZIP);
|
||||||
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces
|
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces
|
||||||
|
@ -640,7 +623,7 @@ static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL,
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"2\" class=\"FILENAME_TXT CENTER_MIDDLE\">"
|
"<td colspan=\"2\" class=\"FILENAME_TXT CENTER_MIDDLE\">"
|
||||||
"<a href=\"%s\" class=\"FILENAME_TXT\" title=\"%s\" target=\"_blank\">"
|
"<a href=\"%s\" class=\"FILENAME_TXT\" title=\"%s\" target=\"_blank\">"
|
||||||
"<img src=\"%s/%s32x32/zip32x32.gif\""
|
"<img src=\"%s32x32/zip32x32.gif\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO40x40\" />"
|
" class=\"ICO40x40\" />"
|
||||||
" %s "
|
" %s "
|
||||||
|
@ -651,11 +634,11 @@ static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL,
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
URL,FileName,
|
URL,FileName,
|
||||||
Gbl.Prefs.URLIcons,Cfg_ICON_FOLDER_FILEXT,
|
CfG_URL_ICON_FILEXT_PUBLIC,
|
||||||
Txt_ZIP_file,
|
Txt_ZIP_file,
|
||||||
Txt_ZIP_file,
|
Txt_ZIP_file,
|
||||||
FileName,
|
FileName,
|
||||||
Gbl.Prefs.URLIcons,
|
Cfg_URL_ICON_PUBLIC,
|
||||||
Txt_Download,
|
Txt_Download,
|
||||||
Txt_Download);
|
Txt_Download);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue