diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 411c745a..2d304e71 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -1,4 +1,6 @@ getResponseNegotiator()->respond($this->getRequest()); } + /** + * Action handler for adding pages to a campaign + * + * @param array $data + * @param Form $form + * @return DBHTMLText|SS_HTTPResponse + */ + public function addtocampaign($data, $form) { + $handler = AddToCampaignHandler::create($form, $data); + return $handler->handle(); + } + /** * Batch Actions Handler */ diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 695923a0..c0c753fe 100755 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -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