Code Duplication    Length = 7-10 lines in 2 locations

code/Model/SiteTree.php 2 locations

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