Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
node_authlink
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
node_authlink
Commits
2f9585ba
Commit
2f9585ba
authored
Oct 18, 2020
by
peritus
Committed by
Joël Pittet
Oct 18, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2931292
by elaman, joelpittet: Provided tokens don't work with Panels module
parent
084122d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
node_authlink.module
+19
-18
19 additions, 18 deletions
node_authlink.module
with
19 additions
and
18 deletions
node_authlink.module
+
19
−
18
View file @
2f9585ba
...
...
@@ -452,27 +452,28 @@ function node_authlink_tokens($type, $tokens, array $data = [], array $options =
return
;
}
$replacements
=
[];
if
(
isset
(
$tokens
[
'authlink:authkey'
]))
{
$replacements
[
'[node:authlink:authkey]'
]
=
$data
[
'node'
]
->
authkey
;
}
if
(
$type
==
'node'
&&
!
empty
(
$data
[
'node'
]
->
authkey
))
{
$node
=
$data
[
'node'
];
if
(
isset
(
$tokens
[
'authlink:view-url'
]))
{
$replacements
[
'[node:authlink:view-url]'
]
=
node_authlink_get_url
(
$data
[
'node'
],
'view'
);
foreach
(
$tokens
as
$name
=>
$original
)
{
switch
(
$name
)
{
case
'authlink:authkey'
:
$replacements
[
$original
]
=
$node
->
authkey
;
break
;
case
'authlink:view-url'
:
$replacements
[
$original
]
=
node_authlink_get_url
(
$node
,
'view'
);
break
;
case
'authlink:edit-url'
:
$replacements
[
$original
]
=
node_authlink_get_url
(
$node
,
'update'
);
break
;
case
'authlink:delete-url'
:
$replacements
[
$original
]
=
node_authlink_get_url
(
$node
,
'delete'
);
break
;
}
if
(
isset
(
$tokens
[
'authlink:edit-url'
]))
{
$replacements
[
'[node:authlink:edit-url]'
]
=
node_authlink_get_url
(
$data
[
'node'
],
'update'
);
}
if
(
isset
(
$tokens
[
'authlink:delete-url'
]))
{
$replacements
[
'[node:authlink:delete-url]'
]
=
node_authlink_get_url
(
$data
[
'node'
],
'delete'
);
}
return
$replacements
;
}
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