Commit 4933177b authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Removed field token code that is supposed to go into Token module.

parent 1ba2aa18
......@@ -14,18 +14,12 @@ The only menu item is for the settings page.
Settings
--------
The settings page is at Administer >> User >> Realname.
The settings page is at Administer >> Config >> User >> Real name.
This is where you choose which fields from the profile will be used
This is where you choose which user tokens will be used
to create the user's RealName.
Note: Currently only "single line textfield" data will be shown.
The "Separator" value will be placed between the pieces of the name.
TODO: Change to a pattern for more flexilibility.
Permissions
-----------
There are no new permissions. The settings page is controlled by the
"administer users" permission.
\ No newline at end of file
"administer users" permission.
......@@ -13,7 +13,7 @@ function realname_token_info() {
'name' => t('Raw name'),
'description' => t('The raw login name of the user account, unprocessed by the RealName module.'),
);
return $info;
}
......@@ -44,17 +44,6 @@ function realname_tokens($type, $tokens, array $data = array(), array $options =
break;
}
}
$user_fields = field_info_instances('user', 'user');
foreach ($user_fields as $field_name => $field) {
$token_name = strtr($field_name, '_', '-');
if ($field['widget']['module'] == 'text' && isset($tokens[$token_name]) && !empty($account->{$field_name}[LANGUAGE_NONE][0])) {
$original = $tokens[$token_name];
$item = $account->{$field_name}[LANGUAGE_NONE][0];
$instance = field_info_instance('user', $field_name, 'user');
$replacements[$original] = $sanitize ? _text_sanitize($instance, LANGUAGE_NONE, $item, 'value') : $item['value'];
}
}
}
return $replacements;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment