Completed
Pull Request — master (#288)
by Damian
02:08
created

FolderFormBuilder::getFormActions()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace SilverStripe\AssetAdmin\Forms;
4
5
use SilverStripe\Forms\FieldList;
6
7
class FolderFormBuilder extends AssetFormBuilder
8
{
9
10
    /**
11
     * Build basic actions
12
     *
13
     * @return FieldList
14
     */
15
    public function getFormActions()
16
    {
17
        // Add delete action as top level button before extensions are triggered
18
        $this->beforeUpdate('FormActions', function (FieldList $actions) {
19
            if ($deleteAction = $this->getDeleteAction()) {
20
                $actions->push($deleteAction);
21
            }
22
        });
23
        return parent::getFormActions();
24
    }
25
}
26