Add 'Add to campaign' button to pages

This commit is contained in:
scott1702 2016-03-17 14:42:53 +13:00 committed by Hamish Friedlander
parent 830a97a9fc
commit 69d7a3ae7d
2 changed files with 7 additions and 0 deletions

View File

@ -1191,6 +1191,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
return $this->getResponseNegotiator()->respond($this->getRequest());
}
public function addtocampaign($data, $form) {
$handler = new AddToCampaignHandler($form, $data);
return $handler->handle();
}
/**
* Batch Actions Handler
*/

View File

@ -2075,6 +2075,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
)
);
$moreOptions->push(AddToCampaignHandler_FormAction::create());
// "readonly"/viewing version that isn't the current version of the record
$stageOrLiveRecord = Versioned::get_one_by_stage($this->class, Versioned::get_stage(), array(
'"SiteTree"."ID"' => $this->ID