$fieldId      = $v['FieldID'];
$fieldTaxonomy    = $api -> getFieldTaxonomy($CollectionID , $fieldId);
$fieldCollectionID  = $fieldTaxonomy['CollectionFieldLookupCollectionID'];

$actFieldName = $api -> _getCollectionFieldName($CollectionID , $fieldId);
$smarty->assign('actFieldName' , $actFieldName);

include_once $_SERVER['DOCUMENT_ROOT']."/".ADMIN_APP_DIR."/editor/ckeditor.php";
$CKEditorDisplay = new CKEditor();
 
$CKEditorDisplay->basePath      = '/'.ADMIN_APP_DIR.'/editor/' ;
$CKEditorDisplay->returnOutput  = true;
    
$CKEditorDisplay->config['width'] = '100%';
$CKEditorDisplay->config['height'] = 450; 
$CKEditorDisplay->initialized = true;
$CKEditorDisplay = CKeditorConfigSettings ($CKEditorDisplay);


$CKEditorDisplay->config['contentsCss'] = "/content.css";
       
      
/*
if ($CollectionID == 13 && $selectedRow['Collection_13_3'] == 3)
{
  $CKEditorDisplay->config['fullPage'] = true;
}
*/

if(!$admin)
{ 
  $CKEditorDisplay->config['toolbar'] = "RowLevel";
}

    if ($_POST[$actFieldName] != '' )
    {
        $theValue =  $_POST[$actFieldName];
    }
    else
    {
        $theValue =  $selectedRow[$actFieldName]; 
    }

if ($CollectionID == 13 && ( $selectedRow['Collection_13_3'] == 3 || $selectedRow['Collection_13_4'] == 3 ))
{
  $displayfields[$fieldId] = '<textarea wrap="off" class="input" style="width: 100%; height: 450px" id="'.$actFieldName.'" name="'.$actFieldName.'">'.$theValue.'</tex'.''.'tarea>';
}
else
{
  $displayfields[$fieldId] = $CKEditorDisplay->editor($actFieldName, $theValue);
}
