mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-10-22 17:05:31 +02:00
IMPR: EmbedObject fields
This commit is contained in:
parent
2c97a2a4cf
commit
a4a10098c4
@ -3,6 +3,11 @@
|
||||
|
||||
namespace Site\Extensions;
|
||||
|
||||
use SilverStripe\Forms\CheckboxField;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\NumericField;
|
||||
use SilverStripe\Forms\TextareaField;
|
||||
use SilverStripe\Forms\TextField;
|
||||
use SilverStripe\ORM\DataExtension;
|
||||
|
||||
class EmbeddedObjectExtension extends DataExtension
|
||||
@ -61,6 +66,29 @@ class EmbeddedObjectExtension extends DataExtension
|
||||
}
|
||||
}
|
||||
|
||||
public function updateCMSFields(FieldList $fields)
|
||||
{
|
||||
parent::updateCMSFields($fields);
|
||||
|
||||
$fields->removeByName([
|
||||
'Width', 'Height', 'EmbedHTML', 'ThumbURL',
|
||||
'Autoplay', 'Loop', 'Controls',
|
||||
'ExtraClass', 'Type',
|
||||
]);
|
||||
|
||||
$fields->addFieldsToTab('Root.Extra', [
|
||||
CheckboxField::create('Autoplay'),
|
||||
CheckboxField::create('Loop'),
|
||||
CheckboxField::create('Controls'),
|
||||
NumericField::create('Width'),
|
||||
NumericField::create('Height'),
|
||||
TextareaField::create('EmbedHTML'),
|
||||
TextField::create('ThumbURL'),
|
||||
TextField::create('ExtraClass'),
|
||||
TextField::create('Type'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function onBeforeWrite()
|
||||
{
|
||||
parent::onBeforeWrite();
|
||||
|
Loading…
Reference in New Issue
Block a user