Locate the frmresourceslist.html file in the Fckeditoreditorfilemanagerbrowserdefault folder and modify the code as follows
Olistmanager.getfilerowhtml found here, the following code replaces the original code
The code is as follows |
Copy Code |
olistmanager.getfilerowhtml = function (FileName, FILEURL, fileSize) { Build the link to view the folder. var slink = ' <a href= ' # "mce_href=" # "onclick=" OpenFile (' + protectpath (FILEURL) + '); return false; " > Selection </a> ';
Get the file icon. var Sicon = Oicons.geticon (fileName);
Return ' <div class= "piclist" ><p> ' + slink + ' <a href= ' # "mce_href=" # "onclick=" DeleteFile (' + protectpath (FILEURL) + '); " style= "COLOR: #FF9933;" mce_style= "color: #FF9933;" > Delete </a></p></div> ' ; } |
In the Add a
<script type= "Text/javascript" src= "/js/ajaxdel.js" ></script>
Ajaxdel.js file
The code is as follows |
Copy Code |
Picture deletion feature ****************************************** var req; Defines variables that are used to create XMLHttpRequest objects
Produces a random number that is not repeated var rn = Math.ceil (Math.random () * 1000000); var rnch = RN;
function Rndnum () { while (rn = = rnch) rn = Math.ceil (Math.random () * 1000000); Rnch = RN; return RN; }
Delete file, Ajax start function DeleteFile (file) { var url = "/ajaxpic.php?filepath=" + escape (file) + "&ud=" + rndnum (); Service-side address to request if (window. XMLHttpRequest)//non IE browser and IE7 (version 7.0 and above), with XMLHttpRequest object to create Built { req = new XMLHttpRequest (); } else if (window. ActiveXObject)//ie (version 6.0 and below) browsers are created with ActiveXObject objects if the user's browser disables ActiveX, may fail. { req = new ActiveXObject ("Microsoft.XMLHTTP"); }
if (req)///successfully created XMLHttpRequest { Req.open ("Get", url, True); Establish a connection to the server (Request mode post or get, address, true to indicate asynchronous) Req.onreadystatechange = callback; Specifying callback Functions Req.send (NULL); Send Request } }
function callback () { if (Req.responsetext ==1) { Alert (' Delete successful! '); Refresh (); } Else { Alert (' Delete failed! '); }//, refresh yourself. } |
ajaxpic.php file saved as ajaxpic.php
The code is as follows |
Copy Code |
? $root = DirName (__file__); $filePath = isset ($_get[' FilePath '])? $_get[' FilePath ']: '; if (unlink ($root. $filePath)) { echo ' 1 '; } Else { echo ' 0 '; } ?> |