Jump to content

Accidental Deletion Prevention


Arceus
 Share

Recommended Posts

Since I know in Athens atm, the delete buttons just delete stuff, here's a quick code you can add to the buttonstrip template to add in deletion confirmation. This will stop it from deleting things when a user accidentally clicks a delete button. You can do this in the admin panel, as well, by editing the default_admin files.

 

Get into frame.template.php and find this:

$arry .= '
                        <li class="page-item"><a class="page-link" href="'.$button->href.'"'.(isset($button->modal) ? ' data-toggle="modal" data-target="'.$button->modal.'"' : '').'>'.$button->title.'</a></li>';

And add this:

($button->title == 'Delete' ? ' onclick="return confirm(\'Are you sure?\');"' : '').

You should end up with this:

$arry .= '
                        <li class="page-item"><a class="page-link" href="'.$button->href.'"'.(isset($button->modal) ? ' data-toggle="modal" data-target="'.$button->modal.'"' : '').($button->title == 'Delete' ? ' onclick="return confirm(\'Are you sure?\');"' : '').'>'.$button->title.'</a></li>';

I don't know if this will work in all browsers for all users, but hopefully it'll work for most and stop most instances of accidental deletion.

  • Like 1
  • Fuck Yeah! 1

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.