mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-68285 core_h5p: Fix unused variables and undeclared globals
This commit is contained in:
parent
d939d6e769
commit
c667e6064a
1 changed files with 2 additions and 5 deletions
|
@ -146,7 +146,6 @@ class core extends \H5PCore {
|
||||||
public static function get_scripts(): array {
|
public static function get_scripts(): array {
|
||||||
global $PAGE;
|
global $PAGE;
|
||||||
|
|
||||||
$factory = new factory();
|
|
||||||
$jsrev = $PAGE->requires->get_jsrev();
|
$jsrev = $PAGE->requires->get_jsrev();
|
||||||
$urls = [];
|
$urls = [];
|
||||||
foreach (self::$scripts as $script) {
|
foreach (self::$scripts as $script) {
|
||||||
|
@ -224,10 +223,6 @@ class core extends \H5PCore {
|
||||||
public function fetch_content_type(array $library): ?int {
|
public function fetch_content_type(array $library): ?int {
|
||||||
$factory = new factory();
|
$factory = new factory();
|
||||||
|
|
||||||
// Get a temp path to download the content type.
|
|
||||||
$temppath = make_request_directory();
|
|
||||||
$tempfile = "{$temppath}/" . $library['machineName'] . ".h5p";
|
|
||||||
|
|
||||||
// Download the latest content type from the H5P official repository.
|
// Download the latest content type from the H5P official repository.
|
||||||
$fs = get_file_storage();
|
$fs = get_file_storage();
|
||||||
$file = $fs->create_file_from_url(
|
$file = $fs->create_file_from_url(
|
||||||
|
@ -287,6 +282,8 @@ class core extends \H5PCore {
|
||||||
* - array contentTypes: an object for each H5P content type with its information
|
* - array contentTypes: an object for each H5P content type with its information
|
||||||
*/
|
*/
|
||||||
public function get_latest_content_types(): \stdClass {
|
public function get_latest_content_types(): \stdClass {
|
||||||
|
global $CFG;
|
||||||
|
|
||||||
$siteuuid = $this->get_site_uuid() ?? md5($CFG->wwwroot);
|
$siteuuid = $this->get_site_uuid() ?? md5($CFG->wwwroot);
|
||||||
$postdata = ['uuid' => $siteuuid];
|
$postdata = ['uuid' => $siteuuid];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue