mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
IMPR: Widget Class Name
This commit is contained in:
parent
fbdd0c11ee
commit
64478a7dff
@ -1,14 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace A2nt\CMSNiceties\Widgets;
|
namespace A2nt\CMSNiceties\Widgets;
|
||||||
|
|
||||||
|
|
||||||
use DNADesign\Elemental\Forms\TextCheckboxGroupField;
|
use DNADesign\Elemental\Forms\TextCheckboxGroupField;
|
||||||
use SilverStripe\CMS\Model\SiteTree;
|
use SilverStripe\CMS\Model\SiteTree;
|
||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
||||||
use SilverStripe\Forms\TreeDropdownField;
|
use SilverStripe\Forms\TreeDropdownField;
|
||||||
use SilverStripe\ORM\DataExtension;
|
use SilverStripe\ORM\DataExtension;
|
||||||
|
use SilverStripe\Forms\LiteralField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class \A2nt\CMSNiceties\Widgets\WidgetExtension
|
* Class \A2nt\CMSNiceties\Widgets\WidgetExtension
|
||||||
@ -32,8 +31,21 @@ class WidgetExtension extends DataExtension
|
|||||||
TextCheckboxGroupField::create()
|
TextCheckboxGroupField::create()
|
||||||
->setName('Title')
|
->setName('Title')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($this->owner->ID) {
|
||||||
$fields->push(TreeDropdownField::create(
|
$fields->push(TreeDropdownField::create(
|
||||||
'MovePageID', 'Move widget to page', SiteTree::class
|
'MovePageID',
|
||||||
|
'Move widget to page',
|
||||||
|
SiteTree::class
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
$fields->push(LiteralField::create(
|
||||||
|
'ClassName',
|
||||||
|
'<div class="form-group field text">'
|
||||||
|
.'<div class="form__field-label">Class</div>'
|
||||||
|
.'<div class="form__field-holder">'.$obj->getField('ClassName').'</div>'
|
||||||
|
.'</div>'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user