stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / elements / htmlarea.html
index dca4328..dba744e 100644 (file)
@@ -6,32 +6,40 @@ Example:
             'field'      => 'fieldname',
             'curr_value' => $curr_value,
             'height'     => 800,
+            'config'     => { extraPlugins => 'blockprotect' },
          );
 
 </%doc>
 
 % #init
-<SCRIPT TYPE="text/javascript" src="<% $p %>elements/fckeditor/fckeditor.js">
+<SCRIPT TYPE="text/javascript" src="<% $fsurl %>elements/ckeditor/ckeditor.js">
 </SCRIPT>
 
 % #editor
-<SCRIPT TYPE="text/javascript">
-
-  var oFCKeditor = new FCKeditor('<% $opt{'field'} %>');
-  oFCKeditor.Value = <% $opt{'curr_value'} |js_string %>;
+<textarea name="<% $opt{'field'} %>"><% $opt{'curr_value'} |h %></textarea>
 
-  oFCKeditor.BasePath = '<% $p %>elements/fckeditor/';
-  oFCKeditor.Config['SkinPath'] = '<% $p %>elements/fckeditor/editor/skins/silver/';
-  oFCKeditor.Height = '<% $opt{'height'} || 420 %>';
-  oFCKeditor.Config['StartupFocus'] = true;
-  oFCKeditor.Config['EnterMode'] = 'br';
+<SCRIPT TYPE="text/javascript">
 
-  oFCKeditor.Create();
+  var <% $opt{'field'} %>_editor =
+    CKEDITOR.replace('<% $opt{'field'} %>',
+                   <% encode_json($config) %>
+  );
 
 </SCRIPT>
 
 <%init>
 
 my %opt = @_;
+my $config = {
+  'height'              => ($opt{height} || 420),
+  'startupFocus'        => Cpanel::JSON::XS::true,
+  'skin'                => 'kama',
+  'toolbarCanCollapse'  => JSON::true,
+  'removePlugins'       => 'elementspath',
+  'basePath'            => $fsurl.'elements/ckeditor/',
+  'enterMode'           => 2,
+  %{ $opt{config} || {} },
+};
+$config->{width} = $opt{width} if defined($opt{width});
 
 </%init>