Browse Source

Using absolute path instead of relative for fckeditor lib (Requires testing it could break the fckeditor everywhere maybe under Windoz? ) Should fix bug #3792

Julio Montoya 13 years ago
parent
commit
8e511162af
1 changed files with 8 additions and 15 deletions
  1. 8 15
      main/inc/lib/fckeditor/fckeditor.php

+ 8 - 15
main/inc/lib/fckeditor/fckeditor.php

@@ -157,11 +157,12 @@ class FCKeditor
      *
      *
      * @return string
      * @return string
      */
      */
-    public function CreateHtml()
-    {
-        // Adaptation for the Chamilo LMS ---------------------------------------------------------
-
-        $this->BasePath = api_get_path(REL_PATH).'main/inc/lib/fckeditor/';
+    public function CreateHtml() {
+        // Adaptation for the Chamilo LMS
+        
+		//@todo why the BasePath is relative ? we should use this constant WEB_PATH
+        //$this->BasePath = api_get_path(REL_PATH).'main/inc/lib/fckeditor/';
+        $this->BasePath = api_get_path(WEB_PATH).'main/inc/lib/fckeditor/';
 
 
         $config = $this->get_custom_configuration();
         $config = $this->get_custom_configuration();
         $this->read_configuration($config);
         $this->read_configuration($config);
@@ -173,14 +174,9 @@ class FCKeditor
             $this->Config['BlockCopyPaste'] = false;
             $this->Config['BlockCopyPaste'] = false;
         }
         }
 
 
-        //----------------------------------------------------------------------------------------
-
         $HtmlValue = htmlspecialchars( $this->Value ) ;
         $HtmlValue = htmlspecialchars( $this->Value ) ;
-
         $Html = '' ;
         $Html = '' ;
-
-        if ( $this->IsCompatible() )
-        {
+        if ( $this->IsCompatible() ) {
             if ( api_get_setting('server_type') == 'test' )
             if ( api_get_setting('server_type') == 'test' )
                 $File = 'fckeditor.original.html' ;
                 $File = 'fckeditor.original.html' ;
             else
             else
@@ -199,9 +195,7 @@ class FCKeditor
 
 
             // Render the editor IFRAME.
             // Render the editor IFRAME.
             $Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
             $Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></iframe>" ;
-        }
-        else
-        {
+        } else {
             if ( strpos( $this->Width, '%' ) === false )
             if ( strpos( $this->Width, '%' ) === false )
                 $WidthCSS = $this->Width . 'px' ;
                 $WidthCSS = $this->Width . 'px' ;
             else
             else
@@ -214,7 +208,6 @@ class FCKeditor
 
 
             $Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
             $Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
         }
         }
-
         return $Html ;
         return $Html ;
     }
     }