Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2497)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2498)
@@ -95,4 +95,16 @@
 	if ( definition.onLoad )
 		this.on( 'load', definition.onLoad, this, null, CKEDITOR.tools.getNextNumber() );
+	if ( definition.onOk )
+		this.on( 'ok', function( evt )
+				{
+					if ( definition.onOk.call( this, evt ) === false )
+						evt.data.hide = false;
+				}, this, null, 0 );
+	if ( definition.onCancel )
+		this.on( 'cancel', function( evt )
+				{
+					if ( definition.onCancel.call( this, evt ) === false )
+						evt.data.hide = false;
+				}, this, null, 0 );
 
 	// Insert the title.
@@ -283,4 +295,14 @@
 	{
 		return this._.element;
+	},
+
+	getChild : function( id )
+	{
+		return this._.contents[id];
+	},
+
+	getValueOf : function( id )
+	{
+		return this._.contents[id] && this._.contents[id].getValue();
 	}
 };
@@ -300,5 +322,7 @@
 			onClick : function( evt )
 			{
-				evt.data.dialog.hide();
+				var ret = evt.data.dialog.fire( 'ok', { hide : true } ).hide;
+				if ( ret !== false )
+					evt.data.dialog.hide();
 			}
 		},
@@ -311,5 +335,7 @@
 			onClick : function( evt )
 			{
-				evt.data.dialog.hide();
+				var ret = evt.data.dialog.fire( 'cancel', { hide : true } ).hide;
+				if ( ret !== false )
+					evt.data.dialog.hide();
 			}
 		},
