public static function TextimageImager::processTextString in Textimage 7.3
Process text string, detokenise and apply case conversion.
3 calls to TextimageImager::processTextString()
- Textimage::process in classes/
Textimage.inc - Process the Textimage, with the required raw text.
- theme_textimage_formatter in ./
textimage.module - Theme function to format a Textimage.
- _textimage_get_text_wrapper in effects/
textimage_text.inc - Get the image containing the text.
File
- classes/
TextimageImager.inc, line 187 - Textimage - Image processor class.
Class
- TextimageImager
- Textimage - Image processor class.
Code
public static function processTextString($text, $case_format, $node = NULL, $source_image_file = NULL) {
// Replace any tokens in text with run-time values.
global $user;
$text = token_replace($text, array(
'user' => $user,
'node' => $node,
'file' => $source_image_file,
));
// Convert case, if requested.
switch ($case_format) {
case 'upper':
return drupal_strtoupper($text);
case 'lower':
return drupal_strtolower($text);
case 'ucfirst':
return drupal_ucfirst($text);
case 'ucwords':
return preg_replace_callback('/(\\w+)/', array(
'TextimageImager',
'uppercaseWords',
), $text);
default:
return $text;
}
}