Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
FCKeditor Class Reference

List of all members.

Public Member Functions

 FCKeditor ($instanceName)
 Main Constructor.
 Create ()
 Display FCKeditor.
 CreateHtml ()
 Return the HTML code required to run FCKeditor.
 IsCompatible ()
 Returns true if browser is compatible with FCKeditor.
 GetConfigFieldString ()
 Get settings from Config array as a single string.
 EncodeConfig ($valueToEncode)
 Encode characters that may break the configuration string generated by GetConfigFieldString().
 __construct ($instanceName)
 Main Constructor.
 Create ()
 Display FCKeditor.
 CreateHtml ()
 Return the HTML code required to run FCKeditor.
 IsCompatible ()
 Returns true if browser is compatible with FCKeditor.
 GetConfigFieldString ()
 Get settings from Config array as a single string.
 EncodeConfig ($valueToEncode)
 Encode characters that may break the configuration string generated by GetConfigFieldString().

Public Attributes

 $InstanceName
 $BasePath
 $Width
 $Height
 $ToolbarSet
 $Value
 $Config

Detailed Description

Definition at line 74 of file fckeditor_php4.php.


Constructor & Destructor Documentation

FCKeditor::__construct ( instanceName)

Main Constructor.

Refer to the _samples/php directory for examples.

Parameters:
string$instanceName

Definition at line 130 of file fckeditor_php5.php.

       {
              $this->InstanceName  = $instanceName ;
              $this->BasePath             = '/fckeditor/' ;
              $this->Width         = '100%' ;
              $this->Height        = '200' ;
              $this->ToolbarSet    = 'Default' ;
              $this->Value         = '' ;

              $this->Config        = array() ;
       }

Member Function Documentation

Display FCKeditor.

Definition at line 146 of file fckeditor_php4.php.

       {
              echo $this->CreateHtml() ;
       }

Here is the call graph for this function:

Display FCKeditor.

Definition at line 146 of file fckeditor_php5.php.

       {
              echo $this->CreateHtml() ;
       }

Here is the call graph for this function:

Return the HTML code required to run FCKeditor.

Returns:
string

Definition at line 156 of file fckeditor_php5.php.

       {
              $HtmlValue = htmlspecialchars( $this->Value ) ;

              $Html = '' ;

              if ( $this->IsCompatible() )
              {
                     if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == "true" )
                            $File = 'fckeditor.original.html' ;
                     else
                            $File = 'fckeditor.html' ;

                     $Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;

                     if ( $this->ToolbarSet != '' )
                            $Link .= "&Toolbar={$this->ToolbarSet}" ;

                     // Render the linked hidden field.
                     $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;

                     // Render the configurations hidden field.
                     $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ;

                     // Render the editor IFRAME.
                     $Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
              }
              else
              {
                     if ( strpos( $this->Width, '%' ) === false )
                            $WidthCSS = $this->Width . 'px' ;
                     else
                            $WidthCSS = $this->Width ;

                     if ( strpos( $this->Height, '%' ) === false )
                            $HeightCSS = $this->Height . 'px' ;
                     else
                            $HeightCSS = $this->Height ;

                     $Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
              }

              return $Html ;
       }

Here is the call graph for this function:

Return the HTML code required to run FCKeditor.

Returns:
string

Definition at line 156 of file fckeditor_php4.php.

       {
              $HtmlValue = htmlspecialchars( $this->Value ) ;

              $Html = '' ;

              if ( !isset( $_GET ) ) {
                     global $HTTP_GET_VARS ;
                     $_GET = $HTTP_GET_VARS ;
              }

              if ( $this->IsCompatible() )
              {
                     if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == "true" )
                            $File = 'fckeditor.original.html' ;
                     else
                            $File = 'fckeditor.html' ;

                     $Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ;

                     if ( $this->ToolbarSet != '' )
                            $Link .= "&amp;Toolbar={$this->ToolbarSet}" ;

                     // Render the linked hidden field.
                     $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ;

                     // Render the configurations hidden field.
                     $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ;

                     // Render the editor IFRAME.
                     $Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
              }
              else
              {
                     if ( strpos( $this->Width, '%' ) === false )
                            $WidthCSS = $this->Width . 'px' ;
                     else
                            $WidthCSS = $this->Width ;

                     if ( strpos( $this->Height, '%' ) === false )
                            $HeightCSS = $this->Height . 'px' ;
                     else
                            $HeightCSS = $this->Height ;

                     $Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
              }

              return $Html ;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

FCKeditor::EncodeConfig ( valueToEncode)

Encode characters that may break the configuration string generated by GetConfigFieldString().

protected

Parameters:
string$valueToEncode
Returns:
string

Definition at line 248 of file fckeditor_php5.php.

       {
              $chars = array(
                     '&' => '%26',
                     '=' => '%3D',
                     '"' => '%22' ) ;

              return strtr( $valueToEncode,  $chars ) ;
       }
FCKeditor::EncodeConfig ( valueToEncode)

Encode characters that may break the configuration string generated by GetConfigFieldString().

protected

Parameters:
string$valueToEncode
Returns:
string

Definition at line 253 of file fckeditor_php4.php.

       {
              $chars = array(
                     '&' => '%26',
                     '=' => '%3D',
                     '"' => '%22' ) ;

              return strtr( $valueToEncode,  $chars ) ;
       }

Here is the caller graph for this function:

FCKeditor::FCKeditor ( instanceName)

Main Constructor.

Refer to the _samples/php directory for examples.

Parameters:
string$instanceName

Definition at line 130 of file fckeditor_php4.php.

       {
              $this->InstanceName  = $instanceName ;
              $this->BasePath             = '/fckeditor/' ;
              $this->Width         = '100%' ;
              $this->Height        = '200' ;
              $this->ToolbarSet    = 'Default' ;
              $this->Value         = '' ;

              $this->Config        = array() ;
       }

Get settings from Config array as a single string.

protected

Returns:
string

Definition at line 217 of file fckeditor_php5.php.

       {
              $sParams = '' ;
              $bFirst = true ;

              foreach ( $this->Config as $sKey => $sValue )
              {
                     if ( $bFirst == false )
                            $sParams .= '&amp;' ;
                     else
                            $bFirst = false ;

                     if ( $sValue === true )
                            $sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
                     else if ( $sValue === false )
                            $sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
                     else
                            $sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ;
              }

              return $sParams ;
       }

Here is the call graph for this function:

Get settings from Config array as a single string.

protected

Returns:
string

Definition at line 222 of file fckeditor_php4.php.

       {
              $sParams = '' ;
              $bFirst = true ;

              foreach ( $this->Config as $sKey => $sValue )
              {
                     if ( $bFirst == false )
                            $sParams .= '&amp;' ;
                     else
                            $bFirst = false ;

                     if ( $sValue === true )
                            $sParams .= $this->EncodeConfig( $sKey ) . '=true' ;
                     else if ( $sValue === false )
                            $sParams .= $this->EncodeConfig( $sKey ) . '=false' ;
                     else
                            $sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ;
              }

              return $sParams ;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if browser is compatible with FCKeditor.

Returns:
boolean

Definition at line 206 of file fckeditor_php5.php.

Here is the call graph for this function:

Returns true if browser is compatible with FCKeditor.

Returns:
boolean

Definition at line 211 of file fckeditor_php4.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 88 of file fckeditor_php4.php.

Definition at line 122 of file fckeditor_php4.php.

Definition at line 102 of file fckeditor_php4.php.

Definition at line 82 of file fckeditor_php4.php.

Definition at line 108 of file fckeditor_php4.php.

Definition at line 114 of file fckeditor_php4.php.

Definition at line 95 of file fckeditor_php4.php.


The documentation for this class was generated from the following files: