AddToCampaignHandler_FormAction   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
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