Basically, the Joomla! editor (JCE/TinyMCE) based on a parameter can be enabled or disabled when the users load the specific page. Disabled means: the content is not editable and the opacity background must be set.
In the default.php:
<?php
$editor =& JFactory::getEditor();
/*
Parameter Type Default Description
$name string The control name
$html string The contents of the text area
$width string The width of the text area (px or %)
$height string The height of the text area (px or %)
$col int The number of columns for the textarea
$row int The number of rows for the textarea
$buttons boolean true True and the editor buttons will be displayed
$params array array() Associative array of editor parameters
*/
echo $editor->display('emailText', $this->articleFullText, '960', '700', '20', '20', false);
?>
Is it possible to set the editor settings in the default.php (view)? (I did not find any specific parameter)
I created the following function (thanks to stackoverflow) which enables or disables the editor
function setEditorEditable(editable) {
if (editable == 1) {
tinymce.get(tinymce.activeEditor.id).getBody().setAttribute('contenteditable', 'true');
J('#' + tinymce.activeEditor.id + '_parent').fadeTo(0, 1);
} else {
tinymce.get(tinymce.activeEditor.id).getBody().setAttribute('contenteditable', 'false');
J('#' + tinymce.activeEditor.id + '_parent').fadeTo(0, 0.5);
}
}
But, if I call the function within the jQuery .ready the editor DOM obj is null.
How and where in code can I set/change the editor setting?
Thanks!