LFO - A plugin for FCKeditor

Overview

The LFO plugin allows for opening and saving files right off of the web server that FCKeditor is running on.

It should be noted that the LFO plugin uses a custom file browser called the LFO browser. It cannot be used with any other browser. Additionally, the browser is only written in PHP so it can only be used on systems that have PHP. The plugin and browser have only been tested on Slackware Linux with Apache.

File Structure Differences

The LFO browser is a modified version of the default browser that comes with FCKeditor. However, the file structure browser uses is quite different. This plugin as designed to allow for a loose structure that can accomodate file editing for many different projects. Simply put, all file browsing starts at a top level that you specify and users can put whatever they want wherever they want. Of course, there are restrictions on file types that you can configure.

Installation and Configuration

Warning - Please understand security issues that can arise from allowing write access to your server before continuing! I designed this plugin for internal intranet use so security was not a huge concern. If you see any blatant security issues, please let me know!

  1. Unzip the archive into the root of your editor directory. This should create the plugin files and the browser files into the correct location.
  2. Open your editor configuration file and follow the next two steps.

  3. Configure the editor to see the plugin by adding the following line:

    FCKConfig.Plugins.Add( 'LFO','en') ;

  4. Add the menu items for opening and saving:

    FCKConfig.ToolbarSets["default"] = [
    ['Source','DocProps','-',
    'LFOGetFile','LFOSaveFileAs','Preview','-','Templates'],

  5. Optional - Remove the 'Save' menu item that comes in the default configuration since the icons are similar. Cut out the part in blue.

    FCKConfig.ToolbarSets["Default"] = [
    ['Source','DocProps','-',
    'Save','NewPage','Preview','-','Templates'],

  6. Make the LFO browser the active one by changing the associated lines:

    FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/LFO/browser.html?Connector=connectors/php/connector.php' ;

    FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/LFO/browser.html?Type=Image&Connector=connectors/php/connector.php' ;


  7. Open the file /editor/filemanager/browser/LFO/connectors/php/config.php and configure the following items:

    $Config['Enabled'] = true ; This turns on the browser.
    $Config['UserFilesPath'] = '/files/' ; This is where you set the path to your user file store relative to the editor base directory.
    $Config['UserFilesAbsolutePath'] = '/home/htdocs/editor/files/' ; This is the absolute path. You should set it to match your server.

    The following settings are very important. The lines below are what you configure to allow and disallow the writing of certain files to the server. In this default configuration, only htm and html files are allowed. The browser can only deal with ASCII files. Do not allow it to attempt to open binary files!

    $Config['AllowedExtensions']['File'] = array('htm','html') ;

    $Config['DeniedExtensions']['File'] = array('php','php3','php5','phtml','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg','cgi','asmx') ;


    The rest of the file type settings operate exactly like the default browser. Check the original docs.

  8. Make sure that your user file store is configured for read/write and you should be done with config. Now, you can upload all the browser and plugin files. If everything goes ok, you should see the icons for opening getfile and saving savefile files.

Questions

Questions and ideas go to greggp@pobox.com. I'll try to answer as soon as possible.