| @@ 505-517 (lines=13) @@ | ||
| 502 | ->setTitle(_t('AssetAdmin.ActionAdd', 'Add folder')) |
|
| 503 | ) |
|
| 504 | )->setHTMLID('Form_AddForm'); |
|
| 505 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
|
| 506 | $request = $this->getRequest(); |
|
| 507 | if($request->isAjax() && $negotiator) { |
|
| 508 | $form->setupFormErrors(); |
|
| 509 | $result = $form->forTemplate(); |
|
| 510 | ||
| 511 | return $negotiator->respond($request, array( |
|
| 512 | 'CurrentForm' => function() use($result) { |
|
| 513 | return $result; |
|
| 514 | } |
|
| 515 | )); |
|
| 516 | } |
|
| 517 | }); |
|
| 518 | $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); |
|
| 519 | // TODO Can't merge $FormAttributes in template at the moment |
|
| 520 | $form->addExtraClass('add-form cms-add-form cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses()); |
|
| @@ 916-928 (lines=13) @@ | ||
| 913 | new FieldList() |
|
| 914 | )->setHTMLID('Form_ListViewForm'); |
|
| 915 | $listview->setAttribute('data-pjax-fragment', 'ListViewForm'); |
|
| 916 | $listview->setValidationResponseCallback(function() use ($negotiator, $listview) { |
|
| 917 | $request = $this->getRequest(); |
|
| 918 | if($request->isAjax() && $negotiator) { |
|
| 919 | $listview->setupFormErrors(); |
|
| 920 | $result = $listview->forTemplate(); |
|
| 921 | ||
| 922 | return $negotiator->respond($request, array( |
|
| 923 | 'CurrentForm' => function() use($result) { |
|
| 924 | return $result; |
|
| 925 | } |
|
| 926 | )); |
|
| 927 | } |
|
| 928 | }); |
|
| 929 | ||
| 930 | $this->extend('updateListView', $listview); |
|
| 931 | ||
| @@ 151-163 (lines=13) @@ | ||
| 148 | )->setHTMLID('Form_AddForm'); |
|
| 149 | $form->setAttribute('data-hints', $this->SiteTreeHints()); |
|
| 150 | $form->setAttribute('data-childfilter', $this->Link('childfilter')); |
|
| 151 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
|
| 152 | $request = $this->getRequest(); |
|
| 153 | if($request->isAjax() && $negotiator) { |
|
| 154 | $this->setupFormErrors(); |
|
| 155 | $result = $this->forTemplate(); |
|
| 156 | ||
| 157 | return $negotiator->respond($request, array( |
|
| 158 | 'CurrentForm' => function() use($result) { |
|
| 159 | return $result; |
|
| 160 | } |
|
| 161 | )); |
|
| 162 | } |
|
| 163 | }); |
|
| 164 | $form->addExtraClass('cms-add-form cms-content center cms-edit-form ' . $this->BaseCSSClasses()); |
|
| 165 | $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); |
|
| 166 | ||