Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bg_img_field
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
bg_img_field
Commits
b05c1be9
Commit
b05c1be9
authored
6 years ago
by
Jeffrey Fortune
Browse files
Options
Downloads
Patches
Plain Diff
changed t() to ->t() when used in non static methods
parent
dee8c043
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Plugin/Field/FieldFormatter/BgImgFieldFormatter.php
+3
-2
3 additions, 2 deletions
src/Plugin/Field/FieldFormatter/BgImgFieldFormatter.php
src/Plugin/Field/FieldType/BgImgItem.php
+30
-29
30 additions, 29 deletions
src/Plugin/Field/FieldType/BgImgItem.php
with
33 additions
and
31 deletions
src/Plugin/Field/FieldFormatter/BgImgFieldFormatter.php
+
3
−
2
View file @
b05c1be9
...
...
@@ -140,10 +140,11 @@ class BgImgFieldFormatter extends ResponsiveImageFormatter implements ContainerF
$responsive_image_style
=
$this
->
responsiveImageStyleStorage
->
load
(
$this
->
getSetting
(
'responsive_image_style'
));
if
(
$responsive_image_style
)
{
$summary
[]
=
t
(
'Responsive image style: @responsive_image_style'
,
[
'@responsive_image_style'
=>
$responsive_image_style
->
label
()]);
$summary
[]
=
$this
->
t
(
'Responsive image style: @responsive_image_style'
,
[
'@responsive_image_style'
=>
$responsive_image_style
->
label
()]);
}
else
{
$summary
[]
=
t
(
'Select a responsive image style.'
);
$summary
[]
=
$this
->
t
(
'Select a responsive image style.'
);
}
return
$summary
;
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/Field/FieldType/BgImgItem.php
+
30
−
29
View file @
b05c1be9
...
...
@@ -139,8 +139,8 @@ class BgImgItem extends ImageItem {
$elements
[
'css_settings'
]
=
[
'#type'
=>
'details'
,
'#title'
=>
t
(
'CSS Settings'
),
'#description'
=>
t
(
'Set default CSS properties for the background image.'
),
'#title'
=>
$this
->
t
(
'CSS Settings'
),
'#description'
=>
$this
->
t
(
'Set default CSS properties for the background image.'
),
'#open'
=>
FALSE
,
];
...
...
@@ -153,8 +153,8 @@ class BgImgItem extends ImageItem {
// The css selector input field needed to.
$elements
[
'css_settings'
][
'css_selector'
]
=
[
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Selector'
),
'#description'
=>
t
(
'CSS Selector for background image.'
),
'#title'
=>
$this
->
t
(
'Selector'
),
'#description'
=>
$this
->
t
(
'CSS Selector for background image.'
),
'#default_value'
=>
$css_option_settings
[
'css_selector'
],
'#token_types'
=>
$token_types
,
'#element_validate'
=>
'token_element_validate'
,
...
...
@@ -171,55 +171,56 @@ class BgImgItem extends ImageItem {
// User ability to select a background repeat option.
$elements
[
'css_settings'
][
'css_repeat'
]
=
[
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Repeat Options'
),
'#description'
=>
t
(
'Add the css no repeat value to the background image.'
),
'#title'
=>
$this
->
t
(
'Repeat Options'
),
'#description'
=>
$this
->
t
(
'Add the css no repeat value to the background image.'
),
'#default_value'
=>
$css_option_settings
[
'css_repeat'
],
'#options'
=>
[
"inherit"
=>
t
(
"inherit"
),
"no-repeat"
=>
t
(
"no-repeat"
),
"repeat"
=>
t
(
'repeat'
),
"inherit"
=>
$this
->
t
(
"inherit"
),
"no-repeat"
=>
$this
->
t
(
"no-repeat"
),
"repeat"
=>
$this
->
t
(
'repeat'
),
],
];
// User the ability to choose background size.
$elements
[
'css_settings'
][
'css_background_size'
]
=
[
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Background Size'
),
'#description'
=>
t
(
"Add the background size setting you would like for the image, use inherit for default."
),
'#title'
=>
$this
->
t
(
'Background Size'
),
'#description'
=>
$this
->
t
(
"Add the background size setting you would like for the image, use inherit for default."
),
'#default_value'
=>
$css_option_settings
[
'css_background_size'
],
'#options'
=>
[
'inherit'
=>
t
(
'inherit'
),
'auto'
=>
t
(
'auto'
),
'cover'
=>
t
(
'cover'
),
'contain'
=>
t
(
'contain'
),
'initial'
=>
t
(
'initial'
),
'inherit'
=>
$this
->
t
(
'inherit'
),
'auto'
=>
$this
->
t
(
'auto'
),
'cover'
=>
$this
->
t
(
'cover'
),
'contain'
=>
$this
->
t
(
'contain'
),
'initial'
=>
$this
->
t
(
'initial'
),
],
];
// User the ability to set the background position.
$elements
[
'css_settings'
][
'css_background_position'
]
=
[
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Background Position'
),
'#description'
=>
t
(
'Set a background position, leave unchecked to have your own in your theme css.'
),
'#title'
=>
$this
->
t
(
'Background Position'
),
'#description'
=>
$this
->
t
(
'Set a background position, leave unchecked to
# have your own in your theme css.'
),
'#default_value'
=>
$css_option_settings
[
'css_background_position'
],
'#options'
=>
[
"inherit"
=>
t
(
"inherit"
),
"left top"
=>
t
(
"left top"
),
"left center"
=>
t
(
"left center"
),
"left bottom"
=>
t
(
"left bottom"
),
"right top"
=>
t
(
"right bottom"
),
"right center"
=>
t
(
"right center"
),
"right bottom"
=>
t
(
"right bottom"
),
"center top"
=>
t
(
"center top"
),
"center center"
=>
t
(
"center center"
),
"center bottom"
=>
t
(
"center bottom"
),
"inherit"
=>
$this
->
t
(
"inherit"
),
"left top"
=>
$this
->
t
(
"left top"
),
"left center"
=>
$this
->
t
(
"left center"
),
"left bottom"
=>
$this
->
t
(
"left bottom"
),
"right top"
=>
$this
->
t
(
"right bottom"
),
"right center"
=>
$this
->
t
(
"right center"
),
"right bottom"
=>
$this
->
t
(
"right bottom"
),
"center top"
=>
$this
->
t
(
"center top"
),
"center center"
=>
$this
->
t
(
"center center"
),
"center bottom"
=>
$this
->
t
(
"center bottom"
),
],
'#tree'
=>
TRUE
,
];
$elements
[
'file_settings'
]
=
[
'#type'
=>
'details'
,
'#title'
=>
t
(
"File Settings"
),
'#title'
=>
$this
->
t
(
"File Settings"
),
'#open'
=>
FALSE
,
]
+
$parentElements
;
...
...
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