diff --git a/composer.json b/composer.json index 608375b..bafeec7 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,12 @@ "silverstripe/cms": "^4", "a2nt/silverstripe-elemental-basics": "*", "silverstripe/widgets": "*", - "drmartingonzo/ss-tinymce-charcount": "*" + "drmartingonzo/ss-tinymce-charcount": "*", + "gorriecoe/silverstripe-embed": "*" }, "autoload": { "psr-4": { - "A2nt\\ElementalBasics\\": "src/" + "A2nt\\CMSNiceties\\": "src/" } } } diff --git a/src/Extensions/EmbedObjectField.php b/src/Extensions/EmbedObjectField.php index f0ea483..1c1d8a0 100755 --- a/src/Extensions/EmbedObjectField.php +++ b/src/Extensions/EmbedObjectField.php @@ -3,37 +3,51 @@ namespace A2nt\CMSNiceties\Extensions; - -use Sheadawson\Linkable\Forms\EmbeddedObjectField; +use gorriecoe\Embed\Extensions\Embeddable; use SilverStripe\Forms\CheckboxField; use SilverStripe\Forms\CompositeField; use SilverStripe\Forms\LiteralField; use SilverStripe\ORM\FieldType\DBHTMLText; -class EmbedObjectField extends EmbeddedObjectField +class EmbedObjectField extends Embeddable { + /** + * List the allowed included embed types. If null all are allowed. + * @var array + */ + private static $allowed_embed_types = [ + 'video', + 'photo' + ]; + + /** + * Defines tab to insert the embed fields into. + * @var string + */ + private static $embed_tab = 'Main'; + /** * @param array $properties * @return mixed|DBHTMLText */ - public function FieldHolder($properties = []) + /*public function FieldHolder($properties = []) { $name = $this->getName(); $fields = [ CheckboxField::create( $name . '[autoplay]', - _t(self::CLASS.'AUTOPLAY', 'Autoplay video?') + _t(self::class.'AUTOPLAY', 'Autoplay video?') )->setValue($this->object->getField('Autoplay')), CheckboxField::create( $name . '[loop]', - _t(self::CLASS.'LOOP', 'Loop video?') + _t(self::class.'LOOP', 'Loop video?') )->setValue($this->object->getField('Loop')), CheckboxField::create( $name.'[controls]', - _t(self::CLASS.'CONTROLS', 'Show player controls?') + _t(self::class.'CONTROLS', 'Show player controls?') )->setValue($this->object->getField('Controls')) ]; @@ -43,5 +57,5 @@ class EmbedObjectField extends EmbeddedObjectField parent::FieldHolder($properties) ) ], $fields)); - } + }*/ }