Moodle form: How can I call the browse file option in editor

Moodle form: How can I call the browse file option in editor

by Raymond Mlambo -
Number of replies: 2

Hello,

Please see screenshot below. How can I add the file browsing option in my editor?

I've made sure that my plugin has the course context and I have instantiated the form very well. But I need the ability to add files through the editor. See my code below:


$mform->addElement('editor', 'intro', get_string('intro', 'block_archivedata'), array(
            'subdirs' => 0,
            'maxbytes' => 0,
            'maxfiles' => 0,
            'height' => 500, // height of the popup window
            'width' => 150,
            'changeformat' => 0,
            'context' => null,
            'noclean' => 0,
            'trusttext' => 0,
            'enable_filemanagement' => true)); // Add elements to your form
        $mform->setType('intro', PARAM_RAW);
        $mform->addRule('intro', null, 'required', null, 'client');



Average of ratings: -
In reply to Raymond Mlambo

Re: Moodle form: How can I call the browse file option in editor

by Ambrish Tiwari -

Hi Raymond

You can customize the atto, Goto  Administration > Site administration > Plugins > Text editors > Atto HTML editor > Atto toolbar settings. I think this is link more help to you.

https://docs.moodle.org/27/en/Text_editor



In reply to Ambrish Tiwari

Re: Moodle form: How can I call the browse file option in editor

by Raymond Mlambo -

Hello Ambrish,

The settings specified on that page are already on my site for Atto. At the moment, if I call the editor in a form in a plugin, say in a module context when creating a new instance, it works and a user can upload a file perfectly.

But if I call it from a form on a page somewhere else, with a course context on the page, it doesnt work.