1 | <?php |
||
23 | class RemoteFileModalExtension extends Extension |
||
24 | { |
||
25 | private static $allowed_actions = array( |
||
26 | 'remoteCreateForm', |
||
27 | 'remoteEditForm', |
||
28 | 'remoteEditFormSchema', |
||
29 | ); |
||
30 | |||
31 | /** |
||
32 | * @return ModalController |
||
33 | */ |
||
34 | public function getOwner() |
||
40 | |||
41 | /** |
||
42 | * @return HTTPRequest |
||
43 | */ |
||
44 | protected function getRequest() |
||
48 | |||
49 | /** |
||
50 | * @return FormSchema |
||
51 | */ |
||
52 | protected function getFormSchema() |
||
56 | |||
57 | /** |
||
58 | * Form for creating a new OEmbed object in the WYSIWYG, used by the InsertEmbedModal component |
||
59 | * |
||
60 | * @return Form |
||
61 | */ |
||
62 | public function remoteCreateForm() |
||
71 | |||
72 | /** |
||
73 | * Form for editing a OEmbed object in the WYSIWYG, used by the InsertEmbedModal component |
||
74 | * |
||
75 | * @return Form |
||
76 | */ |
||
77 | public function remoteEditForm() |
||
89 | |||
90 | /** |
||
91 | * Capture the schema handling process, as there is validation done to the URL provided before form is generated |
||
92 | * |
||
93 | * @param HTTPRequest $request |
||
94 | * @return HTTPResponse |
||
95 | */ |
||
96 | public function remoteEditFormSchema(HTTPRequest $request) |
||
118 | |||
119 | /** |
||
120 | * Generate schema for the given form based on the X-Formschema-Request header value |
||
121 | * |
||
122 | * @todo de-dupe this logic with LeftAndMain::getSchemaResponse() |
||
123 | * |
||
124 | * @param string $schemaID ID for this schema. Required. |
||
125 | * @param Form $form Required for 'state' or 'schema' response |
||
126 | * @param ValidationResult $errors Required for 'error' response |
||
127 | * @param array $extraData Any extra data to be merged with the schema response |
||
128 | * @return HTTPResponse |
||
129 | */ |
||
130 | protected function getSchemaResponse($schemaID, $form = null, ValidationResult $errors = null, $extraData = []) |
||
145 | } |
||
146 |