Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ebt_core
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
ebt_core
Commits
1d4c0f7e
Commit
1d4c0f7e
authored
2 years ago
by
renatog
Committed by
Ivan Abramenko
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3342896
: Add the missing "Background Color" into global settings form
parent
47c075eb
Branches
Branches containing commit
Tags
1.4.7
Tags containing commit
1 merge request
!22
Issue #3342896: Add the missing "Background Color" into global settings form
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Form/EbtCoreSettingsForm.php
+13
-0
13 additions, 0 deletions
src/Form/EbtCoreSettingsForm.php
with
13 additions
and
0 deletions
src/Form/EbtCoreSettingsForm.php
+
13
−
0
View file @
1d4c0f7e
...
...
@@ -86,6 +86,14 @@ class EbtCoreSettingsForm extends ConfigFormBase {
],
];
$form
[
'ebt_core_background_color'
]
=
[
'#type'
=>
'textfield'
,
'#title'
=>
$this
->
t
(
'Background Color'
),
'#default_value'
=>
$config
->
get
(
'ebt_core_background_color'
),
'#description'
=>
$this
->
t
(
'HEX color for Background color. If empty the default value will be #0d77b5'
),
'#element_validate'
=>
[[
'\Drupal\ebt_core\Plugin\Field\FieldWidget\EbtSettingsDefaultWidget'
,
'validateColorElement'
]],
];
$form
[
'ebt_core_mobile_breakpoint'
]
=
[
'#type'
=>
'number'
,
'#title'
=>
$this
->
t
(
'Mobile breakpoint'
),
...
...
@@ -153,11 +161,16 @@ class EbtCoreSettingsForm extends ConfigFormBase {
* {@inheritdoc}
*/
public
function
submitForm
(
array
&
$form
,
FormStateInterface
$form_state
)
{
// If the "ebt_core_background_color" is empty, let's use the default value.
$ebt_core_background_color
=
!
empty
(
$form_state
->
getValue
(
'ebt_core_background_color'
))
?
$form_state
->
getValue
(
'ebt_core_background_color'
)
:
'#0d77b5'
;
$this
->
config
(
static
::
SETTINGS
)
->
set
(
'ebt_core_primary_color'
,
$form_state
->
getValue
(
'ebt_core_primary_color'
))
->
set
(
'ebt_core_primary_button_text_color'
,
$form_state
->
getValue
(
'ebt_core_primary_button_text_color'
))
->
set
(
'ebt_core_secondary_color'
,
$form_state
->
getValue
(
'ebt_core_secondary_color'
))
->
set
(
'ebt_core_secondary_button_text_color'
,
$form_state
->
getValue
(
'ebt_core_secondary_button_text_color'
))
->
set
(
'ebt_core_background_color'
,
$ebt_core_background_color
)
->
set
(
'ebt_core_mobile_breakpoint'
,
$form_state
->
getValue
(
'ebt_core_mobile_breakpoint'
))
->
set
(
'ebt_core_tablet_breakpoint'
,
$form_state
->
getValue
(
'ebt_core_tablet_breakpoint'
))
->
set
(
'ebt_core_desktop_breakpoint'
,
$form_state
->
getValue
(
'ebt_core_desktop_breakpoint'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment