Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prevnext-3433980
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
prevnext-3433980
Commits
aa3eb8f1
Commit
aa3eb8f1
authored
4 years ago
by
Daniele Piaggesi
Browse files
Options
Downloads
Patches
Plain Diff
Replaced array() notation with short syntax
parent
d860cfd1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
prevnext.module
+1
-1
1 addition, 1 deletion
prevnext.module
src/Form/PrevnextSettingsForm.php
+3
-4
3 additions, 4 deletions
src/Form/PrevnextSettingsForm.php
with
4 additions
and
5 deletions
prevnext.module
+
1
−
1
View file @
aa3eb8f1
...
...
@@ -83,7 +83,7 @@ function prevnext_entity_extra_field_info() {
*/
function
prevnext_node_view
(
array
&
$build
,
Node
$node
,
EntityViewDisplayInterface
$display
,
$view_mode
)
{
//
To c
heck if current node is configured for prevnext or not.
//
C
heck
ing
if current node is configured for prevnext or not.
$config
=
\Drupal
::
config
(
'prevnext.settings'
);
$enabled_nodetypes
=
$config
->
get
(
'prevnext_enabled_nodetypes'
);
if
(
empty
(
$enabled_nodetypes
[
$node
->
getType
()]))
{
...
...
This diff is collapsed.
Click to expand it.
src/Form/PrevnextSettingsForm.php
+
3
−
4
View file @
aa3eb8f1
...
...
@@ -30,16 +30,15 @@ class PrevnextSettingsForm extends ConfigFormBase {
* {@inheritdoc}
*/
public
function
buildForm
(
array
$form
,
FormStateInterface
$form_state
)
{
$config
=
$this
->
config
(
'prevnext.settings'
);
$form
[
'prevnext_enabled_nodetypes'
]
=
array
(
$form
[
'prevnext_enabled_nodetypes'
]
=
[
'#title'
=>
$this
->
t
(
'Enabled Node Types'
),
'#description'
=>
$this
->
t
(
'Check node types enabled for Previous/Next'
),
'#type'
=>
'checkboxes'
,
'#options'
=>
node_type_get_names
(),
'#default_value'
=>
!
empty
(
$config
->
get
(
'prevnext_enabled_nodetypes'
))
?
$config
->
get
(
'prevnext_enabled_nodetypes'
)
:
array
()
,
)
;
'#default_value'
=>
!
empty
(
$config
->
get
(
'prevnext_enabled_nodetypes'
))
?
$config
->
get
(
'prevnext_enabled_nodetypes'
)
:
[]
,
]
;
return
parent
::
buildForm
(
$form
,
$form_state
);
}
...
...
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