Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
fd90b0b9
Commit
fd90b0b9
authored
Jan 19, 2015
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2407489
by kim.pepper: Remove user.pages.inc
parent
3d556b75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
37 deletions
+25
-37
core/modules/user/user.module
core/modules/user/user.module
+25
-5
core/modules/user/user.pages.inc
core/modules/user/user.pages.inc
+0
-32
No files found.
core/modules/user/user.module
View file @
fd90b0b9
...
...
@@ -3,18 +3,19 @@
use
Drupal\Component\Utility\Crypt
;
use
Drupal\Component\Utility\String
;
use
Drupal\Component\Utility\Unicode
;
use
Drupal\Core\Entity\Display\EntityViewDisplayInterface
;
use
Drupal\Core\Field\BaseFieldDefinition
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Render\Element
;
use
Drupal\Core\Routing\RouteMatchInterface
;
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\Core\Session\AnonymousUserSession
;
use
\
Drupal\Core\Entity\Display\EntityViewDisplayInterface
;
use
Drupal\Core\Url
;
use
Drupal\Core\Site\Settings
;
use
Drupal\Core\Url
;
use
Drupal\user\Entity\Role
;
use
Drupal\user\Entity\User
;
use
Drupal\user\UserInterface
;
use
Drupal\user\RoleInterface
;
use
Drupal\
Core\Field\BaseFieldDefinition
;
use
Drupal\
user\UserInterface
;
/**
* @file
...
...
@@ -93,7 +94,6 @@ function user_theme() {
return
array
(
'user'
=>
array
(
'render element'
=>
'elements'
,
'file'
=>
'user.pages.inc'
,
),
'username'
=>
array
(
'variables'
=>
array
(
'account'
=>
NULL
,
'attributes'
=>
array
(),
'link_options'
=>
array
()),
...
...
@@ -1485,3 +1485,23 @@ function user_logout() {
// Destroy the current session, and reset $user to the anonymous user.
session_destroy
();
}
/**
* Prepares variables for user templates.
*
* Default template: user.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* fields attached to the user. Properties used:
* - #user: A \Drupal\user\Entity\User object. The user account of the
* profile being viewed.
* - attributes: HTML attributes for the containing element.
*/
function
template_preprocess_user
(
&
$variables
)
{
// Helpful $content variable for templates.
foreach
(
Element
::
children
(
$variables
[
'elements'
])
as
$key
)
{
$variables
[
'content'
][
$key
]
=
$variables
[
'elements'
][
$key
];
}
}
core/modules/user/user.pages.inc
deleted
100644 → 0
View file @
3d556b75
<?php
/**
* @file
* User page callback file for the user module.
*/
use
Drupal\Core\Render\Element
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
;
/**
* Prepares variables for user templates.
*
* Default template: user.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* fields attached to the user. Properties used:
* - #user: A \Drupal\user\Entity\User object. The user account of the
* profile being viewed.
* - attributes: HTML attributes for the containing element.
*/
function
template_preprocess_user
(
&
$variables
)
{
$account
=
$variables
[
'elements'
][
'#user'
];
// Helpful $content variable for templates.
foreach
(
Element
::
children
(
$variables
[
'elements'
])
as
$key
)
{
$variables
[
'content'
][
$key
]
=
$variables
[
'elements'
][
$key
];
}
}
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