Implemented attachment icons in summary/threaded list

SVN revision: 2088
This commit is contained in:
2008-04-04 19:41:35 +00:00
parent 8643bd3268
commit 40bce3f5d5
4 changed files with 61 additions and 4 deletions
+38 -2
View File
@@ -16746,6 +16746,20 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp
}
if (strieq(mode, "Threaded")) {
rsputs(" ");
for (i = 0; i < MAX_ATTACHMENTS; i++)
if (attachment[i][0]) {
strlcpy(str, attachment[i], sizeof(str));
str[13] = 0;
sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);
url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */
rsprintf("<a href=\"%s\" target=\"_blank\">", ref);
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\" alt=\"%s\" title=\"%s\"></a>",
attachment[i]+14, attachment[i]+14);
}
if (highlight != message_id)
rsprintf("</a>\n");
else
@@ -16832,10 +16846,27 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp
strencode_nouml(str);
else
rsputs("&nbsp;");
rsputs("</td>\n");
}
if (strieq(mode, "Threaded"))
rsprintf("</tr>\n");
if (strieq(mode, "Summary")) {
/* show attachment icons */
rsputs("<td class=\"listatt\">&nbsp;");
for (i = 0; i < MAX_ATTACHMENTS; i++)
if (attachment[i][0]) {
strlcpy(str, attachment[i], sizeof(str));
str[13] = 0;
sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14);
url_encode(ref, sizeof(ref)); /* for file names with special characters like "+" */
rsprintf("<a href=\"%s\" target=\"_blank\">", ref);
rsprintf("<img border=\"0\" align=\"absmiddle\" src=\"attachment.png\" alt=\"%s\" title=\"%s\"></a>",
attachment[i]+14, attachment[i]+14);
}
rsputs("&nbsp;</td>");
}
colspan = n_attr_disp;
@@ -19877,6 +19908,11 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa
if (!strieq(mode, "Full") && n_line > 0 && show_text)
rsprintf("<th class=\"listtitle\">%s</th>\n", loc("Text"));
if (strieq(mode, "Summary")) {
rsprintf("<th width=\"10\" class=\"listtitle\"><img src=\"attachment.png\" alt=\"%s\" title=\"%s\"</th>",
loc("Attachments"), loc("Attachments"));
}
rsprintf("</tr>\n\n");
}
} /* if (!csv && !xml) */