Index: /CKEditor/branches/prototype/_source/core/config.js
===================================================================
--- /CKEditor/branches/prototype/_source/core/config.js	(revision 2656)
+++ /CKEditor/branches/prototype/_source/core/config.js	(revision 2657)
@@ -159,5 +159,5 @@
 	 * config.plugins = 'elementspath,toolbar,wysiwygarea';
 	 */
-	plugins : 'basicstyles,button,dialog,elementspath,horizontalrule,htmldataprocessor,keystrokes,removeformat,smiley,sourcearea,tab,toolbar,wysiwygarea',
+	plugins : 'basicstyles,button,dialog,elementspath,horizontalrule,htmldataprocessor,keystrokes,removeformat,smiley,link,sourcearea,tab,toolbar,wysiwygarea',
 
 	/**
Index: /CKEditor/branches/prototype/_source/lang/en.js
===================================================================
--- /CKEditor/branches/prototype/_source/lang/en.js	(revision 2656)
+++ /CKEditor/branches/prototype/_source/lang/en.js	(revision 2657)
@@ -53,5 +53,40 @@
 	ok				: 'OK',
 	cancel			: 'Cancel',
-	horizontalrule	: "Insert Horizontal Line",
+	horizontalrule	: 'Insert Horizontal Line',
+	link			: 'Link',
+	linkTitle		: 'Link',
+	linkInfo		: 'Link Info',
+	linkTarget		: 'Link Target',
+	linkUpload		: 'Link Upload',
+	linkAdvanced	: 'Link Advanced',
+	linkType		: 'Link Type',
+	linkToAnchor	: 'Link to anchor in the text',
+	linkToEmail		: 'E-mail',
+	linkTarget		: 'Target',
+	linkTargetNotSet	: '<not set>',
+	linkTargetFrame	: '<frame>',
+	linkTargetPopup	: '<popup window>',
+	linkTargetNew	: 'New Window (_blank)',
+	linkTargetTop	: 'Topmost Window (_top)',
+	linkTargetSelf	: 'Same Window (_self)',
+	linkTargetParent	: 'Parent Window (_parent)',
+	linkTargetFrameName	: 'Target Frame Name',
+	linkTargetPopupName	: 'Popup Window Name',
+	linkPopupFeatures	: 'Popup Window Features',
+	linkPopupResizable	: 'Resizable',
+	linkPopupStatusBar	: 'Status Bar',
+	linkPopupLocationBar	: 'Location Bar',
+	linkPopupToolbar	: 'Toolbar',
+	linkPopupMenuBar	: 'Menu Bar',
+	linkPopupFullScreen	: 'Full Screen (IE)',
+	linkPopupScrollBars	: 'Scroll Bars',
+	linkPopupDependent	: 'Dependent (Netscape)',
+	linkPopupWidth		: 'Width',
+	linkPopupLeft		: 'Left Position',
+	linkPopupHeight		: 'Height',
+	linkPopupTop		: 'Top Position',
+	browseServer	: 'Browser Server',
+	url				: 'URL',
+	protocol		: 'Protocol',
 
 	elementsPath :
Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2656)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2657)
@@ -1583,4 +1583,6 @@
 					if ( height )
 						styles.push( 'height:' + fixLength( height ) );
+					if ( elementDefinition.padding != undefined )
+						styles.push( 'padding:' + fixLength( elementDefinition.padding ) );
 					if ( styles.length > 0 )
 						html.push( 'style="' + styles.join('; ') + '" ' );
@@ -1590,5 +1592,6 @@
 				return html.join( '' );
 			};
-			CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'hbox' }, htmlList, 'table', null, null, innerHTML );
+			CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'hbox' }, htmlList, 'table', null, 
+					{ align : elementDefinition.align || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) }, innerHTML );
 		},
 
@@ -1618,4 +1621,6 @@
 				html.push( 'width:' + fixLength( elementDefinition.width || '100%' ), ';' );
 				html.push( '"' );
+				html.push( 'align="', CKEDITOR.tools.htmlEncode(
+					elementDefinition.align || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) ), '" ' );
 
 				html.push( '><tbody>' );
@@ -1630,4 +1635,6 @@
 					else if ( elementDefinition.expand )
 						styles.push( 'height:' + Math.floor( 100 / childHtmlList.length ) + '%' );
+					if ( elementDefinition.padding != undefined )
+						styles.push( 'padding:' + fixLength( elementDefinition.padding ) );
 					if ( styles.length > 0 )
 						html.push( 'style="', styles.join( '; ' ), '" ' );
Index: /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2656)
+++ /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2657)
@@ -84,11 +84,15 @@
 				var innerHTML = function()
 				{
-					var html = [ '<div class="cke_dialog_ui_labeled_label">',
+					var html = [];
+					if ( elementDefinition.labelLayout != 'horizontal' )
+						html.push( '<div class="cke_dialog_ui_labeled_label">',
 							CKEDITOR.tools.htmlEncode( elementDefinition.label ),
-							'</div>',
-							'<div class="cke_dialog_ui_labeled_content">',
-							contentHtml( dialog, elementDefinition ),
-							'</div>'
-						];
+							'</div>' );
+					html.push( '<div class="cke_dialog_ui_labeled_content">',
+						elementDefinition.labelLayout == 'horizontal'
+							? '<span class="cke_dialog_ui_labeled_label">' + CKEDITOR.tools.htmlEncode( elementDefinition.label ) + '</span> '
+							: '',
+						contentHtml( dialog, elementDefinition ),
+						'</div>' );
 					return html.join( '' );
 				};
@@ -342,5 +346,6 @@
 						}, this );
 
-				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'table', null, null, innerHTML );
+				CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'table', null, 
+						{ align : elementDefinition.align || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) }, innerHTML );
 			},
 
@@ -383,4 +388,25 @@
 					_.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) );
 					return html.join( '' );
+				};
+
+				CKEDITOR.ui.dialog.labeledElement.call( this, dialog, elementDefinition, htmlList, innerHTML );
+			},
+
+			/**
+			 * A file upload input.
+			 */
+			file : function( dialog, elementDefinition, htmlList )
+			{
+				if ( arguments.length < 3 )
+					return;
+				
+				var _ = initPrivateObject.call( this, elementDefinition );
+
+				if ( elementDefinition.validate )
+					this.validate = elementDefinition.validate;
+
+				/** @ignore */
+				var innerHTML = function()
+				{
 				};
 
Index: /CKEditor/branches/prototype/_source/plugins/link/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/link/plugin.js	(revision 2657)
+++ /CKEditor/branches/prototype/_source/plugins/link/plugin.js	(revision 2657)
@@ -0,0 +1,326 @@
+/*
+ * CKEditor - The text editor for Internet - http://ckeditor.com
+ * Copyright (C) 2003-2008 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ */
+
+CKEDITOR.plugins.add( 'link',
+{
+	init : function( editor, pluginPath )
+	{
+		var link = CKEDITOR.plugins.link;
+
+		editor.addCommand( 'link', link.commands.link );
+		editor.ui.addButton( 'Link',
+			{
+				label : editor.lang.link,
+				command : 'link'
+			} );
+		CKEDITOR.dialog.add( 'link', link.dialog );
+	}
+} );
+
+CKEDITOR.plugins.link =
+{
+	commands :
+	{
+		link :
+		{
+			exec : function( editor )
+			{
+				editor.openDialog( 'link' );
+			}
+		}
+	},
+
+	dialog : function( editor )
+	{
+		return {
+			title : editor.lang.linkTitle,
+			minWidth : 400,
+			minHeight : 320,
+			contents : [
+				{
+					id : 'info',
+					label : editor.lang.linkInfo,
+					elements :
+					[
+						{
+							id : 'linkType',
+							type : 'select',
+							label : editor.lang.linkType,
+							'default' : 'url',
+							items :
+							[
+								[ editor.lang.url, 'url' ],
+								[ editor.lang.linkToAnchor, 'anchor' ],
+								[ editor.lang.linkToEmail, 'email' ]
+							]
+						},
+						{
+							type : 'hbox',
+							widths : [ '25%', '75%' ],
+							children : 
+							[
+								{
+									id : 'protocol',
+									type : 'select',
+									label : editor.lang.protocol,
+									'default' : 'http://',
+									style : 'width : 100%;',
+									items :
+									[
+										[ 'http://' ],
+										[ 'https//' ],
+										[ 'ftp://' ],
+										[ 'news://' ],
+										[ '<other>' ]
+									]
+								},
+								{
+									type : 'text',
+									id : 'url',
+									label : editor.lang.url
+								}
+							]
+						},
+						{
+							type : 'button',
+							id : 'browse',
+							label : editor.lang.browseServer
+						}
+					]
+				},
+				{
+					id : 'target',
+					label : editor.lang.linkTarget,
+					elements : 
+					[
+						{
+							type : 'hbox',
+							widths : [ '50%', '50%' ],
+							children :
+							[
+								{
+									type : 'select',
+									id : 'linkTargetType',
+									label : editor.lang.linkTarget,
+									'default' : 'notSet',
+									style : 'width : 100%;',
+									'items' : 
+									[
+										[ editor.lang.linkTargetNotSet, 'notSet' ],
+										[ editor.lang.linkTargetFrame, 'frame' ],
+										[ editor.lang.linkTargetPopup, 'popup' ],
+										[ editor.lang.linkTargetNew, 'new' ],
+										[ editor.lang.linkTargetType, 'top' ],
+										[ editor.lang.linkTargetSelf, 'self' ],
+										[ editor.lang.linkTargetParent, 'parent' ]
+									]
+								},
+								{
+									type : 'text',
+									id : 'linkTargetName',
+									label : editor.lang.linkTargetFrameName
+								}
+							]
+						},
+						{
+							type : 'vbox',
+							width : 260,
+							align : 'center',
+							padding : 2,
+							children : 
+							[
+								{
+									type : 'html',
+									html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.linkPopupFeatures ) + '</div>'
+								},
+								{
+									type : 'hbox',
+									children : 
+									[
+										{
+											type : 'checkbox',
+											id : 'resizable',
+											label : editor.lang.linkPopupResizable
+										},
+										{
+											type : 'checkbox',
+											id : 'statusBar',
+											label : editor.lang.linkPopupStatusBar
+										}
+									]
+								},
+								{
+									type : 'hbox',
+									children :
+									[
+										{
+											type : 'checkbox',
+											id : 'locationBar',
+											label : editor.lang.linkPopupLocationBar
+										},
+										{
+											type : 'checkbox',
+											id : 'toolbar',
+											label : editor.lang.linkPopupToolbar
+										}
+									]
+								},
+								{
+									type : 'hbox',
+									children :
+									[
+										{
+											type : 'checkbox',
+											id : 'menubar',
+											label : editor.lang.linkPopupMenuBar
+										},
+										{
+											type : 'checkbox',
+											id : 'fullscreen',
+											label : editor.lang.linkPopupFullScreen
+										}
+									]
+								},
+								{
+									type : 'hbox',
+									children :
+									[
+										{
+											type : 'checkbox',
+											id : 'scrollbars',
+											label : editor.lang.linkPopupScrollBars
+										},
+										{
+											type : 'checkbox',
+											id : 'dependent',
+											label : editor.lang.linkPopupDependent
+										}
+									]
+								},
+								{
+									type : 'hbox',
+									children :
+									[
+										{
+											type : 'hbox',
+											padding : 0,
+											widths : [ '30%', '70%' ],
+											children : 
+											[
+												{
+													'type' : 'html',
+													html : '<span>' + CKEDITOR.tools.htmlEncode( editor.lang.linkPopupWidth ) + '</span>'
+												},
+												{
+													'type' : 'text',
+													labelLayout : 'horizontal',
+													label : '',
+													id : 'popupWidth'
+												}
+											]
+										},
+										{
+											type : 'hbox',
+											padding : 0,
+											widths : [ '55%', '45%' ],
+											children : 
+											[
+												{
+													'type' : 'html',
+													html : '<span>' + CKEDITOR.tools.htmlEncode( editor.lang.linkPopupLeft ) + '</span>'
+												},
+												{
+													'type' : 'text',
+													labelLayout : 'horizontal',
+													label : '',
+													id : 'popupLeft'
+												}
+											]
+										}
+									]
+								},
+								{
+									type : 'hbox',
+									children :
+									[
+										{
+											type : 'hbox',
+											padding : 0,
+											widths : [ '30%', '70%' ],
+											children : 
+											[
+												{
+													'type' : 'html',
+													html : '<span>' + CKEDITOR.tools.htmlEncode( editor.lang.linkPopupHeight ) + '</span>'
+												},
+												{
+													'type' : 'text',
+													labelLayout : 'horizontal',
+													label : '',
+													id : 'popupHeight'
+												}
+											]
+										},
+										{
+											type : 'hbox',
+											padding : 0,
+											widths : [ '55%', '45%' ],
+											children : 
+											[
+												{
+													'type' : 'html',
+													html : '<span>' + CKEDITOR.tools.htmlEncode( editor.lang.linkPopupTop ) + '</span>'
+												},
+												{
+													'type' : 'text',
+													labelLayout : 'horizontal',
+													label : '',
+													id : 'popupTop'
+												}
+											]
+										}
+
+									]
+								}
+							]
+						}
+					]
+				},
+				{
+					id : 'Upload',
+					label : editor.lang.linkUpload,
+					expand : true,
+					elements : 
+					[
+					]
+				},
+				{
+					id : 'Advanced',
+					label : editor.lang.linkAdvanced,
+					expand : true,
+					elements : 
+					[
+					]
+				},
+			]
+		};
+	}
+};
Index: /CKEditor/branches/prototype/_source/plugins/toolbar/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/toolbar/plugin.js	(revision 2656)
+++ /CKEditor/branches/prototype/_source/plugins/toolbar/plugin.js	(revision 2657)
@@ -222,4 +222,4 @@
 CKEDITOR.config.toolbar =
 [
-	[ 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'SelectAll', 'RemoveFormat', '-', 'Smiley', 'HorizontalRule' ]
+	[ 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'SelectAll', 'RemoveFormat', '-', 'Link', 'Smiley', 'HorizontalRule' ]
 ];
Index: /CKEditor/branches/prototype/_source/skins/default/dialog.css
===================================================================
--- /CKEditor/branches/prototype/_source/skins/default/dialog.css	(revision 2656)
+++ /CKEditor/branches/prototype/_source/skins/default/dialog.css	(revision 2657)
@@ -291,4 +291,10 @@
 }
 
+.cke_skin_default .cke_dialog_ui_vbox table,
+.cke_skin_default .cke_dialog_ui_hbox table
+{
+	margin: auto;
+}
+
 .cke_skin_default .cke_dialog_ui_vbox_child
 {
