Commit bf535c52 authored by Andrew Nicols's avatar Andrew Nicols
Browse files

MDL-69549 mod_page: Content export implementation

parent 1e6f8165
// This file is part of Moodle -
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <>.
* Content export definition.
* @package mod_page
* @copyright 2020 Andrew Nicols <>
* @license GNU GPL v3 or later
namespace mod_page\content;
use core\content\export\exportable_items\exportable_textarea;
use core\content\export\exporters\abstract_mod_exporter;
* A class which assists a component to export content.
* @copyright 2020 Andrew Nicols <>
* @license GNU GPL v3 or later
class exporter extends abstract_mod_exporter {
* Get the exportable items for mod_page.
* @param bool $includeuserdata Whether to include user data, in addition to shared content.
* @return \core\content\export\exportable_item[]
public function get_exportables(bool $includeuserdata = false): array {
$contentitems = [];
$contentitems[] = new exportable_textarea(
get_string('content', 'mod_page'),
// Content is in the 'content' field of the 'page' table.
// The record ID in the database is the CMID.
// The mod_page content has files in 'content/0', and the itemid (0) is present in the URL.
return $contentitems;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment