我需要將TinyMCE和圖像上傳按鈕對話框與我自己的web應用程序集成在一起 - 但我需要使用一些自定義變量將圖像上傳到我的PHP代碼中。 我的PHP調用與下面的激活碼tinyMCE.init:如何集成TinyMCE按鈕並通過變量傳遞
發起的PHP代碼(觸發編輯器)......
<?php
$js='
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "spellchecker,advhr,table,addimg",
theme_advanced_buttons1 : "cut,copy,paste,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,formatselect,zoom, blockquote,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,addimg,|,code,preview,|,forecolor,backcolor",
theme_advanced_buttons2 : "tablecontrols,|,spellchecker,advhr,removeformat,|,sub,sup,|,charmap,visualaid",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
content_css : "'.config::siteurl.'/css/myStyle.css"
});
....這將激活編輯器自定義按鈕「 addimg「;當我點擊addimg自定義按鈕時,它按照預期觸發自定義dialog.htm;但我需要的是,這dialog.htm包含我的變量,這樣當表單發送則接收PHP可以利用它們
dialog.htm形式...
.
.
.
<form id='file_upload_form' name='file_upload_form' enctype='multipart/form-data' action='myUploader.php' method='POST'>
<input type='text' name='MySpecialId’ value='xxxx'>
<table width=100%>
<tr valign=top>
<td width=100>Please choose a file: </td>
<td align=left>
<input style='width: 100%;' id='myFile' name='myFile' type='file'>
</td>
</tr>
</table>
</form>
.
.
的問題是如何能我從原始PHP調用者獲得一個值到dialog.htm中,以便在上面的表單中設置MySpecialId值?我想我可以使用dialog.js的AddImgDialog.init()js方法來設置表單,但再次如何讓TinyMCE工具欄通過調用PHP中的值傳遞給自定義按鈕dialog.js?
例如
var AddImgDialog = {
init : function() {
alert('My passed through value is xxxxx');
},
.
.
任何提示? 感謝 TD