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:
|
||||
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 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: 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.
|
||||
Changes icon to upload file in timeline.
|
||||
Code refactoring in media. (246034 lines)
|
||||
|
|
|
@ -1469,13 +1469,13 @@ static void Lay_WriteAboutZone (void)
|
|||
Cfg_URL_ICON_PUBLIC,Cfg_ABOUT_LOGO,
|
||||
Cfg_ABOUT_NAME,Cfg_ABOUT_NAME,
|
||||
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);
|
||||
HTM_DIV_End ();
|
||||
fprintf (Gbl.F.Out,"</a>");
|
||||
|
||||
/***** Questions and problems *****/
|
||||
fprintf (Gbl.F.Out,"<div>");
|
||||
HTM_DIV_Begin (NULL);
|
||||
fprintf (Gbl.F.Out,"%s: "
|
||||
"<a href=\"mailto:%s\" class=\"ABOUT\" target=\"_blank\">%s</a>",
|
||||
Txt_Questions_and_problems,
|
||||
|
@ -1483,7 +1483,7 @@ static void Lay_WriteAboutZone (void)
|
|||
HTM_DIV_End ();
|
||||
|
||||
/***** About and time to generate and send page *****/
|
||||
fprintf (Gbl.F.Out,"<div>");
|
||||
HTM_DIV_Begin (NULL);
|
||||
|
||||
/* About */
|
||||
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
|
||||
{
|
||||
const char *IdSuffix;
|
||||
Med_FormType_t FormType;
|
||||
const char *IconSuffix;
|
||||
const char *ParamSuffix;
|
||||
const char *FunctionName;
|
||||
const char *Icon;
|
||||
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],
|
||||
struct MediaUploader *MediaUploader);
|
||||
static void Med_PutHiddenFormTypeMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
||||
const char *IdSuffix,
|
||||
struct ParamUploadMedia *ParamUploadMedia,
|
||||
Med_FormType_t FormType);
|
||||
struct MediaUploader *MediaUploader,
|
||||
struct ParamUploadMedia *ParamUploadMedia);
|
||||
|
||||
static Med_Action_t Med_GetMediaActionFromForm (const char *ParamAction);
|
||||
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;
|
||||
struct ParamUploadMedia ParamUploadMedia;
|
||||
char Id[Frm_MAX_BYTES_ID + 1];
|
||||
size_t i;
|
||||
size_t NumUploader;
|
||||
|
||||
#define Med_NUM_MEDIA_UPLOADERS 3
|
||||
struct MediaUploader MediaUploader[Med_NUM_MEDIA_UPLOADERS] =
|
||||
{
|
||||
{/* Upload icon */
|
||||
{/* Upload */
|
||||
Med_FORM_FILE,
|
||||
"ico_upl", // <id>_ico_upl
|
||||
"par_upl", // <id>_par_upl
|
||||
"mediaClickOnActivateUpload",
|
||||
"photo-video.svg",
|
||||
Txt_Image_video
|
||||
},
|
||||
{/* YouTube icon */
|
||||
{/* YouTube */
|
||||
Med_FORM_YOUTUBE,
|
||||
"ico_you", // <id>_ico_you
|
||||
"par_you", // <id>_par_you
|
||||
"mediaClickOnActivateYoutube",
|
||||
"youtube-brands.svg",
|
||||
"YouTube"
|
||||
},
|
||||
{/* Embed icon */
|
||||
{/* Embed */
|
||||
Med_FORM_EMBED,
|
||||
"ico_emb", // <id>_ico_emb
|
||||
"par_emb", // <id>_par_emb
|
||||
"mediaClickOnActivateEmbed",
|
||||
"code.svg",
|
||||
"Embed"
|
||||
|
@ -412,31 +419,24 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
|||
HTM_DIV_Begin ("class=\"PREF_CONTAINER\""); // icons container
|
||||
|
||||
/* Draw icons */
|
||||
for (i = 0;
|
||||
i < Med_NUM_MEDIA_UPLOADERS;
|
||||
i++)
|
||||
Med_PutIconMediaUploader (Id,&MediaUploader[i]);
|
||||
for (NumUploader = 0;
|
||||
NumUploader < Med_NUM_MEDIA_UPLOADERS;
|
||||
NumUploader++)
|
||||
Med_PutIconMediaUploader (Id,&MediaUploader[NumUploader]);
|
||||
|
||||
/* End icons */
|
||||
HTM_DIV_End (); // icons container
|
||||
HTM_DIV_End (); // icons containers
|
||||
|
||||
/***** Hidden field with form type *****/
|
||||
/* Upload file */
|
||||
Med_PutHiddenFormTypeMediaUploader (Id,"par_upl", // <id>_par_upl
|
||||
&ParamUploadMedia,Med_FORM_FILE);
|
||||
|
||||
/* YouTube embedded video */
|
||||
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);
|
||||
|
||||
/***** Form types *****/
|
||||
for (NumUploader = 0;
|
||||
NumUploader < Med_NUM_MEDIA_UPLOADERS;
|
||||
NumUploader++)
|
||||
Med_PutHiddenFormTypeMediaUploader (Id,&MediaUploader[NumUploader],
|
||||
&ParamUploadMedia);
|
||||
|
||||
/***** Media file *****/
|
||||
fprintf (Gbl.F.Out,"<div>");
|
||||
HTM_DIV_Begin (NULL);
|
||||
fprintf (Gbl.F.Out,"<input id=\"%s_fil\" type=\"file\"" // <id>_fil
|
||||
" name=\"%s\" accept=\"image/,video/\""
|
||||
" class=\"%s\" disabled=\"disabled\""
|
||||
|
@ -447,7 +447,7 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
|||
HTM_DIV_End (); // <id>_fil
|
||||
|
||||
/***** Media URL *****/
|
||||
fprintf (Gbl.F.Out,"<div>");
|
||||
HTM_DIV_Begin (NULL);
|
||||
fprintf (Gbl.F.Out,"<input id=\"%s_url\" type=\"url\"" // <id>_url
|
||||
" name=\"%s\" placeholder=\"%s\""
|
||||
" class=\"%s\" maxlength=\"%u\" value=\"\""
|
||||
|
@ -459,7 +459,7 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
|
|||
HTM_DIV_End (); // <id>_url
|
||||
|
||||
/***** Media title *****/
|
||||
fprintf (Gbl.F.Out,"<div>");
|
||||
HTM_DIV_Begin (NULL);
|
||||
fprintf (Gbl.F.Out,"<input id=\"%s_tit\" type=\"text\"" // <id>_tit
|
||||
" name=\"%s\" placeholder=\"%s\""
|
||||
" class=\"%s\" maxlength=\"%u\" value=\"\""
|
||||
|
@ -488,8 +488,8 @@ static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
|||
struct MediaUploader *MediaUploader)
|
||||
{
|
||||
/***** Icon to activate form in media uploader *****/
|
||||
HTM_DIV_Begin ("id=\"%s_%s\" class=\"PREF_OFF\"", // <id>_IdSuffix
|
||||
UniqueId,MediaUploader->IdSuffix);
|
||||
HTM_DIV_Begin ("id=\"%s_%s\" class=\"PREF_OFF\"", // <id>_IconSuffix
|
||||
UniqueId,MediaUploader->IconSuffix);
|
||||
fprintf (Gbl.F.Out,"<a href=\"\" onclick=\"%s('%s');return false;\">"
|
||||
"<img src=\"%s/%s\" alt=\"%s\" title=\"%s\""
|
||||
" class=\"ICO_HIGHLIGHT ICOx16\" />"
|
||||
|
@ -497,7 +497,7 @@ static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
|
|||
MediaUploader->FunctionName,UniqueId,
|
||||
Cfg_URL_ICON_PUBLIC,MediaUploader->Icon,
|
||||
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],
|
||||
const char *IdSuffix,
|
||||
struct ParamUploadMedia *ParamUploadMedia,
|
||||
Med_FormType_t FormType)
|
||||
struct MediaUploader *MediaUploader,
|
||||
struct ParamUploadMedia *ParamUploadMedia)
|
||||
{
|
||||
/***** Hidden field with form type *****/
|
||||
/* 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\" />",
|
||||
UniqueId,IdSuffix,
|
||||
ParamUploadMedia->FormType,(unsigned) FormType);
|
||||
UniqueId,MediaUploader->ParamSuffix,
|
||||
ParamUploadMedia->FormType,(unsigned) MediaUploader->FormType);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -153,7 +153,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
/***** Link to page 1, including a text *****/
|
||||
if (Subject)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<div>");
|
||||
HTM_DIV_Begin (NULL);
|
||||
if (LinkToPagCurrent)
|
||||
{
|
||||
switch (WhatPaginate)
|
||||
|
|
|
@ -567,7 +567,7 @@ static void Prj_ShowFormToFilterByDpt (void)
|
|||
struct Prj_Filter Filter;
|
||||
|
||||
/***** Begin form *****/
|
||||
fprintf (Gbl.F.Out,"<div>");
|
||||
HTM_DIV_Begin (NULL);
|
||||
Frm_StartForm (ActSeePrj);
|
||||
Filter.My_All = Gbl.Prjs.Filter.My_All;
|
||||
Filter.PreNon = Gbl.Prjs.Filter.PreNon;
|
||||
|
|
Loading…
Reference in New Issue