Code Duplication    Length = 7-10 lines in 2 locations

code/Model/SiteTree.php 2 locations

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