registerFunction( 'onInitEditor', 'botNoEditorInit' ); $_MAMBOTS->registerFunction( 'onGetEditorContents', 'botNoEditorGetContents' ); $_MAMBOTS->registerFunction( 'onEditorArea', 'botNoEditorEditorArea' ); /** * No WYSIWYG Editor - javascript initialisation */ function botNoEditorInit() { return << function insertAtCursor(myField, myValue) { if (document.selection) { // IE support myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0') { // MOZILLA/NETSCAPE support var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } EOD; } /** * No WYSIWYG Editor - copy editor contents to form field * @param string The name of the editor area * @param string The name of the form field */ function botNoEditorGetContents( $editorArea, $hiddenField ) { return <<trigger( 'onCustomEditorButton' ); $buttons = array(); foreach ($results as $result) { if ( $result[0] ) { $buttons[] = ''.$result[1].''; } } $buttons = implode( "", $buttons ); $width = $width . 'px'; $height = $height . 'px'; return <<$content
$buttons EOD; } ?>