Commit 5c74951e authored by Nigel McNie's avatar Nigel McNie
Browse files

Added a new api function to return the javascript required to intialise the...

Added a new api function to return the javascript required to intialise the editor. Used in the views interface when configuring blocks and javascript is on
parent e070ff95
......@@ -57,4 +57,18 @@ function pieform_element_tinywysiwyg_get_value(Pieform $form, $element) {
return pieform_element_wysiwyg_get_value($form, $element);
}
/**
* Extension by Mahara. This api function returns the javascript required to
* set up the element, assuming the element has been placed in the page using
* javascript. This feature is used in the views interface.
*
* In theory, this could go upstream to pieforms itself
*
* @param Pieform $form The form
* @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']) . ');';
}
?>
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