mirror of https://github.com/acanas/swad-core.git
Version 15.192.6
This commit is contained in:
parent
733875e061
commit
7206f79112
|
@ -1743,12 +1743,13 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
.TEST_EXA_LIGHT {color:#A0A0A0; font-size:12pt;}
|
||||
.TEST_EDI {color:#404040; font-size:12pt;}
|
||||
.TEST_EDI_LIGHT {color:#A0A0A0; font-size:12pt;}
|
||||
.TEST_IMG_SHOW_STEM {width:600px; border-radius:4px; margin:10px 0;}
|
||||
.TEST_IMG_SHOW_ANS {width:450px; border-radius:4px; margin:10px 0;}
|
||||
.TEST_IMG_EDIT_LIST_STEM {width:300px; border-radius:2px; margin:5px 0;}
|
||||
.TEST_IMG_EDIT_LIST_ANS {width:225px; border-radius:2px; margin:5px 0;}
|
||||
.TEST_IMG_EDIT_ONE_STEM {width:600px; border-radius:4px;}
|
||||
.TEST_IMG_EDIT_ONE_ANS {width:450px; border-radius:4px;}
|
||||
.TEST_IMG_SHOW_STEM {width:100%; border-radius:4px; margin:10px 0;}
|
||||
.TEST_IMG_SHOW_ANS {width:100%; border-radius:4px; margin:10px 0;}
|
||||
.TEST_IMG_EDIT_LIST_STEM {width:100%; border-radius:2px; margin:5px 0;}
|
||||
.TEST_IMG_EDIT_LIST_ANS {width:100%; border-radius:2px; margin:5px 0;}
|
||||
.TEST_IMG_EDIT_ONE_CONTAINER {margin:15px 0; text-align:left; vertical-align:top;}
|
||||
.TEST_IMG_EDIT_ONE_STEM {width:100%; border-radius:4px;}
|
||||
.TEST_IMG_EDIT_ONE_ANS {width:100%; border-radius:4px;}
|
||||
.TEST_EDI_ANS_LEFT_COL
|
||||
{
|
||||
box-sizing:border-box;
|
|
@ -2031,8 +2031,7 @@ void Ctr_RequestPhoto (void)
|
|||
fprintf (Gbl.F.Out,"<label class=\"%s\">"
|
||||
"%s: "
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"%s\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"\""
|
||||
"<input type=\"file\" name=\"%s\" accept=\"image/*\""
|
||||
" onchange=\"document.getElementById('%s').submit();\" />",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_File_with_the_photo,
|
||||
|
|
|
@ -134,13 +134,15 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.192.5 (2016-04-11)"
|
||||
#define CSS_FILE "swad15.192.css"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.192.6 (2016-04-11)"
|
||||
#define CSS_FILE "swad15.192.6.css"
|
||||
#define JS_FILE "swad15.190.1.js"
|
||||
|
||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||
/*
|
||||
Version 15.192.6: Apr 11, 2016 Changes in layout of test edition.
|
||||
Changes in forms to upload files. (199359 lines)
|
||||
Version 15.192.5: Apr 11, 2016 Fixed bug in edition of tests. (199369 lines)
|
||||
Version 15.192.4: Apr 11, 2016 Fixed bug when removing messages. (199370 lines)
|
||||
Version 15.192.3: Apr 11, 2016 Fixed bugs when receiving forum image. (199355 lines)
|
||||
|
|
|
@ -7994,8 +7994,7 @@ static void Brw_PutFormToUploadOneFileClassic (const char *FileNameToShow)
|
|||
break;
|
||||
}
|
||||
Brw_ParamListFiles (Brw_IS_FOLDER,Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk,Gbl.FileBrowser.FilFolLnkName);
|
||||
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\""
|
||||
" size=\"50\" maxlength=\"100\" value=\"\" />",
|
||||
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\" />",
|
||||
Fil_NAME_OF_PARAM_FILENAME_ORG);
|
||||
|
||||
/* Button to send */
|
||||
|
|
|
@ -3848,8 +3848,7 @@ static void For_WriteFormForumPst (bool IsReply,long ThrCod,const char *Subject)
|
|||
" alt=\"%s\" title=\"%s (%s)\""
|
||||
" class=\"ICON20x20\" />"
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"ImgFil\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"\" />"
|
||||
"<input type=\"file\" name=\"ImgFil\" accept=\"image/*\" />"
|
||||
"<br />",
|
||||
Gbl.Prefs.IconsURL,
|
||||
Txt_Image,Txt_Image,Txt_optional);
|
||||
|
|
16
swad_image.c
16
swad_image.c
|
@ -171,13 +171,6 @@ void Img_GetImageFromForm (unsigned NumOpt,struct Image *Image,
|
|||
/***** Secondly, get the image name and the file *****/
|
||||
switch (Image->Action)
|
||||
{
|
||||
case Img_ACTION_NO_IMAGE: // Do not use image (remove current image if exists)
|
||||
break;
|
||||
case Img_ACTION_KEEP_IMAGE: // Keep current image unchanged
|
||||
/***** Get image name *****/
|
||||
if (GetImageFromDB)
|
||||
GetImageFromDB (NumOpt,Image);
|
||||
break;
|
||||
case Img_ACTION_NEW_IMAGE: // Upload new image
|
||||
/***** Get new image (if present ==> process and create temporary file) *****/
|
||||
Img_GetAndProcessImageFileFromForm (Image,ParamFile,
|
||||
|
@ -189,15 +182,22 @@ void Img_GetImageFromForm (unsigned NumOpt,struct Image *Image,
|
|||
Image->Name[0] = '\0';
|
||||
}
|
||||
break;
|
||||
case Img_ACTION_KEEP_IMAGE: // Keep current image unchanged
|
||||
/***** Get image name *****/
|
||||
if (GetImageFromDB != NULL)
|
||||
GetImageFromDB (NumOpt,Image);
|
||||
break;
|
||||
case Img_ACTION_CHANGE_IMAGE: // Replace old image by new image
|
||||
/***** Get new image (if present ==> process and create temporary file) *****/
|
||||
Img_GetAndProcessImageFileFromForm (Image,ParamFile,
|
||||
Width,Height,Quality);
|
||||
if (Image->Status != Img_FILE_PROCESSED && // No new image received-processed successfully
|
||||
GetImageFromDB)
|
||||
GetImageFromDB != NULL)
|
||||
/* Get image name */
|
||||
GetImageFromDB (NumOpt,Image);
|
||||
break;
|
||||
case Img_ACTION_NO_IMAGE: // Do not use image (remove current image if exists)
|
||||
break;
|
||||
}
|
||||
|
||||
/***** By last, get image title from form *****/
|
||||
|
|
|
@ -41,10 +41,10 @@
|
|||
#define Img_NUM_ACTIONS 4
|
||||
typedef enum
|
||||
{
|
||||
Img_ACTION_NO_IMAGE, // Do not use image (remove current image if exists)
|
||||
Img_ACTION_KEEP_IMAGE, // Keep current image unchanged
|
||||
Img_ACTION_NEW_IMAGE, // Upload new image
|
||||
Img_ACTION_KEEP_IMAGE, // Keep current image unchanged
|
||||
Img_ACTION_CHANGE_IMAGE, // Change existing image by a new image
|
||||
Img_ACTION_NO_IMAGE, // Do not use image (remove current image if exists)
|
||||
} Img_Action_t;
|
||||
|
||||
/***** Status of an image file *****/
|
||||
|
|
|
@ -1041,8 +1041,7 @@ void Inf_FormToSendPage (Inf_InfoSrc_t InfoSrc)
|
|||
"%s:"
|
||||
"</td>"
|
||||
"<td class=\"LEFT_MIDDLE\">"
|
||||
"<input type=\"file\" name=\"%s\""
|
||||
" size=\"50\" maxlength=\"100\" value=\"\" />"
|
||||
"<input type=\"file\" name=\"%s\" />"
|
||||
"</td>"
|
||||
"</tr>"
|
||||
"</table>",
|
||||
|
|
|
@ -297,7 +297,6 @@ void Log_RequestLogo (Sco_Scope_t Scope)
|
|||
"%s: "
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"%s\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"\""
|
||||
" onchange=\"document.getElementById('%s').submit();\" />",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_File_with_the_logo,
|
||||
|
|
|
@ -430,8 +430,7 @@ static void Msg_PutFormMsgUsrs (const char *Content)
|
|||
" alt=\"%s\" title=\"%s (%s)\""
|
||||
" class=\"ICON20x20\" />"
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"ImgFil\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"\" />"
|
||||
"<input type=\"file\" name=\"ImgFil\" accept=\"image/*\" />"
|
||||
"<br />",
|
||||
Gbl.Prefs.IconsURL,
|
||||
Txt_Image,Txt_Image,Txt_optional);
|
||||
|
|
|
@ -318,13 +318,11 @@ void Pho_ReqPhoto (const struct UsrData *UsrDat,bool PhotoExists,const char *Pho
|
|||
fprintf (Gbl.F.Out,"<label class=\"%s\">"
|
||||
"%s: "
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"%s\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"%ld.jpg\""
|
||||
"<input type=\"file\" name=\"%s\" accept=\"image/*\""
|
||||
" onchange=\"document.getElementById('%s').submit();\" />",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_File_with_the_photo,
|
||||
Fil_NAME_OF_PARAM_FILENAME_ORG,
|
||||
UsrDat->UsrCod,
|
||||
Gbl.Form.Id);
|
||||
|
||||
/***** End frame *****/
|
||||
|
|
|
@ -2035,8 +2035,7 @@ static void Soc_PutTextarea (const char *Placeholder,
|
|||
" alt=\"%s\" title=\"%s (%s)\""
|
||||
" class=\"ICON20x20\" />"
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"ImgFil\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"\" />"
|
||||
"<input type=\"file\" name=\"ImgFil\" accept=\"image/*\" />"
|
||||
"<br />",
|
||||
Gbl.Prefs.IconsURL,
|
||||
Txt_Image,Txt_Image,Txt_optional);
|
||||
|
|
107
swad_test.c
107
swad_test.c
|
@ -1062,90 +1062,87 @@ static void Tst_PutFormToEditQstImage (struct Image *Image,
|
|||
bool OptionsDisabled)
|
||||
{
|
||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||
extern const char *Txt_Image;
|
||||
extern const char *Txt_optional;
|
||||
extern const char *Txt_No_image;
|
||||
extern const char *Txt_Current_image;
|
||||
extern const char *Txt_Change_image;
|
||||
extern const char *Txt_Image;
|
||||
extern const char *Txt_optional;
|
||||
extern const char *Txt_Image_title_attribution;
|
||||
static unsigned UniqueId = 0;
|
||||
|
||||
/***** Start container *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"LEFT_TOP\">");
|
||||
fprintf (Gbl.F.Out,"<div class=\"TEST_IMG_EDIT_ONE_CONTAINER\">");
|
||||
|
||||
/***** Choice 1: No image *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"%s\" value=\"%u\"",
|
||||
ParamAction,Img_ACTION_NO_IMAGE);
|
||||
if (!Image->Name[0])
|
||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"%s"
|
||||
"</label><br />",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_No_image);
|
||||
|
||||
/***** Choice 2: Current image *****/
|
||||
if (Image->Name[0])
|
||||
{
|
||||
/* Action to perform on image */
|
||||
Par_PutHiddenParamUnsigned ("ImgAct",(unsigned) Img_ACTION_NEW_IMAGE);
|
||||
|
||||
/* File */
|
||||
fprintf (Gbl.F.Out,"<label>"
|
||||
"<img src=\"%s/photo64x64.gif\""
|
||||
" alt=\"%s\" title=\"%s (%s)\""
|
||||
" class=\"ICON20x20\" />"
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"%s\" accept=\"image/*\"",
|
||||
Gbl.Prefs.IconsURL,
|
||||
Txt_Image,Txt_Image,Txt_optional,
|
||||
ParamFile);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />");
|
||||
}
|
||||
else
|
||||
{
|
||||
/***** Choice 1: No image *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"%s\" value=\"%u\"",
|
||||
ParamAction,Img_ACTION_NO_IMAGE);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"%s"
|
||||
"</label>"
|
||||
"<br />",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_No_image);
|
||||
|
||||
/***** Choice 2: Current image *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" name=\"%s\" value=\"%u\" checked=\"checked\"",
|
||||
ParamAction,Img_ACTION_KEEP_IMAGE);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"<label class=\"%s\">"
|
||||
"%s"
|
||||
"</label><br />",
|
||||
"</label>",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_Current_image);
|
||||
Img_ShowImage (Image,ClassImg);
|
||||
}
|
||||
|
||||
/***** Choice 3: Change/new image *****/
|
||||
UniqueId++;
|
||||
if (Image->Name[0]) // Image exists
|
||||
{
|
||||
/***** Change image *****/
|
||||
/***** Choice 3: Change/new image *****/
|
||||
UniqueId++;
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"chg_img_%u\" name=\"%s\""
|
||||
" value=\"%u\"",
|
||||
UniqueId,ParamAction,Img_ACTION_CHANGE_IMAGE); // Replace existing image by new image
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"<label class=\"%s\">"
|
||||
"%s: "
|
||||
"</label>",
|
||||
The_ClassForm[Gbl.Prefs.Theme],Txt_Change_image);
|
||||
}
|
||||
else // Image does not exist
|
||||
{
|
||||
/***** New image *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"radio\" id=\"chg_img_%u\" name=\"%s\""
|
||||
" value=\"%u\"",
|
||||
UniqueId,ParamAction,Img_ACTION_NEW_IMAGE); // Upload new image
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"%s\" accept=\"image/*\"",
|
||||
The_ClassForm[Gbl.Prefs.Theme],Txt_Change_image,
|
||||
ParamFile);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," />"
|
||||
"<label class=\"%s\">"
|
||||
"%s (%s): "
|
||||
"</label>",
|
||||
The_ClassForm[Gbl.Prefs.Theme],Txt_Image,Txt_optional);
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," onchange=\"document.getElementById('chg_img_%u').checked = true;\" />",
|
||||
UniqueId);
|
||||
}
|
||||
|
||||
/***** Image file *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"\"",
|
||||
ParamFile);
|
||||
if (OptionsDisabled)
|
||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||
fprintf (Gbl.F.Out," onchange=\"document.getElementById('chg_img_%u').checked = true;\" />"
|
||||
"<br />",
|
||||
UniqueId);
|
||||
|
||||
/***** Image title/attribution *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"%s\""
|
||||
fprintf (Gbl.F.Out,"<br />"
|
||||
"<input type=\"text\" name=\"%s\""
|
||||
" placeholder=\"%s (%s)…\""
|
||||
" class=\"%s\" maxlength=\"%u\" value=\"%s\">",
|
||||
ParamTitle,Txt_Image_title_attribution,Txt_optional,
|
||||
|
|
|
@ -143,8 +143,7 @@ void TsI_ShowFormImportQstsFromXML (void)
|
|||
fprintf (Gbl.F.Out,"<label class=\"%s\">"
|
||||
"%s: "
|
||||
"</label>"
|
||||
"<input type=\"file\" name=\"%s\""
|
||||
" size=\"40\" maxlength=\"100\" value=\"\""
|
||||
"<input type=\"file\" name=\"%s\" accept=\".xml\""
|
||||
" onchange=\"document.getElementById('%s').submit();\" />",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_XML_file,
|
||||
|
|
Loading…
Reference in New Issue