function get_field(&$qa_content, $content, $format, $fieldname, $rows /* $autofocus parameter deprecated */)
{
$scriptsrc=$this->urltoroot.'ckeditor.js?'.QA_VERSION;
$alreadyadded=false;
if (isset($qa_content['script_src']))
foreach ($qa_content['script_src'] as $testscriptsrc)
if ($testscriptsrc==$scriptsrc)
$alreadyadded=true;
if (!$alreadyadded) {
$uploadimages=qa_opt('wysiwyg_editor_upload_images');
$uploadall=$uploadimages && qa_opt('wysiwyg_editor_upload_all');
$qa_content['script_src'][]=$scriptsrc;
$qa_content['script_lines'][]=array(
"qa_wysiwyg_editor_config={toolbar:[".
"['Bold','Italic','Underline','Strike'],".
"['Link','Unlink'],".
"['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],".
"['NumberedList','BulletedList','-','Blockquote'],".
"['Image','Table','Smiley','SpecialChar'],".
"['RemoveFormat', 'Maximize','Source']".
"]".
", defaultLanguage:".qa_js(qa_opt('site_language')).
", skin:'v2'".
", toolbarCanCollapse:false".
", removePlugins:'elementspath'".
", resize_enabled:false".
", autogrow:false".
", entities:false".
($uploadimages ? (", filebrowserImageUploadUrl:".qa_js(qa_path('wysiwyg-editor-upload', array('qa_only_image' => true)))) : "").
($uploadall ? (", filebrowserUploadUrl:".qa_js(qa_path('wysiwyg-editor-upload'))) : "").
"};"
);
}
if ($format=='html')
$html=$content;
else
$html=qa_html($content, true);
return array(
'tags' => 'NAME="'.$fieldname.'"',
'value' => qa_html($html),
'rows' => $rows,
);
}