File Manager Element of File API not displaying

File Manager Element of File API not displaying

by Edmund Evangelista -
Number of replies: 0

Can somebody help me figure out why my File Manager element does not appear properly? The codes in my form are shown below.

Fine Manager Not Displaying

<?php

require_once("$CFG->libdir/formslib.php");

class code_syllabus_form extends moodleform {

    public function definition() {

        $mform =& $this->_form;

        $mform->addElement('header', 'Select file to attach', 'Select file to attach','UPLOAD');

        $entry = array();

        $attributes=array();

        $maxbytes=0;

        $filemanager_options = array();

        // 3 == FILE_EXTERNAL & FILE_INTERNAL

        // These two constant names are defined in repository/lib.php

        $filemanager_options['return_types'] = 3;

        $filemanager_options['accepted_types'] = '*';

        $filemanager_options['maxbytes'] = 0;

        $filemanager_options['maxfiles'] = -1;

        $filemanager_options['mainfile'] = true;

        $mform->addElement('filemanager', 'files', get_string('selectfiles'), null, $filemanager_options);

// buttons

        $this->add_action_buttons();

    }

}

?>

Average of ratings: -