Hi,
I am facing trouble to use file handling in mform editor using File API in Moodle forms.
In description_form.php, I have added
$editoroptions = $this->_customdata['editoroptions'];
$mform->addElement('editor', 'textfieldup_editor', get_string("desc_up", "local_myplugin"), null, $editoroptions);
and
in description.php, I have added
$editoroptions = array('trusttext' => true, 'maxfiles' => $maxfiles, 'maxbytes' => $CFG->maxbytes, 'context' =>context_course::instance($courseid),
'subdirs' => file_area_contains_subdirs($context, 'local_myplugin', 'entryup', $entry->id));
after that I have create the object of my description form and process the data like this
if ($my_desc_form = $mform->get_data()) {
if (!empty($my_desc_form->textfieldup_editor)) {
$entry = file_postupdate_standard_editor($my_desc_form, 'textfieldup', $editoroptions, context_course::instance($courseobj->id), 'local_myplugin', 'up', $entry->id);
$up_definition = file_rewrite_pluginfile_urls($date_table_desc_form->textfieldup_editor["text"], 'pluginfile.php', 30, 'local_myplugin', 'up', 3);
}
set_config("desc_up_", $my_desc_form->textfieldup_editor['text'], "local_myplugin");
}
I can not retrieve perfect image url from file_rewrite_pluginfile_urls().
Does any one help me regarding this?
Thanks and Regrads,
Sandipa