36      if ( isset( $_SERVER ) ) {
 
   37           $sAgent = $_SERVER[
'HTTP_USER_AGENT'] ;
 
   40           global $HTTP_SERVER_VARS ;
 
   41           if ( isset( $HTTP_SERVER_VARS ) ) {
 
   42                $sAgent = $HTTP_SERVER_VARS[
'HTTP_USER_AGENT'] ;
 
   45                global $HTTP_USER_AGENT ;
 
   46                $sAgent = $HTTP_USER_AGENT ;
 
   50      if ( strpos($sAgent, 
'MSIE') !== 
false && strpos($sAgent, 
'mac') === 
false && strpos($sAgent, 
'Opera') === 
false )
 
   52           $iVersion = (float)substr($sAgent, strpos($sAgent, 
'MSIE') + 5, 3) ;
 
   53           return ($iVersion >= 5.5) ;
 
   55      else if ( strpos($sAgent, 
'Gecko/') !== false )
 
   58           if (preg_match(
"|Gecko/\d+\.\d+|", $sAgent))
 
   60           $iVersion = (int)substr($sAgent, strpos($sAgent, 
'Gecko/') + 6, 8) ;
 
   61           return ($iVersion >= 20030210) ;
 
   63      else if ( strpos($sAgent, 
'Opera/') !== false )
 
   65           $fVersion = (float)substr($sAgent, strpos($sAgent, 
'Opera/') + 6, 4) ;
 
   66           return ($fVersion >= 9.5) ;
 
   68      else if ( preg_match( 
"|AppleWebKit/(\d+)|i", $sAgent, $matches ) )
 
   70           $iVersion = $matches[1] ;
 
   71           return ( $matches[1] >= 522 ) ;
 
  135           $this->InstanceName = $instanceName ;
 
  136           $this->BasePath          = 
'/fckeditor/' ;
 
  137           $this->Width        = 
'100%' ;
 
  138           $this->Height       = 
'200' ;
 
  139           $this->ToolbarSet   = 
'Default' ;
 
  142           $this->Config       = array() ;
 
  161           $HtmlValue = htmlspecialchars( $this->Value ) ;
 
  167                if ( isset( $_GET[
'fcksource'] ) && $_GET[
'fcksource'] == 
"true" )
 
  168                     $File = 
'fckeditor.original.html' ;
 
  170                     $File = 
'fckeditor.html' ;
 
  172                $Link = 
"{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;
 
  174                if ( $this->ToolbarSet != 
'' )
 
  175                     $Link .= 
"&Toolbar={$this->ToolbarSet}" ;
 
  178                $Html .= 
"<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;
 
  181                $Html .= 
"<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->
GetConfigFieldString() . 
"\" style=\"display:none\" />" ;
 
  184                $Html .= 
"<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
 
  188                if ( strpos( $this->Width, 
'%' ) === 
false )
 
  189                     $WidthCSS = $this->Width . 
'px' ;
 
  193                if ( strpos( $this->Height, 
'%' ) === 
false )
 
  194                     $HeightCSS = $this->Height . 
'px' ;
 
  198                $Html .= 
"<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
 
  225           foreach ( $this->Config as $sKey => $sValue )
 
  227                if ( $bFirst == 
false )
 
  228                     $sParams .= 
'&' ;
 
  232                if ( $sValue === 
true )
 
  234                else if ( $sValue === 
false )
 
  258           return strtr( $valueToEncode,  $chars ) ;
 
EncodeConfig($valueToEncode)
Encode characters that may break the configuration string generated by GetConfigFieldString(). 
 
GetConfigFieldString()
Get settings from Config array as a single string. 
 
FCKeditor_IsCompatibleBrowser()
Check if browser is compatible with FCKeditor. 
 
IsCompatible()
Returns true if browser is compatible with FCKeditor. 
 
Create()
Display FCKeditor. 
 
CreateHtml()
Return the HTML code required to run FCKeditor. 
 
__construct($instanceName)
Main Constructor.