mirror of https://github.com/acanas/swad-core.git
Version19.42.7
This commit is contained in:
parent
8b43a0c971
commit
86bb09193f
|
@ -487,13 +487,14 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.42.6 (2019-10-24)"
|
#define Log_PLATFORM_VERSION "SWAD 19.42.7 (2019-10-24)"
|
||||||
#define CSS_FILE "swad19.42.6.css"
|
#define CSS_FILE "swad19.42.6.css"
|
||||||
#define JS_FILE "swad19.39.js"
|
#define JS_FILE "swad19.39.js"
|
||||||
/*
|
/*
|
||||||
// TODO: Perico: poner un candado de bloqueo de creación/edición de proyectos (por ejemplo en asignaturas obsoletas)
|
// TODO: Perico: poner un candado de bloqueo de creación/edición de proyectos (por ejemplo en asignaturas obsoletas)
|
||||||
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
||||||
|
|
||||||
|
Version 19.42.7: Oct 24, 2019 Code refactoring in media. (246037 lines)
|
||||||
Version 19.42.6: Oct 24, 2019 Code refactoring in CSS.
|
Version 19.42.6: Oct 24, 2019 Code refactoring in CSS.
|
||||||
Changes icon to upload file in timeline.
|
Changes icon to upload file in timeline.
|
||||||
Code refactoring in media. (246034 lines)
|
Code refactoring in media. (246034 lines)
|
||||||
|
|
|
@ -1469,13 +1469,13 @@ static void Lay_WriteAboutZone (void)
|
||||||
Cfg_URL_ICON_PUBLIC,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);
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
HTM_DIV_Begin (NULL);
|
||||||
fprintf (Gbl.F.Out,"%s",Cfg_ABOUT_NAME);
|
fprintf (Gbl.F.Out,"%s",Cfg_ABOUT_NAME);
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
|
||||||
/***** Questions and problems *****/
|
/***** Questions and problems *****/
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
HTM_DIV_Begin (NULL);
|
||||||
fprintf (Gbl.F.Out,"%s: "
|
fprintf (Gbl.F.Out,"%s: "
|
||||||
"<a href=\"mailto:%s\" class=\"ABOUT\" target=\"_blank\">%s</a>",
|
"<a href=\"mailto:%s\" class=\"ABOUT\" target=\"_blank\">%s</a>",
|
||||||
Txt_Questions_and_problems,
|
Txt_Questions_and_problems,
|
||||||
|
@ -1483,7 +1483,7 @@ static void Lay_WriteAboutZone (void)
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
|
||||||
/***** About and time to generate and send page *****/
|
/***** About and time to generate and send page *****/
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
HTM_DIV_Begin (NULL);
|
||||||
|
|
||||||
/* About */
|
/* About */
|
||||||
fprintf (Gbl.F.Out,"<a href=\"%s\" class=\"ABOUT\" target=\"_blank\">",
|
fprintf (Gbl.F.Out,"<a href=\"%s\" class=\"ABOUT\" target=\"_blank\">",
|
||||||
|
|
73
swad_media.c
73
swad_media.c
|
@ -98,7 +98,9 @@ typedef enum
|
||||||
|
|
||||||
struct MediaUploader
|
struct MediaUploader
|
||||||
{
|
{
|
||||||
const char *IdSuffix;
|
Med_FormType_t FormType;
|
||||||
|
const char *IconSuffix;
|
||||||
|
const char *ParamSuffix;
|
||||||
const char *FunctionName;
|
const char *FunctionName;
|
||||||
const char *Icon;
|
const char *Icon;
|
||||||
const char *Title;
|
const char *Title;
|
||||||
|
@ -125,9 +127,8 @@ static void Med_FreeMediaTitle (struct Media *Media);
|
||||||
static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
||||||
struct MediaUploader *MediaUploader);
|
struct MediaUploader *MediaUploader);
|
||||||
static void Med_PutHiddenFormTypeMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
static void Med_PutHiddenFormTypeMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
||||||
const char *IdSuffix,
|
struct MediaUploader *MediaUploader,
|
||||||
struct ParamUploadMedia *ParamUploadMedia,
|
struct ParamUploadMedia *ParamUploadMedia);
|
||||||
Med_FormType_t FormType);
|
|
||||||
|
|
||||||
static Med_Action_t Med_GetMediaActionFromForm (const char *ParamAction);
|
static Med_Action_t Med_GetMediaActionFromForm (const char *ParamAction);
|
||||||
static Med_FormType_t Usr_GetFormTypeFromForm (struct ParamUploadMedia *ParamUploadMedia);
|
static Med_FormType_t Usr_GetFormTypeFromForm (struct ParamUploadMedia *ParamUploadMedia);
|
||||||
|
@ -348,25 +349,31 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
||||||
extern const char *Txt_Link;
|
extern const char *Txt_Link;
|
||||||
struct ParamUploadMedia ParamUploadMedia;
|
struct ParamUploadMedia ParamUploadMedia;
|
||||||
char Id[Frm_MAX_BYTES_ID + 1];
|
char Id[Frm_MAX_BYTES_ID + 1];
|
||||||
size_t i;
|
size_t NumUploader;
|
||||||
|
|
||||||
#define Med_NUM_MEDIA_UPLOADERS 3
|
#define Med_NUM_MEDIA_UPLOADERS 3
|
||||||
struct MediaUploader MediaUploader[Med_NUM_MEDIA_UPLOADERS] =
|
struct MediaUploader MediaUploader[Med_NUM_MEDIA_UPLOADERS] =
|
||||||
{
|
{
|
||||||
{/* Upload icon */
|
{/* Upload */
|
||||||
|
Med_FORM_FILE,
|
||||||
"ico_upl", // <id>_ico_upl
|
"ico_upl", // <id>_ico_upl
|
||||||
|
"par_upl", // <id>_par_upl
|
||||||
"mediaClickOnActivateUpload",
|
"mediaClickOnActivateUpload",
|
||||||
"photo-video.svg",
|
"photo-video.svg",
|
||||||
Txt_Image_video
|
Txt_Image_video
|
||||||
},
|
},
|
||||||
{/* YouTube icon */
|
{/* YouTube */
|
||||||
|
Med_FORM_YOUTUBE,
|
||||||
"ico_you", // <id>_ico_you
|
"ico_you", // <id>_ico_you
|
||||||
|
"par_you", // <id>_par_you
|
||||||
"mediaClickOnActivateYoutube",
|
"mediaClickOnActivateYoutube",
|
||||||
"youtube-brands.svg",
|
"youtube-brands.svg",
|
||||||
"YouTube"
|
"YouTube"
|
||||||
},
|
},
|
||||||
{/* Embed icon */
|
{/* Embed */
|
||||||
|
Med_FORM_EMBED,
|
||||||
"ico_emb", // <id>_ico_emb
|
"ico_emb", // <id>_ico_emb
|
||||||
|
"par_emb", // <id>_par_emb
|
||||||
"mediaClickOnActivateEmbed",
|
"mediaClickOnActivateEmbed",
|
||||||
"code.svg",
|
"code.svg",
|
||||||
"Embed"
|
"Embed"
|
||||||
|
@ -412,31 +419,24 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
||||||
HTM_DIV_Begin ("class=\"PREF_CONTAINER\""); // icons container
|
HTM_DIV_Begin ("class=\"PREF_CONTAINER\""); // icons container
|
||||||
|
|
||||||
/* Draw icons */
|
/* Draw icons */
|
||||||
for (i = 0;
|
for (NumUploader = 0;
|
||||||
i < Med_NUM_MEDIA_UPLOADERS;
|
NumUploader < Med_NUM_MEDIA_UPLOADERS;
|
||||||
i++)
|
NumUploader++)
|
||||||
Med_PutIconMediaUploader (Id,&MediaUploader[i]);
|
Med_PutIconMediaUploader (Id,&MediaUploader[NumUploader]);
|
||||||
|
|
||||||
/* End icons */
|
/* End icons */
|
||||||
HTM_DIV_End (); // icons container
|
HTM_DIV_End (); // icons container
|
||||||
HTM_DIV_End (); // icons containers
|
HTM_DIV_End (); // icons containers
|
||||||
|
|
||||||
/***** Hidden field with form type *****/
|
/***** Form types *****/
|
||||||
/* Upload file */
|
for (NumUploader = 0;
|
||||||
Med_PutHiddenFormTypeMediaUploader (Id,"par_upl", // <id>_par_upl
|
NumUploader < Med_NUM_MEDIA_UPLOADERS;
|
||||||
&ParamUploadMedia,Med_FORM_FILE);
|
NumUploader++)
|
||||||
|
Med_PutHiddenFormTypeMediaUploader (Id,&MediaUploader[NumUploader],
|
||||||
/* YouTube embedded video */
|
&ParamUploadMedia);
|
||||||
Med_PutHiddenFormTypeMediaUploader (Id,"par_you", // <id>_par_you
|
|
||||||
&ParamUploadMedia,Med_FORM_YOUTUBE);
|
|
||||||
|
|
||||||
/* Other embedded media */
|
|
||||||
Med_PutHiddenFormTypeMediaUploader (Id,"par_emb", // <id>_par_emb
|
|
||||||
&ParamUploadMedia,Med_FORM_EMBED);
|
|
||||||
|
|
||||||
|
|
||||||
/***** Media file *****/
|
/***** Media file *****/
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
HTM_DIV_Begin (NULL);
|
||||||
fprintf (Gbl.F.Out,"<input id=\"%s_fil\" type=\"file\"" // <id>_fil
|
fprintf (Gbl.F.Out,"<input id=\"%s_fil\" type=\"file\"" // <id>_fil
|
||||||
" name=\"%s\" accept=\"image/,video/\""
|
" name=\"%s\" accept=\"image/,video/\""
|
||||||
" class=\"%s\" disabled=\"disabled\""
|
" class=\"%s\" disabled=\"disabled\""
|
||||||
|
@ -447,7 +447,7 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
||||||
HTM_DIV_End (); // <id>_fil
|
HTM_DIV_End (); // <id>_fil
|
||||||
|
|
||||||
/***** Media URL *****/
|
/***** Media URL *****/
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
HTM_DIV_Begin (NULL);
|
||||||
fprintf (Gbl.F.Out,"<input id=\"%s_url\" type=\"url\"" // <id>_url
|
fprintf (Gbl.F.Out,"<input id=\"%s_url\" type=\"url\"" // <id>_url
|
||||||
" name=\"%s\" placeholder=\"%s\""
|
" name=\"%s\" placeholder=\"%s\""
|
||||||
" class=\"%s\" maxlength=\"%u\" value=\"\""
|
" class=\"%s\" maxlength=\"%u\" value=\"\""
|
||||||
|
@ -459,7 +459,7 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
||||||
HTM_DIV_End (); // <id>_url
|
HTM_DIV_End (); // <id>_url
|
||||||
|
|
||||||
/***** Media title *****/
|
/***** Media title *****/
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
HTM_DIV_Begin (NULL);
|
||||||
fprintf (Gbl.F.Out,"<input id=\"%s_tit\" type=\"text\"" // <id>_tit
|
fprintf (Gbl.F.Out,"<input id=\"%s_tit\" type=\"text\"" // <id>_tit
|
||||||
" name=\"%s\" placeholder=\"%s\""
|
" name=\"%s\" placeholder=\"%s\""
|
||||||
" class=\"%s\" maxlength=\"%u\" value=\"\""
|
" class=\"%s\" maxlength=\"%u\" value=\"\""
|
||||||
|
@ -488,8 +488,8 @@ static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
||||||
struct MediaUploader *MediaUploader)
|
struct MediaUploader *MediaUploader)
|
||||||
{
|
{
|
||||||
/***** Icon to activate form in media uploader *****/
|
/***** Icon to activate form in media uploader *****/
|
||||||
HTM_DIV_Begin ("id=\"%s_%s\" class=\"PREF_OFF\"", // <id>_IdSuffix
|
HTM_DIV_Begin ("id=\"%s_%s\" class=\"PREF_OFF\"", // <id>_IconSuffix
|
||||||
UniqueId,MediaUploader->IdSuffix);
|
UniqueId,MediaUploader->IconSuffix);
|
||||||
fprintf (Gbl.F.Out,"<a href=\"\" onclick=\"%s('%s');return false;\">"
|
fprintf (Gbl.F.Out,"<a href=\"\" onclick=\"%s('%s');return false;\">"
|
||||||
"<img src=\"%s/%s\" alt=\"%s\" title=\"%s\""
|
"<img src=\"%s/%s\" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICO_HIGHLIGHT ICOx16\" />"
|
" class=\"ICO_HIGHLIGHT ICOx16\" />"
|
||||||
|
@ -497,7 +497,7 @@ static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
||||||
MediaUploader->FunctionName,UniqueId,
|
MediaUploader->FunctionName,UniqueId,
|
||||||
Cfg_URL_ICON_PUBLIC,MediaUploader->Icon,
|
Cfg_URL_ICON_PUBLIC,MediaUploader->Icon,
|
||||||
MediaUploader->Title,MediaUploader->Title);
|
MediaUploader->Title,MediaUploader->Title);
|
||||||
HTM_DIV_End (); // <id>_IdSuffix
|
HTM_DIV_End (); // <id>_IconSuffix
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -505,16 +505,15 @@ static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Med_PutHiddenFormTypeMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
static void Med_PutHiddenFormTypeMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
||||||
const char *IdSuffix,
|
struct MediaUploader *MediaUploader,
|
||||||
struct ParamUploadMedia *ParamUploadMedia,
|
struct ParamUploadMedia *ParamUploadMedia)
|
||||||
Med_FormType_t FormType)
|
|
||||||
{
|
{
|
||||||
/***** Hidden field with form type *****/
|
/***** Hidden field with form type *****/
|
||||||
/* Upload file */
|
/* Upload file */
|
||||||
fprintf (Gbl.F.Out,"<input type=\"hidden\" id=\"%s_%s\"" // <id>_IdSuffix
|
fprintf (Gbl.F.Out,"<input type=\"hidden\" id=\"%s_%s\"" // <id>_ParamSuffix
|
||||||
" name=\"%s\" value=\"%u\" disabled=\"disabled\" />",
|
" name=\"%s\" value=\"%u\" disabled=\"disabled\" />",
|
||||||
UniqueId,IdSuffix,
|
UniqueId,MediaUploader->ParamSuffix,
|
||||||
ParamUploadMedia->FormType,(unsigned) FormType);
|
ParamUploadMedia->FormType,(unsigned) MediaUploader->FormType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -153,7 +153,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
||||||
/***** Link to page 1, including a text *****/
|
/***** Link to page 1, including a text *****/
|
||||||
if (Subject)
|
if (Subject)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
HTM_DIV_Begin (NULL);
|
||||||
if (LinkToPagCurrent)
|
if (LinkToPagCurrent)
|
||||||
{
|
{
|
||||||
switch (WhatPaginate)
|
switch (WhatPaginate)
|
||||||
|
|
|
@ -567,7 +567,7 @@ static void Prj_ShowFormToFilterByDpt (void)
|
||||||
struct Prj_Filter Filter;
|
struct Prj_Filter Filter;
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form *****/
|
||||||
fprintf (Gbl.F.Out,"<div>");
|
HTM_DIV_Begin (NULL);
|
||||||
Frm_StartForm (ActSeePrj);
|
Frm_StartForm (ActSeePrj);
|
||||||
Filter.My_All = Gbl.Prjs.Filter.My_All;
|
Filter.My_All = Gbl.Prjs.Filter.My_All;
|
||||||
Filter.PreNon = Gbl.Prjs.Filter.PreNon;
|
Filter.PreNon = Gbl.Prjs.Filter.PreNon;
|
||||||
|
|
Loading…
Reference in New Issue