Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
token_prepare_tokens($tokens = array(), $leading = '[', $trailing = ']')
contributions/token/token.module, line 327
A helper function that transforms all the elements of an array. Used to change the delimiter style from brackets to percent symbols etc.
tokens The array of tokens keys with no delimiting chacaters
leading Character(s) to prepend to the token key before searching for matches. Defaults to an open-bracket.
trailing Character(s) to append to the token key before searching for matches. Defaults to a close-bracket. @return The array of token keys, each wrapped in the specified delimiter style.
<?php
function token_prepare_tokens($tokens = array(), $leading = '[', $trailing = ']') {
foreach ($tokens as $key => $value) {
$tokens[$key] = $leading . $value . $trailing;
}
return $tokens;
}
?>