| @@ 20-27 (lines=8) @@ | ||
| 17 | { |
|
| 18 | if (isset($_POST['delete'])) { |
|
| 19 | $model = new DelModel(); |
|
| 20 | if ($model->del($id)) { |
|
| 21 | AlertsCollection::add(new Alert( |
|
| 22 | 'success', |
|
| 23 | 'Poprawnie usunięto!' |
|
| 24 | )); |
|
| 25 | $this->redirectTo(DIR.'/admin/appearance/menu'); |
|
| 26 | return; |
|
| 27 | } |
|
| 28 | AlertsCollection::add(new Alert( |
|
| 29 | 'success', |
|
| 30 | 'Coś się zepsuło!' |
|
| @@ 23-30 (lines=8) @@ | ||
| 20 | $view = new EditView(); |
|
| 21 | ||
| 22 | if (isset($_POST['update'])) { |
|
| 23 | if ($model->edit($id, $_POST)) { |
|
| 24 | AlertsCollection::add(new Alert( |
|
| 25 | 'success', |
|
| 26 | 'Zaktualizowano!' |
|
| 27 | )); |
|
| 28 | $this->redirectTo(DIR.'/admin/appearance/menu/edit/'.$id); |
|
| 29 | return; |
|
| 30 | } |
|
| 31 | AlertsCollection::add(new Alert( |
|
| 32 | 'error', |
|
| 33 | 'Coś się zepsuło!' |
|