Index: /CKEditor/branches/versions/3.6.x/CHANGES.html
===================================================================
--- /CKEditor/branches/versions/3.6.x/CHANGES.html	(revision 6676)
+++ /CKEditor/branches/versions/3.6.x/CHANGES.html	(revision 6677)
@@ -40,5 +40,6 @@
 			New features:</p>
 	<ul>
-		<li></li>
+		<li><a href="http://dev.ckeditor.com/ticket/6589">#6589</a> : Automatically use a "onDialogEvent" function in the iframeDialog contents if no callback is used on creation.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/5745">#5745</a> : Allow to pass extra configuration options for iframeDialog.</li>
 	</ul>
 	<p>
Index: /CKEditor/branches/versions/3.6.x/_source/plugins/iframedialog/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.6.x/_source/plugins/iframedialog/plugin.js	(revision 6676)
+++ /CKEditor/branches/versions/3.6.x/_source/plugins/iframedialog/plugin.js	(revision 6677)
@@ -13,5 +13,17 @@
 	onLoad : function()
 	{
-		CKEDITOR.dialog.addIframe = function( name, title, src, width, height, onContentLoad )
+		/**
+		 * An iframe base dialog.
+		 * @param {String} name Name of the dialog
+		 * @param {String} title Title of the dialog
+		 * @param {Number} minWidth Minimum width of the dialog
+		 * @param {Number} minHeight Minimum height of the dialog
+		 * @param {Function} [onContentLoad] Function called when the iframe has been loaded.
+		 * If it isn't specified, the inner frame is notified of the dialog events ('load',
+		 * 'resize', 'ok' and 'cancel') on a function called 'onDialogEvent'
+		 * @param {Object} [userDefinition] Additional properties for the dialog definition
+		 * @example
+		 */
+		CKEDITOR.dialog.addIframe = function( name, title, src, minWidth, minHeight, onContentLoad, userDefinition )
 		{
 			var element =
@@ -25,10 +37,47 @@
 			if ( typeof( onContentLoad ) == 'function' )
 				element.onContentLoad = onContentLoad;
+			else
+				element.onContentLoad = function()
+				{
+					var element = this.getElement(),
+						childWindow = element.$.contentWindow;
+
+					// If the inner frame has defined a "onDialogEvent" function, setup listeners
+					if ( childWindow.onDialogEvent )
+					{
+						var dialog = this.getDialog(),
+							notifyEvent = function(e)
+							{
+								return childWindow.onDialogEvent(e);
+							};
+
+						dialog.on( 'ok', notifyEvent );
+						dialog.on( 'cancel', notifyEvent );
+						dialog.on( 'resize', notifyEvent );
+
+						// Clear listeners
+						dialog.on( 'hide', function(e)
+							{
+								dialog.removeListener( 'ok', notifyEvent );
+								dialog.removeListener( 'cancel', notifyEvent );
+								dialog.removeListener( 'resize', notifyEvent );
+
+								e.removeListener();
+							} );
+
+						// Notify child iframe of load:
+						childWindow.onDialogEvent( {
+								name : 'load',
+								sender : this,
+								editor : dialog._.editor
+							} );
+					}
+				};
 
 			var definition =
 			{
 				title : title,
-				minWidth : width,
-				minHeight : height,
+				minWidth : minWidth,
+				minHeight : minHeight,
 				contents :
 				[
@@ -42,5 +91,8 @@
 			};
 
-			return this.add( name, function(){ return definition; } );
+			for ( var i in userDefinition )
+				definition[i] = userDefinition[i];
+
+			this.add( name, function(){ return definition; } );
 		};
 
