Code Duplication    Length = 11-12 lines in 2 locations

code/Controllers/CMSMain.php 1 location

@@ 1468-1478 (lines=11) @@
1465
            new FieldList()
1466
        )->setHTMLID('Form_ListViewForm');
1467
        $listview->setAttribute('data-pjax-fragment', 'ListViewForm');
1468
        $listview->setValidationResponseCallback(function (ValidationResult $errors) use ($negotiator, $listview) {
1469
            $request = $this->getRequest();
1470
            if ($request->isAjax() && $negotiator) {
1471
                $result = $listview->forTemplate();
1472
                return $negotiator->respond($request, array(
1473
                    'CurrentForm' => function () use ($result) {
1474
                        return $result;
1475
                    }
1476
                ));
1477
            }
1478
        });
1479
1480
        $this->extend('updateListView', $listview);
1481

code/Controllers/CMSPageAddController.php 1 location

@@ 155-166 (lines=12) @@
152
        )->setHTMLID('Form_AddForm');
153
        $form->setAttribute('data-hints', $this->SiteTreeHints());
154
        $form->setAttribute('data-childfilter', $this->Link('childfilter'));
155
        $form->setValidationResponseCallback(function (ValidationResult $errors) use ($negotiator, $form) {
156
            $request = $this->getRequest();
157
            if ($request->isAjax() && $negotiator) {
158
                $result = $form->forTemplate();
159
                return $negotiator->respond($request, array(
160
                    'CurrentForm' => function () use ($result) {
161
                        return $result;
162
                    }
163
                ));
164
            }
165
            return null;
166
        });
167
        $form->addExtraClass('flexbox-area-grow fill-height cms-add-form cms-content cms-edit-form ' . $this->BaseCSSClasses());
168
        $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
169