I'm looking to change the default folder that files get uploaded into, when using TinyMCE's editor using a DataExtension. No success so far, so looking for help!
The HtmnlEditorField's MediaForm method sets the default upload folder on line 433 (3.0.5):
$computerUploadField->setFolderName(Upload::$uploads_folder);
Also it allows people to extend the method:
// Allow other people to extend the fields being added to the imageform
$this->extend('updateMediaForm', $form);
so I've created a dataextension but have no luck getting any classes added (unobtrusive way to ensure my extension is loading correctly.
// mysite/code/framework/HtmlEditorFieldExtension.php:
class HtmlEditorFieldExtension extends DataExtension {
public function updateMediaForm(Form $form) {
$computerUploadField = $form->Fields()->fieldByName(_t('HtmlEditorField.FROMCOMPUTER','From your computer'));
$computerUploadField->addExtraClass('TEST');
}
}
// config.php:
Object::add_extension('Page', 'HtmlEditorFieldExtension');
Any ideas?