Commit 3ee2dc12 authored by Nigel McNie's avatar Nigel McNie
Browse files

Make the tinywysiwyg element respect the user preference for using the WYSIWYG editor

parent cdf521f1
......@@ -68,7 +68,11 @@ function pieform_element_tinywysiwyg_get_value(Pieform $form, $element) {
* @param array $element The element
*/
function pieform_element_tinywysiwyg_views_js(Pieform $form, $element) {
return 'tinyMCE.execCommand("mceAddControl", true, ' . json_encode($form->get_name() . '_' . $element['name']) . ');';
global $USER;
if ($USER->get_account_preference('wysiwyg') || defined('PUBLIC')) {
return 'tinyMCE.execCommand("mceAddControl", true, ' . json_encode($form->get_name() . '_' . $element['name']) . ');';
}
return '';
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment