Code Duplication    Length = 7-10 lines in 2 locations

code/Model/SiteTree.php 2 locations

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