MDL-67814 core_h5p: modifications to interact with the Hub selector

The HUB selector allows you to install/update H5P content types from
the H5P editor. We have moved these features to the Content Bank, so we
will not show the HUB selector in the H5P editor.
This commit is contained in:
Víctor Déniz Falcón 2020-04-12 10:59:48 +01:00 committed by Adrian Greeve
parent a0ce8f87b3
commit 8c325d3feb
3 changed files with 18 additions and 1 deletions

View File

@ -1265,6 +1265,10 @@ class framework implements \H5PFrameworkInterface {
* Get stored setting.
* Implements getOption.
*
* To avoid updating the cache libraries when using the Hub selector,
* {@link \H5PEditorAjax::isContentTypeCacheUpdated}, the setting content_type_cache_updated_at
* always return the current time.
*
* @param string $name Identifier for the setting
* @param string $default Optional default value if settings is not set
* @return mixed Return Whatever has been stored as the setting
@ -1277,6 +1281,11 @@ class framework implements \H5PFrameworkInterface {
return \H5PDisplayOptionBehaviour::CONTROLLED_BY_AUTHOR_DEFAULT_OFF;
}
// To avoid update the libraries cache using the Hub selector.
if ($name == 'content_type_cache_updated_at') {
return time();
}
$value = get_config('core_h5p', $name);
if ($value === false) {
return $default;

View File

@ -6,6 +6,8 @@ Downloaded last release from: https://github.com/h5p/h5p-editor-php-library/rele
Import procedure:
- Copy all the files from the folder repository in this directory.
- In the method ns.LibrarySelector.prototype.appendTo (scripts/h5peditor-library-selector.js),
comment the line "this.$selector.appendTo($element);" to avoid the display of the Hub Selector.
Removed:
* composer.json

View File

@ -129,7 +129,13 @@ ns.LibrarySelector.prototype.appendTo = function ($element) {
var self = this;
this.$parent = $element;
this.$selector.appendTo($element);
/*
Start Moodle change
This line is commented out to prevent display of the hub selector in Moodle.
For more information see MDL-67814
*/
//this.$selector.appendTo($element);
/* End Moodle change */
this.$tutorialUrl.appendTo($element);
this.$exampleUrl.appendTo($element);