Code Duplication    Length = 7-10 lines in 2 locations

code/Model/SiteTree.php 2 locations

@@ 2182-2188 (lines=7) @@
2179
        }
2180
2181
        // "unpublish"
2182
        if ($isPublished && $canPublish && $isOnDraft && $canUnpublish) {
2183
            $moreOptions->push(
2184
                FormAction::create('unpublish', _t(__CLASS__.'.BUTTONUNPUBLISH', 'Unpublish'), 'delete')
2185
                    ->setDescription(_t(__CLASS__.'.BUTTONUNPUBLISHDESC', 'Remove this page from the published site'))
2186
                    ->addExtraClass('btn-secondary')
2187
            );
2188
        }
2189
2190
        // "rollback"
2191
        if ($isOnDraft && $isPublished && $canEdit && $stagesDiffer) {
@@ 2191-2200 (lines=10) @@
2188
        }
2189
2190
        // "rollback"
2191
        if ($isOnDraft && $isPublished && $canEdit && $stagesDiffer) {
2192
            $moreOptions->push(
2193
                FormAction::create('rollback', _t(__CLASS__.'.BUTTONCANCELDRAFT', 'Cancel draft changes'))
2194
                    ->setDescription(_t(
2195
                        'SilverStripe\\CMS\\Model\\SiteTree.BUTTONCANCELDRAFTDESC',
2196
                        'Delete your draft and revert to the currently published page'
2197
                    ))
2198
                    ->addExtraClass('btn-secondary')
2199
            );
2200
        }
2201
2202
        // "restore"
2203
        if ($canEdit && !$isOnDraft && $isPublished) {