H5P editor class, for editing local H5P content.
More...
|
| __construct () |
| Inits the H5P editor.
|
|
| add_editor_to_form (MoodleQuickForm $mform) |
| Adds an H5P editor to a form. More...
|
|
| save_content (stdClass $content) |
| Creates or updates an H5P content. More...
|
|
| set_content (int $id) |
| Loads an existing content for edition. More...
|
|
| set_library (string $library, int $contextid, string $component, string $filearea, ?int $itemid=0, string $filepath='/', ?string $filename=null, ?int $userid=null) |
| Sets the content type library and the file area to create a new H5P content. More...
|
|
H5P editor class, for editing local H5P content.
- Copyright
- 2020 Victor Deniz victo.nosp@m.r@mo.nosp@m.odle..nosp@m.com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ add_editor_to_form()
Adds an H5P editor to a form.
- Parameters
-
- Return values
-
◆ save_content()
core_h5p\editor::save_content |
( |
stdClass |
$content | ) |
|
Creates or updates an H5P content.
- Parameters
-
stdClass | $content | Object containing all the necessary data. |
- Return values
-
◆ set_content()
core_h5p\editor::set_content |
( |
int |
$id | ) |
|
Loads an existing content for edition.
If the H5P content or its file can't be retrieved, it is not possible to edit the content.
- Parameters
-
int | $id | Id of the H5P content from the h5p table. |
- Return values
-
◆ set_library()
core_h5p\editor::set_library |
( |
string |
$library, |
|
|
int |
$contextid, |
|
|
string |
$component, |
|
|
string |
$filearea, |
|
|
?int |
$itemid = 0 , |
|
|
string |
$filepath = '/' , |
|
|
?string |
$filename = null , |
|
|
?int |
$userid = null |
|
) |
| |
Sets the content type library and the file area to create a new H5P content.
Note: this method must be used to create new content, to edit an existing H5P content use only set_content with the ID from the H5P table.
- Parameters
-
string | $library | Library of the H5P content type to create. |
int | $contextid | Context where the file of the H5P content will be stored. |
string | $component | Component where the file of the H5P content will be stored. |
string | $filearea | File area where the file of the H5P content will be stored. |
int | $itemid | Item id file of the H5P content. |
string | $filepath | File path where the file of the H5P content will be stored. |
null | string | $filename | H5P content file name. |
null | int | $userid | H5P content file owner userid (default will use $USER->id). |
- Return values
-
The documentation for this class was generated from the following file: