CKEDITOR.plugins.add( 'tokens_rechnung', { requires : ['richcombo'], //, 'styles' ], init : function( editor ) { var config = editor.config, lang = editor.lang.format; // Gets the list of tags from the settings. var tags_k = []; //new Array(); var tags_b = []; var tags_f = []; var tags_a = []; var tags_r = []; //this.add('value', 'drop_text', 'drop_label'); tags_k[0]=["[Kunde_Briefanrede]", "Kunde_Briefanrede", "Kunde_Briefanrede"]; tags_k[1]=["[Kunde_Anrede]", "Kunde_Anrede", "Kunde_Anrede"]; tags_k[2]=["[Kunde_Nachname]", "Kunde_Nachname", "Kunde_Nachname"]; tags_k[3]=["[Kunde_Vorname]", "Kunde_Vorname", "Kunde_Vorname"]; tags_b[0]=["[Bearbeiter_Nachname]", "Bearbeiter_Nachname", "Bearbeiter_Nachname"]; tags_b[1]=["[Bearbeiter_Vorname]", "Bearbeiter_Vorname", "Bearbeiter_Vorname"]; tags_b[2]=["[Bearbeiter_Telefon]", "Bearbeiter_Telefon", "Bearbeiter_Telefon"]; tags_b[3]=["[Bearbeiter_Mobil]", "Bearbeiter_Mobil", "Bearbeiter_Mobil"]; tags_b[4]=["[Bearbeiter_EMail]", "Bearbeiter_EMail", "Bearbeiter_EMail"]; 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"]; tags_a[0]=["[Bestätigung_Datum]", "Bestätigung_Datum", "Bestätigung_Datum"]; tags_a[1]=["[Erteilung_Auftrag_Datum]", "Erteilung_Auftrag_Datum", "Erteilung_Auftrag_Datum"]; tags_r[0]=["[Rechnung_Datum]", "Rechnung_Datum", "Rechnung_Datum"]; tags_r[1]=["[Rechnung_Nummer]", "Rechnung_Nummer", "Rechnung_Nummer"]; tags_r[2]=["[Rechnung_Betrag]", "Rechnung_Betrag", "Rechnung_Betrag"]; tags_r[3]=["[Zahlbar_Bis]", "Zahlbar_Bis", "Zahlbar_Bis"]; // Create style objects for all defined styles. editor.ui.addRichCombo( 'tokens_rechnung', { 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( "Kunde" ); //this.add('value', 'drop_text', 'drop_label'); for (var this_tags_k in tags_k){ this.add(tags_k[this_tags_k][0], tags_k[this_tags_k][1], tags_k[this_tags_k][2]); } this.startGroup( "Bearbeiter" ); //this.add('value', 'drop_text', 'drop_label'); for (var this_tags_b in tags_b){ this.add(tags_b[this_tags_b][0], tags_b[this_tags_b][1], tags_b[this_tags_b][2]); } 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]); } this.startGroup( "Bestätigung" ); //this.add('value', 'drop_text', 'drop_label'); for (var this_tags_a in tags_a){ this.add(tags_a[this_tags_a][0], tags_a[this_tags_a][1], tags_a[this_tags_a][2]); } this.startGroup( "Rechnung" ); //this.add('value', 'drop_text', 'drop_label'); for (var this_tags_r in tags_r){ this.add(tags_r[this_tags_r][0], tags_r[this_tags_r][1], tags_r[this_tags_r][2]); } }, onClick : function( value ) { editor.focus(); editor.fire( 'saveSnapshot' ); editor.insertHtml(value); editor.fire( 'saveSnapshot' ); } }); } });