CKEDITOR.plugins.add( 'tokens_kontakt',
{   
   requires : ['richcombo'], //, 'styles' ],
   init : function( editor )
   {
      var config = editor.config,
         lang = editor.lang.format;

      // Gets the list of tags from the settings.
	  var tags_f = [];
      //this.add('value', 'drop_text', 'drop_label');
	  tags_f[0]=["[Firma_Name]", "Firma_Name", "Firma_Name"];
	  tags_f[1]=["[Firma_Vertreter]", "Firma_Vertreter", "Firma_Vertreter"];
	  tags_f[2]=["[Firma_Telefon]", "Firma_Telefon", "Firma_Telefon"];
	  tags_f[3]=["[Firma_Mobil]", "Firma_Mobil", "Firma_Mobil"];
	  tags_f[4]=["[Firma_EMail]", "Firma_EMail", "Firma_EMail"];
      
      // Create style objects for all defined styles.

      editor.ui.addRichCombo( 'tokens_kontakt',
         {
            label : "Textbausteine",
            title : "Textbausteine einfügen",
            voiceLabel : "Textbausteine einfügen",
            className : 'cke_format',
            multiSelect : false,

            panel :
            {
               css : [ config.contentsCss, CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ],
               voiceLabel : lang.panelVoiceLabel
            },

            init : function()
            {
               this.startGroup( "Firma" );
               //this.add('value', 'drop_text', 'drop_label');
               for (var this_tags_f in tags_f){
                  this.add(tags_f[this_tags_f][0], tags_f[this_tags_f][1], tags_f[this_tags_f][2]);
               }
            },

            onClick : function( value )
            {         
               editor.focus();
               editor.fire( 'saveSnapshot' );
               editor.insertHtml(value);
               editor.fire( 'saveSnapshot' );
            }
         });
   }
});
