summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-01-19 09:52:48 +0000
committerAlex Pott2015-01-19 09:52:48 +0000
commitfd90b0b9424429f1f040c636c56ac89e7e611068 (patch)
tree316aa72225b73179c6f772df8cc9befc44a1eda7
parent3d556b75dfbec29f92591d7861f7cfdbd86f2d9d (diff)
Issue #2407489 by kim.pepper: Remove user.pages.inc
-rw-r--r--core/modules/user/user.module30
-rw-r--r--core/modules/user/user.pages.inc32
2 files changed, 25 insertions, 37 deletions
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index ebd4ced..ad38b9d 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -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];
+ }
+}
diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc
deleted file mode 100644
index ac8de7d..0000000
--- a/core/modules/user/user.pages.inc
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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];
- }
-}