Index: _source/plugins/dialog/plugin.js
===================================================================
--- _source/plugins/dialog/plugin.js (revision 6137)
+++ _source/plugins/dialog/plugin.js (revision )
@@ -188,6 +188,34 @@
definition : definition
}
, editor ).definition;
+
+ var tabsToRemove = {};
+ // Cache tabs that should be removed.
+ if ( !( 'removeDialogContents' in editor._ ) && editor.config.removeDialogContents )
+ {
+ var removeContents = editor.config.removeDialogContents.split( ';' );
+
+ for ( i = 0; i < removeContents.length; i++ )
+ {
+ var parts = removeContents[ i ].split( ':' );
+ if ( parts.length == 2 )
+ {
+ var removeDialogName = parts[ 0 ].toLowerCase();
+ if ( !tabsToRemove[ removeDialogName ] )
+ tabsToRemove[ removeDialogName ] = [];
+ tabsToRemove[ removeDialogName ].push( parts[ 1 ] );
+ }
+ }
+ editor._.removeDialogContents = tabsToRemove;
+ }
+
+ // Remove tabs of this dialog.
+ if ( editor._.removeDialogContents && ( tabsToRemove = editor._.removeDialogContents[ dialogName.toLowerCase() ] ) )
+ {
+ for ( i = 0; i < tabsToRemove.length; i++ )
+ definition.removeContents( tabsToRemove[ i ] );
+ }
+
// Initialize load, show, hide, ok and cancel events.
if ( definition.onLoad )
this.on( 'load', definition.onLoad );
@@ -1401,9 +1429,10 @@
// Tool function used to remove an item from an array based on its id.
var removeById = function( array, id, recurse )
{
+ id = id.toLowerCase();
for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
{
- if ( item.id == id )
+ if ( item.id.toLowerCase() == id )
return array.splice( i, 1 );
if ( recurse && item[ recurse ] )
{
@@ -3010,9 +3039,22 @@
* @since 3.5
* @example
* config.dialog_buttonsOrder = 'rtl';
-*/
+ */
-/**
+/**
+ * The dialog contents to removed. It's a string composed by dialog name and tab name with a colon between them.
+ * Separate each pair with semicolon (see example).
+ * Note: All names are case-insensitive.
+ * Note: Be cautious when specifying dialog tabs that are mandatory, like "info", dialog functionality might be broken because of this!
+ * @name CKEDITOR.config.removeDialogContents
+ * @type String
+ * @since 3.5
+ * @default ''
+ * @example
+ * config.removeDialogContents = 'flash:advanced;Image:Link';
+ */
+
+/**
* Fired when a dialog definition is about to be used to create a dialog into
* an editor instance. This event makes it possible to customize the definition
* before creating it.