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
|
@ -421,12 +421,12 @@ if (!isguestuser()) {
|
|||
|
||||
if ($generalforums) {
|
||||
echo $OUTPUT->heading(get_string('generalforums', 'forum'));
|
||||
echo $OUTPUT->table($generaltable);
|
||||
echo html_writer::table($generaltable);
|
||||
}
|
||||
|
||||
if ($learningforums) {
|
||||
echo $OUTPUT->heading(get_string('learningforums', 'forum'));
|
||||
echo $OUTPUT->table($learningtable);
|
||||
echo html_writer::table($learningtable);
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
|
|
@ -51,22 +51,22 @@ class mod_forum_renderer extends plugin_renderer_base {
|
|||
|
||||
$existingcell = new html_table_cell();
|
||||
$existingcell->text = $existinguc->display(true);
|
||||
$existingcell->set_classes(array('existing'));
|
||||
$existingcell->attributes['class'] = 'existing';
|
||||
$actioncell = new html_table_cell();
|
||||
$actioncell->text = html_writer::start_tag('div', array());
|
||||
$actioncell->text .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'subscribe', 'value'=>$this->page->theme->larrow.' '.get_string('add'), 'class'=>'actionbutton'));
|
||||
$actioncell->text .= html_writer::empty_tag('br', array());
|
||||
$actioncell->text .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'unsubscribe', 'value'=>$this->page->theme->rarrow.' '.get_string('remove'), 'class'=>'actionbutton'));
|
||||
$actioncell->text .= html_writer::end_tag('div', array());
|
||||
$actioncell->set_classes(array('actions'));
|
||||
$actioncell->attributes['class'] = 'actions';
|
||||
$potentialcell = new html_table_cell();
|
||||
$potentialcell->text = $potentialuc->display(true);
|
||||
$potentialcell->set_classes(array('potential'));
|
||||
$potentialcell->attributes['class'] = 'potential';
|
||||
|
||||
$table = new html_table();
|
||||
$table->set_classes(array('subscribertable','boxaligncenter'));
|
||||
$table->attributes['class'] = 'subscribertable boxaligncenter';
|
||||
$table->data = array(new html_table_row(array($existingcell, $actioncell, $potentialcell)));
|
||||
$output .= $this->output->table($table);
|
||||
$output .= html_writer::table($table);
|
||||
|
||||
$output .= html_writer::end_tag('form');
|
||||
return $output;
|
||||
|
@ -95,7 +95,7 @@ class mod_forum_renderer extends plugin_renderer_base {
|
|||
foreach ($users as $user) {
|
||||
$table->data[] = array($this->output->user_picture($user, array('courseid'=>$course->id)), fullname($user), $user->email);
|
||||
}
|
||||
$output .= $this->output->table($table);
|
||||
$output .= html_writer::table($table);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
@ -116,4 +116,4 @@ class mod_forum_renderer extends plugin_renderer_base {
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue