/**
* Implementation of hook_token_values().
*/
function content_profile_token_token_values($type, $object = NULL, $options = array()) {
$values = array();
switch ($type) {
case 'user':
if (isset($object)) {
$account = user_load(array('uid' => $object->uid));
}
else {
global $user;
$account = user_load(array('uid' => $user->uid));
}
$node_profile = content_profile_load('profile', $account->uid);
$values['profile'] = ($node_profile->title) ? $node_profile->title : '';
break;
}
return $values;
}
/**
* Implementation of hook_token_list().
*/
function content_profile_token_token_list($type = 'all') {
if ($type == 'user' || $type == 'all') {
$tokens = array();
$tokens['user']['profile'] = t('Profile title of authors content profile');
return $tokens;
}
}
I have created a module, and added a .info file as intended, but when I check the token list for a image field title I don't see any of the tokens implemented by my module.
What am I doing wrong?
UPDATED!!!
Now i see my token in imagefield token list, but it doesnt works == doesnt add content profile title for img...