I am trying to replace the standard image upload dialog with a custom php script that I have written. I want to replace the normal dialog with an iframe containing my script. I spent a good hour digging through the ckeditor source trying to find out where the image upload dialog was being generated but I couldn't find it. What is the best way for me to go about this?
Tue, 09/29/2009 - 01:48
#1
Re: Changing Contents of Upload Image Dialog
To insert an iframe have a quick look around the forum and you should be able to find a few instances where this has been done before. The docs are pretty much non-existent for this type of stuff so you'll have to delve in.
I'm currently working on a custom plugin that uses an iFrame so if I succeed I'll have to document what I did.
N.B. You may have to look in the "_sources" dir for the un-minified code.
Re: Changing Contents of Upload Image Dialog
Re: Changing Contents of Upload Image Dialog
I first added an additional tab in /link/dialogs/link.js
My iFrame just contains a form select input with all the internal pages.
I had to do a bit of hard coding to get the value from the iFrame and I had to put this in the "validate" section of the "url". To get the value I used this code:
I've got it working ok but it took me quite a while, hope that helps.
Re: Changing Contents of Upload Image Dialog
I haven't done the second part of the code as i don't quite understand where you put it. Any extra help as to where you put it to make it work would be a big help.
Re: Changing Contents of Upload Image Dialog
The validation starts on line 349 of the link.js file and what the code does is loop through all the iframes in the editor to find my custom one with the specified id, find the form select with the specified id and get the selected value. I then set the value of the URL to the selected page in my Iframe, this should enable the page to validate and the URL to be inserted.
Its a little complex and I don't think I've explained it very well. Let me know if you're still having problems.
Re: Changing Contents of Upload Image Dialog
Re: Changing Contents of Upload Image Dialog