function imagefield_extended_check_text in ImageField Extended 6.4
Same name and namespace in other branches
- 6.3 imagefield_extended.module \imagefield_extended_check_text()
2 calls to imagefield_extended_check_text()
- imagefield_extended_token_values in ./
imagefield_extended.module - Implements hook_token_values().
- theme_imagefield_extended_formatter_ife in ./
imagefield_extended.module - ImageField Extended formatter theme callback.
1 string reference to 'imagefield_extended_check_text'
- imagefield_extended_filefield_data_info in ./
imagefield_extended.module - Implementation of hook_filefield_data_info().
File
- ./
imagefield_extended.module, line 367 - Insert additional fields into a FileField / ImageField data array.
Code
function imagefield_extended_check_text($textfield) {
$text = isset($textfield['body']) ? trim($textfield['body']) : '';
if (empty($text)) {
return '';
}
$format = isset($textfield['format']) ? $textfield['format'] : FILTER_FORMAT_DEFAULT;
switch ($textfield['style']) {
case 'formatted':
return check_markup($text, $format, FALSE);
case 'textarea':
return filter_xss($text);
case 'textfield':
default:
return check_plain($text);
}
}