mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-07-08 20:39:31 +02:00
MINOR Removed unused SecurityAdmin->deleteitems() method
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92840 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2d82a2ff35
commit
3a14e1dc58
|
@ -25,7 +25,6 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
||||||
'AddRecordForm',
|
'AddRecordForm',
|
||||||
'MemberForm',
|
'MemberForm',
|
||||||
'EditForm',
|
'EditForm',
|
||||||
'deleteitems',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
public function init() {
|
public function init() {
|
||||||
|
@ -227,27 +226,6 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
||||||
return FormResponse::respond();
|
return FormResponse::respond();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete a number of items
|
|
||||||
*/
|
|
||||||
public function deleteitems() {
|
|
||||||
$ids = split(' *, *', $_REQUEST['csvIDs']);
|
|
||||||
|
|
||||||
$script = "st = \$('sitetree'); \n";
|
|
||||||
foreach($ids as $id) {
|
|
||||||
if(is_numeric($id)) {
|
|
||||||
$record = DataObject::get_by_id($this->stat('tree_class'), $id);
|
|
||||||
if($record && !$record->canDelete()) return Security::permissionFailure($this);
|
|
||||||
|
|
||||||
DataObject::delete_by_id($this->stat('tree_class'), $id);
|
|
||||||
$script .= "node = st.getTreeNodeByIdx($id); if(node) node.parentTreeNode.removeTreeNode(node); $('Form_EditForm').closeIfSetTo($id); \n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FormResponse::add($script);
|
|
||||||
|
|
||||||
return FormResponse::respond();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the entire site tree as a nested set of ULs.
|
* Return the entire site tree as a nested set of ULs.
|
||||||
* @return string Unordered list <UL> HTML
|
* @return string Unordered list <UL> HTML
|
||||||
|
|
Loading…
Reference in New Issue
Block a user