basic button re-ordering #3

Merged
merged 2 commits into from Feb 7, 2012
View
24 code/DataObjects/DataObjectAsPage.php
@@ -100,21 +100,23 @@ public function getCMSActions()
$PublishAction = FormAction::create('doPublish', 'Save & Publish');
$PublishAction->describe("Publish this item");
$Actions->insertFirst($PublishAction);
-
- if($this->Status != 'Draft')
- {
- //Create the Unpublish action
- $unPublishAction = FormAction::create('doUnpublish', 'Unpublish');
- $unPublishAction->describe("Unpublish this item");
- $Actions->insertFirst($unPublishAction);
- }
-
+
//Create the Duplicate action
$DuplicateAction = FormAction::create('duplicate', 'Duplicate Object');
$DuplicateAction->describe("Duplicate this item");
+ //add it to the existing actions
+ $Actions->insertFirst($DuplicateAction);
+
+ if($this->Status != 'Draft')
+ {
+ //Create the Unpublish action
+ $unPublishAction = FormAction::create('doUnpublish', 'Unpublish');
+ $unPublishAction->describe("Unpublish this item");
+ $unPublishAction->addExtraClass('delete');
+ $Actions->insertFirst($unPublishAction);
+ }
- //add it to the existing actions
- $Actions->insertFirst($DuplicateAction);
+
return $Actions;
}