Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
H5P content bank manager class. More...
Public Member Functions | |
can_access () | |
Returns user has access capability for the main content bank and the content itself (base on is_access_allowed from plugin). | |
can_copy (content $content) | |
Returns whether or not the user has permission to copy the content. | |
can_delete (content $content) | |
Check if the user can delete this content. | |
can_download (content $content) | |
Returns whether or not the user has permission to download the content. | |
can_edit (?content $content=null) | |
Returns whether or not the user has permission to use the editor. | |
can_manage (content $content) | |
Check if the user can managed this content. | |
can_upload () | |
Returns the user has permission to upload new content. | |
create_content (\stdClass $record=null) | |
Fills content_bank table with appropiate information. | |
delete_content (\core_contentbank\content $content) | |
Delete this content from the content_bank and remove all the H5P related information. | |
delete_content (content $content) | |
Delete this content from the content_bank. | |
get_contenttype_name () | |
Returns the contenttype name of this content. | |
get_contenttype_types () | |
Returns the list of different H5P content types the user can create. | |
get_download_url (content $content) | |
Returns the URL to download the content. | |
get_icon (\core_contentbank\content $content) | |
Returns the HTML code to render the icon for H5P content types. | |
get_icon (content $content) | |
Returns the HTML code to render the icon for content bank contents. | |
get_manageable_extensions () | |
Return an array of extensions this contenttype could manage. | |
get_plugin_name () | |
Returns the plugin name of the current instance. | |
get_view_content (\core_contentbank\content $content) | |
Returns the HTML content to add to view.php visualizer. | |
get_view_content (content $content) | |
Returns the HTML content to add to view.php visualizer. | |
get_view_url (content $content) | |
Returns the URL where the content will be visualized. | |
is_feature_supported (string $feature) | |
Returns the plugin supports the feature. | |
move_content (content $content, context $context) | |
Move content to another context. | |
rename_content (content $content, string $name) | |
Rename this content from the content_bank. | |
replace_content (stored_file $file, content $content) | |
Replace a content using an uploaded file. | |
upload_content (stored_file $file, stdClass $record=null) | |
Create a new content from an uploaded file. | |
Public Attributes | |
string const | CAN_COPY = 'copy' |
Constant representing whether the plugin implements copy feature. | |
string const | CAN_DOWNLOAD = 'download' |
Constant representing whether the plugin implements download feature. | |
string const | CAN_EDIT = 'edit' |
Constant representing whether the plugin implements edition feature. | |
string const | CAN_UPLOAD = 'upload' |
Constant representing whether the plugin implements uploading feature. | |
Protected Member Functions | |
get_implemented_features () | |
Return an array of implemented features by this plugin. | |
is_access_allowed () | |
Returns user has access capability for the content itself. | |
is_copy_allowed (content $content) | |
Returns plugin allows copying. | |
is_delete_allowed (content $content) | |
Returns if content allows deleting. | |
is_download_allowed (content $content) | |
Returns plugin allows downloading. | |
is_edit_allowed (?content $content) | |
Returns plugin allows edition. | |
is_manage_allowed (content $content) | |
Returns if content allows managing. | |
is_upload_allowed () | |
Returns plugin allows uploading. | |
Protected Attributes | |
context | $context = null |
This contenttype's context. | |
H5P content bank manager class.
|
finalinherited |
Returns user has access capability for the main content bank and the content itself (base on is_access_allowed from plugin).
bool | True if content could be accessed. False otherwise. |
|
finalinherited |
Returns whether or not the user has permission to copy the content.
content | $content | The content to be copied. |
bool | True if the user can copy the content. False otherwise. |
|
finalinherited |
Check if the user can delete this content.
content | $content | The content to be deleted. |
bool | True if content could be uploaded. False otherwise. |
|
finalinherited |
Returns whether or not the user has permission to download the content.
content | $content | The content to be downloaded. |
bool | True if the user can download the content. False otherwise. |
|
finalinherited |
Returns whether or not the user has permission to use the editor.
This function will be called with the content to be edited as parameter, or null when is checking permission to create a new content using the editor.
content | $content | The content to be edited or null when creating a new content. |
bool | True if the user can edit content. False otherwise. |
|
finalinherited |
Check if the user can managed this content.
content | $content | The content to be managed. |
bool | True if content could be managed. False otherwise. |
|
finalinherited |
Returns the user has permission to upload new content.
bool | True if content could be uploaded. False otherwise. |
|
inherited |
Fills content_bank table with appropiate information.
dml_exception | A DML specific exception is thrown for any creation error. |
stdClass | $record | An optional content record compatible object (default null) |
content | Object with content bank information. |
contenttype_h5p\contenttype::delete_content | ( | \core_contentbank\content | $content | ) |
Delete this content from the content_bank and remove all the H5P related information.
content | $content | The content to delete. |
boolean | true if the content has been deleted; false otherwise. |
|
inherited |
Delete this content from the content_bank.
This method can be overwritten by the plugins if they need to delete specific information.
content | $content | The content to delete. |
boolean | true if the content has been deleted; false otherwise. |
|
inherited |
Returns the contenttype name of this content.
string | Content type of the current instance |
contenttype_h5p\contenttype::get_contenttype_types | ( | ) |
Returns the list of different H5P content types the user can create.
array | An object for each H5P content type:
|
Reimplemented from core_contentbank\contenttype.
|
inherited |
Returns the URL to download the content.
content | $content | The content to be downloaded. |
string | URL with the content to download. |
contenttype_h5p\contenttype::get_icon | ( | \core_contentbank\content | $content | ) |
Returns the HTML code to render the icon for H5P content types.
content | $content | The content to be displayed. |
string | HTML code to render the icon |
|
inherited |
Returns the HTML code to render the icon for content bank contents.
content | $content | The content to be displayed. |
string | HTML code to render the icon |
|
protected |
Return an array of implemented features by this plugin.
array |
Reimplemented from core_contentbank\contenttype.
contenttype_h5p\contenttype::get_manageable_extensions | ( | ) |
Return an array of extensions this contenttype could manage.
array |
Reimplemented from core_contentbank\contenttype.
|
inherited |
Returns the plugin name of the current instance.
string | Plugin name of the current instance |
contenttype_h5p\contenttype::get_view_content | ( | \core_contentbank\content | $content | ) |
Returns the HTML content to add to view.php visualizer.
content | $content | The content to be displayed. |
string | HTML code to include in view.php. |
|
inherited |
Returns the HTML content to add to view.php visualizer.
content | $content | The content to be displayed. |
string | HTML code to include in view.php. |
|
inherited |
Returns the URL where the content will be visualized.
content | $content | The content to be displayed. |
string | URL where to visualize the given content. |
|
protected |
Returns user has access capability for the content itself.
bool | True if content could be accessed. False otherwise. |
Reimplemented from core_contentbank\contenttype.
|
protectedinherited |
Returns plugin allows copying.
content | $content | The content to be copied. |
bool | True if plugin allows copying. False otherwise. |
|
protectedinherited |
Returns if content allows deleting.
content | $content | The content to be deleted. |
bool | True if content allows uploading. False otherwise. |
|
protectedinherited |
Returns plugin allows downloading.
content | $content | The content to be downloaed. |
bool | True if plugin allows downloading. False otherwise. |
|
protectedinherited |
Returns plugin allows edition.
content | $content | The content to be edited. |
bool | True if plugin allows edition. False otherwise. |
|
finalinherited |
Returns the plugin supports the feature.
string | $feature | Feature code e.g CAN_UPLOAD |
bool | True if content could be uploaded. False otherwise. |
|
protectedinherited |
Returns if content allows managing.
content | $content | The content to be managed. |
bool | True if content allows uploading. False otherwise. |
|
protectedinherited |
Returns plugin allows uploading.
bool | True if plugin allows uploading. False otherwise. |
|
inherited |
Move content to another context.
This method can be overwritten by the plugins if they need to change some other specific information.
content | $content | The content to rename. |
context | $context | The new context. |
boolean | true if the content has been renamed; false otherwise. |
|
inherited |
Rename this content from the content_bank.
This method can be overwritten by the plugins if they need to change some other specific information.
content | $content | The content to rename. |
string | $name | The name of the content. |
boolean | true if the content has been renamed; false otherwise. |
|
inherited |
Replace a content using an uploaded file.
file_exception | If file operations fail |
dml_exception | if the content creation fails |
stored_file | $file | the uploaded file |
content | $content | the original content record |
content | Object with the updated content bank information. |
|
inherited |
Create a new content from an uploaded file.
file_exception | If file operations fail |
dml_exception | if the content creation fails |
stored_file | $file | the uploaded file |
stdClass | null | $record | an optional content record |
content | Object with content bank information. |
|
inherited |
Constant representing whether the plugin implements copy feature.
|
inherited |
Constant representing whether the plugin implements download feature.