3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
\r
4 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
\r
6 * == BEGIN LICENSE ==
\r
8 * Licensed under the terms of any of the following licenses at your
\r
11 * - GNU General Public License Version 2 or later (the "GPL")
\r
12 * http://www.gnu.org/licenses/gpl.html
\r
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
\r
15 * http://www.gnu.org/licenses/lgpl.html
\r
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
\r
18 * http://www.mozilla.org/MPL/MPL-1.1.html
\r
22 * This is the integration file for Lasso.
\r
24 * It defines the FCKeditor class ("custom type" in Lasso terms) that can
\r
25 * be used to create editor instances in Lasso pages on server side.
\r
31 -description='Creates an instance of FCKEditor.'
\r
34 'instancename' = 'FCKEditor1',
\r
37 'toolbarset' = 'Default',
\r
38 'initialvalue' = string,
\r
39 'basepath' = '/fckeditor/',
\r
41 'checkbrowser' = true,
\r
42 'displayerrors' = false
\r
47 -required='instancename', -type='string',
\r
48 -optional='width', -type='string',
\r
49 -optional='height', -type='string',
\r
50 -optional='toolbarset', -type='string',
\r
51 -optional='initialvalue', -type='string',
\r
52 -optional='basepath', -type='string',
\r
53 -optional='config', -type='array'
\r
55 self->instancename = #instancename;
\r
56 local_defined('width') ? self->width = #width;
\r
57 local_defined('height') ? self->height = #height;
\r
58 local_defined('toolbarset') ? self->toolbarset = #toolbarset;
\r
59 local_defined('initialvalue') ? self->initialvalue = #initialvalue;
\r
60 local_defined('basepath') ? self->basepath = #basepath;
\r
61 local_defined('config') ? self->config = #config;
\r
64 define_tag('create');
\r
65 if(self->isCompatibleBrowser);
\r
67 <input type="hidden" id="' + self->instancename + '" name="' + self->instancename + '" value="' + encode_html(self->initialvalue) + '" style="display:none" />
\r
68 ' + self->parseConfig + '
\r
69 <iframe id="' + self->instancename + '___Frame" src="' + self->basepath + 'editor/fckeditor.html?InstanceName=' + self->instancename + '&Toolbar=' + self->toolbarset + '" width="' + self->width + '" height="' + self->height + '" frameborder="0" scrolling="no"></iframe>
\r
73 <textarea name="' + self->instancename + '" rows="4" cols="40" style="width: ' + self->width + '; height: ' + self->height + '">' + encode_html(self->initialvalue) + '</textarea>
\r
79 define_tag('isCompatibleBrowser');
\r
80 local('result' = false);
\r
81 if (client_browser->Find("MSIE") && !client_browser->Find("mac") && !client_browser->Find("Opera"));
\r
82 #result = client_browser->Substring(client_browser->Find("MSIE")+5,3)>=5.5;
\r
84 if (client_browser->Find("Gecko/"));
\r
85 #result = client_browser->Substring(client_browser->Find("Gecko/")+6,8)>=20030210;
\r
87 if (client_browser->Find("Opera/"));
\r
88 #result = client_browser->Substring(client_browser->Find("Opera/")+6,4)>=9.5;
\r
90 if (client_browser->Find("AppleWebKit/"));
\r
91 #result = client_browser->Substring(client_browser->Find("AppleWebKit/")+12,3)>=522;
\r
96 define_tag('parseConfig');
\r
97 if(self->config->size);
\r
98 local('out' = '<input type="hidden" id="' + self->instancename + '___Config" value="');
\r
99 iterate(self->config, local('this'));
\r
100 loop_count > 1 ? #out += '&';
\r
101 #out += encode_html(#this->first) + '=' + encode_html(#this->second);
\r
103 #out += '" style="display:none" />\n';
\r