Code Duplication    Length = 7-10 lines in 2 locations

code/Model/SiteTree.php 2 locations

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