NodesController::admin_delete PHP Method

admin_delete() public method

Admin delete
public admin_delete ( integer $id = null ) : void
$id integer
return void
    public function admin_delete($id = null)
    {
        if (!$id) {
            $this->Session->setFlash(__d('croogo', 'Invalid id for Node'), 'flash', array('class' => 'error'));
            return $this->redirect(array('action' => 'index'));
        }
        $Node = $this->{$this->modelClass};
        if ($Node->delete($id)) {
            $this->Session->setFlash(__d('croogo', 'Node deleted'), 'flash', array('class' => 'success'));
            return $this->redirect(array('action' => 'index'));
        }
    }