mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-56046 dataformat: changes to docs, upgrade.txt and error message
This commit is contained in:
parent
7ad2822269
commit
e0ee37e426
@ -41,7 +41,7 @@ class writer extends \core\dataformat\base {
|
||||
/** @var $extension */
|
||||
public $extension = ".json";
|
||||
|
||||
/** @var $hasstarted */
|
||||
/** @var $sheetstarted */
|
||||
public $sheetstarted = false;
|
||||
|
||||
/** @var $sheetdatadded */
|
||||
|
@ -4,9 +4,9 @@ information provided here is intended especially for developers.
|
||||
=== 3.4 ===
|
||||
|
||||
* In order to allow multiple sheets in an exported file the functions write_header() and write_footer() have
|
||||
been removed from core dataformats plugins and have been replaced.
|
||||
- write_header() has been split into the two functions start_output() and start_sheet().
|
||||
- write_footer() has been split into the two functions close_output() and close_sheet().
|
||||
been removed from core dataformat plugins and have been replaced.
|
||||
- write_header() has been replaced with the two functions start_output() and start_sheet().
|
||||
- write_footer() has been replaced with the two functions close_output() and close_sheet().
|
||||
For backwards compatibility write_header() and write_footer() will continue to work but if used will
|
||||
trigger the function error_log().
|
||||
|
||||
|
@ -58,7 +58,7 @@ function download_as_dataformat($filename, $dataformat, $columns, $iterator, $ca
|
||||
$format->send_http_headers();
|
||||
// This exists to support all dataformats - see MDL-56046.
|
||||
if (method_exists($format, 'write_header')) {
|
||||
error_log('The function write_header() does not support multiple tables. In order to support multiple tables you ' .
|
||||
error_log('The function write_header() does not support multiple sheets. In order to support multiple sheets you ' .
|
||||
'must implement start_output() and start_sheet() and remove write_header() in your dataformat.');
|
||||
$format->write_header($columns);
|
||||
} else {
|
||||
@ -77,7 +77,7 @@ function download_as_dataformat($filename, $dataformat, $columns, $iterator, $ca
|
||||
}
|
||||
// This exists to support all dataformats - see MDL-56046.
|
||||
if (method_exists($format, 'write_footer')) {
|
||||
error_log('The function write_footer() does not support multiple tables. In order to support multiple tables you ' .
|
||||
error_log('The function write_footer() does not support multiple sheets. In order to support multiple sheets you ' .
|
||||
'must implement close_sheet() and close_output() and remove write_footer() in your dataformat.');
|
||||
$format->write_footer($columns);
|
||||
} else {
|
||||
|
@ -1774,7 +1774,7 @@ class table_dataformat_export_format extends table_default_export_format_parent
|
||||
public function output_headers($headers) {
|
||||
$this->columns = $headers;
|
||||
if (method_exists($this->dataformat, 'write_header')) {
|
||||
error_log('The function write_header() does not support multiple tables. In order to support multiple tables you ' .
|
||||
error_log('The function write_header() does not support multiple sheets. In order to support multiple sheets you ' .
|
||||
'must implement start_output() and start_sheet() and remove write_header() in your dataformat.');
|
||||
$this->dataformat->write_header($headers);
|
||||
} else {
|
||||
@ -1797,7 +1797,7 @@ class table_dataformat_export_format extends table_default_export_format_parent
|
||||
*/
|
||||
public function finish_table() {
|
||||
if (method_exists($this->dataformat, 'write_footer')) {
|
||||
error_log('The function write_footer() does not support multiple tables. In order to support multiple tables you ' .
|
||||
error_log('The function write_footer() does not support multiple sheets. In order to support multiple sheets you ' .
|
||||
'must implement close_sheet() and close_output() and remove write_footer() in your dataformat.');
|
||||
$this->dataformat->write_footer($this->columns);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user