Skip to content

Commit ac89489

Browse files
committed
Allow to override the banner with its existing env variable
1 parent ae08d95 commit ac89489

File tree

6 files changed

+13
-22
lines changed

6 files changed

+13
-22
lines changed

.env

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ NO_URL_REWRITE_AVAILABLE=0
129129
# Set to 1, if Part-DB should redirect all HTTP requests to HTTPS. You dont need to configure this, if your webserver already does this.
130130
REDIRECT_TO_HTTPS=0
131131

132-
# Override value if you want to show to show a given text on homepage.
133-
# When this is empty the content of config/banner.md is used as banner
134-
BANNER=""
135-
136132
# Set this to zero, if you want to disable the year 2038 bug check on 32-bit systems (it will cause errors with current 32-bit PHP versions)
137133
DISABLE_YEAR2038_BUG_CHECK=0
138134

config/banner.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
Welcome to Part-DB.
2-
3-
<small>If you want to change this banner, edit `config/banner.md` file or set the `BANNER` environment variable.</small>
1+
**Attention**:
2+
Since Version 2.0.0 this file is no longer used.
43

5-
<blockquote class="pb-0">
6-
<p style="font-size: 12px">
7-
And God said <br>
8-
$\nabla \cdot \vec{D} = \rho$,
9-
$\nabla \cdot \vec{B} = 0$,
10-
$\nabla \times \vec{E} = -\frac{\partial \vec{B}}{\partial t}$,
11-
$\nabla \times \vec{H} = \vec{j} + \frac{\partial \vec{D}}{\partial t}$, <br>
12-
and then there was light.
13-
</p>
14-
</blockquote>
4+
You can now set the banner text directly in the admin interface, or by setting the `BANNER` environment variable.

config/parameters.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ parameters:
9090
env(ERROR_PAGE_SHOW_HELP): 1
9191

9292
env(DEMO_MODE): 0
93-
env(BANNER): ''
9493

9594

9695
env(EMAIL_SENDER_EMAIL): '[email protected]'

docs/upgrade/1_to_2.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ easily upgrade your system to the new requirements. Otherwise, you can use the o
2424
ships all required dependencies and is always up to date with the latest requirements, so that you do not have to worry
2525
about the requirements at all.
2626

27-
27+
## Changes
28+
* The `config/banner.md` file that could been used to customize the banner text, was removed. You can now set the banner text
29+
directly in the admin interface, or by setting the `BANNER` environment variable. If you want to keep your existing
30+
banner text, you will have to copy it from the `config/banner.md` file to the admin interface or set the `BANNER`
31+
environment variable.
32+

src/Services/System/BannerHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*/
3131
class BannerHelper
3232
{
33-
public function __construct(private CustomizationSettings $customizationSettings)
33+
public function __construct(private readonly CustomizationSettings $customizationSettings)
3434
{
3535

3636
}
@@ -43,4 +43,4 @@ public function getBanner(): string
4343
{
4444
return $this->customizationSettings->banner ?? "";
4545
}
46-
}
46+
}

src/Settings/SystemSettings/CustomizationSettings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class CustomizationSettings
4949
#[SettingsParameter(
5050
label: new TM("settings.system.customization.banner"),
5151
formType: RichTextEditorType::class, formOptions: ['mode' => 'markdown-full'],
52+
envVar: "BANNER", envVarMode: EnvVarMode::OVERWRITE,
5253
)]
5354
public ?string $banner = null;
5455

@@ -58,4 +59,4 @@ class CustomizationSettings
5859
)]
5960
#[ValidTheme]
6061
public string $theme = 'bootstrap';
61-
}
62+
}

0 commit comments

Comments
 (0)