Merge branch 'MDL-48010_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE
This commit is contained in:
@@ -19,11 +19,11 @@ require_once '../../../config.php';
|
||||
require_once 'lib.php';
|
||||
require_once $CFG->libdir.'/filelib.php';
|
||||
|
||||
$url = required_param('url', PARAM_URL); // only real urls here
|
||||
$gradesurl = required_param('url', PARAM_URL); // only real urls here
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$feedback = optional_param('feedback', 0, PARAM_BOOL);
|
||||
|
||||
$url = new moodle_url('/grade/import/xml/import.php', array('id'=>$id,'url'=>$url));
|
||||
$url = new moodle_url('/grade/import/xml/import.php', array('id' => $id,'url' => $gradesurl));
|
||||
if ($feedback !== 0) {
|
||||
$url->param('feedback', $feedback);
|
||||
}
|
||||
@@ -46,9 +46,10 @@ require_capability('gradeimport/xml:view', $context);
|
||||
core_php_time_limit::raise();
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
|
||||
$text = download_file_content($url);
|
||||
$text = download_file_content($gradesurl);
|
||||
if ($text === false) {
|
||||
print_error('cannotreadfile');
|
||||
print_error('cannotreadfile', 'error',
|
||||
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $gradesurl);
|
||||
}
|
||||
|
||||
$error = '';
|
||||
@@ -75,7 +76,6 @@ if ($importcode !== false) {
|
||||
}
|
||||
|
||||
} else {
|
||||
print_error('error', 'gradeimport_xml');
|
||||
print_error('errorduringimport', 'gradeimport_xml',
|
||||
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ $string['errincorrectgradeidnumber'] = 'Error - idnumber \'{$a}\' from the impor
|
||||
$string['errincorrectidnumber'] = 'Error - incorrect idnumber';
|
||||
$string['errincorrectuseridnumber'] = 'Error - idnumber \'{$a}\' from the import file does not match any user.';
|
||||
$string['error'] = 'Errors occur';
|
||||
$string['errorduringimport'] = 'An error occurred when trying to import: {$a}';
|
||||
$string['fileurl'] = 'Remote file URL';
|
||||
$string['pluginname'] = 'XML file';
|
||||
$string['xml:publish'] = 'Publish import grades from XML';
|
||||
|
||||
Reference in New Issue
Block a user