Using a textarea WYSIWIG editor

For integrating a WYSIWIGEditor (standard is TinyFCK which combines the best wyswyg editors available) you have to:

Inside Seagull Module

in Mgr Class action

In your class method where you want to use the WYSIWYG editor, you just have to tell Seagull you want to use it.

// enable hmtl wysiwyg editor
$output->wysiwyg = true;

This includes the needed JavaScript to your output.

in Template

All textareas with class="wysiwyg" will be replaced by the editor. This enables you to have multiple editor per page :

<textarea  name="frmBodyName" id="frmBodyName" class="wysiwyg">{event.text}</textarea>

in Mgr Class validation

Wondering why no HTML is passing the validation process? For security reasons Seagull strips all HTML automatically. But there is a way to get around this: use the $allowTags = true attribute in $req->get.

$input->event = (object)$req->get('frmBodyName', $allowTags = true);

Integrate the fileconnector

If you want to upgrade TinyFCK this is how you can integrate it:

You have to tell the php connector where to find the images. So edit the www/tinyfck/filemanager/connectors/php/config.php:

<?php
include '../../../../../lib/SGL/FrontController.php';
SGL_FrontController::init();
session_start();

[...]

global $Config ;

// SECURITY: You must explicitelly enable this "connector". (Set it to "true").
$Config['Enabled'] = true ;

// Path to user files relative to the document root.
$Config['UserFilesPath'] = SGL_BASE_URL . '/images/' ;

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\UserFiles\\' or '/root/mysite/UserFiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = SGL_WEB_ROOT.'/images/';

[...]
?>

Configure TinyFCK

You find the configuration file here: /www/js/SglTinyFckConfig.js. More info about using this file is available at the TinyMCE docs