Ver código fonte

Fixing ajaxfilemanager thumb generation see #3710 (Renaming the Image class to ImageAjaxFileManager)

Julio Montoya 13 anos atrás
pai
commit
2028c7ad90

+ 1 - 1
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajax_editor_reset.php

@@ -41,7 +41,7 @@
 		{
 			
 			include_once(CLASS_IMAGE);
-			$image = new Image();
+			$image = new ImageAjaxFileManager();
 			$image->loadImage($_POST['path']);
 			
 			switch($_POST['mode'])

+ 1 - 1
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajax_image_editor.php

@@ -32,7 +32,7 @@
 			}
 		}
 		require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php");
-		$image = new Image();
+		$image = new ImageAjaxFileManager();
 		
 		$imageInfo = $image->getImageInfo($path);
 

+ 1 - 1
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajax_image_save.php

@@ -50,7 +50,7 @@
 			}
 			
 			include_once(CLASS_IMAGE);
-			$image = new Image();
+			$image = new ImageAjaxFileManager();
 			if($image->loadImage($originalImage))
 			{				
 				

+ 22 - 31
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajax_image_thumbnail.php

@@ -1,33 +1,24 @@
 <?php
-	/**
-	 * ajax preview
-	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
-	 * @link www.phpletter.com
-	 * @since 22/April/2007
-	 *
-	 */
-	include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
-	if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']))
-	{
-		include_once(CLASS_IMAGE);
-		$image = new Image(true);
-		if($image->loadImage($_GET['path']))
-		{
-			if($image->resize(CONFIG_IMG_THUMBNAIL_MAX_X, CONFIG_IMG_THUMBNAIL_MAX_Y, true, true))
-			{
-				$image->showImage();
-			}else 
-			{
-				echo PREVIEW_NOT_PREVIEW . ".";	
-			}
-		}else 
-		{
-			echo PREVIEW_NOT_PREVIEW . "..";			
+/**
+ * ajax preview
+ * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
+ * @link www.phpletter.com
+ * @since 22/April/2007
+ *
+ */
+include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
+if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path'])) {
+	require_once CLASS_IMAGE;
+	$image = new ImageAjaxFileManager(true);
+	if($image->loadImage($_GET['path'])) {
+		if($image->resize(CONFIG_IMG_THUMBNAIL_MAX_X, CONFIG_IMG_THUMBNAIL_MAX_Y, true, true)) {
+			$image->showImage();
+		} else {
+			echo PREVIEW_NOT_PREVIEW . ".";	
 		}
-
-			
-	}else 
-	{
-		echo PREVIEW_NOT_PREVIEW . "...";
-	}
-
+	} else {
+		echo PREVIEW_NOT_PREVIEW . "..";			
+	}		
+} else {
+	echo PREVIEW_NOT_PREVIEW . "...";
+}

+ 1 - 1
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajax_image_undo.php

@@ -44,7 +44,7 @@
 			}		
 			 
 				include_once(CLASS_IMAGE);
-				$image = new Image();
+				$image = new ImageAjaxFileManager();
 				if($image->loadImage($sessionImage))
 				{
 					$imageInfo = $image->getOriginalImageInfo();

+ 11 - 14
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.image.php

@@ -1,19 +1,16 @@
 <?php
-	/**
-	 * this class provide functions to edit an image, e.g. resize, rotate, flip, crop
-	 * @author Logan Cai cailongqun [at] yahoo [dot] com [dot] cn
-	 * @link  www.phpletter.com
-	 * @version 0.9
-	 * @since 14/May/2007
-	 * @name Image
-	 * 
-	 */
-	
+/**
+ * this class provide functions to edit an image, e.g. resize, rotate, flip, crop
+ * @author Logan Cai cailongqun [at] yahoo [dot] com [dot] cn
+ * @link  www.phpletter.com
+ * @version 0.9
+ * @since 14/May/2007
+ * @name Image
+ * 
+ */
 	
-	
-	
-	class Image
-	{
+class ImageAjaxFileManager
+{
 		var $_debug = false; 
 		var $_errors = array();
 		var $gdInfo = array(); //keep all information of GD extension

+ 6 - 4
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.php

@@ -1,6 +1,6 @@
 <?php
 	/**
-	 * sysem  config setting
+	 * system  config setting
 	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
 	 * @link www.phpletter.com
 	 * @version 1.0
@@ -8,6 +8,8 @@
 	 *
 	 * Modifications of system config setting for Chamilo
 	 * @author Juan Carlos Raña Trabado
+	 * @author Julio Montoya <gugli100@gmail.com> BeezNest 2011 Fixing bugs
+	 * 
 	 * @since 31/December/2008
 	 */
 
@@ -21,8 +23,7 @@
 	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.auth.php");
 	define('CONFIG_QUERY_STRING_ENABLE', true); //Enable passed query string to setting the system configuration
 
-	if(!headers_sent())
-	{
+	if(!headers_sent()) {
 		header('Content-Type: text/html; charset=utf-8');
 	}
 
@@ -91,6 +92,7 @@
 		}
 	}
 	addNoCacheHeaders();
+	$web_path = api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/ajaxfilemanager/';
 	//URL Declartions
 	define('CONFIG_URL_IMAGE_PREVIEW', 'ajax_image_preview.php');
 	define('CONFIG_URL_CREATE_FOLDER', 'ajax_create_folder.php');
@@ -112,7 +114,7 @@
 	define('CONFIG_URL_GET_FOLDER_LIST', 'ajax_get_folder_listing.php');
 	define('CONFIG_URL_SAVE_TEXT', 'ajax_save_text.php');
 	define('CONFIG_URL_LIST_LISTING', 'ajax_get_file_listing.php');
-	define('CONFIG_URL_IMG_THUMBNAIL', 'ajax_image_thumbnail.php');
+	define('CONFIG_URL_IMG_THUMBNAIL', $web_path.'ajax_image_thumbnail.php');
 	define('CONFIG_URL_FILEnIMAGE_MANAGER', 'ajaxfilemanager.php');
 	define('CONFIG_URL_FILE_PASTE', 'ajax_file_paste.php');