mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-77150 core_table: Fix classes added as columnsattributes are ignored
Fix columnattributes with key 'class' being ingored by adding them to every 'column_class'.
This commit is contained in:
parent
a31f5830bd
commit
855839d195
@ -1143,6 +1143,12 @@ class flexible_table {
|
||||
foreach ($row as $index => $data) {
|
||||
$column = $colbyindex[$index];
|
||||
|
||||
$columnattributes = $this->columnsattributes[$column] ?? [];
|
||||
if (isset($columnattributes['class'])) {
|
||||
$this->column_class($column, $columnattributes['class']);
|
||||
unset($columnattributes['class']);
|
||||
}
|
||||
|
||||
$attributes = [
|
||||
'class' => "cell c{$index}" . $this->column_class[$column],
|
||||
'id' => "{$rowid}_c{$index}",
|
||||
@ -1155,7 +1161,7 @@ class flexible_table {
|
||||
$attributes['scope'] = 'row';
|
||||
}
|
||||
|
||||
$attributes += $this->columnsattributes[$column] ?? [];
|
||||
$attributes += $columnattributes;
|
||||
|
||||
if (empty($this->prefs['collapse'][$column])) {
|
||||
if ($this->column_suppress[$column] && $suppresslastrow !== null && $suppresslastrow[$index] === $data) {
|
||||
|
@ -1,6 +1,10 @@
|
||||
This files describes API changes in core libraries and APIs,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 4.1.2 ===
|
||||
|
||||
* The method `flexible_table::set_columnsattributes` now can be used with 'class' key to add custom classes to the DOM.
|
||||
|
||||
=== 4.1.1 ===
|
||||
|
||||
* There is a new helper function mtrace_exception to help with reporting exceptions you have caught in scheduled tasks.
|
||||
|
Loading…
x
Reference in New Issue
Block a user