'de',
'nl-formal'=>'nl');
if (isset($aTranslationTable[$sLanguageCode])) {
$sResultCode=$aTranslationTable[$sLanguageCode];
}
else
{
$sResultCode=$sLanguageCode;
}
return $sResultCode;
}
function PrepareEditorScript()
{
global $clang, $imageurl, $homeurl, $js_admin_includes;
global $sCKEditorURL;
$js_admin_includes[]=$sCKEditorURL.'/ckeditor.js';
$script = "\n";
return $script;
}
function getEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=null,$qID=null,$action=null)
{
global $defaulthtmleditormode;
//error_log("TIBO fieldtype=$fieldtype,fieldname=$fieldname,fieldtext=$fieldtext,surveyID=$surveyID,gID=$gID,qID=$qID,action=$action");
if (isset($_SESSION['htmleditormode']) &&
$_SESSION['htmleditormode'] == 'none')
{
return '';
}
if (!isset($_SESSION['htmleditormode']) ||
($_SESSION['htmleditormode'] != 'inline' &&
$_SESSION['htmleditormode'] != 'popup') )
{
$htmleditormode = $defaulthtmleditormode;
}
else
{
$htmleditormode = $_SESSION['htmleditormode'];
}
if ( ($fieldtype == 'email-inv' ||
$fieldtype == 'email-reg' ||
$fieldtype == 'email-conf' ||
$fieldtype == 'email-rem' ) &&
getEmailFormat($surveyID) != 'html')
{
return '';
}
if ($htmleditormode == 'popup' ||
( $fieldtype == 'editanswer' ||
$fieldtype == 'addanswer' ||
$fieldtype == 'editlabel' ||
$fieldtype == 'addlabel') && (preg_match("/^translate/",$action) == 0 ) )
{
return getPopupEditor($fieldtype,$fieldname,$fieldtext, $surveyID,$gID,$qID,$action);
}
elseif ($htmleditormode == 'inline')
{
return getInlineEditor($fieldtype,$fieldname,$fieldtext, $surveyID,$gID,$qID,$action);
}
else
{
return '';
}
}
function getPopupEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=null,$qID=null,$action=null)
{
global $clang, $imageurl, $homeurl;
$htmlcode = '';
$imgopts = '';
$toolbarname = 'Basic';
if ($fieldtype == 'editanswer' ||
$fieldtype == 'addanswer' ||
$fieldtype == 'editlabel' ||
$fieldtype == 'addlabel')
{
$imgopts = "width='16' height='16'";
}
$htmlcode .= ""
. "gTview("Start HTML Editor in a Popup Window")."\" class='editorLink'>\n"
. "\t
gT("Start HTML Editor in a Popup Window")."\" id='".$fieldname."_popupctrlena' name='".$fieldname."_popupctrlena' border='0' src='".$imageurl."/edithtmlpopup.png' $imgopts align='top' class='btneditanswerena' />\n"
. "\t
gT("Give focus to the HTML Editor Popup Window")."\" id='".$fieldname."_popupctrldis' name='".$fieldname."_popupctrldis' border='0' src='".$imageurl."/edithtmlpopup_disabled.png' style='display: none' $imgopts align='top' class='btneditanswerdis' />\n"
. "\n";
return $htmlcode;
}
function getInlineEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=null,$qID=null,$action=null)
{
global $clang, $imageurl, $homeurl, $rooturl, $sCKEditorURL, $ckeditexpandtoolbar, $uploadurl;
$htmlcode = '';
$imgopts = '';
$toolbarname = 'inline';
$toolbaroption="";
$htmlformatoption="";
$oCKeditorVarName = "oCKeditor_".str_replace("-","_",$fieldname);
if ( ($fieldtype == 'editanswer' ||
$fieldtype == 'addanswer' ||
$fieldtype == 'editlabel' ||
$fieldtype == 'addlabel') && (preg_match("/^translate/",$action) == 0) )
{
$toolbaroption= ",toolbarStartupExpanded:true\n"
.",toolbar:'popup'\n"
.",toolbarCanCollapse:false\n";
}
else
{
if (!isset($ckeditexpandtoolbar) || $ckeditexpandtoolbar == true)
{
$toolbaroption = ",toolbarStartupExpanded:true\n"
.",toolbar:'inline'\n";
}
}
if ( $fieldtype == 'email-inv' ||
$fieldtype == 'email-reg' ||
$fieldtype == 'email-conf'||
$fieldtype == 'email-admin-notification'||
$fieldtype == 'email-admin-resp'||
$fieldtype == 'email-rem' )
{
$htmlformatoption = ",fullPage:true\n";
}
$htmlcode .= ""
. "';
return $htmlcode;
}
?>