Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
N
node_authlink
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
node_authlink
Commits
fe5c2b0f
Commit
fe5c2b0f
authored
Aug 23, 2018
by
akalam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid warnings when a content type is not configured
parent
b9037434
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
node_authlink.module
node_authlink.module
+7
-3
No files found.
node_authlink.module
View file @
fe5c2b0f
...
...
@@ -22,6 +22,10 @@ function node_authlink_form_node_type_form_alter(&$form, FormStateInterface &$fo
$type
=
$node_type
->
getEntity
()
->
id
();
$config
=
\
Drupal
::
config
(
'node_authlink.settings'
);
$config_enable
=
$config
->
get
(
'enable'
);
$config_grants
=
$config
->
get
(
'grants'
);
$config_expire
=
$config
->
get
(
'expire'
);
$form
[
'node_authlink'
]
=
[
'#type'
=>
'details'
,
'#title'
=>
t
(
'Node authorize link'
),
...
...
@@ -31,14 +35,14 @@ function node_authlink_form_node_type_form_alter(&$form, FormStateInterface &$fo
$form
[
'node_authlink'
][
'node_authlink_enable'
]
=
[
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Enable'
),
'#default_value'
=>
$config
->
get
(
'enable.'
.
$type
)
,
'#default_value'
=>
isset
(
$config_enable
[
$type
])
?
$config_enable
[
$type
]
:
0
,
'#description'
=>
t
(
'Disable of this feature will cost erase of authorization keys of all nodes in this node type.'
),
];
$form
[
'node_authlink'
][
'node_authlink_grants'
]
=
[
'#type'
=>
'checkboxes'
,
'#title'
=>
t
(
'Grants to give'
),
'#default_value'
=>
$config
->
get
(
'grants.'
.
$type
)
,
'#default_value'
=>
isset
(
$config_grants
[
$type
])
?
$config_grants
[
$type
]
:
[]
,
'#options'
=>
[
'view'
=>
t
(
'View'
),
'update'
=>
t
(
'Update'
),
...
...
@@ -55,7 +59,7 @@ function node_authlink_form_node_type_form_alter(&$form, FormStateInterface &$fo
$form
[
'node_authlink'
][
'node_authlink_expire'
]
=
[
'#type'
=>
'select'
,
'#title'
=>
t
(
'Regenerate authkeys after'
),
'#default_value'
=>
$config
->
get
(
'expire.'
.
$type
)
,
'#default_value'
=>
isset
(
$config_expire
[
$type
])
?
$config_expire
[
$type
]
:
''
,
'#options'
=>
$period
,
'#description'
=>
t
(
'Keys older than selected time will be regenerated by cron run.'
),
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment