MDL-41211 tool_uploadcourse: Passing restore file path to processor

This commit is contained in:
Frederic Massart
2013-08-15 10:42:13 +08:00
parent 50ff861263
commit 8a4b2b944d
2 changed files with 15 additions and 2 deletions
@@ -58,11 +58,12 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
$mform->disabledIf('options[shortnametemplate]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_CREATE_OR_UPDATE);
$mform->disabledIf('options[shortnametemplate]', 'options[mode]', 'eq', tool_uploadcourse_processor::MODE_UPDATE_ONLY);
// Restore file is not in the array options on purpose, because formslib can't handle it!
$contextid = $this->_customdata['contextid'];
$mform->addElement('hidden', 'contextid', $contextid);
$mform->setType('contextid', PARAM_INT);
$mform->addElement('filepicker', 'options[restorefile]', get_string('templatefile', 'tool_uploadcourse'));
$mform->addHelpButton('options[restorefile]', 'templatefile', 'tool_uploadcourse');
$mform->addElement('filepicker', 'restorefile', get_string('templatefile', 'tool_uploadcourse'));
$mform->addHelpButton('restorefile', 'templatefile', 'tool_uploadcourse');
$mform->addElement('text', 'options[templatecourse]', get_string('coursetemplatename', 'tool_uploadcourse'));
$mform->setType('options[templatecourse]', PARAM_TEXT);