You are here

function ctools_context_user_convert in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 plugins/contexts/user.inc \ctools_context_user_convert()

Convert a context into a string.

1 call to ctools_context_user_convert()
ctools_context_user_edit_convert in plugins/contexts/user_edit_form.inc
Convert a context into a string.
1 string reference to 'ctools_context_user_convert'
user.inc in plugins/contexts/user.inc
Plugin to provide a user context.

File

plugins/contexts/user.inc, line 171
Plugin to provide a user context.

Code

function ctools_context_user_convert($context, $type) {
  $tokens = token_info();
  if (isset($tokens['tokens']['user'][$type])) {
    $values = token_generate('user', array(
      $type => $type,
    ), array(
      'user' => $context->data,
    ));
    if (isset($values[$type])) {
      return $values[$type];
    }
  }
}