Total Complexity | 2 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class GridFieldLinkButton implements GridField_HTMLProvider |
||
17 | { |
||
18 | /** |
||
19 | * Fragment to write the button to. |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $targetFragment; |
||
23 | |||
24 | /** |
||
25 | * URL link the button links out to. |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $link; |
||
29 | |||
30 | /** |
||
31 | * Caption text for the button to show |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $caption; |
||
35 | |||
36 | /** |
||
37 | * @param string $link The URL link the button links out to. |
||
38 | * @param string $targetFragment The HTML fragment to write the button into |
||
39 | */ |
||
40 | public function __construct($link, $caption, $targetFragment) |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Place the link button in a <p> tag above the field |
||
49 | * |
||
50 | * @param GridField $gridField |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | public function getHTMLFragments($gridField) |
||
64 |