Extension:FCKeditor (by Mafs)/HTML::WikiConverter

Testing Report...

Using HTML::WikiConverter, we can get around some of the problems discussed in FCKeditor, namely, storing HTML in the database instead of wikitext. There might still be problems with this method...

Requirements

 * 1) FCKeditor
 * 2) Perl
 * 3) HTML::WikiConverter
 * 4) The PHP Perl extension - For more info, see . If you are using something like XAMPP, you probably already have the extension and just need to uncomment it in your php.ini file.

Installation

 * 1) Install perl.
 * 2) *If you are using Windows try ActivePerl. It should be pretty straightforward. Double click to install.
 * 3) *If you are using Linux/Unix, there is a good chance you already have perl. If not, you can get ActivePerl for your system or try compiling from source.  Thats about the best I can do.
 * 4) Install WikiConverter from CPAN or whereever. (How would you do this on a windows machine? Wonderfullyrich 16:50, 17 April 2007 (UTC))
 * 5) *If you have the CPAN package manager (you should) run .  If you are behind a proxy or firewall or something you are going to have to get more advanced help, here for exemple.
 * 6) *If you don't have CPAN, you can download the WikiConverter source and compile if yourself. See  for more info.
 * 7) *Alternately, you might be able to install the .pm file (which is in the source package) directly if you can figure out which directory to put it in (maybe C:\Perl\lib\HTML).
 * 8) Install the php perl extension.
 * 9) *For Windows, download the file from and copy it to your php extensions directory.  There is a good chance its already there especially if you are using a package like XAMPP.
 * 10) *Find your php.ini file (for xampp its in xampp/apache/bin) and add an include line to your php.ini file. It should look like extension=php_perl.dll
 * 11) *In case are using ActiveState's ActivePerl, copy the perl##.dll (where ## is the version number) from the perl bin directory to some php reachable directory (apache's main dir, or php's main one should work).
 * 12) Unzip FCKeditor to a directory on your web server.
 * 13) *I use htdocs/fckeditor. Once you have this unzipped, you have to point your editor.BasePath at it.  See below.


 * Hope that helps.

EditPage.php
In EditPage.php->importFormData (line 218 in 1.5.8) add:

Make sure to change PATHTOYOURWIKI to the correct value. This will make internal wiki links work correctly. (Note: I use the relative path /wiki/index.php. Using an absolute path like localhost/wiki/index.php didn't work for me.)

Next, down where the form is added (line ~716 in 1.5.8 after the above text is added) replace:

with:

Note: You have to add in the noeditsection and notoc magic words or the TOC and section links will show up in FCKeditor.

Parser.php
In Parser, you can add a new magic word to prevent automatic anchor creation in rendered text. This will prevent them from showing up in the FCKeditor which you don't want. Add the following around line 2479 (line 3028 for v.1.6.3):

Note: Alternately, the new magic word code can be put in your Language.php and MagicWord.php files where it really belongs. Its included here so that you don't have to modify as many files.

Later around line 2666 (v.1.6.3 line 3228) (after you've added the above code), change:

to:

FCKeditor Code Changes
The FCKeditor standard toolbar set has some features that can't be used in the wiki like forms and flash objects. You will probably also want to add a new toolset to FCKeditor config file, fckconfig.js. Something like:

Unknown toolbar item "UniversalKey" just remove it from the list
 * *Note:* The 'UniversayKey' generated an Error for me

Related links
wclEditor - An implementation that also stores data as wikitext instead of html but also supports run-time switching between wikitext and visual editing without reloading a page. Beta version.