From 5c4b28b083f54904abc6d08697a044dcb90bd4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 23 Apr 2019 15:07:32 +0200 Subject: [PATCH] Version18.118.5 --- swad_changelog.h | 3 +- swad_file_browser.c | 85 ++++++++++++++++----------------------------- swad_text.c | 20 +++++------ 3 files changed, 42 insertions(+), 66 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index af1e271cf..a7775bfbd 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -448,10 +448,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.118.4 (2019-04-23)" +#define Log_PLATFORM_VERSION "SWAD 18.118.5 (2019-04-23)" #define CSS_FILE "swad18.112.1.css" #define JS_FILE "swad18.116.5.js" /* + Version 18.118.5: Apr 23, 2019 Code refactoring in file browser. (242497 lines) Version 18.118.4: Apr 23, 2019 Changes in file browser. (242518 lines) Version 18.118.3: Apr 22, 2019 Changed the behaviour of creating zip in file browser. (242545 lines) Version 18.118.2: Apr 22, 2019 Removed unused code related to hidden_params table. (242545 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index 73791fb68..902e1a80e 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -1332,14 +1332,13 @@ static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *Row static void Brw_PutIconNewFileOrFolder (void); static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size, - struct FileMetadata *FileMetadata, - const char *FileNameToShow); + struct FileMetadata *FileMetadata); static void Brw_PutIconFile (unsigned Size,Brw_FileType_t FileType,const char *FileName); static void Brw_PutButtonToDownloadZIPOfAFolder (const char *PathInTree,const char *FileName); static void Brw_WriteFileName (unsigned Level,bool IsPublic, - const char *PathInTree,const char *FileName,const char *FileNameToShow); + const char *PathInTree,const char *FileName); static void Brw_GetFileNameToShowDependingOnLevel (Brw_FileBrowser_t FileBrowser, unsigned Level, Brw_FileType_t FileType, @@ -1351,9 +1350,7 @@ static void Brw_GetFileNameToShow (Brw_FileType_t FileType, static void Brw_WriteDatesAssignment (void); static void Brw_WriteFileSizeAndDate (struct FileMetadata *FileMetadata); static void Brw_WriteFileOrFolderPublisher (unsigned Level,unsigned long UsrCod); -static void Brw_PutParamsRemFile (void); static void Brw_AskConfirmRemoveFolderNotEmpty (void); -static void Brw_PutParamsRemFolder (void); static void Brw_WriteCurrentClipboard (void); @@ -5462,7 +5459,6 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, bool LightStyle = false; bool IsRecent = false; struct FileMetadata FileMetadata; - char FileNameToShow[NAME_MAX + 1]; char FileBrowserId[32]; bool SeeDocsZone = Gbl.FileBrowser.Type == Brw_SHOW_DOC_INS || Gbl.FileBrowser.Type == Brw_SHOW_DOC_CTR || @@ -5565,13 +5561,6 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, else // Not an assignment zone Gbl.FileBrowser.Asg.AsgCod = -1L; - /***** Get the name of the file to show *****/ - Brw_GetFileNameToShowDependingOnLevel (Gbl.FileBrowser.Type, - Level, - Gbl.FileBrowser.FileType, - FileName, - FileNameToShow); - /***** Start this row *****/ if (asprintf (&Anchor,"fil_brw_%u_%s", Gbl.FileBrowser.Id,RowId) < 0) @@ -5648,7 +5637,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, { /* Icon with file type or link */ fprintf (Gbl.F.Out,"",Gbl.RowEvenOdd); - Brw_PutIconFileWithLinkToViewMetadata (16,&FileMetadata,FileNameToShow); + Brw_PutIconFileWithLinkToViewMetadata (16,&FileMetadata); fprintf (Gbl.F.Out,""); } @@ -5659,7 +5648,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, /* File or folder name */ Brw_WriteFileName (Level,FileMetadata.IsPublic, - PathInTree,FileName,FileNameToShow); + PathInTree,FileName); /* End column */ fprintf (Gbl.F.Out,"" @@ -6214,10 +6203,9 @@ static void Brw_PutIconNewFileOrFolder (void) // FileType can be Brw_IS_FILE or Brw_IS_LINK static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size, - struct FileMetadata *FileMetadata, - const char *FileNameToShow) + struct FileMetadata *FileMetadata) { - extern const char *Txt_View_data_of_FILE_OR_LINK_X; + extern const char *Txt_View_data; /***** Start form *****/ Frm_StartForm (Brw_ActReqDatFile[Gbl.FileBrowser.Type]); @@ -6226,10 +6214,7 @@ static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size, FileMetadata->FilCod); /***** Name and link of the file or folder *****/ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_View_data_of_FILE_OR_LINK_X, - FileNameToShow); - Frm_LinkFormSubmit (Gbl.Title,Gbl.FileBrowser.TxtStyle,NULL); + Frm_LinkFormSubmit (Txt_View_data,Gbl.FileBrowser.TxtStyle,NULL); /***** Icon depending on the file extension *****/ Brw_PutIconFile (Size,FileMetadata->FileType,FileMetadata->FilFolLnkName); @@ -6254,10 +6239,8 @@ static void Brw_PutIconFile (unsigned Size,Brw_FileType_t FileType,const char *F /***** Icon depending on the file extension *****/ if (FileType == Brw_IS_LINK) - fprintf (Gbl.F.Out,"\"%s\"FileType == Brw_IS_LINK) ? URL : // If it's a link, show full URL in title + Txt_Download; + /* Put anchor and filename */ fprintf (Gbl.F.Out,"", - URL, - (FileMetadata->FileType == Brw_IS_LINK) ? URL : // If it's a link, show full URL in title - FileNameToShow); + URL,Title); Brw_PutIconFile (32,FileMetadata->FileType,FileMetadata->FilFolLnkName); fprintf (Gbl.F.Out," %s " "", FileNameToShow, Cfg_URL_ICON_PUBLIC, - Txt_Download,Txt_Download); + Title,Title); } } diff --git a/swad_text.c b/swad_text.c index 81a831ebb..7de1fb685 100644 --- a/swad_text.c +++ b/swad_text.c @@ -52143,25 +52143,25 @@ const char *Txt_View_attendance = "Ver presença"; #endif -const char *Txt_View_data_of_FILE_OR_LINK_X = // Warning: it is very important to include %s in the following sentences +const char *Txt_View_data = #if L==1 // ca - "Veure dades de %s"; + "Veure dades"; #elif L==2 // de - "Siehe Daten von %s"; + "Siehe Daten"; #elif L==3 // en - "View data of %s"; + "View data"; #elif L==4 // es - "Ver datos de %s"; + "Ver datos"; #elif L==5 // fr - "Voir les données de %s"; + "Voir les données"; #elif L==6 // gn - "Ver datos de %s"; // Okoteve traducción + "Ver datos"; // Okoteve traducción #elif L==7 // it - "Visualizza i dati de %s"; + "Visualizza i dati"; #elif L==8 // pl - "Zobacz dane z %s"; + "Zobacz dane"; #elif L==9 // pt - "Ver os dados de %s"; + "Ver os dados"; #endif const char *Txt_View_email_addresses =