MDL-71981 dataformat: indicate HTML support in writer callback.
This commit is contained in:
committed by
Adrian Greeve
parent
1d8512bc0e
commit
80e2f8473e
@@ -59,7 +59,8 @@ class dataformat {
|
||||
* @param string $dataformat
|
||||
* @param array $columns
|
||||
* @param Iterable $iterator
|
||||
* @param callable|null $callback
|
||||
* @param callable|null $callback Optional callback method to apply to each record prior to writing, which accepts two
|
||||
* parameters as such: function($record, bool $supportshtml) returning formatted record
|
||||
* @throws coding_exception
|
||||
*/
|
||||
public static function download_data(string $filename, string $dataformat, array $columns, Iterable $iterator,
|
||||
@@ -89,7 +90,7 @@ class dataformat {
|
||||
$rownum = 0;
|
||||
foreach ($iterator as $row) {
|
||||
if (is_callable($callback)) {
|
||||
$row = $callback($row);
|
||||
$row = $callback($row, $format->supports_html());
|
||||
}
|
||||
if ($row === null) {
|
||||
continue;
|
||||
@@ -131,7 +132,7 @@ class dataformat {
|
||||
$rownum = 0;
|
||||
foreach ($iterator as $row) {
|
||||
if (is_callable($callback)) {
|
||||
$row = $callback($row);
|
||||
$row = $callback($row, $format->supports_html());
|
||||
}
|
||||
if ($row === null) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user