I’ve created a new plugin which allows
Flash TextArea to be used as a RTE for editing document content.
While TinyMCE is full featured and its can be trimmed down, Flash TextArea has a very clean and simple interface and outputs strict xhtml which allows users to easily and quickly create and edit documents while retaining the styles originally intended by the designer.
FlashTA is a WYSIWYG replacement text area for html forms. While there are various implementations done in javascript, most of them don´t work in this/that browser/os combo, and every time a browser vendor makes a change, they need to update the editor so it doesn´t break on every possible combination of browsers.
FlashTA tries to overcome that problem by using flash. It also tries to adhere stricty to the (x)html specification. No presentation code is generated (so say bye bye to your idea of selecting text color, font face, etc).
FlashTA features an easy integration and multiple browser support (Mozilla, MSIE, FireFox, Opera & Safari).
To install, you will need to
download and extract the support files. The zip file contains the folder ’flashtextarea’ which should be placed in the assets/plugins/ directory.
Next, create a new plugin and copy and paste the code:
Plugin name:
Flash TextArea
Description:
<strong>0.1</strong> - Flash TextArea
//<?php
/**
* Flash TextArea RTE Plugin
* For more information about Flash TextArea, please visit their website: http://osflash.org/flashtextarea
* Plugin written by: Brian Stanback (www.stanback.net)
* Last modified: March 22, 2007
* Version: 0.1
*
* Events: OnRichTextEditorInit, OnRichTextEditorRegister
* Plugin configuration: &height=Editor Height;text;450px &lang=Language;list;en,es;en
*/
// Directory to flash textarea plugin folder relative to modx installation directory
$ftaPath = '/assets/plugins/flashtextarea/';
// Handle event
$e = &$modx->Event;
switch ($e->name)
{
case "OnRichTextEditorRegister": // register only for backend
$e->output("Flash TextArea");
break;
case "OnRichTextEditorInit":
if ($editor == "Flash TextArea")
{
include_once($modx->config['base_path'] . ltrim($ftaPath, '/') . 'fta.functions.php');
$base_url = rtrim($modx->config['base_url'], '/');
$fta_url = $base_url . '/' . trim($ftaPath, '/');
$site_url = $modx->config['site_url'];
if ($modx->isFrontend())
$frontend = true;
else
$frontend = false;
$html = getFtaScript($frontend, $site_url, $base_url, $fta_url, $height, $lang);
$e->output($html);
}
}
Check the following events:
OnRichTextEditorInit,
OnRichTextEditorRegister
Add the following to the plugin configuration:
&height=Editor Height;text;450px &lang=Language;list;en,es;en
Finally, in order to upload images you will need to edit the file within assets/plugins/flashtextarea/deploy/fileManager.php and change:
’diskPath’=>’’
To the system path where your modx media/images folder lives:
’diskPath’=>’/path/to/modx/assets/media/’
A demo of the RTE in action can be seen here:
http://www.extremefx.com.ar/demos/fta/
Thanks to
Zi for originally finding/suggesting it.