diff --git a/src/elogd.c b/src/elogd.c index 5de3b23b..4821974a 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -16759,7 +16759,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp int *n_display, char *locked_by, int highlight, regex_t * re_buf, int highlight_mid, int absolute_link) { - char str[NAME_LENGTH], ref[256], *nowrap, sclass[80], format[256], file_name[MAX_PATH_LENGTH], *slist, + char str[NAME_LENGTH], ref[256], *nowrap, rowstyle[80], tdstyle[80], format[256], file_name[MAX_PATH_LENGTH], *slist, *svalue, comment[256], param[80]; char display[NAME_LENGTH], attr_icon[80]; int i, j, n, i_line, index, colspan, n_attachments, line_len, thumb_status, max_line_len, n_lines, @@ -16781,56 +16781,56 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp if (strieq(mode, "Summary")) { if (highlight_mid == message_id) { if (number % 2 == 1) - strcpy(sclass, "list1h"); + strcpy(rowstyle, "list1h"); else - strcpy(sclass, "list2h"); + strcpy(rowstyle, "list2h"); } else { if (number % 2 == 1) - strcpy(sclass, "list1"); + strcpy(rowstyle, "list1"); else - strcpy(sclass, "list2"); + strcpy(rowstyle, "list2"); } } else if (strieq(mode, "Full")) { if (highlight_mid == message_id) - strcpy(sclass, "list1h"); + strcpy(rowstyle, "list1h"); else - strcpy(sclass, "list1"); + strcpy(rowstyle, "list1"); } else if (strieq(mode, "Threaded")) { if (highlight) { if (highlight == message_id) - strcpy(sclass, "thread"); + strcpy(rowstyle, "thread"); else - strcpy(sclass, "threadreply"); + strcpy(rowstyle, "threadreply"); } else { if (highlight_mid == message_id) { if (level == 0) - strcpy(sclass, "threadh"); + strcpy(rowstyle, "threadh"); else - strcpy(sclass, "threadreply"); + strcpy(rowstyle, "threadreply"); } else { if (level == 0) - strcpy(sclass, "thread"); + strcpy(rowstyle, "thread"); else - strcpy(sclass, "threadreply"); + strcpy(rowstyle, "threadreply"); } } } rsprintf(""); - /* check attributes for style */ + /* check attributes for row style */ for (i = 0; i < n_attr; i++) { sprintf(str, "Style %s %s", attr_list[i], attrib[i]); if (getcfg(lbs->name, str, display, sizeof(display))) { - sprintf(str, "%s\" style=\"%s\"", sclass, display); - strlcpy(sclass, str, sizeof(sclass)); + sprintf(str, "%s\" style=\"%s\"", rowstyle, display); + strlcpy(rowstyle, str, sizeof(rowstyle)); break; } } /* only single cell for threaded display */ if (strieq(mode, "Threaded")) { - rsprintf("", sclass); + rsprintf("", rowstyle); if (locked_by && locked_by[0]) { sprintf(str, "%s %s", loc("Entry is currently edited by"), locked_by); @@ -16937,7 +16937,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp } else { /* show select box */ if (select && !strieq(mode, "Threaded")) { - rsprintf("", sclass); + rsprintf("", rowstyle); rsprintf("\n", (*n_display)++, message_id); rsprintf("\n"); } @@ -16961,7 +16961,8 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp loc("Reply")); } else { - rsprintf("", sclass); + + rsprintf("", rowstyle); if (locked_by && locked_by[0]) { sprintf(str, "%s %s", loc("Entry is currently edited by"), locked_by); @@ -16997,16 +16998,16 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp rsprintf(", %s", lbs->name); } else { if (disp_attr_link == NULL || disp_attr_link[index]) - rsprintf("\n%s\n", sclass, nowrap, ref, + rsprintf("\n%s\n", rowstyle, nowrap, ref, lbs->name); else - rsprintf("\n%s\n", sclass, nowrap, lbs->name); + rsprintf("\n%s\n", rowstyle, nowrap, lbs->name); } } if (strieq(disp_attr[index], loc("Edit"))) { if (!strieq(mode, "Threaded")) { - rsprintf("\n", sclass, nowrap, ref, loc("Edit")); + rsprintf("\n", rowstyle, nowrap, ref, loc("Edit")); rsprintf("\n\"%s\"\n", loc("Edit entry"), loc("Edit entry")); } @@ -17014,7 +17015,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp if (strieq(disp_attr[index], loc("Delete"))) { if (!strieq(mode, "Threaded")) { - rsprintf("\n", sclass, nowrap, ref, loc("Delete")); + rsprintf("\n", rowstyle, nowrap, ref, loc("Delete")); rsprintf("\n\"%s\"\n", loc("Delete entry"), loc("Delete entry")); } @@ -17037,14 +17038,23 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp rsprintf(", %s", str); } else { if (disp_attr_link == NULL || disp_attr_link[index]) - rsprintf("\n%s\n", sclass, nowrap, ref, str); + rsprintf("\n%s\n", rowstyle, nowrap, ref, str); else - rsprintf("\n%s\n", sclass, nowrap, str); + rsprintf("\n%s\n", rowstyle, nowrap, str); } } for (i = 0; i < n_attr; i++) if (strieq(disp_attr[index], attr_list[i])) { + + /* check attributes for cell style */ + strlcpy(tdstyle, rowstyle, sizeof(tdstyle)); + sprintf(str, "Cell Style %s %s", attr_list[i], attrib[i]); + if (getcfg(lbs->name, str, display, sizeof(display))) { + sprintf(str, "%s\" style=\"%s\"", rowstyle, display); + strlcpy(tdstyle, str, sizeof(rowstyle)); + } + if (strieq(mode, "Threaded")) { if (strieq(attr_options[i][0], "boolean")) { if (atoi(attrib[i]) == 1) { @@ -17133,9 +17143,9 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp } else { if (strieq(attr_options[i][0], "boolean")) { if (atoi(attrib[i]) == 1) - rsprintf("\n\n", sclass); + rsprintf("\n\n", tdstyle); else - rsprintf("\n\n", sclass); + rsprintf("\n\n", tdstyle); } else if (attr_flags[i] & AF_DATE) { @@ -17152,9 +17162,9 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp my_strftime(str, sizeof(str), format, pts); if (disp_attr_link == NULL || disp_attr_link[index]) - rsprintf("\n%s\n", sclass, ref, str); + rsprintf("\n%s\n", tdstyle, ref, str); else - rsprintf("\n%s\n", sclass, str); + rsprintf("\n%s\n", tdstyle, str); } else if (attr_flags[i] & AF_DATETIME) { @@ -17171,13 +17181,13 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp my_strftime(str, sizeof(str), format, pts); if (disp_attr_link == NULL || disp_attr_link[index]) - rsprintf("\n%s\n", sclass, ref, str); + rsprintf("\n%s\n", tdstyle, ref, str); else - rsprintf("\n%s\n", sclass, str); + rsprintf("\n%s\n", tdstyle, str); } else if (attr_flags[i] & AF_ICON) { - rsprintf("", sclass); + rsprintf("", rowstyle); sprintf(str, "Icon comment %s", attrib[i]); getcfg(lbs->name, str, comment, sizeof(comment)); @@ -17192,7 +17202,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp } else { - rsprintf("", sclass); + rsprintf("", tdstyle); if (disp_attr_link == NULL || disp_attr_link[index]) rsprintf("", ref);