$string['err_rangelength'] = 'You must enter between {$a->format[0]} and {$a->format[1]} characters here.';
$string['err_required'] = 'You must supply a value here.';
$string['err_wrongfileextension'] = 'Some files ({$a->wrongfiles}) cannot be uploaded. Only file types {$a->whitelist} are allowed.';
+$string['filesofthesetypes'] = 'Accepted files types:';
$string['filetypesany'] = 'All file types';
$string['filetypesnotall'] = 'It is not allowed to select \'All file types\' here';
$string['filetypesnotwhitelisted'] = 'These file types are not allowed here: {$a}';
// label element needs 'for' attribute work
$html .= html_writer::empty_tag('input', array('value' => '', 'id' => 'id_'.$elname, 'type' => 'hidden'));
+ if (!empty($options->accepted_types) && $options->accepted_types != '*') {
+ $html .= html_writer::tag('p', get_string('filesofthesetypes', 'form'));
+ $util = new \core_form\filetypes_util();
+ $filetypes = $options->accepted_types;
+ $filetypedescriptions = $util->describe_file_types($filetypes);
+ $html .= $OUTPUT->render_from_template('core_form/filetypes-descriptions', $filetypedescriptions);
+ }
+
return $html;
}
$string['enabled_help'] = 'If enabled, students are able to upload one or more files as their submission.';
$string['eventassessableuploaded'] = 'A file has been uploaded.';
$string['file'] = 'File submissions';
-$string['filesofthesetypes'] = 'Files of these types may be added to the submission:';
$string['maxbytes'] = 'Maximum file size';
$string['maxfiles'] = 'Maximum files per submission';
$string['maxfiles_help'] = 'If file submissions are enabled, each assignment can be set to accept up to this number of files for their submission.';
$string['siteuploadlimit'] = 'Site upload limit';
$string['submissionfilearea'] = 'Uploaded submission files';
// Deprecated since Moodle 3.4.
+$string['filesofthesetypes'] = 'Files of these types may be added to the submission:';
$string['filetypewithexts'] = '{$a->name} — {$a->extlist}';
$string['nonexistentfiletypes'] = 'The following file types were not recognised: {$a}';
+filesofthesetypes,assignsubmission_file
filetypewithexts,assignsubmission_file
nonexistentfiletypes,assignsubmission_file
$submissionid);
$mform->addElement('filemanager', 'files_filemanager', $this->get_name(), null, $fileoptions);
- if (!empty($this->get_config('filetypeslist'))) {
- $text = html_writer::tag('p', get_string('filesofthesetypes', 'assignsubmission_file'));
- $util = new \core_form\filetypes_util();
- $filetypes = $this->get_configured_typesets();
- $filetypedescriptions = $util->describe_file_types($filetypes);
- $text .= $OUTPUT->render_from_template('core_form/filetypes-descriptions', $filetypedescriptions);
- $mform->addElement('static', '', '', $text);
- }
-
return true;
}