Total Complexity | 4 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class ElementContent extends BaseElement |
||
9 | { |
||
10 | private static $icon = 'font-icon-block-content'; |
||
|
|||
11 | |||
12 | private static $db = [ |
||
13 | 'HTML' => 'HTMLText' |
||
14 | ]; |
||
15 | |||
16 | private static $table_name = 'ElementContent'; |
||
17 | |||
18 | private static $singular_name = 'content block'; |
||
19 | |||
20 | private static $plural_name = 'content blocks'; |
||
21 | |||
22 | private static $description = 'HTML text block'; |
||
23 | |||
24 | /** |
||
25 | * Re-title the HTML field to Content |
||
26 | * |
||
27 | * {@inheritDoc} |
||
28 | */ |
||
29 | public function getCMSFields() |
||
30 | { |
||
31 | $this->beforeUpdateCMSFields(function (FieldList $fields) { |
||
32 | $fields |
||
33 | ->fieldByName('Root.Main.HTML') |
||
34 | ->setTitle(_t(__CLASS__ . '.ContentLabel', 'Content')); |
||
35 | }); |
||
36 | return parent::getCMSFields(); |
||
37 | } |
||
38 | |||
39 | public function getSummary() |
||
42 | } |
||
43 | |||
44 | protected function provideBlockSchema() |
||
45 | { |
||
46 | $blockSchema = parent::provideBlockSchema(); |
||
47 | $blockSchema['content'] = $this->getSummary(); |
||
48 | return $blockSchema; |
||
49 | } |
||
50 | |||
51 | public function getType() |
||
54 | } |
||
55 | } |
||
56 |