You are here

function imagefield_extended_check_text in ImageField Extended 6.3

Same name and namespace in other branches
  1. 6.4 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.

File

./imagefield_extended.module, line 387
Insert additional fields into an 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);
  }
}