From 50e210d4819c0bd7b652869a621c4f4ed92be9f2 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Tue, 29 May 2007 14:01:25 +0000 Subject: [PATCH] Made output more XML compatible SVN revision: 1864 --- src/elogd.c | 61 +++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index de265b29..65806ed0 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -5776,7 +5776,7 @@ PATTERN_LIST pattern_list[] = { }; char *email_quote_table = - "
%s:
"; + "
%s:
"; void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str) { @@ -6994,9 +6994,14 @@ void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, /* DOCTYPE */ rsprintf("\n"); + /* this code would be for XML files... + rsprintf("\n"); + rsprintf("\n"); + */ + /* page title */ rsprintf("\n"); - rsprintf("\n"); + rsprintf("\n"); rsprintf("%s\n", title); /* Cascading Style Sheet */ @@ -7024,13 +7029,13 @@ void show_html_header(LOGBOOK * lbs, BOOL expires, char *title, BOOL close_head, } } else rsprintf("\n", css); - rsprintf("\n"); - rsprintf("\n"); + rsprintf("\n"); + rsprintf("\n"); if (rss_feed) { rsprintf("name); - rsprintf("href=\"elog.rdf\">\n"); + rsprintf("href=\"elog.rdf\" />\n"); } if (close_head) @@ -7046,9 +7051,9 @@ void show_standard_header(LOGBOOK * lbs, BOOL expires, char *title, char *path, show_top_text(lbs); if (path && path[0]) - rsprintf("
\n\n", path); + rsprintf("\n\n", path); else - rsprintf("\n\n"); + rsprintf("\n\n"); } /*------------------------------------------------------------------*/ @@ -7061,7 +7066,7 @@ void show_upgrade_page(LOGBOOK * lbs) rsprintf("\n"); - rsprintf("\n\n"); + rsprintf("
\n\n"); rsprintf("\n"); @@ -7356,9 +7361,9 @@ void show_standard_title(char *logbook, char *text, int printable) LBLIST phier, pnode, pnext, flb; if (printable) - rsprintf("
ELog Electronic Logbook Upgrade Information
\n\n"); + rsprintf("
\n\n"); else - rsprintf("
\n\n"); + rsprintf("
\n\n"); /* scan logbook hierarchy */ phier = get_logbook_hierarchy(); @@ -7469,7 +7474,7 @@ void show_standard_title(char *logbook, char *text, int printable) /*---- title row ----*/ - rsprintf("
\n"); + rsprintf("
\n"); /* left cell */ rsprintf("
"); @@ -7657,7 +7662,7 @@ void show_error(char *error) show_html_header(NULL, FALSE, "ELOG error", TRUE, FALSE, NULL, FALSE); rsprintf("
\n"); - rsprintf("\n", error); rsprintf("
%s
"); @@ -9377,7 +9382,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL /*---- entry form ----*/ /* table for two-column items */ - rsprintf("
"); + rsprintf("
"); /* print required message if one of the attributes has it set */ for (i = 0; i < n_attr; i++) { @@ -9476,7 +9481,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf(""); else if (aindex < n_disp_attr - 1 && (format_flags[attr_index[aindex + 1]] & AFF_SAME_LINE)) { /* if next attribute on same line, start a new subtable */ - rsprintf("
"); + rsprintf("
"); subtable = 1; } else /* for normal attribute, start new row */ @@ -9881,7 +9886,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL } else if (attr_flags[index] & AF_ICON) { /* display icons */ rsprintf("\n", title); - rsprintf("
\n"); + rsprintf("
\n"); for (i = 0; i < MAX_N_LIST && attr_options[index][i][0]; i++) { if (strstr(attrib[index], attr_options[index][i])) @@ -13195,7 +13200,7 @@ void csv_import(LOGBOOK * lbs, char *csv, char *csvfile) /* title row */ sprintf(str, loc("CSV import preview of %s"), csvfile); show_standard_header(lbs, TRUE, str, "./", FALSE, NULL); - rsprintf("
\n"); + rsprintf("
\n"); rsprintf("\n", str, str); /* menu buttons */ @@ -13428,7 +13433,7 @@ void xml_import(LOGBOOK * lbs, char *xml, char *xmlfile) /* title row */ sprintf(str, loc("XML import preview of %s"), xmlfile); show_standard_header(lbs, TRUE, str, "./", FALSE, NULL); - rsprintf("
%s
\n"); + rsprintf("
\n"); rsprintf("\n", str, str); /* menu buttons */ @@ -14868,7 +14873,7 @@ void synchronize_logbook(LOGBOOK * lbs, int mode, BOOL sync_all) for (index = 0; index < nserver; index++) { if (mode == SYNC_HTML) { - rsprintf("
%s
%s", lbs->name_enc, lbs->name); @@ -15628,7 +15633,7 @@ void synchronize(LOGBOOK * lbs, int mode) synchronize_logbook(lbs, mode, FALSE); if (mode == SYNC_HTML) { - rsprintf("
\n", loc("Back")); rsprintf("
%s

\n"); @@ -16774,7 +16779,7 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands, char ref[256], str[NAME_LENGTH], comment[NAME_LENGTH], list[MAX_N_LIST][NAME_LENGTH], option[NAME_LENGTH]; rsprintf("

\n"); - rsprintf("\n"); + rsprintf("
\n"); rsprintf("\n"); @@ -18634,7 +18639,7 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa if (isparam("new_entries") && atoi(getparam("new_entries")) == 1) { rsprintf("
\n"); - rsprintf("\n"); + rsprintf("
\n"); rsprintf("", loc("New entries since")); memcpy(&tms, localtime(<ime_start), sizeof(struct tm)); my_strftime(str, sizeof(str), "%c", &tms); @@ -18644,7 +18649,7 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa if (disp_filter) { rsprintf("
%s:
\n"); - rsprintf("\n"); + rsprintf("
\n"); if (isparam("ma") || isparam("ya") || isparam("da")) { memset(&tms, 0, sizeof(struct tm)); @@ -19293,7 +19298,7 @@ void show_elog_thread(LOGBOOK * lbs, int message_id, int absolute_links, int hig el_retrieve(lbs, head_id, date, attr_list, attrib, lbs->n_attr, text, &size, in_reply_to, reply_to, attachment, encoding, locked_by); - rsprintf("
\n"); + rsprintf("
\n"); display_line(lbs, head_id, 0, "Threaded", 1, 0, FALSE, 0, @@ -21330,7 +21335,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command) /*---- title ----*/ if (email) - rsprintf("
\n"); + rsprintf("
\n"); else show_standard_title(lbs->name, "", 0); @@ -21338,7 +21343,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command) if (!email) { rsprintf("
\n"); - rsprintf("\n"); + rsprintf("
\n"); rsprintf("\n", loc("This entry has been deleted")); else { /* overall message table */ - rsprintf("
\n"); n = strbreak(menu_str, menu_item, MAX_N_LIST, ",", FALSE); @@ -21484,7 +21489,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command) rsprintf("
%s
\n"); + rsprintf("
\n"); /* check for locked attributes */ for (i = 0; i < lbs->n_attr; i++) { @@ -21643,7 +21648,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command) } /* 2 column table for all attributes */ - rsprintf("
"); + rsprintf("
"); subtable = 0; /* generate list of attributes to show */ @@ -21696,7 +21701,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command) rsprintf(""); else if (i < lbs->n_attr - 1 && (format_flags[i + 1] & AFF_SAME_LINE)) { /* if next attribute on same line, start a new subtable */ - rsprintf("
"); + rsprintf("
"); subtable = 1; } else /* for normal attribute, start new row */