Skip to content

Commit 919e372

Browse files
committed
Add support for the new Bear CMS Element Types API.
1 parent 3aad0be commit 919e372

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "7.1.*|7.2.*|7.3.*|7.4.*|8.0.*|8.1.*",
20-
"bearcms/bearframework-addon": "1.*",
20+
"bearcms/bearframework-addon": "^1.83",
2121
"bearframework/localization-addon": "1.*",
2222
"ivopetkov/client-packages-bearframework-addon": "1.*"
2323
},

index.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,18 @@
2626
return include $context->dir . '/locales/bg.php';
2727
});
2828

29-
\BearCMS\Internal\ElementsTypes::add('code', [
30-
'componentSrc' => 'bearcms-code-element',
31-
'componentFilename' => $context->dir . '/components/codeElement.php',
32-
'fields' => [
33-
[
34-
'id' => 'code',
35-
'type' => 'textbox'
36-
],
37-
[
38-
'id' => 'language',
39-
'type' => 'textbox'
40-
]
29+
$type = new \BearCMS\Internal\ElementType('code', 'bearcms-code-element', $context->dir . '/components/codeElement.php');
30+
$type->properties = [
31+
[
32+
'id' => 'code',
33+
'type' => 'string'
34+
],
35+
[
36+
'id' => 'language',
37+
'type' => 'string'
4138
]
42-
]);
39+
];
40+
\BearCMS\Internal\ElementsTypes::add($type);
4341

4442
$languages = [
4543
'apache' => 'Apache',

0 commit comments

Comments
 (0)