You are here

function ctools_context_string_convert in Chaos Tool Suite (ctools) 7

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

Convert a context into a string.

1 string reference to 'ctools_context_string_convert'
string.inc in plugins/contexts/string.inc
Plugin to provide a string context.

File

plugins/contexts/string.inc, line 58
Plugin to provide a string context.

Code

function ctools_context_string_convert($context, $type) {
  switch ($type) {
    case 'raw':
      return $context->data;
    case 'html_safe':
      return check_plain($context->data);
    case 'uppercase_words_html_safe':
      return ucwords(str_replace('-', ' ', check_plain($context->data)));
  }
}