Code Duplication    Length = 7-10 lines in 2 locations

code/Model/SiteTree.php 2 locations

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