unable to delete sub folder fix

Share your CuteNews.RU skins and code snippets.

unable to delete sub folder fix

Postby gamezonline » Sun Feb 07, 2010 5:57 pm

a quick bug fix for Improved image manager

Edit: A small bug fix, there a bug in the code right now that if you click delete then click cancel on the confirm windows then try to rename a folder it will delete the forlder you was trying to rename, code has been updata to apply a fix for that bug
Edit: 2 Another bug fix
in /inc/mod/images.mdu on line 505 find

Code: Select all
<input type="submit" id="rename_folder" value="<?=$echo['renameFolder']; ?>" disabled />
<input type="submit" id="delete_folder" value="<?=$echo['deleteFolder']; ?>" onclick="confirmDelete('<?=$PHP_SELF; ?>&action=delete_folder')" disabled />


and replace it with

Code: Select all
<input type="submit" id="rename_folder" value="<?=$echo['renameFolder']; ?>" onclick="document.subfolder_form.action.value='rename_subfolders'" disabled />
<input type="submit" id="delete_folder" value="<?=$echo['deleteFolder']; ?>" onclick="document.subfolder_form.action.value='delete_folder';return confirmDelete('');" disabled />


in skins/cute.js on line 28 find
Code: Select all
function confirmDelete(url){
   var agree = confirm('Do you really want to delete this?');

   if (agree){
      document.location=url;
   }
}


and replace it with
Code: Select all
function confirmDelete(url){
   var agree = confirm('Do you really want to delete this?');

   if (agree){
      if(url !='') document.location=url; else return true;
   }
   else if(url=='')return false;
}


now im not the best coder but it works, if u have any problems leave a post and ill try to help you out
Last edited by gamezonline on Sun Feb 07, 2010 6:34 pm, edited 1 time in total.
gamezonline
 
Posts: 8
Joined: Sun Feb 08, 2009 3:17 am

Postby DarkSlim » Sun Feb 07, 2010 6:22 pm

Cool thanks! I will also check it out :)

Added to the CNR Index!
User avatar
DarkSlim
 
Posts: 296
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL


Return to Skins and snippets



Who is online

Users browsing this forum: No registered users and 0 guests

cron