mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
79b9bb6f18
Reuse existing functionality rather than creating "new legacy code" through writing more Entwine
32 lines
758 B
PHP
32 lines
758 B
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: dmooyman
|
|
* Date: 12/08/16
|
|
* Time: 12:15 PM
|
|
*/
|
|
namespace SilverStripe\Admin;
|
|
|
|
use FormAction;
|
|
|
|
/**
|
|
* A form action to return from geCMSActions or otherwise include in a CMS Edit Form that
|
|
* has the right action name and CSS classes to trigger the AddToCampaignHandler.
|
|
*
|
|
* See SiteTree.php and CMSMain.php for an example of it's use
|
|
*/
|
|
class AddToCampaignHandler_FormAction extends FormAction
|
|
{
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct('addtocampaign', _t('CAMPAIGNS.ADDTOCAMPAIGN', 'Add to Campaign'));
|
|
|
|
$this->setUseButtonTag(false);
|
|
$this->addExtraClass('add-to-campaign-action');
|
|
$this->setValidationExempt(true);
|
|
$this->addExtraClass('btn');
|
|
$this->addExtraClass('btn-primary');
|
|
}
|
|
}
|