Hello,
I want to create a moodle theme with a setting with "admin_setting_confightmleditor". But when I render settings page of that theme, I can't upload images in the html editor. I can add only an image URL.
Any solution?
Thank you so much!
Asked and Answered
Hi,
Finally I used this solution: http://icsbcn.blogspot.com.es/2015/03/use-image-repository-in-theme-settings.html
Best regards,
Iban Cardona.
Hi Iban Cardona,
Interesting solution. There is something in the back of my mind (after having had a previous issue with the Grid format) that draft files expire after a certain time - perhaps 60 days - so you may find that they disappear unexpectedly in the future. I'm not that familiar with the File API, but perhaps that is something to double check.
Cheers,
Gareth
I use the main menu block on the front page. Upload the images that I want to use - then I have the link. Then I just delete the block which orphans it and am able to use the images.
Hi Gareth,
I didn't know that draft files disappeared after 60 days... But in my solution I try to move files from draft to another location:
$newfile = $fs->create_file_from_storedfile($file_record, $file);
I hope this is enough to prevent files disappear... What do you think?
Best regards,
Iban Cardona.