Пример #1
0
 /**
  * @Request({"id": "int"}, csrf=true)
  */
 public function deleteAction($id = 0)
 {
     if ($role = $this->roles->find($id)) {
         $this->roles->delete($role);
     }
     return $this->redirect('@system/role');
 }
Пример #2
0
 /**
  * @Request({"id": "int"}, csrf=true)
  */
 public function deleteAction($id)
 {
     try {
         if (!($menu = $this->menus->find($id))) {
             throw new Exception(__('Invalid menu id'));
         }
         $this->menus->delete($menu);
         $this['db']->delete('@system_menu_item', ['menu_id' => $id]);
     } catch (Exception $e) {
         $this['message']->error($e->getMessage());
     }
     return $this->redirect('@system/menu');
 }
Пример #3
0
 /**
  * @Request({"ids": "int[]"}, csrf=true)
  * @Response("json")
  */
 public function deleteAction($ids = [])
 {
     foreach ($ids as $id) {
         if ($page = $this->pages->find($id)) {
             $this->pages->delete($page);
         }
     }
     return ['message' => _c('{0} No page deleted.|{1} Page deleted.|]1,Inf[ Pages deleted.', count($ids))];
 }
Пример #4
0
 /**
  * @Request({"ids": "int[]"}, csrf=true)
  * @Response("json")
  */
 public function deleteAction($ids = [])
 {
     foreach ($ids as $id) {
         if ($comment = $this->comments->find($id)) {
             $this->comments->delete($comment);
         }
     }
     return ['message' => _c('{0} No comment deleted.|{1} Comment deleted.|]1,Inf[ Comments deleted.', count($ids))];
 }
Пример #5
0
 /**
  * @Request({"ids": "int[]"}, csrf=true)
  */
 public function deleteAction($ids = [])
 {
     foreach ($ids as $id) {
         if ($alias = $this->aliases->find($id)) {
             $this->aliases->delete($alias);
         }
     }
     $this['message']->success(_c('{0} No alias deleted.|{1} Alias deleted.|]1,Inf[ Aliases deleted.', count($ids)));
     return $this->redirect('@system/alias');
 }
Пример #6
0
 /**
  * @Request({"ids": "int[]"}, csrf=true)
  */
 public function deleteAction($ids = [])
 {
     foreach ($ids as $id) {
         if ($widget = $this->widgets->find($id)) {
             $this->widgets->delete($widget);
         }
     }
     $this['message']->success(_c('{0} No widget deleted.|{1} Widget deleted.|]1,Inf[ Widgets deleted.', count($ids)));
     return $this->redirect('@system/widgets');
 }