Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Disable "Upload file" in tinymcy image editor


Reply

3 Posts   677 Views

Avatar
martbarr

12 February 2011 at 1:42am Community Member, 46 Posts

Is this possible without hacking the code?

I want to force my users to only upload using "Files and Images" tab until they are a bit more established.

Many thanks
Martin

Avatar
swaiba

12 February 2011 at 1:54am Forum Moderator, 1796 Posts

Alright,

take a look at... http://api.silverstripe.org/trunk/forms/fields-formattedinput/HtmlEditorConfig.html

I use..

HtmlEditorConfig::get('cms')->insertButtonsBefore('formatselect', 'fontselect');


...in my _config.php to *add* something, maybe one of the other functions like "modifyButtons" might help?

Avatar
Invader_Zim

12 February 2011 at 2:48am (Last edited: 12 February 2011 2:49am), Community Member, 141 Posts

Well, i think i've got a rather hacky solution:

1. create a file hideUpload.js in mysite/javascript/ with this code:

(function($) {
$("#Form_EditorToolbarImageForm p.showUploadField").hide();
})(jQuery);

2. add this line to your mysite/_config.php

LeftAndMain::require_javascript('mysite/javascript/hideUpload.js');

This will hide the the image upload thingy from your users.

Cheers,
Christian