summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/user.api.php8
-rw-r--r--modules/user/user.module40
2 files changed, 20 insertions, 28 deletions
diff --git a/modules/user/user.api.php b/modules/user/user.api.php
index 72608ecfa..481002b41 100644
--- a/modules/user/user.api.php
+++ b/modules/user/user.api.php
@@ -314,10 +314,10 @@ function hook_user_logout($account) {
*
* @param $account
* The user object on which the operation is being performed.
- * @param $build_mode
- * Build mode, e.g. 'full'.
+ * @param $view_mode
+ * View mode, e.g. 'full'.
*/
-function hook_user_view($account, $build_mode) {
+function hook_user_view($account, $view_mode) {
if (user_access('create blog content', $account)) {
$account->content['summary']['blog'] = array(
'#type' => 'user_profile_item',
@@ -402,7 +402,7 @@ function hook_user_role_update($role) {
* Inform other modules that a user role has been deleted.
*
* This hook allows you act when a user role has been deleted.
- * If your module stores references to roles, it's recommended that you
+ * If your module stores references to roles, it's recommended that you
* implement this hook and delete existing instances of the deleted role
* in your module database tables.
*
diff --git a/modules/user/user.module b/modules/user/user.module
index 432f936b9..9767c3288 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -142,25 +142,17 @@ function user_entity_info() {
),
),
),
+ 'view modes' => array(
+ 'full' => array(
+ 'label' => t('User account'),
+ ),
+ ),
),
);
return $return;
}
/**
- * Implements hook_field_build_modes().
- */
-function user_field_build_modes($obj_type) {
- $modes = array();
- if ($obj_type == 'user') {
- $modes = array(
- 'full' => t('User account'),
- );
- }
- return $modes;
-}
-
-/**
* Implements hook_field_extra_fields().
*/
function user_field_extra_fields($bundle) {
@@ -2129,15 +2121,15 @@ function _user_cancel($edit, $account, $method) {
*
* @param $account
* A user object.
- * @param $build_mode
- * Build mode, e.g. 'full'.
+ * @param $view_mode
+ * View mode, e.g. 'full'.
*
* @return
* An array as expected by drupal_render().
*/
-function user_view($account, $build_mode = 'full') {
+function user_view($account, $view_mode = 'full') {
// Retrieve all profile fields and attach to $account->content.
- user_build_content($account, $build_mode);
+ user_build_content($account, $view_mode);
$build = $account->content;
// We don't need duplicate rendering info in account->content.
@@ -2146,7 +2138,7 @@ function user_view($account, $build_mode = 'full') {
$build += array(
'#theme' => 'user_profile',
'#account' => $account,
- '#build_mode' => $build_mode,
+ '#view_mode' => $view_mode,
);
// Allow modules to modify the structured user.
@@ -2160,19 +2152,19 @@ function user_view($account, $build_mode = 'full') {
*
* @param $account
* A user object.
- * @param $build_mode
- * Build mode, e.g. 'full'.
+ * @param $view_mode
+ * View mode, e.g. 'full'.
*/
-function user_build_content($account, $build_mode = 'full') {
+function user_build_content($account, $view_mode = 'full') {
// Remove previously built content, if exists.
$account->content = array();
// Build fields content.
- field_attach_prepare_view('user', array($account->uid => $account), $build_mode);
- $account->content += field_attach_view('user', $account, $build_mode);
+ field_attach_prepare_view('user', array($account->uid => $account), $view_mode);
+ $account->content += field_attach_view('user', $account, $view_mode);
// Populate $account->content with a render() array.
- module_invoke_all('user_view', $account, $build_mode);
+ module_invoke_all('user_view', $account, $view_mode);
}
/**