Browse Source

[svn r21771] Uploaded images by a fckeditor now can be added also to the DB

Julio Montoya 15 years ago
parent
commit
79212da831

+ 5 - 4
main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php

@@ -525,7 +525,7 @@ class ImageManager
 	 */
 	 */
 	function _processFiles($relative, $file)
 	function _processFiles($relative, $file)
 	{
 	{
-		
+		global $_course; 
 		if($file['error']!=0)
 		if($file['error']!=0)
 		{
 		{
 			return false;
 			return false;
@@ -583,12 +583,13 @@ class ImageManager
 		//now copy the file
 		//now copy the file
 		$path = Files::makePath($this->getBaseDir(),$relative);		
 		$path = Files::makePath($this->getBaseDir(),$relative);		
 		$result = Files::copyFile($file['tmp_name'], $path, $file['name']);
 		$result = Files::copyFile($file['tmp_name'], $path, $file['name']);
-
+		
 		//no copy error
 		//no copy error
        if (!is_int($result)) {
        if (!is_int($result)) {
-	   	    if (isset($_course['dbName']) && $_course<>'-1') {
+       	     	
+	   	    if (isset($_course['dbName']) && $_course<>'-1') {	   	    	
 				//adding the document to the DB
 				//adding the document to the DB
-				global $_course, $to_group_id;
+				global $to_group_id; 
 				
 				
 				// looking for the /document/ folder
 				// looking for the /document/ folder
 				$document_path = substr($path, strpos($path,'/document/')+9, strlen($path)); //   /shared_folder/4/name
 				$document_path = substr($path, strpos($path,'/document/')+9, strlen($path)); //   /shared_folder/4/name