Code Duplication    Length = 7-10 lines in 2 locations

code/Model/SiteTree.php 2 locations

@@ 2150-2156 (lines=7) @@
2147
        }
2148
2149
        // "unpublish"
2150
        if ($isPublished && $canPublish && $isOnDraft && $canUnpublish) {
2151
            $moreOptions->push(
2152
                FormAction::create('unpublish', _t(__CLASS__.'.BUTTONUNPUBLISH', 'Unpublish'), 'delete')
2153
                    ->setDescription(_t(__CLASS__.'.BUTTONUNPUBLISHDESC', 'Remove this page from the published site'))
2154
                    ->addExtraClass('btn-secondary')
2155
            );
2156
        }
2157
2158
        // "rollback"
2159
        if ($isOnDraft && $isPublished && $canEdit && $stagesDiffer) {
@@ 2159-2168 (lines=10) @@
2156
        }
2157
2158
        // "rollback"
2159
        if ($isOnDraft && $isPublished && $canEdit && $stagesDiffer) {
2160
            $moreOptions->push(
2161
                FormAction::create('rollback', _t(__CLASS__.'.BUTTONCANCELDRAFT', 'Cancel draft changes'))
2162
                    ->setDescription(_t(
2163
                        'SilverStripe\\CMS\\Model\\SiteTree.BUTTONCANCELDRAFTDESC',
2164
                        'Delete your draft and revert to the currently published page'
2165
                    ))
2166
                    ->addExtraClass('btn-secondary')
2167
            );
2168
        }
2169
2170
        // "restore"
2171
        if ($canEdit && !$isOnDraft && $isPublished) {