MDL-67547 dataformat: allow plugins to declare support for HTML.

This commit is contained in:
Paul Holden 2019-12-18 21:38:40 +00:00
parent a09eb2697f
commit 118a109499
6 changed files with 62 additions and 10 deletions

View file

@ -92,6 +92,15 @@ table {
echo \html_writer::end_tag('tr');
}
/**
* Method to define whether the dataformat supports export of HTML
*
* @return bool
*/
public function supports_html(): bool {
return true;
}
/**
* Write a single record
*
@ -99,6 +108,8 @@ table {
* @param int $rownum
*/
public function write_record($record, $rownum) {
$record = $this->format_record($record);
echo \html_writer::start_tag('tr');
foreach ($record as $cell) {
echo \html_writer::tag('td', $cell);