I have an an iframe-based plug-in that I've written to access a PHP page, which simply lists some files. When the user clicks on a file, it returns the file to the editor as an HTML link. This works just fine with one editor on the screen. With more than one editor, it only sends the link to the first editor.
In the PHP page, I use the URL of the iframe source to send in values. One of these values is the instance of the editor I'm trying to send to.
My question is this: from within an iframe dialog that contains an external page (ie, PHP), can you access the exact editor instance name that the user clicked on?
When I access the instances manually, it works, but I simply don't know how many instances there will be:
PHP page (greatly simplified):
This works because I know the instance name (response_1). I can't seem to find a way to obtain the instance name the user clicked on from within the PHP page using JavaScript. CKEDITOR.currentInstance.name doesn't seem to work from within the PHP page.
Any ideas?
Thanks!
In the PHP page, I use the URL of the iframe source to send in values. One of these values is the instance of the editor I'm trying to send to.
My question is this: from within an iframe dialog that contains an external page (ie, PHP), can you access the exact editor instance name that the user clicked on?
When I access the instances manually, it works, but I simply don't know how many instances there will be:
PHP page (greatly simplified):
<script> var CKEDITOR = window.parent.CKEDITOR; var oEditor = CKEDITOR.instances.response_1; var oHref = 'my link code here...'; var element = CKEDITOR.dom.element.createFromHtml( '' + oHref + '' ); oEditor.insertElement( element ); </script>
This works because I know the instance name (response_1). I can't seem to find a way to obtain the instance name the user clicked on from within the PHP page using JavaScript. CKEDITOR.currentInstance.name doesn't seem to work from within the PHP page.
Any ideas?
Thanks!