This commit is contained in:
Ilya Tregubov 2024-05-06 09:55:08 +08:00
commit dc2f500573

View File

@ -154,7 +154,7 @@ class player {
* Get the encoded URL for embeding this H5P content.
*
* @param string $url Local URL of the H5P file to display.
* @param stdClass $config Configuration for H5P buttons.
* @param \stdClass $config Configuration for H5P buttons.
* @param bool $preventredirect Set to true in scripts that can not redirect (CLI, RSS feeds, etc.), throws exceptions
* @param string $component optional moodle component to sent xAPI tracking
* @param bool $displayedit Whether the edit button should be displayed below the H5P content.
@ -163,7 +163,8 @@ class player {
* @return string The embedable code to display a H5P file.
*/
public static function display(
string $url, \stdClass $config,
string $url,
\stdClass $config,
bool $preventredirect = true,
string $component = '',
bool $displayedit = false,
@ -193,7 +194,7 @@ class player {
if ($originalfile) {
// Check if the user can edit this content.
if (api::can_edit_content($originalfile)) {
$template->editurl = $CFG->wwwroot . '/h5p/edit.php?url=' . $url;
$template->editurl = (new \moodle_url('/h5p/edit.php', ['url' => $url]))->out(false);
}
}
}