In http://drupal.org/node/118747 I'm working on converting TinyMCE to use the Forms API to decide if and how to apply an editor to specific textareas. (The original issue was http://drupal.org/node/119862, but I rolled it into the other patch.)

The aim is to allow modules to designate the WYSIWYG behaviour for particular textareas by setting form element properties, just as is done for, e.g., collapse or autocomplete. We introduce two new properties, #wysiwyg and #wysiwyg_style. These are library-neutral, so that all WYSIWYG editors can read them. We set these properties in the hook_elements() implementation, and then read from them in the textarea processing function.

Attached is a draft (untested) patch. Is there support for the idea? If so, I'd be happy to work on this further.

CommentFileSizeAuthor
#1 fckeditor-forms-api.patch1.57 KBnedjo

Comments

nedjo’s picture

Status: Active » Needs review
StatusFileSize
new1.57 KB

With patch this time.

ontwerpwerk’s picture

I like the idea - it reminds me of http://drupal.org/node/81297

how will the #wysiwyg attributes be set for form fields?

nedjo’s picture

In the short term, two ways, I guess. 1, contrib modules can implement them directly in form defining functions. 2. modules like tinymce and fckeditor can continue their current custom tests.

In the longer term maybe we can relagate this to a single helper contrib module. Or, if we have demonstrated support for a standard in the rich text modules and this is used in many other contrib modules, we'll have a stronger argument for adding these form parameters to core.

wwalc’s picture

Status: Needs review » Closed (won't fix)

FCKeditor already accepts #wysiwyg attribute (#319943: #wysiwyg should not show excluding/including link). Any other improvements in this area should be introduced by the Wysiwyg API.