Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
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
220
Merge Requests
220
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
drupal
Commits
7ee29979
Commit
7ee29979
authored
Oct 12, 2016
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2809333
by andypost: Use build array for user login block links
parent
d9636476
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
core/modules/user/src/Plugin/Block/UserLoginBlock.php
core/modules/user/src/Plugin/Block/UserLoginBlock.php
+20
-12
No files found.
core/modules/user/src/Plugin/Block/UserLoginBlock.php
View file @
7ee29979
...
...
@@ -98,19 +98,27 @@ public function build() {
// Build action links.
$items
=
array
();
if
(
\
Drupal
::
config
(
'user.settings'
)
->
get
(
'register'
)
!=
USER_REGISTER_ADMINISTRATORS_ONLY
)
{
$items
[
'create_account'
]
=
\
Drupal
::
l
(
$this
->
t
(
'Create new account'
),
new
Url
(
'user.register'
,
array
(),
array
(
'attributes'
=>
array
(
$items
[
'create_account'
]
=
[
'#type'
=>
'link'
,
'#title'
=>
$this
->
t
(
'Create new account'
),
'#url'
=>
Url
::
fromRoute
(
'user.register'
,
[],
[
'attributes'
=>
[
'title'
=>
$this
->
t
(
'Create a new user account.'
),
'class'
=>
array
(
'create-account-link'
),
),
)));
'class'
=>
[
'create-account-link'
],
],
]),
];
}
$items
[
'request_password'
]
=
\
Drupal
::
l
(
$this
->
t
(
'Reset your password'
),
new
Url
(
'user.pass'
,
array
(),
array
(
'attributes'
=>
array
(
$items
[
'request_password'
]
=
[
'#type'
=>
'link'
,
'#title'
=>
$this
->
t
(
'Reset your password'
),
'#url'
=>
Url
::
fromRoute
(
'user.pass'
,
[],
[
'attributes'
=>
[
'title'
=>
$this
->
t
(
'Send password reset instructions via email.'
),
'class'
=>
array
(
'request-password-link'
),
),
)));
'class'
=>
[
'request-password-link'
],
],
]),
];
return
array
(
'user_login_form'
=>
$form
,
'user_links'
=>
array
(
...
...
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