function _locale_export_wrap
Same name and namespace in other branches
- 6.x drupal-6.x/includes/locale.inc \_locale_export_wrap()
Custom word wrapping for Portable Object (Template) files.
Related topics
1 call to _locale_export_wrap()
- _locale_export_string in drupal-7.x/
includes/ locale.inc - Print out a string on multiple lines
Archivo
- drupal-7.x/
includes/ locale.inc, line 1802 - Administration functions for locale.module.
Código
function _locale_export_wrap($str, $len) {
$words = explode(' ', $str);
$return = array();
$cur = "";
$nstr = 1;
while (count($words)) {
$word = array_shift($words);
if ($nstr) {
$cur = $word;
$nstr = 0;
}
elseif (strlen("$cur $word") > $len) {
$return[] = $cur . " ";
$cur = $word;
}
else {
$cur = "$cur $word";
}
}
$return[] = $cur;
return implode("\n", $return);
}