It's a prototype, so you can't access the functions directly! Anyways, here's code taken out of DreamPages.template.php for you to see how I did it. If val does not equal 2, than it disables the WYSIWYG Toggle View. You place a call to the check_bbc function on the onchange event of a Radio Button, or whatever for that matter...
And $context['page_content'] represents the $editorOptions['id'] value. For example, when you build the editor:
$editorOptions = array(
'id' => 'body',
'labels' => array(
),
'height' => '250px',
'width' => '100%',
'preview_type' => 2,
'rich_active' => false,
);
$context['page_content'] = $editorOptions['id'];
So, in this case, the $context['page_content'] = 'body';
function check_bbc(val)
{
if (val != 2)
{
var obj_wysiwyg = document.getElementById("html_' . $context['page_content'] . '");
document.getElementById("bbcBox_message").style.display = "none";
document.getElementById("smileyBox_message").style.display = "none";
if (obj_wysiwyg)
{
// Disable wysiwyg when switching to html/php options!
if (obj_wysiwyg.style.display != "none")
{
var sText = oEditorHandle_' . $context['page_content'] . '.getText(true, 1).replace(/&#/g, "&#").php_to8bit().php_urlencode();
oEditorHandle_' . $context['page_content'] . '.tmpMethod = sendXMLDocument;
oEditorHandle_' . $context['page_content'] . '.tmpMethod(smf_prepareScriptUrl(smf_scripturl) + "action=jseditor;view=0;', $context['session_var'] . '=' . $context['session_id'] . ';xml", "message=" + sText, oEditorHandle_' . $context['page_content'] . '.onToggleDataReceived);
}
}
}
else
{
document.getElementById("bbcBox_message").style.display = "";
document.getElementById("smileyBox_message").style.display = "";
}
}
There, have fun with it.