4.x style
[freeside.git] / httemplate / elements / htmlarea.html
1 <%doc>
2
3 Example:
4
5   include('/elements/htmlarea.html',
6             'field'      => 'fieldname',
7             'curr_value' => $curr_value,
8             'height'     => 800,
9             'config'     => { extraPlugins => 'blockprotect' },
10          );
11
12 </%doc>
13
14 % #init
15 <SCRIPT TYPE="text/javascript" src="<% $fsurl %>elements/ckeditor/ckeditor.js">
16 </SCRIPT>
17
18 % #editor
19 <textarea name="<% $opt{'field'} %>"><% $opt{'curr_value'} |h %></textarea>
20
21 <SCRIPT TYPE="text/javascript">
22
23   var <% $opt{'field'} %>_editor =
24     CKEDITOR.replace('<% $opt{'field'} %>',
25                    <% encode_json($config) %>
26   );
27
28 </SCRIPT>
29
30 <%init>
31
32 my %opt = @_;
33 my $config = {
34   'height'              => ($opt{height} || 420),
35   'startupFocus'        => Cpanel::JSON::XS::true,
36   'skin'                => 'kama',
37   'toolbarCanCollapse'  => JSON::true,
38   'removePlugins'       => 'elementspath',
39   'basePath'            => $fsurl.'elements/ckeditor/',
40   'enterMode'           => 2,
41   %{ $opt{config} || {} },
42 };
43 $config->{width} = $opt{width} if defined($opt{width});
44
45 </%init>