diff --git a/src/Elements/AccordionElement.php b/src/Elements/AccordionElement.php index 95fdaba..6da4783 100755 --- a/src/Elements/AccordionElement.php +++ b/src/Elements/AccordionElement.php @@ -28,14 +28,14 @@ class AccordionElement extends ElementList private static $table_name = 'AccordionElement'; - private static $db = [ - 'OpenFirst' => 'Boolean(0)', - 'KeepOpenned' => 'Boolean(0)', - ]; + private static $db = [ + 'OpenFirst' => 'Boolean(0)', + 'KeepOpenned' => 'Boolean(0)', + ]; - public function getType() + public function getType(): string { - return self::$singular_name; + return _t(__CLASS__ . '.BlockType', self::$singular_name); } public function Accordion() @@ -43,15 +43,15 @@ class AccordionElement extends ElementList return $this->Elements()->renderWith(static::class.'_AccordionArea'); } - public function getCMSFields() - { - $fields = parent::getCMSFields(); + public function getCMSFields() + { + $fields = parent::getCMSFields(); - $fields->addFieldsToTab('Root.Main', [ - CheckboxField::create('OpenFirst', 'Open first accordion element on page load'), - CheckboxField::create('KeepOpenned', 'Keep elements open'), - ]); + $fields->addFieldsToTab('Root.Main', [ + CheckboxField::create('OpenFirst', 'Open first accordion element on page load'), + CheckboxField::create('KeepOpenned', 'Keep elements open'), + ]); - return $fields; - } + return $fields; + } } diff --git a/src/Elements/CustomSnippetElement.php b/src/Elements/CustomSnippetElement.php index 5ec85f2..856936e 100755 --- a/src/Elements/CustomSnippetElement.php +++ b/src/Elements/CustomSnippetElement.php @@ -28,9 +28,9 @@ class CustomSnippetElement extends ElementContent private static $table_name = 'CustomSnippetElement'; - public function getType() + public function getType(): string { - return self::$singular_name; + return _t(__CLASS__ . '.BlockType', self::$singular_name); } public function getCMSFields() diff --git a/src/Elements/InstagramElement.php b/src/Elements/InstagramElement.php index b45998b..e1bf98a 100755 --- a/src/Elements/InstagramElement.php +++ b/src/Elements/InstagramElement.php @@ -45,9 +45,9 @@ class InstagramElement extends BaseElement 'DisplayGallery' => true, ]; - public function getType() + public function getType(): string { - return self::$singular_name; + return _t(__CLASS__ . '.BlockType', self::$singular_name); } /** @@ -89,7 +89,7 @@ class InstagramElement extends BaseElement foreach ($attributes as $name => $value) { if ($value === true) { $value = $name; - } else if (is_scalar($value)) { + } elseif (is_scalar($value)) { $value = (string) $value; } else { $value = json_encode($value); diff --git a/src/Elements/MapElement.php b/src/Elements/MapElement.php index b3c9d2a..04389cb 100755 --- a/src/Elements/MapElement.php +++ b/src/Elements/MapElement.php @@ -50,7 +50,7 @@ class MapElement extends ElementContent public function getType(): string { - return self::$singular_name; + return _t(__CLASS__ . '.BlockType', self::$singular_name); } public function getCMSFields(): FieldList diff --git a/src/Elements/SidebarElement.php b/src/Elements/SidebarElement.php index a216ef9..c780c66 100755 --- a/src/Elements/SidebarElement.php +++ b/src/Elements/SidebarElement.php @@ -29,6 +29,6 @@ class SidebarElement extends BaseElement public function getType(): string { - return self::$singular_name; + return _t(__CLASS__ . '.BlockType', self::$singular_name); } } diff --git a/src/Elements/SliderElement.php b/src/Elements/SliderElement.php index 032c26c..ef17abb 100755 --- a/src/Elements/SliderElement.php +++ b/src/Elements/SliderElement.php @@ -69,9 +69,9 @@ class SliderElement extends ElementSlideshow private $items; - public function getType() + public function getType(): string { - return self::$singular_name; + return _t(__CLASS__ . '.BlockType', self::$singular_name); } protected function ratioSize($size) diff --git a/src/Elements/TeamMembersElement.php b/src/Elements/TeamMembersElement.php index 3ba2f6b..f9f73b8 100755 --- a/src/Elements/TeamMembersElement.php +++ b/src/Elements/TeamMembersElement.php @@ -25,9 +25,9 @@ class TeamMembersElement extends BaseElement private static $description = 'Displays random Team Members'; - public function getType() + public function getType(): string { - return self::$singular_name; + return _t(__CLASS__ . '.BlockType', self::$singular_name); } public function Members()