You are here

function _token_clean_css_identifier in Token 7

Same name and namespace in other branches
  1. 6 token.pages.inc \_token_clean_css_identifier()

Wrapper function for drupal_clean_css_identifier() for use with tokens.

This trims any brackets from the token and also cleans the colon character to a hyphen.

See also

drupal_clean_css_identifier()

1 call to _token_clean_css_identifier()
_token_token_tree_format_row in ./token.pages.inc
Build a row in the token tree.

File

./token.pages.inc, line 232
User page callbacks for the token module.

Code

function _token_clean_css_identifier($id) {
  static $replacements = array(
    ' ' => '-',
    '_' => '-',
    '/' => '-',
    '[' => '-',
    ']' => '',
    ':' => '--',
    '?' => '',
    '<' => '-',
    '>' => '-',
  );
  return 'token-' . rtrim(strtr(trim($id, '[]'), $replacements), '-');
}