DrupalBin
Submit Code
About
Recent Posts
css path
40 min 26 sec
ago
Fix for Code
4 hours 40 min
ago
Fix for Code
4 hours 45 min
ago
Fix for Code
4 hours 54 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for Removing an element #process function, yuk!
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
/** * Implementation of hook_elements(). */ function wysiwyg_elements() { $type = array(); $type['textarea'] = array('#process' => array('wysiwyg_process_textarea')); $type['form'] = array('#process' => array('wysiwyg_process_form')); return $type; } /** * Implementation of hook_form_alter(). */ function wysiwyg_form_alter(&$form, &$form_state, $form_id) { $form['#input'] = TRUE; } function wysiwyg_process_form($form) { $form['#input'] = FALSE; wysiwyg_purge_form($form); return $form; } /** * This is a cleanup function to remove the processing done by other editors * on textareas. The WYSIWYG Framework instead manages including all editors * when necessary on textareas. */ function wysiwyg_purge_form(&$form) { foreach (element_children($form) as $key) { wysiwyg_purge_form($form[$key]); if (isset($form['#type']) && $form['#type'] == 'textarea') { $editors = array_keys(wysiwyg_get_editors()); foreach ($form['#process'] as $key => $function) { foreach ($editors as $editor) { if (strpos($function, $editor) === 0) { unset($form['#process'][$key]); } } } } } }
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.