Version 14.39.3

This commit is contained in:
Antonio Cañas Vargas 2014-12-21 14:47:04 +01:00
parent ad4ca51839
commit e465b8d7df
22 changed files with 132 additions and 209 deletions

View File

@ -26,7 +26,11 @@ A:link {text-decoration:none;}
A:visited {text-decoration:none;}
A:active {text-decoration:none;}
A:hover {text-decoration:underline;}
body {margin:0px;}
body
{
margin:0px;
background-color:white;
}
input {font-family:Arial, Nimbus Sans L, DejaVu LGC Sans, Bitstream Vera Sans, sans-serif; font-size:10pt;}
select {font-family:Arial, Nimbus Sans L, DejaVu LGC Sans, Bitstream Vera Sans, sans-serif; font-size:10pt;}
textarea {font-size:8pt;}

View File

@ -26,7 +26,11 @@ A:link {text-decoration:none;}
A:visited {text-decoration:none;}
A:active {text-decoration:none;}
A:hover {text-decoration:underline;}
body {margin:0px;}
body
{
margin:0px;
background-color:white;
}
input {font-Family:Arial, Nimbus Sans L, DejaVu LGC Sans, Bitstream Vera Sans, sans-serif; font-size:16pt;}
select {font-Family:Arial, Nimbus Sans L, DejaVu LGC Sans, Bitstream Vera Sans, sans-serif; font-size:16pt;}
textarea {font-size:12pt;}

View File

@ -74,7 +74,7 @@ void RSS_UpdateRSSFileForACrs (struct Course *Crs)
Lay_ShowErrorAndExit ("Can not create RSS file.");
/***** Write RSS header *****/
fprintf (FileRSS,"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
fprintf (FileRSS,"<?xml version=\"1.0\" encoding=\"windows-1252\"?>\n");
fprintf (FileRSS,"<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n");
/***** Write channel header *****/

View File

@ -35,11 +35,13 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.39.2 (2014/12/21)"
#define Log_PLATFORM_VERSION "SWAD 14.39.3 (2014/12/21)"
// 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 | tail -1
/*
Version 14.39.3 :Dic 21, 2014 Changes to validate HTML5 in W3C validator.
Charset is changed from ISO-8859-1 to windows-1252. (170664 lines)
Version 14.39.2 :Dic 21, 2014 Changes in layout and graphics. (170739 lines)
Version 14.39.1 :Dic 20, 2014 Change from XHTML 1.0 Transitional to HTML5. (170747 lines)
Version 14.39 :Dic 20, 2014 iframes removed from course info. (170746 lines)

View File

@ -484,7 +484,7 @@ void Cht_OpenChatWindow (void)
Lay_ShowErrorAndExit ("Can not open chat.");
/***** Start writing the index.html file to the output *****/
fprintf (Gbl.F.Out,"Content-type: text/html; charset=ISO-8859-1\n\n"); // Two carriage returns at the end of the line are mandatory!
fprintf (Gbl.F.Out,"Content-type: text/html; charset=windows-1252\n\n"); // Two carriage returns at the end of the line are mandatory!
Gbl.Layout.HTMLStartWritten = true;

View File

@ -346,7 +346,7 @@
/* Folder for users, inside private swad directory */
#define Cfg_FOLDER_USR "usr" // Created automatically the first time it is accessed
/* Folder for temporary XHTML 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
/* Folder for temporary public links to file zones, used when displaying file browsers, inside public swad directory */
@ -461,7 +461,7 @@
#define Cfg_TIME_TO_DELETE_Svc_KEY ((time_t)( 7UL*24UL*60UL*60UL)) // After these seconds, a web service key is removed
#define Cfg_TIME_TO_DELETE_XHTML_OUTPUT ((time_t)( 30UL*60UL)) // Remove the XHTML output files older than these seconds
#define Cfg_TIME_TO_DELETE_HTML_OUTPUT ((time_t)( 30UL*60UL)) // Remove the HTML output files older than these seconds
#define Cfg_TIME_TO_ABORT_FILE_UPLOAD ((time_t)( 55UL*60UL)) // After these seconds uploading data, abort upload.

View File

@ -67,26 +67,26 @@ extern struct Globals Gbl;
/*****************************************************************************/
/*****************************************************************************/
/******* Create XHTML output file for the web page sent by this CGI **********/
/******** Create HTML output file for the web page sent by this CGI **********/
/*****************************************************************************/
void Fil_CreateFileForXHTMLOutput (void)
void Fil_CreateFileForHTMLOutput (void)
{
char PathXHTMLOutputPriv[PATH_MAX+1];
char PathHTMLOutputPriv[PATH_MAX+1];
/***** Check if exists the directory for XHTML output. If not exists, create it *****/
sprintf (PathXHTMLOutputPriv,"%s/%s",Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT);
Fil_CreateDirIfNotExists (PathXHTMLOutputPriv);
/***** Check if exists the directory for HTML output. If not exists, create it *****/
sprintf (PathHTMLOutputPriv,"%s/%s",Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT);
Fil_CreateDirIfNotExists (PathHTMLOutputPriv);
/***** Remove old files *****/
Fil_RemoveOldTmpFiles (PathXHTMLOutputPriv,Cfg_TIME_TO_DELETE_XHTML_OUTPUT,false);
Fil_RemoveOldTmpFiles (PathHTMLOutputPriv,Cfg_TIME_TO_DELETE_HTML_OUTPUT,false);
/***** Create a unique name for the file *****/
sprintf (Gbl.XHTMLOutput.FileName,"%s/%s.html",
PathXHTMLOutputPriv,Gbl.UniqueNameEncrypted);
sprintf (Gbl.HTMLOutput.FileName,"%s/%s.html",
PathHTMLOutputPriv,Gbl.UniqueNameEncrypted);
/***** Open file for writing and reading *****/
if ((Gbl.F.Out = fopen (Gbl.XHTMLOutput.FileName,"w+t")) == NULL)
if ((Gbl.F.Out = fopen (Gbl.HTMLOutput.FileName,"w+t")) == NULL)
{
Gbl.F.Out = stdout;
Lay_ShowErrorAndExit ("Can not create output file.");
@ -94,15 +94,15 @@ void Fil_CreateFileForXHTMLOutput (void)
}
/*****************************************************************************/
/***************** Close and remove the XHTML output file ********************/
/****************** Close and remove the HTML output file ********************/
/*****************************************************************************/
void Fil_CloseAndRemoveFileForXHTMLOutput (void)
void Fil_CloseAndRemoveFileForHTMLOutput (void)
{
if (Gbl.F.Out)
{
fclose (Gbl.F.Out);
unlink (Gbl.XHTMLOutput.FileName);
unlink (Gbl.HTMLOutput.FileName);
}
Gbl.F.Out = stdout;
}
@ -153,7 +153,7 @@ bool Fil_ReadStdinIntoTmpFile (void)
Gbl.Layout.HTMLEndWritten = true;
/* Start HTTP response */
fprintf (stdout,"Content-type: text/plain; charset=ISO-8859-1\n");
fprintf (stdout,"Content-type: text/plain; charset=windows-1252\n");
/* Status code and message */
fprintf (stdout,"Status: 501 Not Implemented\r\n\r\n"

View File

@ -44,7 +44,7 @@
// Global files
struct Files
{
FILE *Out; // File with the XHTML output of this CGI
FILE *Out; // File with the HTML output of this CGI
FILE *Tmp; // Temporary file to save stdin
FILE *XML; // XML file for syllabus, for directory tree
};
@ -53,8 +53,8 @@ struct Files
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Fil_CreateFileForXHTMLOutput (void);
void Fil_CloseAndRemoveFileForXHTMLOutput (void);
void Fil_CreateFileForHTMLOutput (void);
void Fil_CloseAndRemoveFileForHTMLOutput (void);
bool Fil_ReadStdinIntoTmpFile (void);
void Fil_EndOfReadingStdin (void);
void Fil_StartReceptionOfFile (char *SrcFileName,char *MIMEType);

View File

@ -6803,8 +6803,7 @@ void Brw_RcvFileInFileBrwDropzone (void)
Gbl.Layout.HTMLEndWritten = true;
/* Start HTTP response */
// Use charset iso-8859-1
fprintf (stdout,"Content-type: text/plain; charset=ISO-8859-1\n");
fprintf (stdout,"Content-type: text/plain; charset=windows-1252\n");
/* Status code and message */
if (UploadSucessful)
@ -8063,7 +8062,7 @@ void Brw_GetLinkToDownloadFile (const char *PathInTree,const char *FileName,char
FileName);
}
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In XHTML, URL must have no spaces
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces
}
/*****************************************************************************/

View File

@ -162,7 +162,7 @@ struct Globals
struct
{
char FileName[PATH_MAX+1];
} XHTMLOutput;
} HTMLOutput;
struct
{
unsigned Num; // Number of institutions

View File

@ -344,11 +344,11 @@ void Inf_ShowInfo (void)
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
{
char QueryDebug[512*1024];
char *XHTMLBuffer;
Syl_WriteSyllabusIntoXHTMLBuffer (InfoType,&XHTMLBuffer);
sprintf (QueryDebug,"INSERT INTO debug (DebugTime,Txt) VALUES (NOW(),'%s')",XHTMLBuffer);
char *HTMLBuffer;
Syl_WriteSyllabusIntoHTMLBuffer (InfoType,&HTMLBuffer);
sprintf (QueryDebug,"INSERT INTO debug (DebugTime,Txt) VALUES (NOW(),'%s')",HTMLBuffer);
DB_QueryINSERT (QueryDebug,"Error inserting in debug table");
free ((void *) XHTMLBuffer);
free ((void *) HTMLBuffer);
}
*/
@ -738,7 +738,7 @@ static void Inf_CheckAndShowPage (Inf_InfoType_t InfoType)
}
/*****************************************************************************/
/************* Check if exists and write page into XHTML buffer **************/
/************* Check if exists and write page into HTML buffer ***************/
/*****************************************************************************/
// This function is called only from web service
@ -1566,21 +1566,21 @@ static void Inf_ShowTxtInfo (Inf_InfoType_t InfoType)
}
/*****************************************************************************/
/************* Check if exists and write page into XHTML buffer **************/
/************* Check if exists and write page into HTML buffer ***************/
/*****************************************************************************/
// This function is called only from web service
int Inf_WritePlainTextIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffer)
int Inf_WritePlainTextIntoHTMLBuffer (Inf_InfoType_t InfoType,char **HTMLBuffer)
{
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES];
char Txt[Cns_MAX_BYTES_LONG_TEXT+1];
char FileNameXHTMLTmp[PATH_MAX+1];
FILE *FileXHTMLTmp;
char FileNameHTMLTmp[PATH_MAX+1];
FILE *FileHTMLTmp;
size_t Length;
/***** Initialize buffer *****/
*XHTMLBuffer = NULL;
*HTMLBuffer = NULL;
/***** Get info text from database *****/
Inf_GetInfoTxtFromDB (InfoType,Txt,Cns_MAX_BYTES_LONG_TEXT);
@ -1588,22 +1588,20 @@ int Inf_WritePlainTextIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffe
if (Txt[0])
{
/***** Create a unique name for the file *****/
sprintf (FileNameXHTMLTmp,"%s/%s/%s_info.html",
sprintf (FileNameHTMLTmp,"%s/%s/%s_info.html",
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
/***** Create a new temporary file for writing and reading *****/
if ((FileXHTMLTmp = fopen (FileNameXHTMLTmp,"w+b")) == NULL)
if ((FileHTMLTmp = fopen (FileNameHTMLTmp,"w+b")) == NULL)
return soap_receiver_fault (Gbl.soap,
"Plain text can not be copied into buffer",
"Can not create temporary file");
/***** Write start of XHTML code *****/
fprintf (FileXHTMLTmp,"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\""
" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"%s\">\n"
/***** Write start of HTML code *****/
fprintf (FileHTMLTmp,"<!DOCTYPE html>\n"
"<html lang=\"%s\">\n"
"<head>\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=iso-8859-1\" />\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=windows-1252\" />\n"
"<title>%s</title>\n"
"</head>\n"
"<body>\n",
@ -1611,7 +1609,7 @@ int Inf_WritePlainTextIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffe
Txt_INFO_TITLE[InfoType]); // Page title
/***** Write plain text into text buffer *****/
fprintf (FileXHTMLTmp,"<tr>"
fprintf (FileHTMLTmp,"<tr>"
"<td align=\"left\">"
"<p align=\"justify\" class=\"DAT\">");
@ -1621,41 +1619,41 @@ int Inf_WritePlainTextIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffe
Str_InsertLinkInURLs (Txt,Cns_MAX_BYTES_LONG_TEXT,60); // Insert links
/* Write text */
fprintf (FileXHTMLTmp,"%s",Txt);
fprintf (FileHTMLTmp,"%s",Txt);
/***** Write end of page into file *****/
fprintf (FileXHTMLTmp,"</p>\n"
fprintf (FileHTMLTmp,"</p>\n"
"</html>\n"
"</body>\n");
/***** Compute length of file *****/
Length = (size_t) ftell (FileXHTMLTmp);
Length = (size_t) ftell (FileHTMLTmp);
/***** Allocate memory for buffer *****/
if ((*XHTMLBuffer = (char *) malloc (Length+1)) == NULL)
if ((*HTMLBuffer = (char *) malloc (Length+1)) == NULL)
{
fclose (FileXHTMLTmp);
unlink (FileNameXHTMLTmp);
fclose (FileHTMLTmp);
unlink (FileNameHTMLTmp);
return soap_receiver_fault (Gbl.soap,
"Plain text can not be copied into buffer",
"Not enough memory for buffer");
}
/***** Copy file content into buffer *****/
fseek (FileXHTMLTmp,0L,SEEK_SET);
if (fread ((void *) *XHTMLBuffer,sizeof (char),Length,FileXHTMLTmp) != Length)
fseek (FileHTMLTmp,0L,SEEK_SET);
if (fread ((void *) *HTMLBuffer,sizeof (char),Length,FileHTMLTmp) != Length)
{
fclose (FileXHTMLTmp);
unlink (FileNameXHTMLTmp);
fclose (FileHTMLTmp);
unlink (FileNameHTMLTmp);
return soap_receiver_fault (Gbl.soap,
"Plain text can not be copied into buffer",
"Error reading file into buffer");
}
(*XHTMLBuffer)[Length] = '\0';
(*HTMLBuffer)[Length] = '\0';
/***** Close and remove temporary file *****/
fclose (FileXHTMLTmp);
unlink (FileNameXHTMLTmp);
fclose (FileHTMLTmp);
unlink (FileNameHTMLTmp);
}
return SOAP_OK;

View File

@ -91,7 +91,7 @@ Inf_InfoSrc_t Inf_ConvertFromStrDBToInfoSrc (const char *StrInfoSrcDB);
void Inf_SetInfoTxtIntoDB (long CrsCod,Inf_InfoType_t InfoType,const char *InfoTxt);
void Inf_GetInfoTxtFromDB (Inf_InfoType_t InfoType,char *InfoTxt,size_t MaxLength);
bool Inf_CheckIfInfoTxtIsNotEmpty (long CrsCod,Inf_InfoType_t InfoType);
int Inf_WritePlainTextIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffer);
int Inf_WritePlainTextIntoHTMLBuffer (Inf_InfoType_t InfoType,char **HTMLBuffer);
void Inf_EditPlainTxtInfo (void);
void Inf_EditRichTxtInfo (void);
void Inf_RecAndChangePlainTxtInfo (void);

View File

@ -174,7 +174,7 @@ void Lay_WriteStartOfPage (void)
if (Gbl.CurrentAct == ActRefCon ||
Gbl.CurrentAct == ActRefLstClk) // Don't generate a full HTML page, only refresh connected users
{
fprintf (Gbl.F.Out,"Content-Type: text/html; charset=ISO-8859-1\r\n");
fprintf (Gbl.F.Out,"Content-Type: text/html; charset=windows-1252\r\n");
fprintf (Gbl.F.Out,"Cache-Control: max-age=0, no-cache, must-revalidate\r\n\r\n");
Gbl.Layout.WritingHTMLStart = false;
@ -194,14 +194,14 @@ void Lay_WriteStartOfPage (void)
/***** Write header to standard output to avoid timeout *****/
// Two \r\n are necessary
fprintf (stdout,"Content-type: text/html; charset=ISO-8859-1\r\n\r\n"
fprintf (stdout,"Content-type: text/html; charset=windows-1252\r\n\r\n"
"<!DOCTYPE html>\n");
/***** Write start of XHTML code *****/
/***** Write start of HTML code *****/
// WARNING: It is necessary to comment the line AddDefaultCharset UTF8 in httpd.conf to enable meta tag
fprintf (Gbl.F.Out,"<html lang=\"%s\">\n"
"<head>\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=iso-8859-1\" />\n",
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=windows-1252\" />\n",
Txt_STR_LANG_ID[Gbl.Prefs.Language]);
/* Title */
@ -246,10 +246,6 @@ void Lay_WriteStartOfPage (void)
Gbl.Usrs.Me.UsrDat.Prefs.Language != Txt_Current_CGI_SWAD_Language) // My language != current language
Lay_WriteRedirectionToMyLanguage ();
/* Soft transition between pages (avoid white screen) for Microsoft Internet Explorer */
if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW)
fprintf (Gbl.F.Out,"<meta http-equiv=\"Page-Exit\" content=\"blendTrans(Duration=0)\" />\n");
/* Write initial scripts depending on the action */
Lay_WriteScripts ();
@ -458,9 +454,9 @@ static void Lay_WriteScripts (void)
Gbl.CurrentAct == ActFrmCreMrkGrp || // Brw_FILE_BRW_ADMIN_MARKS_GRP
Gbl.CurrentAct == ActFrmCreBrf) // Brw_FILE_BRW_BRIEFCASE_USR
{
// Use charset="ISO-8859-1" to force error messages in ISO-8859-1 (default is UTF-8)
// Use charset="windows-1252" to force error messages in windows-1252 (default is UTF-8)
fprintf (Gbl.F.Out,"<script type=\"text/javascript\" src=\"%s/dropzone/dropzone.js\""
" charset=\"ISO-8859-1\">"
" charset=\"windows-1252\">"
"</script>\n",
Cfg_HTTPS_URL_SWAD_PUBLIC);
Lay_WriteScriptCustomDropzone ();
@ -488,8 +484,7 @@ static void Lay_WriteScriptInit (void)
extern const char *Txt_MONTHS_SMALL_SHORT[12];
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
fprintf (Gbl.F.Out,"<script type=\"text/javascript\""
" language=\"JavaScript\">\n");
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
fprintf (Gbl.F.Out,"function init(){\n");
@ -530,8 +525,7 @@ static void Lay_WriteScriptInit (void)
static void Lay_WriteScriptConnectedUsrs (void)
{
fprintf (Gbl.F.Out,"<script type=\"text/javascript\""
" language=\"JavaScript\">\n");
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
fprintf (Gbl.F.Out,"var RefreshParamNxtActCon = \"ActCod=%ld\";\n",
Act_Actions[ActRefCon].ActCod);
@ -552,8 +546,7 @@ static void Lay_WriteScriptConnectedUsrs (void)
static void Lay_WriteScriptCustomDropzone (void)
{
fprintf (Gbl.F.Out,"<script type=\"text/javascript\""
" language=\"JavaScript\">\n");
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
// "myAwesomeDropzone" is the camelized version of the HTML element's ID
// Add a line "forceFallback: true,\n" to test classic upload
@ -1589,7 +1582,7 @@ void Lay_ShowErrorAndExit (const char *Message)
{
rewind (Gbl.F.Out);
Fil_FastCopyOfOpenFiles (Gbl.F.Out,stdout);
Fil_CloseAndRemoveFileForXHTMLOutput ();
Fil_CloseAndRemoveFileForHTMLOutput ();
}
if (Gbl.WebService.IsWebService) // Serving a plugin request

View File

@ -72,9 +72,9 @@ int main (int argc, char *argv[])
extern const char *Txt_You_dont_have_permission_to_perform_this_action;
/*
fprintf (stdout,"Content-type: text/html; charset=ISO-8859-1\r\n"
fprintf (stdout,"Content-type: text/html; charset=windows-1252\r\n"
"Status: 503 Service Temporarily Unavailable\r\n\r\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">"
"<html lang=\"es\">"
"<head><title>%s</title></head>"
"<body><br /><br /><br /><br />"
"<h1 align=\"center\">%s est&aacute; parado por mantenimiento</h1>"
@ -113,8 +113,8 @@ int main (int argc, char *argv[])
// ...because uploading files using Dropzone.js will trigger error
// Sta_ExitIfTooFast ();
/***** Create file for XHTML output *****/
Fil_CreateFileForXHTMLOutput ();
/***** Create file for HTML output *****/
Fil_CreateFileForHTMLOutput ();
/***** Remove old (expired) sessions *****/
Ses_RemoveExpiredSessions ();
@ -141,7 +141,7 @@ int main (int argc, char *argv[])
if (Act_Actions[Gbl.CurrentAct].FunctionPriori != NULL)
Act_Actions[Gbl.CurrentAct].FunctionPriori ();
/***** Start writing XHTML output *****/
/***** Start writing HTML output *****/
Lay_WriteStartOfPage ();
/***** Make a processing or other depending on the action *****/

View File

@ -613,7 +613,7 @@ void Mrk_ShowMyMarks (void)
Lay_ShowErrorAndExit ("Can not open file with my marks.");
/* Start HTML output */
fprintf (Gbl.F.Out,"Content-type: text/html; charset=ISO-8859-1\r\n\r\n"); // Two \r\n aree necessary
fprintf (Gbl.F.Out,"Content-type: text/html; charset=windows-1252\r\n\r\n"); // Two \r\n aree necessary
Gbl.Layout.HTMLStartWritten = true;
/* Copy HTML to output file */

View File

@ -221,7 +221,7 @@ void Sta_ExitIfTooFast (void)
{
/***** Write header to standard output to avoid timeout *****/
// Two \r\n are necessary
fprintf (stdout,"Content-type: text/html; charset=ISO-8859-1\r\n\r\n"
fprintf (stdout,"Content-type: text/html; charset=windows-1252\r\n\r\n"
"<!DOCTYPE html>\n"
"<html lang=\"%s\">\n"
"<head>"

View File

@ -104,7 +104,7 @@ static Inf_InfoType_t Syl_SetSyllabusTypeAndLoadToMemory (void);
static void Syl_LoadToMemory (Inf_InfoType_t InfoType);
static void Syl_ShowSyllabus (Inf_InfoType_t InfoType);
static void Syl_ShowRowSyllabus (Inf_InfoType_t InfoType,unsigned NumItem,int Level,int *CodItem,const char *Text,bool NewItem);
static void Syl_WriteSyllabusIntoXHTMLTmpFile (Inf_InfoType_t InfoType,FILE *FileXHTMLTmp);
static void Syl_WriteSyllabusIntoHTMLTmpFile (Inf_InfoType_t InfoType,FILE *FileHTMLTmp);
static void Syl_PutFormItemSyllabus (Inf_InfoType_t InfoType,bool NewItem,unsigned NumItem,int Level,int *CodItem,const char *Text,const char *Color);
/*****************************************************************************/
@ -624,18 +624,18 @@ static void Syl_ShowRowSyllabus (Inf_InfoType_t InfoType,unsigned NumItem,int Le
}
/*****************************************************************************/
/************** Write the syllabus into a temporary XHTML file ***************/
/************** Write the syllabus into a temporary HTML file ****************/
/*****************************************************************************/
// This function is called only from web service
int Syl_WriteSyllabusIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffer)
int Syl_WriteSyllabusIntoHTMLBuffer (Inf_InfoType_t InfoType,char **HTMLBuffer)
{
char FileNameXHTMLTmp[PATH_MAX+1];
FILE *FileXHTMLTmp;
char FileNameHTMLTmp[PATH_MAX+1];
FILE *FileHTMLTmp;
size_t Length;
/***** Initialize buffer *****/
*XHTMLBuffer = NULL;
*HTMLBuffer = NULL;
/***** Load syllabus from XML file to list of items in memory *****/
Syl_LoadToMemory (InfoType);
@ -643,11 +643,11 @@ int Syl_WriteSyllabusIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffer
if (LstItemsSyllabus.NumItems)
{
/***** Create a unique name for the file *****/
sprintf (FileNameXHTMLTmp,"%s/%s/%s_syllabus.html",
sprintf (FileNameHTMLTmp,"%s/%s/%s_syllabus.html",
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT,Gbl.UniqueNameEncrypted);
/***** Create a new temporary file for writing and reading *****/
if ((FileXHTMLTmp = fopen (FileNameXHTMLTmp,"w+b")) == NULL)
if ((FileHTMLTmp = fopen (FileNameHTMLTmp,"w+b")) == NULL)
{
Syl_FreeListItemsSyllabus ();
return soap_receiver_fault (Gbl.soap,
@ -655,18 +655,18 @@ int Syl_WriteSyllabusIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffer
"Can not create temporary file");
}
/***** Write syllabus in XHTML into a temporary file *****/
Syl_WriteSyllabusIntoXHTMLTmpFile (InfoType,FileXHTMLTmp);
/***** Write syllabus in HTML into a temporary file *****/
Syl_WriteSyllabusIntoHTMLTmpFile (InfoType,FileHTMLTmp);
/***** Write syllabus from list of items in memory to text buffer *****/
/* Compute length of file */
Length = (size_t) ftell (FileXHTMLTmp);
Length = (size_t) ftell (FileHTMLTmp);
/* Allocate memory for buffer */
if ((*XHTMLBuffer = (char *) malloc (Length+1)) == NULL)
if ((*HTMLBuffer = (char *) malloc (Length+1)) == NULL)
{
fclose (FileXHTMLTmp);
unlink (FileNameXHTMLTmp);
fclose (FileHTMLTmp);
unlink (FileNameHTMLTmp);
Syl_FreeListItemsSyllabus ();
return soap_receiver_fault (Gbl.soap,
"Syllabus can not be copied into buffer",
@ -674,21 +674,21 @@ int Syl_WriteSyllabusIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffer
}
/* Copy file content into buffer */
fseek (FileXHTMLTmp,0L,SEEK_SET);
if (fread ((void *) *XHTMLBuffer,sizeof (char),Length,FileXHTMLTmp) != Length)
fseek (FileHTMLTmp,0L,SEEK_SET);
if (fread ((void *) *HTMLBuffer,sizeof (char),Length,FileHTMLTmp) != Length)
{
fclose (FileXHTMLTmp);
unlink (FileNameXHTMLTmp);
fclose (FileHTMLTmp);
unlink (FileNameHTMLTmp);
Syl_FreeListItemsSyllabus ();
return soap_receiver_fault (Gbl.soap,
"Syllabus can not be copied into buffer",
"Error reading file into buffer");
}
(*XHTMLBuffer)[Length] = '\0';
(*HTMLBuffer)[Length] = '\0';
/***** Close and remove temporary file *****/
fclose (FileXHTMLTmp);
unlink (FileNameXHTMLTmp);
fclose (FileHTMLTmp);
unlink (FileNameHTMLTmp);
}
/***** Free list of items *****/
@ -698,23 +698,21 @@ int Syl_WriteSyllabusIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffer
}
/*****************************************************************************/
/************** Write the syllabus into a temporary XHTML file ***************/
/************** Write the syllabus into a temporary HTML file ****************/
/*****************************************************************************/
static void Syl_WriteSyllabusIntoXHTMLTmpFile (Inf_InfoType_t InfoType,FILE *FileXHTMLTmp)
static void Syl_WriteSyllabusIntoHTMLTmpFile (Inf_InfoType_t InfoType,FILE *FileHTMLTmp)
{
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES];
unsigned NumItem;
int i;
/***** Write start of XHTML code *****/
fprintf (FileXHTMLTmp,"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\""
" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"%s\">\n"
/***** Write start of HTML code *****/
fprintf (FileHTMLTmp,"<!DOCTYPE html>\n"
"<html lang=\"%s\">\n"
"<head>\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=iso-8859-1\" />\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=windows-1252\" />\n"
"<title>%s</title>\n"
"</head>\n"
"<body>\n"
@ -723,13 +721,13 @@ static void Syl_WriteSyllabusIntoXHTMLTmpFile (Inf_InfoType_t InfoType,FILE *Fil
Txt_INFO_TITLE[InfoType]); // Page title
/***** Set width of columns of the table *****/
fprintf (FileXHTMLTmp,"<colgroup>\n");
fprintf (FileHTMLTmp,"<colgroup>\n");
for (i = 1;
i <= LstItemsSyllabus.NumLevels;
i++)
fprintf (FileXHTMLTmp,"<col width=\"%d\" />\n",
fprintf (FileHTMLTmp,"<col width=\"%d\" />\n",
i * Syl_WIDTH_NUM_SYLLABUS);
fprintf (FileXHTMLTmp,"<col width=\"*\" />\n"
fprintf (FileHTMLTmp,"<col width=\"*\" />\n"
"</colgroup>\n");
/***** Write all items of the current syllabus into text buffer *****/
@ -738,26 +736,26 @@ static void Syl_WriteSyllabusIntoXHTMLTmpFile (Inf_InfoType_t InfoType,FILE *Fil
NumItem++)
{
/***** Start the row *****/
fprintf (FileXHTMLTmp,"<tr>");
fprintf (FileHTMLTmp,"<tr>");
/***** Indent depending on the level *****/
if (LstItemsSyllabus.Lst[NumItem].Level > 1)
fprintf (FileXHTMLTmp,"<td align=\"left\" colspan=\"%d\"></td>",
fprintf (FileHTMLTmp,"<td align=\"left\" colspan=\"%d\"></td>",
LstItemsSyllabus.Lst[NumItem].Level - 1);
/***** Code of the item *****/
fprintf (FileXHTMLTmp,"<td width=\"%d\" align=\"right\" valign=\"top\" class=\"%s\">",
fprintf (FileHTMLTmp,"<td width=\"%d\" align=\"right\" valign=\"top\" class=\"%s\">",
LstItemsSyllabus.Lst[NumItem].Level * Syl_WIDTH_NUM_SYLLABUS,
StyleSyllabus[LstItemsSyllabus.Lst[NumItem].Level]);
if (LstItemsSyllabus.Lst[NumItem].Level == 1)
fprintf (FileXHTMLTmp,"&nbsp;");
Syl_WriteNumItem (NULL,FileXHTMLTmp,
fprintf (FileHTMLTmp,"&nbsp;");
Syl_WriteNumItem (NULL,FileHTMLTmp,
LstItemsSyllabus.Lst[NumItem].Level,
LstItemsSyllabus.Lst[NumItem].CodItem);
fprintf (FileXHTMLTmp,"&nbsp;</td>");
fprintf (FileHTMLTmp,"&nbsp;</td>");
/***** Text of the item *****/
fprintf (FileXHTMLTmp,"<td align=\"left\" colspan=\"%d\" valign=\"top\" class=\"%s\">"
fprintf (FileHTMLTmp,"<td align=\"left\" colspan=\"%d\" valign=\"top\" class=\"%s\">"
"%s"
"</td>",
LstItemsSyllabus.NumLevels - LstItemsSyllabus.Lst[NumItem].Level + 1,
@ -765,10 +763,10 @@ static void Syl_WriteSyllabusIntoXHTMLTmpFile (Inf_InfoType_t InfoType,FILE *Fil
LstItemsSyllabus.Lst[NumItem].Text);
/***** End of the row *****/
fprintf (FileXHTMLTmp,"</tr>\n");
fprintf (FileHTMLTmp,"</tr>\n");
}
fprintf (FileXHTMLTmp,"</table>\n"
fprintf (FileHTMLTmp,"</table>\n"
"</html>\n"
"</body>\n");
}

View File

@ -61,7 +61,7 @@ void Syl_GetParamItemNumber (void);
void Syl_EditSyllabus (void);
void Syl_FreeListItemsSyllabus (void);
int Syl_ReadLevelItemSyllabus (void);
int Syl_WriteSyllabusIntoXHTMLBuffer (Inf_InfoType_t InfoType,char **XHTMLBuffer);
int Syl_WriteSyllabusIntoHTMLBuffer (Inf_InfoType_t InfoType,char **HTMLBuffer);
void Syl_PutParamNumItem (unsigned NumItem);
void Syl_WriteNumItem (char *StrDst,FILE *FileTgt,int Level,int *CodItem);
void Syl_RemoveItemSyllabus (void);

View File

@ -202,7 +202,7 @@ const char *Txt_Switching_to_LANGUAGE[Txt_NUM_LANGUAGES] =
# # ### # # # # # #####
******************************************************************************/
/**** Don't use HTML entities like &oacute; when variable ends in NO_HTML ****/
/**** Charset must be ISO-8859-1 in this file ****/
/**** Charset must be windows-1252 in this file ****/
/*****************************************************************************/
const char *Txt_Country_NO_HTML =
@ -13109,81 +13109,6 @@ const char *Txt_If_you_send_this_message_you_will_appear_as_its_author =
"se voc&ecirc; enviar esta mensagem, voc&ecirc; vai aparecer como o seu autor";
#endif
const char *Txt_If_you_want_to_create_a_web_page_for_direct_access_to_the_course_X_ = // Warning: it is very important to include %s in the following sentences
#if L==0
"Si desea crear una p&aacute;gina web"
" que le permita acceder directamente a la asignatura <strong>%s</strong>,"
" puede copiar todo el c&oacute;digo XHTML siguiente"
" en un archivo nuevo y guardarlo"
" con la extensi&oacute;n &quot;.htm&quot; o &quot;.html&quot;.<br /><br />"
"Si s&oacute;lo desea insertar un enlace en una p&aacute;gina web existente,"
" copie las l&iacute;neas indicadas abajo en el lugar deseado del archivo HTML."; // Necessita traduccio
#elif L==1
"If you want to create a web page"
" for direct access to the course <strong>%s</strong>,"
" you can copy all of the following XHTML code"
" into a new file and save it"
" with &quot;.htm&quot; or &quot;.html&quot; extension.<br /><br />"
"If you only want to insert a link in an existing web page,"
" copy the lines indicated below in the desired place inside the HTML file."; // Need Übersetzung
#elif L==2
"If you want to create a web page"
" for direct access to the course <strong>%s</strong>,"
" you can copy all of the following XHTML code"
" into a new file and save it"
" with &quot;.htm&quot; or &quot;.html&quot; extension.<br /><br />"
"If you only want to insert a link in an existing web page,"
" copy the lines indicated below in the desired place inside the HTML file.";
#elif L==3
"Si desea crear una p&aacute;gina web"
" que le permita acceder directamente a la asignatura <strong>%s</strong>,"
" puede copiar todo el c&oacute;digo XHTML siguiente"
" en un archivo nuevo y guardarlo"
" con la extensi&oacute;n &quot;.htm&quot; o &quot;.html&quot;.<br /><br />"
"Si s&oacute;lo desea insertar un enlace en una p&aacute;gina web existente,"
" copie las l&iacute;neas indicadas abajo en el lugar deseado del archivo HTML.";
#elif L==4
"If you want to create a web page"
" for direct access to the course <strong>%s</strong>,"
" you can copy all of the following XHTML code"
" into a new file and save it"
" with &quot;.htm&quot; or &quot;.html&quot; extension.<br /><br />"
"If you only want to insert a link in an existing web page,"
" copy the lines indicated below in the desired place inside the HTML file."; // Besoin de traduction
#elif L==5
"Si desea crear una p&aacute;gina web"
" que le permita acceder directamente a la asignatura <strong>%s</strong>,"
" puede copiar todo el c&oacute;digo XHTML siguiente"
" en un archivo nuevo y guardarlo"
" con la extensi&oacute;n &quot;.htm&quot; o &quot;.html&quot;.<br /><br />"
"Si s&oacute;lo desea insertar un enlace en una p&aacute;gina web existente,"
" copie las l&iacute;neas indicadas abajo en el lugar deseado del archivo HTML."; // Okoteve traducción
#elif L==6
"Se vuoi creare una pagina web"
" per accedere direttamente al corso <strong>%s</strong>,"
" puoi copiare tutto il seguente codice HTML"
" in un file e salvarlo"
" con &quot;.htm&quot; o &quot;.html&quot; estensione.<br /><br />"
"Se vuoi solo inserire un link in una pagina web esistente,"
" copia le linee indicate sotto nel posto desiderato all'interno del file HTML.";
#elif L==7
"Jesli chcesz stworzyc strone www"
" do bezposredniego dostepu do kursu <strong>%s</strong>,"
" mozna skopiowac wszystkie nastepujacy kod XHTML"
" do nowego pliku i zapisac go"
" z &quot;.htm&quot; or &quot;.html&quot; rozszerzenie.<br /><br />"
"Jesli chcesz tylko wstawic link w istniejacej stronie internetowej."
" kopii w spos&oacute;b wskazany ponizej w wybranym miejscu w pliku HTML.";
#elif L==8
"If you want to create a web page"
" for direct access to the course <strong>%s</strong>,"
" you can copy all of the following XHTML code"
" into a new file and save it"
" with &quot;.htm&quot; or &quot;.html&quot; extension.<br /><br />"
"If you only want to insert a link in an existing web page,"
" copy the lines indicated below in the desired place inside the HTML file."; // Necessita de tradução
#endif
const char *Txt_Image =
#if L==0
"Imatge";

View File

@ -1215,7 +1215,7 @@ int swad__getCourseInfo (struct soap *soap,
{
case Inf_LECTURES: // Syllabus (lectures)
case Inf_PRACTICALS: // Syllabys (practicals)
Result = Syl_WriteSyllabusIntoXHTMLBuffer (InfoType,&(getCourseInfo->infoTxt));
Result = Syl_WriteSyllabusIntoHTMLBuffer (InfoType,&(getCourseInfo->infoTxt));
break;
default:
break;
@ -1223,7 +1223,7 @@ int swad__getCourseInfo (struct soap *soap,
break;
case Inf_INFO_SRC_PLAIN_TEXT: // Plain text
case Inf_INFO_SRC_RICH_TEXT: // Rich text (not yet available)
Result = Inf_WritePlainTextIntoXHTMLBuffer (InfoType,&(getCourseInfo->infoTxt));
Result = Inf_WritePlainTextIntoHTMLBuffer (InfoType,&(getCourseInfo->infoTxt));
break;
case Inf_INFO_SRC_PAGE: // Web page hosted in SWAD server
Result = Inf_WritePageIntoHTMLBuffer (InfoType,&(getCourseInfo->infoTxt));
@ -3642,7 +3642,7 @@ int swad__getDirectoryTree (struct soap *soap,
Brw_InitializeFileBrowser ();
Brw_SetFullPathInTree (Brw_RootFolderInternalNames[Gbl.FileBrowser.Type],".");
/* Check if exists the directory for XHTML output. If not exists, create it */
/* Check if exists the directory for HTML output. If not exists, create it */
sprintf (PathXMLPriv,"%s/%s",Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_OUT);
Fil_CreateDirIfNotExists (PathXMLPriv);

View File

@ -68,7 +68,7 @@ void XML_WriteStartFile (FILE *FileTgt,const char *Type,bool Credits)
{
extern const char *Txt_NEW_LINE;
fprintf (FileTgt,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>%s"
fprintf (FileTgt,"<?xml version=\"1.0\" encoding=\"windows-1252\"?>%s"
"<%s>%s",
Txt_NEW_LINE,
Type,Txt_NEW_LINE);

View File

@ -189,7 +189,7 @@ void ZIP_CreateZIPAsgWrk (void)
Cfg_FOLDER_FILE_BROWSER_TMP,
Gbl.FileBrowser.TmpPubDir,
FileNameZIP);
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In XHTML, URL must have no spaces
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces
/****** Link to download file *****/
ZIP_ShowLinkToDownloadZIP (FileNameZIP,URL,FileStatus.st_size,0);
@ -400,7 +400,7 @@ static void ZIP_CompressFolderIntoZIP (void)
Cfg_FOLDER_FILE_BROWSER_TMP,
Gbl.FileBrowser.TmpPubDir,
FileNameZIP);
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In XHTML, URL must have no spaces
Str_CopyStrChangingSpaces (URLWithSpaces,URL,PATH_MAX); // In HTML, URL must have no spaces
/****** Link to download file *****/
ZIP_ShowLinkToDownloadZIP (FileNameZIP,URL,FileStatus.st_size,UncompressedSize);