| @@ 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()); |
|
| @@ 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 | ||
| @@ 818-830 (lines=13) @@ | ||
| 815 | new FieldList() |
|
| 816 | )->setHTMLID('Form_ListViewForm'); |
|
| 817 | $listview->setAttribute('data-pjax-fragment', 'ListViewForm'); |
|
| 818 | $listview->setValidationResponseCallback(function() use ($negotiator, $listview) { |
|
| 819 | $request = $this->getRequest(); |
|
| 820 | if($request->isAjax() && $negotiator) { |
|
| 821 | $listview->setupFormErrors(); |
|
| 822 | $result = $listview->forTemplate(); |
|
| 823 | ||
| 824 | return $negotiator->respond($request, array( |
|
| 825 | 'CurrentForm' => function() use($result) { |
|
| 826 | return $result; |
|
| 827 | } |
|
| 828 | )); |
|
| 829 | } |
|
| 830 | }); |
|
| 831 | ||
| 832 | $this->extend('updateListView', $listview); |
|
| 833 | ||