Hello,
I'm triing to write a plugin, that inserts some php-code into the text being edited. (like <?php function(); ?>)
So, I started out having a popup-window and including the following code:
Guess what - it doesn't work. After all it would be great if the code could work in IE aswell as in Firefox, but I guess that's another issue.
Björn
I'm triing to write a plugin, that inserts some php-code into the text being edited. (like <?php function(); ?>)
So, I started out having a popup-window and including the following code:
<script language="javascript">
FCK = window.opener.FCK;
function insertphp()
{
FCK.Focus();
FCK.insertHTML('<?php echo "test"; ?p>');
window.close();
}
</script>
<a href="javascript:insertphp();">Insert PHP</a>
Guess what - it doesn't work. After all it would be great if the code could work in IE aswell as in Firefox, but I guess that's another issue.
Björn

[solved] insert php plugin
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> <title>Insert PHP</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta content="noindex, nofollow" name="robots"> <script src="../../dialog/common/fck_dialog_common.js" type="text/javascript"></script> <script type="text/javascript"> var dialog = window.parent ; var oEditor = dialog.InnerDialogLoaded() ; var FCK = oEditor.FCK ; var FCKBrowserInfo = oEditor.FCKBrowserInfo ; var FCKTools = oEditor.FCKTools ; var FCKRegexLib = oEditor.FCKRegexLib ; var oDOM = FCK.EditorDocument ; var oFakeImage = dialog.Selection.GetSelectedElement() ; var oAnchor ; window.onload = function() { window.parent.SetOkButton( true ) ; window.parent.SetAutoSize( true ) ; SelectField( 'txtName' ) ; } function Ok() { var sNewName = document.getElementById('txtName').value ; FCK.InsertHtml('<?php somefunction('+sNewName+'); ?>'); return true; } </script> </head> <body style="overflow: hidden"> <table height="100%" width="100%"> <tr> <td align="center"> <table border="0" cellpadding="0" cellspacing="0" width="80%"> <tr> <td> <span>Insert PHP</span><BR> <input id="txtName" style="WIDTH: 100%" type="text"> </td> </tr> </table> </td> </tr> </table> </body> </html>