| @@ 459-471 (lines=13) @@ | ||
| 456 | ->setTitle(_t('AssetAdmin.ActionAdd', 'Add folder')) |
|
| 457 | ) |
|
| 458 | )->setHTMLID('Form_AddForm'); |
|
| 459 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
|
| 460 | $request = $this->getRequest(); |
|
| 461 | if($request->isAjax() && $negotiator) { |
|
| 462 | $form->setupFormErrors(); |
|
| 463 | $result = $form->forTemplate(); |
|
| 464 | ||
| 465 | return $negotiator->respond($request, array( |
|
| 466 | 'CurrentForm' => function() use($result) { |
|
| 467 | return $result; |
|
| 468 | } |
|
| 469 | )); |
|
| 470 | } |
|
| 471 | }); |
|
| 472 | $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); |
|
| 473 | // TODO Can't merge $FormAttributes in template at the moment |
|
| 474 | $form->addExtraClass('add-form cms-add-form cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses()); |
|
| @@ 836-848 (lines=13) @@ | ||
| 833 | new FieldList() |
|
| 834 | )->setHTMLID('Form_ListViewForm'); |
|
| 835 | $listview->setAttribute('data-pjax-fragment', 'ListViewForm'); |
|
| 836 | $listview->setValidationResponseCallback(function() use ($negotiator, $listview) { |
|
| 837 | $request = $this->getRequest(); |
|
| 838 | if($request->isAjax() && $negotiator) { |
|
| 839 | $listview->setupFormErrors(); |
|
| 840 | $result = $listview->forTemplate(); |
|
| 841 | ||
| 842 | return $negotiator->respond($request, array( |
|
| 843 | 'CurrentForm' => function() use($result) { |
|
| 844 | return $result; |
|
| 845 | } |
|
| 846 | )); |
|
| 847 | } |
|
| 848 | }); |
|
| 849 | ||
| 850 | $this->extend('updateListView', $listview); |
|
| 851 | ||
| @@ 129-141 (lines=13) @@ | ||
| 126 | )->setHTMLID('Form_AddForm'); |
|
| 127 | $form->setAttribute('data-hints', $this->SiteTreeHints()); |
|
| 128 | $form->setAttribute('data-childfilter', $this->Link('childfilter')); |
|
| 129 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
|
| 130 | $request = $this->getRequest(); |
|
| 131 | if($request->isAjax() && $negotiator) { |
|
| 132 | $this->setupFormErrors(); |
|
| 133 | $result = $this->forTemplate(); |
|
| 134 | ||
| 135 | return $negotiator->respond($request, array( |
|
| 136 | 'CurrentForm' => function() use($result) { |
|
| 137 | return $result; |
|
| 138 | } |
|
| 139 | )); |
|
| 140 | } |
|
| 141 | }); |
|
| 142 | $form->addExtraClass('cms-add-form stacked cms-content center cms-edit-form ' . $this->BaseCSSClasses()); |
|
| 143 | $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); |
|
| 144 | ||