1 | <?php |
||
21 | class ContentReviewCMSExtension extends LeftAndMainExtension |
||
22 | { |
||
23 | private static $allowed_actions = [ |
||
24 | 'ReviewContentForm', |
||
25 | 'savereview', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * URL handler for the "content due for review" form |
||
30 | * |
||
31 | * @param HTTPRequest $request |
||
32 | * @return Form|null |
||
33 | */ |
||
34 | public function ReviewContentForm(HTTPRequest $request) |
||
40 | |||
41 | /** |
||
42 | * Return a handler for "content due for review" forms, according to the given object ID |
||
43 | * |
||
44 | * @param int $id |
||
45 | * @return Form|null |
||
46 | */ |
||
47 | public function getReviewContentForm($id) |
||
74 | |||
75 | /** |
||
76 | * Action handler for processing the submitted content review |
||
77 | * |
||
78 | * @param array $data |
||
79 | * @param Form $form |
||
80 | * @return DBHTMLText|HTTPResponse|null |
||
81 | */ |
||
82 | public function savereview($data, Form $form) |
||
100 | |||
101 | /** |
||
102 | * Find the page this form is updating |
||
103 | * |
||
104 | * @param array $data Form data |
||
105 | * @return SiteTree Record |
||
106 | * @throws HTTPResponse_Exception |
||
107 | */ |
||
108 | protected function findRecord($data) |
||
123 | |||
124 | /** |
||
125 | * Check if the current request has a X-Formschema-Request header set. |
||
126 | * Used by conditional logic that responds to validation results |
||
127 | * |
||
128 | * @todo Remove duplication. See https://github.com/silverstripe/silverstripe-admin/issues/240 |
||
129 | * |
||
130 | * @return bool |
||
131 | */ |
||
132 | protected function getSchemaRequested() |
||
137 | |||
138 | /** |
||
139 | * Generate schema for the given form based on the X-Formschema-Request header value |
||
140 | * |
||
141 | * @todo Remove duplication. See https://github.com/silverstripe/silverstripe-admin/issues/240 |
||
142 | * |
||
143 | * @param string $schemaID ID for this schema. Required. |
||
144 | * @param Form $form Required for 'state' or 'schema' response |
||
145 | * @param ValidationResult $errors Required for 'error' response |
||
146 | * @param array $extraData Any extra data to be merged with the schema response |
||
147 | * @return HTTPResponse |
||
148 | */ |
||
149 | protected function getSchemaResponse($schemaID, $form = null, ValidationResult $errors = null, $extraData = []) |
||
165 | } |
||
166 |