Commit f36e6976 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Confirm before deleting admin menu items

parent 2c4cb68c
......@@ -31,7 +31,7 @@ define('SUBMENUITEM', 'sitemenu');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$strings = array('edit','delete','update','cancel','add','name','unknownerror');
$adminstrings = array('deletefailed','deletingmenuitem','savingmenuitem',
$adminstrings = array('confirmdeletemenuitem', 'deletefailed','deletingmenuitem','savingmenuitem',
'noadminfiles','loggedinmenu','loggedoutmenu','linkedto','externallink','adminfile',
'loadingmenuitems','menuitemsloaded','failedloadingadminfiles',
'failedloadingmenuitems');
......@@ -225,8 +225,9 @@ function edititem(item) {
// Receive standard json error message
// Request deletion of a menu item from the db
function delitem(itemid) {
logDebug({$getstring['deletingmenuitem']});
sendjsonrequest('deletemenuitem.json.php',{'itemid':itemid}, getitems);
if (confirm({$getstring['confirmdeletemenuitem']})) {
sendjsonrequest('deletemenuitem.json.php',{'itemid':itemid}, getitems);
}
}
// Send the menu item in the form to the database.
......
......@@ -113,6 +113,7 @@ $string['adminfile'] = 'Admin file';
$string['adminpublicdirname'] = 'public'; // Name of the directory in which to store public admin files
$string['adminpublicdirdescription'] = 'Files accessible by logged out users';
$string['badmenuitemtype'] = 'Unknown menu item type';
$string['confirmdeletemenuitem'] = 'Do you really want to delete this item?';
$string['externallink'] = 'External link';
$string['type'] = 'Type';
$string['name'] = 'Name';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment