]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-16597, support set primary file in resource module, add a parameter to filemanag...
authordongsheng <dongsheng>
Tue, 8 Sep 2009 07:55:22 +0000 (07:55 +0000)
committerdongsheng <dongsheng>
Tue, 8 Sep 2009 07:55:22 +0000 (07:55 +0000)
lang/en_utf8/resource.php
mod/resource/mod_form.php

index 2b45d8ab09f1bb65bf11bb3937b0aa4a5839c013..8ff150510a7182ec6f7578a4748b7b19705511cd 100644 (file)
@@ -162,6 +162,7 @@ $string['resourcetyperepository'] = 'Link to a repository object';
 $string['resourcetypetext'] = 'Compose a text page';
 $string['searchweb'] = 'Search for web page';
 $string['serverurl'] = 'Server URL ($a->wwwroot)';
+$string['setmainfile'] = 'Set main file';
 $string['showcourseblocks'] = 'Show the course blocks';
 $string['skipsubmenus'] = 'Skip sub-menu pages';
 $string['tableofcontents'] = 'Table of contents';
index 2dc370b376d8e5bf9a45528781fad6d4c1064ccf..d7c83d0d31389e9611be83a778d1b5e6d4215da8 100644 (file)
@@ -57,10 +57,10 @@ class mod_resource_mod_form extends moodleform_mod {
         //-------------------------------------------------------
         $mform->addElement('header', 'contentsection', get_string('contentheader', 'resource'));
         $mform->addElement('static', 'note', '', '<i>(TODO: This filemanager + textfield is temporary until we create new file manager with main file support.)</i>');
-        $mform->addElement('filemanager', 'files', get_string('file'));
+        $options = array('mainfile'=>'id_mainfile', 'subdirs'=>0, 'maxbytes'=>0, 'maxfiles'=>-1, 'filetypes'=>'*', 'returnvalue'=>'*');
+        $mform->addElement('filemanager', 'files', get_string('file'), null, $options);
         $mform->addElement('static', 'notex', '', '<i>(TODO: Ignore main file when uploading only one file, if multiple files present use "/myfile.ext" to specify the main file.)</i>');
         $mform->addElement('text', 'mainfile', 'Main file');
-
         //-------------------------------------------------------
         $mform->addElement('header', 'optionssection', get_string('optionsheader', 'resource'));