function _entityform_format_text in Entityform 7.2
Same name and namespace in other branches
- 7 entityform.module \_entityform_format_text()
Replace tokens and convert text to markup filter
Parameters
string $text_value:
array $token_types:
Return value
string
2 calls to _entityform_format_text()
File
- ./
entityform.module, line 1779 - Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface
Code
function _entityform_format_text($text_value, $token_types = array()) {
$is_filtered = FALSE;
if (is_array($text_value)) {
// We are dealing for a filtered text value
$text = $text_value['value'];
$format = $text_value['format'];
$is_filtered = TRUE;
}
else {
$text = check_plain($text_value);
}
if ($text == '<none>') {
return '';
}
if ($token_types !== FALSE) {
$token_types[] = 'global';
$text = token_replace($text, $token_types, array(
'clear' => TRUE,
));
}
if ($is_filtered) {
$text = check_markup($text, $format);
}
return $text;
}