si subito stavo pulendo un po il codice:-)
CKEDITOR.plugins.add( 'insertCampoRichiedente',
{
init: function( editor )
{
editor.addCommand( 'insertCampoRichiedenteDialog', new CKEDITOR.dialogCommand( 'insertCampoRichiedenteDialog' ) );editor.ui.addButton( 'InsertCampoRichiedente', { label: 'Variabili Richedente', command: 'insertCampoRichiedenteDialog', icon: this.path + 'images/persona.gif' } ); CKEDITOR.dialog.add( 'insertCampoRichiedenteDialog', function( editor ) { return { title : 'Richiedente', minWidth : 400, minHeight : 200, contents : [ { id : 'general', label : 'Settings', elements : [ { type : 'html', html : 'Selezionare un campo del richiedente.' }, { type : 'select', id : 'selected', label : 'Selezionare:', items : [ [ '-Selezionare-', '' ], [ 'Nome', 'nome' ], [ 'Cognome', 'cognome' ] ], commit : function( data ) { data.selected = this.getValue(); } } ] } ], onOk : function() { var dialog = this, data = {} this.commitContent( data ); switch( data.selected ) { case 'nome' : editor.insertHtml( '{nome}' ); break; case 'cognome' : editor.insertHtml( '{cognome}' ); break; } } }; } );}
} );
Dopo di che va solamente dichiarato nel ckeditor.js alla voce: extraPlugins:' '
Ed infine aggiungerlo alla toolbar.
