// OEdit Ver. 3.7 - © 2007 Peter Andreas Harteg - http://www.harteg.dk var copyright="CMSimple - http://www.cmsimple.dk"; var changemode="'.$tx['editor']['changemode'].'"; var btns='.$tx['editor']['buttons'].'; var iimage=['.$iimage.']; var ilink=['.$ilink.']; function getimage(image){return '.$getimage.'} var format="HTML"; var isNav=(navigator.appName=="Netscape"||navigator.appName=="Opera"); function init(){ // turns iframe editable document.getElementById("f").contentWindow.document.designMode="on"; document.getElementById("f").contentWindow.focus(); window.status=copyright } function chmode(){ // changing between WYSIWYG and HTML if(format=="HTML"){ if(isNav){ var html=document.createTextNode(document.getElementById("f").contentWindow.document.body.innerHTML); with(document.getElementById("f").contentWindow.document.body){ innerHTML=""; appendChild(html) } } else{ with(document.getElementById("f").contentWindow){ with(document.body){ style.fontFamily="Courier"; style.fontSize="10pt"; innerText=innerHTML } focus(); document.body.createTextRange().collapse(false) } } document.getElementById("html").src=img2.src;format="Text" } else{ if(isNav){ var html=document.getElementById("f").contentWindow.document.body.ownerDocument.createRange(); html.selectNodeContents(document.getElementById("f").contentWindow.document.body); document.getElementById("f").contentWindow.document.body.innerHTML=html.toString() } else{ with(document.getElementById("f").contentWindow){ with(document.body){ innerHTML=innerText; style.fontFamily=""; style.fontSize="" } focus(); document.body.createTextRange().collapse(false) } } document.getElementById("html").src=img1.src;format="HTML" } } function cmd(c){ // button commands if(c=="save"){ if(format=="HTML"){ document.getElementById("text").value=document.getElementById("f").contentWindow.document.body.innerHTML; document.getElementById("ta").submit() } else if(confirm(changemode))chmode() } else if(c=="selectall")document.getElementById("f").contentWindow.document.execCommand(c,false,null); else if(c=="html")chmode(); else{ if(format=="HTML"||(c=="cut"||c=="copy"||c=="paste"||c=="undo"||c=="redo")){ var t=null; if(c=="iimage"){ t=document.forms[c].iimage.value;c="insertimage" } if(c=="ilink"){ t=document.forms[c].ilink.value;c="createlink" } if((c.search(/h\d/)!=-1)||c=="p"){ t="<"+c+">";c="formatblock" } document.getElementById("f").contentWindow.focus(); if(t==null&&c=="createlink"){ if(isNav){ t=prompt("Enter URL:",""); document.getElementById("f").contentWindow.document.execCommand("CreateLink",false,t) } else document.getElementById("f").contentWindow.document.selection.createRange().execCommand(c,true,t) } else if(c=="cut"||c=="copy"||c=="paste")document.getElementById("f").contentWindow.document.selection.createRange().execCommand(c,false,null); else document.getElementById("f").contentWindow.document.execCommand(c,false,t); document.getElementById("f").contentWindow.focus(); } } } function tables(){ // Used for editbuttons for(var i=0;i
"); else{ if(btns[i][0]!="")document.write("\""+btns[i][1]+"\""); else document.write("\"\"") } } } function sb(i,t){ // selectbox document.write("
") } function bloker(){ // Blocks dragndrop of editbuttons return false } document.ondragstart=bloker; img1=new Image(); img1.src=getimage("html"); img2=new Image(); img2.src=getimage("layout"); '; // HTML output to content $o.='

'.tag('input type="hidden" name="selected" value="'.$u[$s].'"').tag('input type="hidden" name="function" value="save"').'

'; } ?>