CKEDITOR.dialog.add( 'textPic', function( editor ) {
    return {
        title: 'textPic',
        minWidth: 500,
        minHeight: 300,

        contents: [
            {
                id: 'textPic',
                label: 'Bild mit Text',
                elements: [
                    /*{
                     id: 'image',
                     label: 'Bild:',
                     type: 'text',

                     setup: function(widget){
                     this.setValue(widget.data.image);
                     CKEDITOR.dialog.getCurrent().selectPage(widget.data.box_type);
                     },

                     commit: function(widget){
                     widget.setData('image', this.getValue());
                     //widget.setData('tabIndex', CKEDITOR.dialog.getCurrent()._.currentTabIndex);
                     widget.setData('box_type', CKEDITOR.dialog.getCurrent()._.currentTabId);
                     }
                     },*/
                    {
                        id: 'label',
                        label: 'Label:',
                        type: 'text',

                        setup: function(widget){
                            this.setValue(widget.data.label);
                        },

                        commit: function(widget){
                            widget.setData('label', this.getValue());
                        }
                    },
                    {
                        id: 'link',
                        label: 'Link:',
                        type: 'text',

                        setup: function(widget){
                            this.setValue(widget.data.link);
                        },

                        commit: function(widget){
                            widget.setData('link', this.getValue());
                        }
                    },
                    {
                        id: 'header',
                        label: '&Uuml;berschrift:',
                        type: 'text',

                        setup: function(widget){
                            this.setValue(widget.data.header);
                        },

                        commit: function(widget){
                            widget.setData('header', this.getValue());
                        }
                    },
                    {
                        id: 'text',
                        label: 'Text:',
                        type: 'textarea',

                        setup: function(widget){
                            this.setValue(widget.data.text);
                        },

                        commit: function(widget){
                            widget.setData('text', this.getValue());
                        }
                    },
                ]
            }
        ]
    };
} );

function getData(url){
    var array = [];

    $.ajax({
        type: 'GET',
        url: url,
        contentType: 'application/json',
        dataType: 'JSON',
        async: false,
        success: function(response){
            $.each(eval(response), function(k,v){
                array.push(v);
            });
        },
        error: function(response){
            console.log("error");
        }
    });

    return array;
}