mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-21652 html_table rendering refactored
* class html_component does not exist any more * class html_table rendered via html_writer::table() * html_table, html_table_row and html_table_cell have public $attributes property to set their CSS classes * dropped rotateheaders feature, should be added again after more research of possible ways (<svg> is not nice IMHO) * dropped possibility to define CSS classes for table heading, body and footer - can be easily done and better done using just table class and context
This commit is contained in:
parent
ad70376ce2
commit
16be897441
106 changed files with 565 additions and 677 deletions
|
@ -2400,7 +2400,7 @@ function blocks_move_block($page, &$instance, $destpos, $destweight=NULL, $pinne
|
|||
function print_table($table, $return=false) {
|
||||
global $OUTPUT;
|
||||
// TODO MDL-19755 turn debugging on once we migrate the current core code to use the new API
|
||||
debugging('print_table() has been deprecated. Please change your code to use $OUTPUT->table().');
|
||||
debugging('print_table() has been deprecated. Please change your code to use html_writer::table().');
|
||||
$newtable = new html_table();
|
||||
foreach ($table as $property => $value) {
|
||||
if (property_exists($newtable, $property)) {
|
||||
|
@ -2408,13 +2408,13 @@ function print_table($table, $return=false) {
|
|||
}
|
||||
}
|
||||
if (isset($table->class)) {
|
||||
$newtable->set_classes($table->class);
|
||||
$newtable->attributes['class'] = $table->class;
|
||||
}
|
||||
if (isset($table->rowclass) && is_array($table->rowclass)) {
|
||||
debugging('rowclass[] has been deprecated for html_table and should be replaced by rowclasses[]. please fix the code.');
|
||||
$newtable->rowclasses = $table->rowclass;
|
||||
}
|
||||
$output = $OUTPUT->table($newtable);
|
||||
$output = html_writer::table($newtable);
|
||||
if ($return) {
|
||||
return $output;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue