Changeset 1577

Show
Ignore:
Timestamp:
2008-02-21 10:23:14 (7 months ago)
Author:
wwalc
Message:

Fix for #1488: magnified PHP code, added comments, improved compatibility with PHP6

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/fckeditor.php

    r1574 r1577  
    2626 */ 
    2727 
     28/** 
     29 * Check if browser is compatible with FCKeditor. 
     30 * Return true if is compatible. 
     31 * 
     32 * @return boolean 
     33 */ 
    2834function FCKeditor_IsCompatibleBrowser() 
    2935{ 
  • FCKeditor/trunk/fckeditor_php4.php

    r1574 r1577  
    2828class FCKeditor 
    2929{ 
     30        /** 
     31         * Name of the FCKeditor instance 
     32         * 
     33         * @access protected 
     34         * @var string 
     35         */ 
    3036        var $InstanceName ; 
     37        /** 
     38         * Path to FCKeditor relative to the document root 
     39         * 
     40         * @var string 
     41         */ 
    3142        var $BasePath ; 
     43        /** 
     44         * Width of the FCKeditor 
     45         * Examples: 100%, 600 
     46         * 
     47         * @var mixed 
     48         */ 
    3249        var $Width ; 
     50        /** 
     51         * Height of the FCKeditor 
     52         * Examples: 400, 50% 
     53         * 
     54         * @var mixed 
     55         */ 
    3356        var $Height ; 
     57        /** 
     58         * Name of the toolbar to load 
     59         * 
     60         * @var string 
     61         */ 
    3462        var $ToolbarSet ; 
     63        /** 
     64         * Initial value 
     65         * 
     66         * @var string 
     67         */ 
    3568        var $Value ; 
     69        /** 
     70         * This is where additional configuration can be passed 
     71         * Example: 
     72         * $oFCKeditor->Config['EnterMode'] = 'br'; 
     73         * 
     74         * @var array 
     75         */ 
    3676        var $Config ; 
    3777 
    38         // PHP 4 Constructor 
     78        /** 
     79         * Main Constructor 
     80         * Refer to the _samples/php directory for examples. 
     81         * 
     82         * @param string $instanceName 
     83         */ 
    3984        function FCKeditor( $instanceName ) 
    4085        { 
     
    4994        } 
    5095 
     96        /** 
     97         * Display FCKeditor 
     98         * 
     99         */ 
    51100        function Create() 
    52101        { 
     
    54103        } 
    55104 
     105        /** 
     106         * Return the HTML code required to run FCKeditor 
     107         * 
     108         * @return string 
     109         */ 
    56110        function CreateHtml() 
    57111        { 
     
    62116                if ( !isset( $_GET ) ) { 
    63117                        global $HTTP_GET_VARS ; 
    64                     $_GET = $HTTP_GET_VARS ; 
     118                        $_GET = $HTTP_GET_VARS ; 
    65119                } 
    66120 
     
    104158        } 
    105159 
     160        /** 
     161         * Returns true if browser is compatible with FCKeditor 
     162         * 
     163         * @return boolean 
     164         */ 
    106165        function IsCompatible() 
    107166        { 
     
    109168        } 
    110169 
     170        /** 
     171         * Get settings from Config array as a single string 
     172         * 
     173         * @access protected 
     174         * @return string 
     175         */ 
    111176        function GetConfigFieldString() 
    112177        { 
     
    132197        } 
    133198 
     199        /** 
     200         * Encode characters that may break the configuration string 
     201         * generated by GetConfigFieldString() 
     202         * 
     203         * @access protected 
     204         * @param string $valueToEncode 
     205         * @return string 
     206         */ 
    134207        function EncodeConfig( $valueToEncode ) 
    135208        { 
  • FCKeditor/trunk/fckeditor_php5.php

    r1574 r1577  
    2828class FCKeditor 
    2929{ 
    30         var $InstanceName ; 
    31         var $BasePath ; 
    32         var $Width ; 
    33         var $Height ; 
    34         var $ToolbarSet ; 
    35         var $Value ; 
    36         var $Config ; 
    37  
    38         // PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>) 
    39         function __construct( $instanceName ) 
     30        /** 
     31         * Name of the FCKeditor instance 
     32         * 
     33         * @access protected 
     34         * @var string 
     35         */ 
     36        public $InstanceName ; 
     37        /** 
     38         * Path to FCKeditor relative to the document root 
     39         * 
     40         * @var string 
     41         */ 
     42        public $BasePath ; 
     43        /** 
     44         * Width of the FCKeditor 
     45         * Examples: 100%, 600 
     46         * 
     47         * @var mixed 
     48         */ 
     49        public $Width ; 
     50        /** 
     51         * Height of the FCKeditor 
     52         * Examples: 400, 50% 
     53         * 
     54         * @var mixed 
     55         */ 
     56        public $Height ; 
     57        /** 
     58         * Name of the toolbar to load 
     59         * 
     60         * @var string 
     61         */ 
     62        public $ToolbarSet ; 
     63        /** 
     64         * Initial value 
     65         * 
     66         * @var string 
     67         */ 
     68        public $Value ; 
     69        /** 
     70         * This is where additional configuration can be passed 
     71         * Example: 
     72         * $oFCKeditor->Config['EnterMode'] = 'br'; 
     73         * 
     74         * @var array 
     75         */ 
     76        public $Config ; 
     77 
     78        /** 
     79         * Main Constructor 
     80         * Refer to the _samples/php directory for examples. 
     81         * 
     82         * @param string $instanceName 
     83         */ 
     84        public function __construct( $instanceName ) 
    4085        { 
    4186                $this->InstanceName     = $instanceName ; 
     
    4994        } 
    5095 
    51         function Create() 
     96        /** 
     97         * Display FCKeditor 
     98         * 
     99         */ 
     100        public function Create() 
    52101        { 
    53102                echo $this->CreateHtml() ; 
    54103        } 
    55104 
    56         function CreateHtml() 
     105        /** 
     106         * Return the HTML code required to run FCKeditor 
     107         * 
     108         * @return string 
     109         */ 
     110        public function CreateHtml() 
    57111        { 
    58112                $HtmlValue = htmlspecialchars( $this->Value ) ; 
     
    99153        } 
    100154 
    101         function IsCompatible() 
     155        /** 
     156         * Returns true if browser is compatible with FCKeditor 
     157         * 
     158         * @return boolean 
     159         */ 
     160        public function IsCompatible() 
    102161        { 
    103162                return FCKeditor_IsCompatibleBrowser() ; 
    104163        } 
    105164 
    106         function GetConfigFieldString() 
     165        /** 
     166         * Get settings from Config array as a single string 
     167         * 
     168         * @access protected 
     169         * @return string 
     170         */ 
     171        public function GetConfigFieldString() 
    107172        { 
    108173                $sParams = '' ; 
     
    127192        } 
    128193 
    129         function EncodeConfig( $valueToEncode ) 
     194        /** 
     195         * Encode characters that may break the configuration string 
     196         * generated by GetConfigFieldString() 
     197         * 
     198         * @access protected 
     199         * @param string $valueToEncode 
     200         * @return string 
     201         */ 
     202        public function EncodeConfig( $valueToEncode ) 
    130203        { 
    131204                $chars = array(