3
* FCKeditor - The text editor for internet
4
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
6
* Licensed under the terms of the GNU Lesser General Public License:
7
* http://www.opensource.org/licenses/lgpl-license.php
9
* For further information visit:
10
* http://www.fckeditor.net/
12
* "Support Open Source software. What about a donation today?"
14
* File Name: fckeditor.lasso
15
* This is the integration file for Lasso.
17
* It defines the FCKeditor class ("custom type" in Lasso terms) that can
18
* be used to create editor instances in Lasso pages on server side.
21
* Jason Huck (jason.huck@corefive.com)
27
-description='Creates an instance of FCKEditor.'
30
'instancename' = 'FCKEditor1',
33
'toolbarset' = 'Default',
34
'initialvalue' = string,
35
'basepath' = '/fckeditor/',
37
'checkbrowser' = true,
38
'displayerrors' = false
43
-required='instancename', -type='string',
44
-optional='width', -type='string',
45
-optional='height', -type='string',
46
-optional='toolbarset', -type='string',
47
-optional='initialvalue', -type='string',
48
-optional='basepath', -type='string',
49
-optional='config', -type='array'
51
self->instancename = #instancename;
52
local_defined('width') ? self->width = #width;
53
local_defined('height') ? self->height = #height;
54
local_defined('toolbarset') ? self->toolbarset = #toolbarset;
55
local_defined('initialvalue') ? self->initialvalue = #initialvalue;
56
local_defined('basepath') ? self->basepath = #basepath;
57
local_defined('config') ? self->config = #config;
61
if(self->isCompatibleBrowser);
64
<input type="hidden" id="' + self->instancename + '" name="' + self->instancename + '" value="' + encode_html(self->initialvalue) + '" style="display:none" />
65
' + self->parseConfig + '
66
<iframe id="' + self->instancename + '___Frame" src="' + self->basepath + 'editor/fckeditor.html?InstanceName=' + self->instancename + '&Toolbar=' + self->toolbarset + '" width="' + self->width + '" height="' + self->height + '" frameborder="no" scrolling="no"></iframe>
72
<textarea name="' + self->instancename + '" rows="4" cols="40" style="width: ' + self->width + '; height: ' + self->height + '">' + encode_html(self->initialvalue) + '</textarea>
79
define_tag('isCompatibleBrowser');
80
local('result' = true);
81
(client_browser >> 'Apple' || client_browser >> 'Opera' || client_browser >> 'KHTML') ? #result = false;
85
define_tag('parseConfig');
86
if(self->config->size);
87
local('out' = '<input type="hidden" id="' + self->instancename + '___Config" value="');
88
iterate(self->config, local('this'));
89
loop_count > 1 ? #out += '&';
90
#out += encode_html(#this->first) + '=' + encode_html(#this->second);
92
#out += '" style="display:none" />\n';