From 32c645be44d715a608dfd0b0e52c7594725ac613 Mon Sep 17 00:00:00 2001 From: Jellygnite Date: Thu, 14 Nov 2024 15:31:46 +1000 Subject: [PATCH] ss 5 updates --- src/Model/BaseElementObject.php | 12 +++++++++++- src/Model/ElementFeature.php | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Model/BaseElementObject.php b/src/Model/BaseElementObject.php index 93a0d84..9f1159e 100644 --- a/src/Model/BaseElementObject.php +++ b/src/Model/BaseElementObject.php @@ -54,7 +54,8 @@ class BaseElementObject extends DataObject 'SubTitle' => 'Varchar(255)', 'Content' => 'HTMLText', 'ExtraClass' => 'Varchar(255)', - 'Style' => 'Varchar(255)' + 'Style' => 'Varchar(255)', + 'ShowButton' => 'Boolean' ); /** @@ -76,6 +77,10 @@ class BaseElementObject extends DataObject * @var string */ private static $default_sort = 'Title ASC'; + + private static $defaults = array ( + 'ShowButton' => '0' + ); /** * @var array @@ -165,6 +170,11 @@ public function getCMSFields() $fields->dataFieldByName('ElementLinkID') ); + $fields->insertBefore( + 'Content', + $fields->dataFieldByName('ShowButton') + ); + $image = $fields->dataFieldByName('Image') ->setDescription(_t(__CLASS__.'.ImageDescription', 'Optional. Display an image.')) ->setFolderName('images') diff --git a/src/Model/ElementFeature.php b/src/Model/ElementFeature.php index d35e100..0d0d3d6 100644 --- a/src/Model/ElementFeature.php +++ b/src/Model/ElementFeature.php @@ -92,6 +92,10 @@ public function getCMSFields() LinkField::create('ElementLinkID', $this->fieldLabel('ElementLinkID')) ->setDescription(_t(__CLASS__.'.LinkDescription', 'Optional. Add a call to action link.')) ); + + $fields->dataFieldByName('Content') + ->setRows(6); + $fields->dataFieldByName('Image') ->setFolderName('images') ->setAllowedFileCategories('image/supported','image/unsupported');