@@ 150-161 (lines=12) @@ | ||
147 | )->setHTMLID('Form_AddForm'); |
|
148 | $form->setAttribute('data-hints', $this->SiteTreeHints()); |
|
149 | $form->setAttribute('data-childfilter', $this->Link('childfilter')); |
|
150 | $form->setValidationResponseCallback(function(ValidationResult $errors) use ($negotiator, $form) { |
|
151 | $request = $this->getRequest(); |
|
152 | if($request->isAjax() && $negotiator) { |
|
153 | $result = $form->forTemplate(); |
|
154 | return $negotiator->respond($request, array( |
|
155 | 'CurrentForm' => function() use($result) { |
|
156 | return $result; |
|
157 | } |
|
158 | )); |
|
159 | } |
|
160 | return null; |
|
161 | }); |
|
162 | $form->addExtraClass('flexbox-area-grow fill-height cms-add-form cms-content cms-edit-form ' . $this->BaseCSSClasses()); |
|
163 | $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); |
|
164 |
@@ 989-999 (lines=11) @@ | ||
986 | new FieldList() |
|
987 | )->setHTMLID('Form_ListViewForm'); |
|
988 | $listview->setAttribute('data-pjax-fragment', 'ListViewForm'); |
|
989 | $listview->setValidationResponseCallback(function(ValidationResult $errors) use ($negotiator, $listview) { |
|
990 | $request = $this->getRequest(); |
|
991 | if($request->isAjax() && $negotiator) { |
|
992 | $result = $listview->forTemplate(); |
|
993 | return $negotiator->respond($request, array( |
|
994 | 'CurrentForm' => function() use($result) { |
|
995 | return $result; |
|
996 | } |
|
997 | )); |
|
998 | } |
|
999 | }); |
|
1000 | ||
1001 | $this->extend('updateListView', $listview); |
|
1002 |