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
2f9585ba
Commit
2f9585ba
authored
Oct 17, 2020
by
elaman
Committed by
joelpittet
Oct 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2931292
by elaman, joelpittet: Provided tokens don't work with Panels module
parent
084122d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
node_authlink.module
node_authlink.module
+19
-18
No files found.
node_authlink.module
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
(
isset
(
$tokens
[
'authlink:view-url'
]))
{
$replacements
[
'[node:authlink:view-url]'
]
=
node_authlink_get_url
(
$data
[
'node'
],
'view'
);
}
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'
);
if
(
$type
==
'node'
&&
!
empty
(
$data
[
'node'
]
->
authkey
))
{
$node
=
$data
[
'node'
];
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
;
}
}
}
return
$replacements
;
}
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