array(), 'deleted'=>array(), 'error'=>array() ); foreach($pages as $page) { $id = $page->ID; // Perform the action if($page->canDelete()) $page->delete(); else $status['error'][$page->ID] = true; // check to see if the record exists on the live site, // if it doesn't remove the tree node $liveRecord = Versioned::get_one_by_stage( 'SilverStripe\\CMS\\Model\\SiteTree', 'Live', array( '"SiteTree"."ID"' => $id )); if($liveRecord) { $status['modified'][$liveRecord->ID] = array( 'TreeTitle' => $liveRecord->TreeTitle, ); } else { $status['deleted'][$id] = array(); } } return $this->response(_t('CMSBatchActions.DELETED_DRAFT_PAGES', 'Deleted %d pages from draft site, %d failures'), $status); } public function applicablePages($ids) { return $this->applicablePagesHelper($ids, 'canDelete', true, false); } }