mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'MDL-50269_master' of git://github.com/markn86/moodle
Conflicts: lib/upgrade.txt
This commit is contained in:
commit
200ab5266a
6 changed files with 24 additions and 16 deletions
|
@ -144,7 +144,7 @@ class cc2moodle {
|
|||
|
||||
public function generate_moodle_xml () {
|
||||
|
||||
global $CFG;
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
$cdir = static::$path_to_manifest_folder . DIRECTORY_SEPARATOR . 'course_files';
|
||||
|
||||
|
@ -213,7 +213,7 @@ class cc2moodle {
|
|||
|
||||
} else {
|
||||
$status = false;
|
||||
notify('The course is empty');
|
||||
echo $OUTPUT->notification('The course is empty');
|
||||
static::log_action('The course is empty', false);
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ class entities {
|
|||
}
|
||||
|
||||
public function move_files($files, $destination_folder) {
|
||||
global $CFG;
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
if (!empty($files)) {
|
||||
|
||||
|
@ -220,7 +220,7 @@ class entities {
|
|||
}
|
||||
|
||||
if (!$copy_success) {
|
||||
notify('WARNING: Cannot copy the file ' . $source . ' to ' . $destination);
|
||||
echo $OUTPUT->notification('WARNING: Cannot copy the file ' . $source . ' to ' . $destination);
|
||||
cc2moodle::log_action('Cannot copy the file ' . $source . ' to ' . $destination, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ require_once($CFG->dirroot . '/backup/cc/includes/constants.php');
|
|||
require_once($CFG->dirroot . '/backup/cc/cc2moodle.php');
|
||||
|
||||
function cc_convert ($dir) {
|
||||
global $OUTPUT;
|
||||
|
||||
$manifest_file = $dir . DIRECTORY_SEPARATOR . 'imsmanifest.xml';
|
||||
$moodle_file = $dir . DIRECTORY_SEPARATOR . 'moodle.xml';
|
||||
|
@ -39,26 +40,26 @@ function cc_convert ($dir) {
|
|||
$detected_requirements = detect_requirements();
|
||||
|
||||
if (!$detected_requirements["php5"]) {
|
||||
notify(get_string('cc_import_req_php5', 'imscc'));
|
||||
echo $OUTPUT->notification(get_string('cc_import_req_php5', 'imscc'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$detected_requirements["dom"]) {
|
||||
notify(get_string('cc_import_req_dom', 'imscc'));
|
||||
echo $OUTPUT->notification(get_string('cc_import_req_dom', 'imscc'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$detected_requirements["libxml"]) {
|
||||
notify(get_string('cc_import_req_libxml', 'imscc'));
|
||||
echo $OUTPUT->notification(get_string('cc_import_req_libxml', 'imscc'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$detected_requirements["libxmlminversion"]) {
|
||||
notify(get_string('cc_import_req_libxmlminversion', 'imscc'));
|
||||
echo $OUTPUT->notification(get_string('cc_import_req_libxmlminversion', 'imscc'));
|
||||
return false;
|
||||
}
|
||||
if (!$detected_requirements["xsl"]) {
|
||||
notify(get_string('cc_import_req_xsl', 'imscc'));
|
||||
echo $OUTPUT->notification(get_string('cc_import_req_xsl', 'imscc'));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -76,17 +77,17 @@ function cc_convert ($dir) {
|
|||
if (!$cc2moodle->is_auth()) {
|
||||
return $cc2moodle->generate_moodle_xml();
|
||||
} else {
|
||||
notify(get_string('cc2moodle_req_auth', 'imscc'));
|
||||
echo $OUTPUT->notification(get_string('cc2moodle_req_auth', 'imscc'));
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
notify(get_string('cc2moodle_invalid_schema', 'imscc'));
|
||||
echo $OUTPUT->notification(get_string('cc2moodle_invalid_schema', 'imscc'));
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
notify(get_string('cc2moodle_manifest_dont_load', 'imscc'));
|
||||
echo $OUTPUT->notification(get_string('cc2moodle_manifest_dont_load', 'imscc'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue