PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / trunk
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder vtrunk
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Http / Controllers / SubmissionNoteController.php

SubmissionNoteController.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder trunk, at app/Http/Controllers/SubmissionNoteController.php

53 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Http\Controllers;
4
5 use Exception;
6 use FluentForm\App\Services\Submission\SubmissionService;
7
8 class SubmissionNoteController extends Controller
9 {
10 public function get(SubmissionService $submissionService, $submissionId)
11 {
12 try {
13 $attributes = $this->request->all();
14
15 $sanitizeMap = [
16 'page' => 'intval',
17 'per_page' => 'intval',
18 ];
19 $attributes = fluentform_backend_sanitizer($attributes, $sanitizeMap);
20
21 return $this->sendSuccess(
22 $submissionService->getNotes($submissionId, $attributes)
23 );
24 } catch (Exception $exception) {
25 return $this->sendError([
26 'message' => $exception->getMessage(),
27 ]);
28 }
29 }
30
31 public function store(SubmissionService $submissionService, $submissionId)
32 {
33 try {
34 $attributes = $this->request->all();
35
36 if (isset($attributes['note']['content'])) {
37 $attributes['note']['content'] = wp_kses_post($attributes['note']['content']);
38 }
39 if (isset($attributes['note']['status'])) {
40 $attributes['note']['status'] = sanitize_text_field($attributes['note']['status']);
41 }
42
43 return $this->sendSuccess(
44 $submissionService->storeNote($submissionId, $attributes)
45 );
46 } catch (Exception $exception) {
47 return $this->sendError([
48 'message' => $exception->getMessage(),
49 ]);
50 }
51 }
52 }
53