EasyUpload Plugin for FCKeditor

Introduction

This is a plugin that allows an alternative easy way to add files and images in FCKeditor. It provides three buttons to make it easy for new users to upload pictures or files as well as creating external links.

The dialogs are based on the default Image and Link dialogs, but everything that wasn't extrictly neccesary has been removed so the users are able to work without any previous knowledge.

Author:

Alfonso Martínez de Lizarrondo

Sponsored by:

Edu 2.0

PrimarySite

Version history:

  1. 0.1: 04-August-2006. First version.
  2. 0.2: 19-April-2008. Updated for FCKeditor 2.6.
  3. 0.3: 26-September-2008. Allow to use an external image and browse the server. The assignment of HTML attributes has been removed and instead a dropdown with the available classes for <img> is shown.

Get the latest version and/or updated info

Installation

1. Copying the files

Extract the contents of the zip in you plugins directory, so it ends up like this
Screenshot of installation

editor\
	...
	js\
	lang\
	plugins\
		...
		easyupload\
			fckblank.html
			...
			fckplugin.js
			readme.html
			docs\
			fck_image\
			lang\
		...
	skins\

2. Adding it to FCKeditor

Now add in your fckconfig.js or custom js configuration file the following line: FCKConfig.Plugins.Add( 'easyUpload', 'en' ) ;

3. Adding it to the toolbarset

Add the buttons 'easyImage','easyFile','easyLink' (case sensitive) to your toolbarset: FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink', '-','easyImage','easyFile','easyLink','-','About']
] ;

For the Image and Link buttons it uses the default pictures according to your FCKeditor theme, and the File uses a typical paperclip picture.

If you add the new buttons you might want to remove the default Image and Link options and replace with these ones.

4. Configure the uploads

Then you need to specify the language that you'll use to process the uploaded files: var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py

And if you find it neccesary adjust the path to the upload script or the extensions that will be processed at the client side to allow or reject the file before it is uploaded. FCKConfig.LinkUpload = true ; FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension ; FCKConfig.LinkUploadAllowedExtensions = ".(7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip)$" ; // empty for all FCKConfig.LinkUploadDeniedExtensions = "" ; // empty for no one FCKConfig.ImageUpload = true ; FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Image' ; FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ; // empty for all FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one

Finally:
You must enable the uploader script under filemanager/upload/ YOUR LANGUAGE and check there that the allowed and denied extensions match your needs. You can also adjust in that script the place were the files will be saved, by default all the files are saved at the root of the user files directory, there's no distinction according to the type (Image, File), but you can change it in that config file.

5. Context menu

The plugin provides the context menu entries for link and image elements, so you might also remove those ones from you configuration: FCKConfig.ContextMenu = ['Generic','Anchor','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ;

6. Use it

Now empty the cache of your browser and reload the editor, the new buttons should be ready.

Final notes

If you find this plugin useful, consider making a donation so it can be further improved, any amount can help to keep the development running.

If you need some special feature for this plugin, or if you need any other kind of plugin for FCKeditor then contact me and we can discuss it

Disclaimers

FCKeditor is © FredCK.com