/**
  * Process 'delete' of one category
  *
  * @param int $id
  */
 protected function delete($id)
 {
     d('cp');
     try {
         $this->checkAccessPermission('edit_category');
         $canEdit = true;
     } catch (\Exception $e) {
         $canEdit = false;
         $res = true;
     }
     if ($canEdit) {
         $Editor = new \Lampcms\Category\Editor($this->Registry);
         $res = $Editor->delete($id);
     }
     Responder::sendJSON(array('deleted' => $id, 'res' => $res));
 }
示例#2
0
 /**
  * Process 'delete' of one category
  *
  * @param int $id
  */
 protected function delete($id)
 {
     d('cp');
     $Editor = new \Lampcms\Category\Editor($this->Registry);
     d('cp');
     $res = $Editor->delete($id);
     Responder::sendJSON(array('deleted' => $id, 'res' => $res));
 }