| @@ 448-460 (lines=13) @@ | ||
| 445 | ->setTitle(_t('AssetAdmin.ActionAdd', 'Add folder')) |
|
| 446 | ) |
|
| 447 | )->setHTMLID('Form_AddForm'); |
|
| 448 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
|
| 449 | $request = $this->getRequest(); |
|
| 450 | if($request->isAjax() && $negotiator) { |
|
| 451 | $form->setupFormErrors(); |
|
| 452 | $result = $form->forTemplate(); |
|
| 453 | ||
| 454 | return $negotiator->respond($request, array( |
|
| 455 | 'CurrentForm' => function() use($result) { |
|
| 456 | return $result; |
|
| 457 | } |
|
| 458 | )); |
|
| 459 | } |
|
| 460 | }); |
|
| 461 | $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); |
|
| 462 | // TODO Can't merge $FormAttributes in template at the moment |
|
| 463 | $form->addExtraClass('add-form cms-add-form cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses()); |
|
| @@ 842-854 (lines=13) @@ | ||
| 839 | new FieldList() |
|
| 840 | )->setHTMLID('Form_ListViewForm'); |
|
| 841 | $listview->setAttribute('data-pjax-fragment', 'ListViewForm'); |
|
| 842 | $listview->setValidationResponseCallback(function() use ($negotiator, $listview) { |
|
| 843 | $request = $this->getRequest(); |
|
| 844 | if($request->isAjax() && $negotiator) { |
|
| 845 | $listview->setupFormErrors(); |
|
| 846 | $result = $listview->forTemplate(); |
|
| 847 | ||
| 848 | return $negotiator->respond($request, array( |
|
| 849 | 'CurrentForm' => function() use($result) { |
|
| 850 | return $result; |
|
| 851 | } |
|
| 852 | )); |
|
| 853 | } |
|
| 854 | }); |
|
| 855 | ||
| 856 | $this->extend('updateListView', $listview); |
|
| 857 | ||
| @@ 123-135 (lines=13) @@ | ||
| 120 | )->setHTMLID('Form_AddForm'); |
|
| 121 | $form->setAttribute('data-hints', $this->SiteTreeHints()); |
|
| 122 | $form->setAttribute('data-childfilter', $this->Link('childfilter')); |
|
| 123 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
|
| 124 | $request = $this->getRequest(); |
|
| 125 | if($request->isAjax() && $negotiator) { |
|
| 126 | $this->setupFormErrors(); |
|
| 127 | $result = $this->forTemplate(); |
|
| 128 | ||
| 129 | return $negotiator->respond($request, array( |
|
| 130 | 'CurrentForm' => function() use($result) { |
|
| 131 | return $result; |
|
| 132 | } |
|
| 133 | )); |
|
| 134 | } |
|
| 135 | }); |
|
| 136 | $form->addExtraClass('cms-add-form stacked cms-content center cms-edit-form ' . $this->BaseCSSClasses()); |
|
| 137 | $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); |
|
| 138 | ||