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