| @@ 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()); |
|
| @@ 849-861 (lines=13) @@ | ||
| 846 | new FieldList() |
|
| 847 | )->setHTMLID('Form_ListViewForm'); |
|
| 848 | $listview->setAttribute('data-pjax-fragment', 'ListViewForm'); |
|
| 849 | $listview->setValidationResponseCallback(function() use ($negotiator, $listview) { |
|
| 850 | $request = $this->getRequest(); |
|
| 851 | if($request->isAjax() && $negotiator) { |
|
| 852 | $listview->setupFormErrors(); |
|
| 853 | $result = $listview->forTemplate(); |
|
| 854 | ||
| 855 | return $negotiator->respond($request, array( |
|
| 856 | 'CurrentForm' => function() use($result) { |
|
| 857 | return $result; |
|
| 858 | } |
|
| 859 | )); |
|
| 860 | } |
|
| 861 | }); |
|
| 862 | ||
| 863 | $this->extend('updateListView', $listview); |
|
| 864 | ||
| @@ 135-147 (lines=13) @@ | ||
| 132 | )->setHTMLID('Form_AddForm'); |
|
| 133 | $form->setAttribute('data-hints', $this->SiteTreeHints()); |
|
| 134 | $form->setAttribute('data-childfilter', $this->Link('childfilter')); |
|
| 135 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
|
| 136 | $request = $this->getRequest(); |
|
| 137 | if($request->isAjax() && $negotiator) { |
|
| 138 | $this->setupFormErrors(); |
|
| 139 | $result = $this->forTemplate(); |
|
| 140 | ||
| 141 | return $negotiator->respond($request, array( |
|
| 142 | 'CurrentForm' => function() use($result) { |
|
| 143 | return $result; |
|
| 144 | } |
|
| 145 | )); |
|
| 146 | } |
|
| 147 | }); |
|
| 148 | $form->addExtraClass('cms-add-form cms-content center cms-edit-form ' . $this->BaseCSSClasses()); |
|
| 149 | $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); |
|
| 150 | ||