| @@ 69-76 (lines=8) @@ | ||
| 66 | $model = new SCallbacks; |
|
| 67 | $this->form_validation->set_rules($model->rules()); |
|
| 68 | ||
| 69 | if (!$this->form_validation->run()) { |
|
| 70 | throw new ValidationException( |
|
| 71 | [ |
|
| 72 | 'message' => validation_errors(), |
|
| 73 | 'errors' => $this->form_validation->getErrorsArray(), |
|
| 74 | ] |
|
| 75 | ); |
|
| 76 | } |
|
| 77 | ||
| 78 | $theme = SCallbackThemesQuery::create()->orderByPosition()->findOne(); |
|
| 79 | $status = SCallbackStatusesQuery::create()->filterByIsDefault(TRUE)->findOne(); |
|
| @@ 57-62 (lines=6) @@ | ||
| 54 | $this->form_validation->set_rules('email', lang('Email', 'admin'), 'required|valid_email'); |
|
| 55 | $this->form_validation->set_rules('link', lang('link', 'admin'), 'required'); |
|
| 56 | ||
| 57 | if (!$this->form_validation->run()) { |
|
| 58 | return [ |
|
| 59 | 'message' => validation_errors(), |
|
| 60 | 'errors' => $this->form_validation->getErrorsArray(), |
|
| 61 | ]; |
|
| 62 | } |
|
| 63 | ||
| 64 | $data = $this->input->post(); |
|
| 65 | $data['date'] = time(); |
|