Merge branch 'MDL-67062-master' of git://github.com/sarjona/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 26 Feb 2020 21:44:47 +0000 (22:44 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 26 Feb 2020 21:44:47 +0000 (22:44 +0100)
1  2 
h5p/classes/framework.php
h5p/libraries.php
h5p/tests/behat/h5p_libraries.feature

Simple merge
@@@ -34,10 -37,33 +37,33 @@@ $url = new \moodle_url("/h5p/libraries.
  
  $PAGE->set_context($context);
  $PAGE->set_url($url);
 -$PAGE->set_title($pagetitle);
  $PAGE->set_pagelayout('admin');
 -$PAGE->set_heading($pagetitle);
 +$PAGE->set_title("$SITE->shortname: " . $pagetitle);
 +$PAGE->set_heading($SITE->fullname);
  
+ $h5pfactory = new \core_h5p\factory();
+ if ($deletelibrary) {
+     $library = \core_h5p\api::get_library($deletelibrary);
+     if ($confirm) {
+         require_sesskey();
+         \core_h5p\api::delete_library($h5pfactory, $library);
+         redirect(new moodle_url('/h5p/libraries.php'));
+     }
+     echo $OUTPUT->header();
+     echo $OUTPUT->heading(get_string('deleting', 'core_h5p'));
+     echo $OUTPUT->confirm(
+         get_string('deletelibraryconfirm', 'core_h5p', [
+             'name' => format_string($library->title),
+             'version' => format_string($library->majorversion . '.' . $library->minorversion . '.' . $library->patchversion),
+         ]),
+         new moodle_url($PAGE->url, ['deletelibrary' => $deletelibrary, 'confirm' => 1]),
+         new moodle_url('/h5p/libraries.php')
+     );
+     echo $OUTPUT->footer();
+     die();
+ }
  echo $OUTPUT->header();
  echo $OUTPUT->heading($pagetitle);
  echo $OUTPUT->box(get_string('librariesmanagerdescription', 'core_h5p'));
Simple merge