It dosn't show up in auto_nodetitle(Automatic title generation") list. evenif I add it manually, still it wouldn't recognized.

Comments

hamidrj’s picture

Title: not recognized by auto_nodetitle » just add this at the end of money module
Category: bug » feature

just add this at the end of money module:

/**
* Implementation of hook_token_values
*
* @param string $type $type contains the current context -- 'node', 'user', 'global', etc.
* @param mixed $object contains the specific node, user, etc. that should be used as the basis for the replacements.
* @return array $tokens
*/
function money_token_values($type, $object = NULL) {
if ($type == 'field') {
$tokens = array();
$something = $object[0];
$tokens['money'] = $something['view'];
$tokens['currency'] = $something['currency'];
$tokens['amount'] = $something['amount'];
return $tokens;
}
} // function money_token_values()

/**
* Implementation of hook_token_list
*
* @param string $type indicates the context that token help is being generated for.
* @return array $tokens
*/
function money_token_list($type = 'all') {
if ($type == 'field' || $type == 'all') {
$tokens = array();
$tokens['money']['money'] = t("money");
$tokens['money']['currency'] = t("currency");
$tokens['money']['amount'] = t("amount");
return $tokens;
}
} // function money_token_values()

wim leers’s picture

Title: just add this at the end of money module » Token module support for Money module.

Please create a patch next time. I'll accept this code, since it's only new code.

As soon as I have some time to test your code, I'll commit it.

wim leers’s picture

Title: Token module support for Money module. » Token module support
Status: Active » Fixed

Thanks, committed!

Anonymous’s picture

Status: Fixed » Closed (fixed)