mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1459 from open-sausages/pulls/4.0/add-to-campaign
Add 'Add to campaign' button to pages
This commit is contained in:
commit
f0b574b835
@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use SilverStripe\Model\FieldType\DBHTMLText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The main "content" area of the CMS.
|
* The main "content" area of the CMS.
|
||||||
*
|
*
|
||||||
@ -1191,6 +1193,18 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
return $this->getResponseNegotiator()->respond($this->getRequest());
|
return $this->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
|
* Batch Actions Handler
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
// "readonly"/viewing version that isn't the current version of the record
|
||||||
$stageOrLiveRecord = Versioned::get_one_by_stage($this->class, Versioned::get_stage(), array(
|
$stageOrLiveRecord = Versioned::get_one_by_stage($this->class, Versioned::get_stage(), array(
|
||||||
'"SiteTree"."ID"' => $this->ID
|
'"SiteTree"."ID"' => $this->ID
|
||||||
|
Loading…
Reference in New Issue
Block a user