diff --git a/doc/config.html b/doc/config.html index 5a59d05b..eceb313b 100755 --- a/doc/config.html +++ b/doc/config.html @@ -971,10 +971,19 @@ supplied in an author attribute via the "Preset xxxx" option. The default is 0.
-
Top level only = 0|1
+Expand default = 0|1|2|3
-If this flag is 1, only top level messages are displayed in the search
-result page for threaded display. No replies are shown. The default is 0.
+This setting determines how messages are displayed in threaded mode. Following
+options are possible:
+Summary lines option.
+
Line as link = 0|1
diff --git a/elogd.c b/elogd.c
index 684e9475..ba5fe8cc 100755
--- a/elogd.c
+++ b/elogd.c
@@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG
$Log$
+ Revision 2.111 2002/12/10 07:53:21 midas
+ Implemented expand/collapse
+
Revision 2.110 2002/12/02 16:38:57 midas
Added parameter length check
@@ -856,7 +859,7 @@ int i;
*pD = '\0';
}
-void url_encode(char *ps)
+void url_encode(char *ps, int size)
/********************************************************************\
Encode the given string in-place by adding %XX escapes
\********************************************************************/
@@ -865,7 +868,7 @@ char *pd, *p, str[256];
pd = str;
p = ps;
- while (*p && (int)p < (int)str + 250)
+ while (*p && (int)pd < (int)str + 250)
{
if (strchr(" %&=#?", *p))
{
@@ -879,7 +882,7 @@ char *pd, *p, str[256];
}
}
*pd = '\0';
- strcpy(ps, str);
+ strlcpy(ps, str, size);
}
/*-------------------------------------------------------------------*/
@@ -2051,7 +2054,7 @@ int i, j, n, status;
strcpy(lb_list[n].name, logbook);
strcpy(lb_list[n].name_enc, logbook);
- url_encode(lb_list[n].name_enc);
+ url_encode(lb_list[n].name_enc, sizeof(lb_list[n].name_enc));
/* get data dir from configuration file */
getcfg(logbook, "Data dir", str);
@@ -3766,7 +3769,7 @@ int i, j;
continue;
strcpy(ref, str);
- url_encode(ref);
+ url_encode(ref, sizeof(ref));
if (equal_ustring(str, logbook))
{
@@ -5532,9 +5535,9 @@ int i, fh, size, self_register;
sprintf(mail_text+strlen(mail_text), "\r\nURL : %s", url);
strcpy(str, getparam("new_full_name"));
- url_encode(str);
+ url_encode(str, sizeof(str));
do_crypt(getparam("newpwd"), enc_pwd);
- url_encode(enc_pwd);
+ url_encode(enc_pwd, sizeof(enc_pwd));
sprintf(mail_text+strlen(mail_text), "?cmd=Activate&new_user_name=%s&new_full_name=%s&new_user_email=%s&email_notify=%s&encpwd=%s&unm=%s\r\n",
getparam("new_user_name"),
str,
@@ -6087,7 +6090,7 @@ struct tm *gmt;
/*------------------------------------------------------------------*/
void display_line(LOGBOOK *lbs, int message_id, int number, char *mode,
- int level, BOOL printable, int n_line, int show_attachments,
+ int expand, int level, BOOL printable, int n_line, int show_attachments,
char *date, char *reply_to,
int n_attr_disp, char disp_attr[MAX_N_ATTR+4][NAME_LENGTH],
char attrib[MAX_N_ATTR][NAME_LENGTH],
@@ -6134,6 +6137,10 @@ FILE *f;
for (i=0 ; i| \n", gt("Menu1 BGColor")); + rsprintf(""); + + if (page_n != 1) + sprintf(ref, "page%d", page_n); + else + ref[0] = 0; + build_ref(ref, sizeof(ref), "full", ""); + rsprintf(" %s |", ref, loc("Full")); + + if (page_n != 1) + sprintf(ref, "page%d", page_n); + else + ref[0] = 0; + build_ref(ref, sizeof(ref), "summary", ""); + rsprintf(" %s |", ref, loc("Summary")); + + if (page_n != 1) + sprintf(ref, "page%d", page_n); + else + ref[0] = 0; + build_ref(ref, sizeof(ref), "threaded", ""); + rsprintf(" %s ", ref, loc("Threaded")); + + if (threaded) + { + if (page_n != 1) + sprintf(ref, "page%d", page_n); + else + ref[0] = 0; + + cur_exp = 1; + if (getcfg(lbs->name, "Expand default", str)) + cur_exp = atoi(str); + if (isparam("expand")) + cur_exp = atoi(getparam("expand")); + + if (cur_exp > 0) + { + sprintf(str, "%d", max(0, cur_exp-1)); + build_ref(ref, sizeof(ref), "", str); + rsprintf("| %s ", ref, loc("Collapse")); + } + else + rsprintf("| %s ", loc("Collapse")); + + if (cur_exp < 3) + { + if (page_n != 1) + sprintf(ref, "page%d", page_n); + else + ref[0] = 0; + sprintf(str, "%d", min(3, cur_exp+1)); + build_ref(ref, sizeof(ref), "", str); + rsprintf("| %s ", ref, loc("Expand")); + } + else + rsprintf("| %s ", loc("Expand")); + } + + rsprintf(""); + rsprintf(" |