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:
David Mudrak 2010-03-20 22:15:54 +00:00
parent ad70376ce2
commit 16be897441
106 changed files with 565 additions and 677 deletions

View file

@ -103,7 +103,7 @@
}
asort($table->data);
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo "<div style=\"text-align:center\"><input type=\"submit\" value=\"".get_string("savechanges")."\" /></div>\n";
echo "</div>";

View file

@ -218,7 +218,7 @@
$table->rowclasses[] = 'dimmed_text';
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo '<p class="filtersettingnote">' . get_string('filterallwarning', 'filters') . '</p>';
echo $OUTPUT->footer();

View file

@ -184,7 +184,7 @@ if (!$acl) {
}
if (!empty($table)) {
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo '<p>&nbsp;</p>';
$baseurl = new moodle_url('/admin/mnet/access_control.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage));
echo $OUTPUT->paging_bar($aclcount, $page, $perpage, $baseurl);

View file

@ -218,7 +218,7 @@ $table->data = array(
$registerrow
),
);
echo $OUTPUT->table($table);
echo html_writer::table($table);
// print the list of all hosts, with little action links and buttons
$table = new html_table();
@ -250,7 +250,7 @@ foreach($hosts as $host) {
$OUTPUT->single_button(new moodle_url('/admin/mnet/delete.php', array('hostid' => $host->id)), get_string('delete'))
);
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
// finally, print the initial form to add a new host
echo $OUTPUT->box_start();

View file

@ -122,7 +122,7 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
);
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
$mnet_request->set_method('system/listMethods');
@ -156,7 +156,7 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
html_writer::link($newurl, get_string('inspect', 'mnet'))
);
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
if (isset($methodid) && array_key_exists($methodid-1, $methods)) {
$method = $methods[$methodid-1];
@ -194,7 +194,7 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
$signature['return']['description']
);
echo $OUTPUT->table($table);
echo html_writer::table($table);
$mnet_request->set_method('system/methodHelp');
$mnet_request->add_param($method, 'string');

View file

@ -104,6 +104,6 @@ foreach ($rs as $log) {
}
$rs->close();
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo $OUTPUT->footer();

View file

@ -60,7 +60,7 @@
'<input type="text" name="numcourses" size="3" maxlength="2" value="'.$numcourses.'" />',
'<input type="submit" value="'.get_string('view').'" />') ;
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo '</div>';
echo '</form>';
@ -117,7 +117,7 @@
}
$table->data[] = $a;
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
}
}
echo $OUTPUT->footer();

View file

@ -122,7 +122,7 @@ if ($requestedqtype) {
$totalhidden);
// Print it.
echo $OUTPUT->table($table);
echo html_writer::table($table);
}
// Footer.

View file

@ -92,7 +92,7 @@ if ($issue and ($result = $issue(true))) {
$table->data[] = $row;
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo $OUTPUT->box($result->details, 'generalbox boxwidthnormal boxaligncenter'); // TODO: add proper css
@ -121,7 +121,7 @@ if ($issue and ($result = $issue(true))) {
$table->data[] = $row;
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
}
echo $OUTPUT->footer();

View file

@ -67,7 +67,7 @@ echo $OUTPUT->box($controller->get_intro_text());
echo '<form action="' . $baseurl . '" method="post">';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo '<div class="buttons"><input type="submit" name="submit" value="'.get_string('savechanges').'"/>';
echo '</div></form>';

View file

@ -431,7 +431,7 @@
$table->data[] = $row;
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
if ($context->contextlevel > CONTEXT_USER) {
echo '<div class="backlink"><a href="' . get_context_url($context) . '">' . get_string('backto', '', $contextname) . '</a></div>';

View file

@ -256,7 +256,7 @@
$table->data[] = $row;
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo $OUTPUT->container_start('buttons');
echo $OUTPUT->single_button(new moodle_url($defineurl, array('action' => 'add')), get_string('addrole', 'role'), 'get');

View file

@ -854,7 +854,7 @@ foreach ($contents as $content) {
$table = new html_table();
$table->id = "uupreview";
$table->set_classes = 'generaltable';
$table->attributes['class'] = 'generaltable';
$table->tablealign = 'center';
$table->summary = get_string('uploaduserspreview', 'admin');
$table->head = array();
@ -887,7 +887,7 @@ if (in_array('error', $headings)) {
$value = get_string($content[$key]);
}
$cells->text = $value;
$cells->set_classes($errclass);
$cells->attributes['class'] = $errclass;
$rows->cells[] = $cells;
}
$countcontent++;
@ -928,7 +928,7 @@ if (in_array('error', $headings)) {
$countcontent++;
}
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
if ($haserror) {

View file

@ -298,7 +298,7 @@
echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
}
if (!empty($table)) {
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo $OUTPUT->paging_bar($usercount, $page, $perpage, $baseurl);
if (has_capability('moodle/user:create', $sitecontext)) {
echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');

View file

@ -74,7 +74,7 @@ foreach($users as $user) {
}
echo $OUTPUT->heading("$usercount / $usertotal ".get_string('users'));
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo $OUTPUT->continue_button($return);

View file

@ -125,7 +125,7 @@ foreach($users as $user)
$table->data[] = $temparray;
}
echo $OUTPUT->heading("$usercount / $usertotal ".get_string('users'));
echo $OUTPUT->table($table);
echo html_writer::table($table);
echo '<div class="continuebutton">';
echo '<input type="submit" name="multienrolsubmit" value="save changes" />';
echo '</div>';

View file

@ -137,7 +137,7 @@ foreach ($functions as $function) {
}
}
echo $OUTPUT->table($table);
echo html_writer::table($table);
// we can edit only custom functions, the build-in would be overridden after each upgrade