| @@ 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 | ||
| @@ 922-934 (lines=13) @@ | ||
| 919 | new FieldList() |
|
| 920 | )->setHTMLID('Form_ListViewForm'); |
|
| 921 | $listview->setAttribute('data-pjax-fragment', 'ListViewForm'); |
|
| 922 | $listview->setValidationResponseCallback(function() use ($negotiator, $listview) { |
|
| 923 | $request = $this->getRequest(); |
|
| 924 | if($request->isAjax() && $negotiator) { |
|
| 925 | $listview->setupFormErrors(); |
|
| 926 | $result = $listview->forTemplate(); |
|
| 927 | ||
| 928 | return $negotiator->respond($request, array( |
|
| 929 | 'CurrentForm' => function() use($result) { |
|
| 930 | return $result; |
|
| 931 | } |
|
| 932 | )); |
|
| 933 | } |
|
| 934 | }); |
|
| 935 | ||
| 936 | $this->extend('updateListView', $listview); |
|
| 937 | ||