This patch moves the textarea hook for 'pre' between the title and the textarea. This makes it easier for simply textarea enhancements like quicktags to add a toolbar just above the textarea. It doesn't appear to have any effect on the fckeditor or htmlarea modules. It doesn't introduce any new hooks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

Guess that is a patch.

Bèr Kessels’s picture

+1 From me.

Any module that adds something, will want to add it after the title. I really cannot think of any case where aditional content should sit above the title, but I can think of loads of cases where content needs to sit between the title and textarea.

Stefan Nagtegaal’s picture

Indeed, nice and simple patch! +1 from me either..

jbond’s picture

http://www.voidstar.com/node.php?id=2263

If this patch gets accepted I'll drop this into contrib. It's similar to quicktags but *I* like it better. ;-)

TDobes’s picture

+1... I'm pretty sure the current positioning was accidental anyway... it was always meant to go directly above the textarea.

Bèr Kessels’s picture

Dries,
All people who use this, seem to agree. Any chance this gets in soon?

Bèr

Dries’s picture

FileSize
1.88 KB

Ber: while all people seem to agree, it is unclear how many people tested/reviewed this patch. One ought to be careful. For example, the patch introduces a new variable, $form_element, without properly initializing it ...

How about the attached patch? It is slightly cleaner, slightly faster and properly initializes all variables. I haven't tested it with the WYSIWYG editors but maybe someone else (Julian?) can? Will commit after it has been tested.

Dries’s picture

Anyone to test this?

TDobes’s picture

FileSize
1.97 KB

The patch no longer applied, so I updated it. I also tested it with:
* Quicktags
* TinyMCE
* Areatags (mentioned earlier by jbond)

It worked with all three... +1 for applying Dries' cleaner patch.

jbond: Your module's browser detection code does not work on my server. You seem to expect a $HTTP_USER_AGENT global variable, which does not exist... I think you should instead be using $_SERVER['HTTP_USER_AGENT']. Perhaps your code was created with the assumption that "register_globals" is turned on in php.ini? That setting is off by default, so I wouldn't rely on it.

Dries’s picture

Committed to HEAD. Thanks.

Dries’s picture

Anonymous’s picture