Allow preference sections to define CSS class names

dev-fontawesome
Thomas Bruederli 10 years ago
parent b0a2542ce4
commit a3644638aa

@ -1127,7 +1127,19 @@ class rcmail extends rcube
// format each col // format each col
foreach ($a_show_cols as $col) { foreach ($a_show_cols as $col) {
$val = is_array($row_data[$col]) ? $row_data[$col][0] : $row_data[$col]; $val = is_array($row_data[$col]) ? $row_data[$col][0] : $row_data[$col];
$table->add($col, empty($attrib['ishtml']) ? $this->Q($val) : $val);
// escape html
if (empty($attrib['ishtml'])) {
$val = html::quote($val);
}
// check if we want to add a class to this table cell
$clskey = $col . '_class';
if (!empty($row_data[$clskey])) {
$col .= ' ' . $row_data[$clskey];
}
$table->add($col, $val);
} }
} }
} }

@ -73,6 +73,13 @@ function rcmail_sections_list($attrib)
list($list, $cols) = rcmail_user_prefs(); list($list, $cols) = rcmail_user_prefs();
// add section keys as class name to the primary col
array_walk($list, function(&$item, $key) use ($attrib) {
if (!isset($item['section_class'])) {
$item['section_class'] = trim($attrib['classprefix'] . $key);
}
});
// create XHTML table // create XHTML table
$out = $RCMAIL->table_output($attrib, $list, $cols, 'id'); $out = $RCMAIL->table_output($attrib, $list, $cols, 'id');

Loading…
Cancel
Save