Code Duplication    Length = 8-9 lines in 2 locations

code/model/SiteTree.php 2 locations

@@ 2261-2268 (lines=8) @@
2258
			return $actions;
2259
		}
2260
2261
		if($this->isPublished() && $this->canPublish() && !$this->getIsDeletedFromStage() && $this->canDeleteFromLive()) {
2262
			// "unpublish"
2263
			$moreOptions->push(
2264
				FormAction::create('unpublish', _t('SiteTree.BUTTONUNPUBLISH', 'Unpublish'), 'delete')
2265
					->setDescription(_t('SiteTree.BUTTONUNPUBLISHDESC', 'Remove this page from the published site'))
2266
					->addExtraClass('ss-ui-action-destructive')
2267
			);
2268
		}
2269
2270
		if($this->stagesDiffer('Stage', 'Live') && !$this->getIsDeletedFromStage()) {
2271
			if($this->isPublished() && $this->canEdit())	{
@@ 2270-2278 (lines=9) @@
2267
			);
2268
		}
2269
2270
		if($this->stagesDiffer('Stage', 'Live') && !$this->getIsDeletedFromStage()) {
2271
			if($this->isPublished() && $this->canEdit())	{
2272
				// "rollback"
2273
				$moreOptions->push(
2274
					FormAction::create('rollback', _t('SiteTree.BUTTONCANCELDRAFT', 'Cancel draft changes'), 'delete')
2275
						->setDescription(_t('SiteTree.BUTTONCANCELDRAFTDESC', 'Delete your draft and revert to the currently published page'))
2276
				);
2277
			}
2278
		}
2279
2280
		if($this->canEdit()) {
2281
			if($this->getIsDeletedFromStage()) {