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