mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-22548, hide main file element completely
This commit is contained in:
parent
1daea7fa49
commit
ac9c14dd29
4 changed files with 23 additions and 13 deletions
|
@ -71,3 +71,4 @@ $string['resourceadministration'] = 'Resource administration';
|
|||
$string['resourcecontent'] = 'Files and subfolders';
|
||||
$string['resource:exportresource'] = 'Export resource';
|
||||
$string['resource:view'] = 'View resource';
|
||||
$string['selectmainfile'] = 'Please select the main file by clicking the icon next to file name.';
|
||||
|
|
|
@ -72,8 +72,7 @@ class mod_resource_mod_form extends moodleform_mod {
|
|||
|
||||
$mform->addElement('filemanager', 'files', get_string('selectfiles'), null, $filemanager_options);
|
||||
|
||||
//TODO: ohlala, it should be hidden when JS file manager loaded, the main file should be somehow highlighted directly in editor
|
||||
$mform->addElement('text', 'mainfile', get_string('areamainfile', 'repository'));
|
||||
$mform->addElement('hidden', 'mainfile', get_string('areamainfile', 'repository'), array('id'=>'id_mainfile'));
|
||||
$mform->setType('mainfile', PARAM_PATH);
|
||||
|
||||
//-------------------------------------------------------
|
||||
|
@ -211,9 +210,8 @@ class mod_resource_mod_form extends moodleform_mod {
|
|||
$filepaths[] = $file->get_filepath().$file->get_filename();
|
||||
}
|
||||
if (!in_array($data['mainfile'], $filepaths)) {
|
||||
$errors['mainfile'] = 'Please type correct main file path'; //TODO: will not be needed, do NOT localize!
|
||||
$errors['files'] = get_string('selectmainfile', 'resource');
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue