AddToCampaignHandler_FormAction::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SilverStripe\CampaignAdmin;
4
5
use SilverStripe\Forms\FormAction;
6
7
/**
8
 * A form action to return from geCMSActions or otherwise include in a CMS Edit Form that
9
 * has the right action name and CSS classes to trigger the AddToCampaignHandler.
10
 *
11
 * See SiteTree.php and CMSMain.php for an example of it's use
12
 */
13
class AddToCampaignHandler_FormAction extends FormAction
14
{
15
    public function __construct()
16
    {
17
        parent::__construct('addtocampaign', _t(__CLASS__.'.ADDTOCAMPAIGN', 'Add to Campaign'));
18
        $this->setUseButtonTag(false);
19
        $this->addExtraClass('add-to-campaign-action');
20
        $this->addExtraClass('btn');
21
        $this->addExtraClass('btn-primary');
22
    }
23
}
24