mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Fix for pages admin add to campaign modal
This commit is contained in:
parent
c46490ea3a
commit
c411c500a5
@ -102,6 +102,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
private static $page_length = 15;
|
||||
|
||||
private static $allowed_actions = array(
|
||||
'AddToCampaignForm',
|
||||
'archive',
|
||||
'deleteitems',
|
||||
'DeleteItemsForm',
|
||||
@ -1309,6 +1310,26 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
return $this->getResponseNegotiator()->respond($this->getRequest());
|
||||
}
|
||||
|
||||
/**
|
||||
* Action handler for adding pages to a campaign
|
||||
*
|
||||
* @param SS_HTTPRequest
|
||||
* @return DBHTMLText|SS_HTTPResponse
|
||||
*/
|
||||
public function AddToCampaignForm($request) {
|
||||
$data = $request->postVars();
|
||||
|
||||
if (!$data['Campaign']) {
|
||||
$this->httpError(400, _t(
|
||||
'AddToCampaign.ErrorCampaignNotSelected',
|
||||
'There was no campaign selected to be added to'
|
||||
));
|
||||
return null;
|
||||
}
|
||||
$handler = AddToCampaignHandler::create($this, $data);
|
||||
return $handler->handle();
|
||||
}
|
||||
|
||||
/**
|
||||
* Action handler for adding pages to a campaign
|
||||
*
|
||||
@ -1317,7 +1338,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
* @return DBHTMLText|SS_HTTPResponse
|
||||
*/
|
||||
public function addtocampaign($data, $form) {
|
||||
$handler = AddToCampaignHandler::create($form, $data);
|
||||
$handler = AddToCampaignHandler::create($this, $data);
|
||||
return $handler->handle();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user