Skip to content

Commit ccddc8e

Browse files
committed
Theme options optimizations and fixes.
1 parent 299d1e4 commit ccddc8e

File tree

9 files changed

+317
-225
lines changed

9 files changed

+317
-225
lines changed

components/template.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
min-height: 100%;
2727
}
2828
*{outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);}
29-
ul,ol,li{list-style-position:inside;}
30-
img{border:0;}
31-
a{text-decoration:none;}
3229
.template-content-container{min-height:100vh;display:flex;justify-content:center;flex-direction:column;}
3330
.template-content-container > *{width:100%;}
3431
</style>
@@ -38,7 +35,7 @@
3835
if ($isHomePage) {
3936
echo '<section class="template-home-page-container">';
4037
if (!empty($homePageLogoImage)) {
41-
$imageHTML = '<component src="bearcms-image-element" class="template-home-page-logo" onClick="openUrl" url="' . htmlentities($app->request->base) . '/" filename="' . htmlentities($homePageLogoImage) . '"/>';
38+
$imageHTML = '<component src="bearcms-image-element" class="template-home-page-logo" filename="' . htmlentities($homePageLogoImage) . '"/>';
4239
echo '<div><div class="template-home-page-logo-container">' . $imageHTML . '</div></div>';
4340
}
4441
if ($homePageTitleVisibility === '1') {
@@ -47,7 +44,6 @@
4744
if ($homePageDescriptionVisibility === '1') {
4845
echo '<div><div class="template-home-page-description-container"><div class="template-home-page-description">' . htmlspecialchars($settings->description) . '</div></div></div>';
4946
}
50-
//<component src="bearcms-elements" id="test1" editable="true"/>
5147
echo '<div><div class="template-home-page-content-container"><div class="template-home-page-content">{{body}}</div></div></div>';
5248
echo '</section>';
5349
} else {

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
$context->assets
2727
->addDir('assets');
2828

29-
$theme->version = '1.0';
29+
$theme->version = '1.1';
3030

3131
$theme->get = function(\BearCMS\Themes\Options $options) use ($context) {
3232
$templateFilename = $context->dir . '/components/template.php';

locales/bg.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
'bearcms.themes.focus.options.Visibility' => 'Видимост',
2020
'bearcms.themes.focus.options.Visible' => 'Видимо',
2121
'bearcms.themes.focus.options.Hidden' => 'Скрито',
22-
'bearcms.themes.focus.options.Other content' => 'Друго съдържание',
2322
'bearcms.themes.focus.options.Other pages' => 'Други страници',
2423
'bearcms.themes.focus.options.Back to home button' => 'Бутон към началото',
2524
'bearcms.themes.focus.options.Content' => 'Съдържание',

locales/en.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
'bearcms.themes.focus.options.Visibility' => 'Visibility',
2020
'bearcms.themes.focus.options.Visible' => 'Visible',
2121
'bearcms.themes.focus.options.Hidden' => 'Hidden',
22-
'bearcms.themes.focus.options.Other content' => 'Other content',
2322
'bearcms.themes.focus.options.Other pages' => 'Other pages',
2423
'bearcms.themes.focus.options.Back to home button' => 'Back to home button',
2524
'bearcms.themes.focus.options.Content' => 'Content',

options.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
->addOption("homePageLogoImageCSS", "css", "", [
2222
"cssTypes" => ["cssMargin", "cssBorder", "cssRadius", "cssShadow", "cssSize"],
2323
"cssOutput" => [
24-
["rule", ".template-home-page-logo", "box-sizing:border-box;display:inline-block;overflow:hidden;font-size:0;"],
24+
["rule", ".template-home-page-logo", "box-sizing:border-box;overflow:hidden;font-size:0;"],
2525
["selector", ".template-home-page-logo"]
2626
]
2727
]);
@@ -51,7 +51,7 @@
5151
])
5252
->addOption("homePageTitleCSS", "css", "", [
5353
"cssOutput" => [
54-
["rule", ".template-home-page-title", "display:inline-block;text-decoration:none;"],
54+
["rule", ".template-home-page-title", "box-sizing:border-box;display:inline-block;text-decoration:none;"],
5555
["selector", ".template-home-page-title"]
5656
]
5757
]);
@@ -97,7 +97,7 @@
9797
]);
9898

9999

100-
$homePageContentGroup = $homePageGroup->addGroup(__("bearcms.themes.focus.options.Other content"));
100+
$homePageContentGroup = $homePageGroup->addGroup(__("bearcms.themes.focus.options.Content"));
101101
$homePageContentGroup
102102
->addOption("homePageContentCSS", "css", "", [
103103
"cssTypes" => ["cssPadding", "cssMargin", "cssBorder", "cssRadius", "cssShadow", "cssBackground", "cssSize"],
@@ -127,9 +127,9 @@
127127
]
128128
]);
129129

130-
$otherPagesGroup = $schema->addGroup(__("bearcms.themes.focus.options.Other pages"));
130+
$pagesGroup = $schema->addGroup(__("bearcms.themes.focus.options.Other pages"));
131131

132-
$pageBackToHomeGroup = $otherPagesGroup->addGroup(__("bearcms.themes.focus.options.Back to home button"));
132+
$pageBackToHomeGroup = $pagesGroup->addGroup(__("bearcms.themes.focus.options.Back to home button"));
133133
$pageBackToHomeGroup
134134
->addOption("pageBackToHomeButtonCSS", "css", "", [
135135
"cssTypes" => ["cssMargin", "cssBorder", "cssRadius", "cssShadow", "cssBackground", "cssSize"],
@@ -149,18 +149,21 @@
149149
]
150150
]);
151151

152-
$pageContentGroup = $otherPagesGroup->addGroup(__("bearcms.themes.focus.options.Content"));
153-
$pageContentGroup
152+
$pagesGroup
154153
->addOption("pageContentCSS", "css", "", [
155154
"cssTypes" => ["cssPadding", "cssMargin", "cssBorder", "cssRadius", "cssShadow", "cssBackground", "cssSize"],
156155
"cssOutput" => [
157156
["rule", ".template-page-content", "box-sizing:border-box;"],
158157
["selector", ".template-page-content"]
159158
]
160159
]);
161-
$pageContentGroup->addElementsGroup('pageContentElements', '.template-page-content');
162160

163-
$pageContentElementsContainerGroup = $pageContentGroup->addGroup(__("bearcms.themes.focus.options.Container"));
161+
$pagesContentGroup = $pagesGroup->addGroup(__("bearcms.themes.focus.options.Content"));
162+
163+
$pagesContentGroup->addElementsGroup('pageContentElements', '.template-page-content');
164+
$pagesContentGroup->addPages();
165+
166+
$pageContentElementsContainerGroup = $pagesGroup->addGroup(__("bearcms.themes.focus.options.Container"));
164167
$pageContentElementsContainerGroup
165168
->addOption("pageContentElementsContainerCSS", "css", "", [
166169
"cssTypes" => ["cssPadding", "cssMargin", "cssBorder", "cssRadius", "cssShadow", "cssBackground", "cssSize", "cssTextAlign"],
@@ -179,7 +182,6 @@
179182
]
180183
]);
181184

182-
$schema->addPagesGroup();
183185

184186

185187
return $schema;

0 commit comments

Comments
 (0)