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