Removing the Upload tab is really useful if you want to provide your own custom way of uploading images (I’ll show how to do this in FCKEditor another time) and prevent the built-in way of uploading images from displaying.
Removing the “Browse Server” button probably isn’t so useful because you can easily enough override the way to browse it with your own custom dialog, but I’ve included it because it’s part of the same dialog. I’ll look at how to provide your own custom dialog in a future post as well.
The first screenshot below shows the Image Properties dialog with the Upload tab and Browse Server buttons highlighted with red boxes. Those are what we are going to remove.
Add the following lines to your FCKEditor configuration file to get rid of them. ImageBrowser configures the Browse Server button and ImageUpload the Upload tab.
FCKConfig.ImageBrowser = false; FCKConfig.ImageUpload = false;
This can either be done by modifying the FCKEditor’s fckconfig.js file or in a custom configuration file. A custom config file is a better option and is covered in my FCKEditor: Using a custom configuration file post.
You may need to clear the browser’s cache for the new settings to take effect. Once you’ve reloaded etc the button and tab will be gone as shown in the resulting screenshot below:
The three paste icons in FCKEditor look like so, the first one being a regular paste, the second paste as plain text and the third paste from Word:
The paste from Word one doesn’t actually remove a lot of the formatting HTM rubbish so it’s almost always better to use the paste as plain text function and then re-format it to get rid of the bloated HTML.
You can make FCKEditor always paste as plain text globally by adding the following line to the fckconfig.js file (or your own custom configuration file):
FCKConfig.ForcePasteAsPlainText = true;
or to a specific editor by doing it in code, as in the following PHP example:
$oFCKeditor = new FCKeditor('editornamehere'); ... $oFCKeditor->Config["ForcePasteAsPlainText"] = true; ... $oFCKeditor->Create();
This works beautifully in Internet Explorer which simply pastes the clipboard contents into the editor after removing all the formatting. The Firefox “gotcha” is that it opens up the regular “paste as plain text” window first, you then have to click into the editor, and Ctrl+V paste again.
The regular “paste as plain text” dialog is shown below:
This is a real nusiance and makes it a bit unusable for Firefox. If the people who will be using FCKEditor will be using Firefox at all it’s probably best to not enable this automatic paste as plain text functionality and just get people to use the paste as plain text button when they need to do this until the FCKEditor developers have fixed this issue. I haven’t tried this out in Safari or Opera so don’t know if it has the same problem in those browsers.