Codice PHP:
<script language="javascript" type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
height : "300",
mode : "textareas",
theme : "advanced",
// plugins : "insertdatetime,contextmenu,paste,directionality",
// theme_advanced_buttons1_add_before : "save,newdocument,separator",
// theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "forecolor,backcolor,separator,charmap",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator",
theme_advanced_buttons3_add_before : "fontselect,fontsizeselect",
// theme_advanced_buttons3_add_before : "tablecontrols,separator",
// theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
// theme_advanced_statusbar_location : "bottom",
file_browser_callback : "fileBrowserCallBack",
paste_use_dialog : false,
theme_advanced_resize_horizontal : false,
theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
paste_auto_cleanup_on_paste : true,
paste_convert_headers_to_strong : false,
paste_strip_class_attributes : "all",
paste_remove_spans : false,
paste_remove_styles : false,
theme_advanced_disable : "charmap,separator,link,unlink,image,cleanup,help,code,hr,removeformat,formatselect,styleselect,sub,sup,visualaid,anchor,newdocument"
});
function fileBrowserCallBack(field_name, url, type, win) {
// This is where you insert your custom filebrowser logic
alert("Filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type);
// Insert new URL, this would normaly be done in a popup
win.document.forms[0].elements[field_name].value = "someurl.htm";
}
</script>
<script type="text/javascript">
function modifica(id) {
id--;
riga=document.getElementById('tab1');
back=riga.rows[id].cells[2].innerText;
pn=riga.rows[id].cells[2].parentNode;
f=pn.childNodes[2];
cella=document.createElement("td");
textarea=document.createElement("textarea");
cella.appendChild(textarea);
pn.replaceChild(cella,f);
}
</script>
il primo blocco di script è quello TinyMCE, con l'inizializzazione (modificata in base alla mie esigenze)