Issues (5)

src/ContentWidget.php (5 issues)

1
<?php
2
3
namespace SilverStripe\ContentWidget;
4
5
use SilverStripe\Forms\FieldList;
6
use SilverStripe\Forms\TextField;
7
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
8
use SilverStripe\Widgets\Model\Widget;
9
10
/**
11
 * Content Widget
12
 */
13
class ContentWidget extends Widget
14
{
15
    private static $db = [
0 ignored issues
show
The private property $db is not used, and could be removed.
Loading history...
16
        "HTML" => "HTMLText",
17
    ];
18
19
    private static $title = "Content";
0 ignored issues
show
The private property $title is not used, and could be removed.
Loading history...
20
21
    private static $cmsTitle = "Content";
0 ignored issues
show
The private property $cmsTitle is not used, and could be removed.
Loading history...
22
23
    private static $description = "Custom rich content widget.";
0 ignored issues
show
The private property $description is not used, and could be removed.
Loading history...
24
25
    private static $table_name = 'ContentWidget';
0 ignored issues
show
The private property $table_name is not used, and could be removed.
Loading history...
26
27
    /**
28
     * @return FieldList
29
     */
30
    public function getCMSFields()
31
    {
32
        $fields = parent::getCMSFields();
33
34
        $fields->push(TextField::create("Title"));
35
        $fields->push(HTMLEditorField::create("HTML", "Content"));
36
37
        return $fields;
38
    }
39
}
40