Bug #19918 » 10272_fixed_lgd_cs_params_v2.patch
t3lib/class.t3lib_div.php (working copy) | ||
---|---|---|
* Truncates a string with appended/prepended "..." and takes current character set into consideration.
|
||
* Usage: 75
|
||
*
|
||
* @param string string to truncate
|
||
* @param integer must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
|
||
* @return string New string
|
||
* @param string string to truncate
|
||
* @param integer must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
|
||
* @param string appendix to the truncated string
|
||
* @return string New string
|
||
* @see fixed_lgd()
|
||
*/
|
||
public static function fixed_lgd_cs($string, $chars) {
|
||
public static function fixed_lgd_cs($string, $chars, $appendString='...') {
|
||
if (is_object($GLOBALS['LANG'])) {
|
||
return $GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $string, $chars, '...');
|
||
return $GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $string, $chars, $appendString);
|
||
} elseif (is_object($GLOBALS['TSFE'])) {
|
||
return $GLOBALS['TSFE']->csConvObj->crop($GLOBALS['TSFE']->charSet, $string, $chars, '...');
|
||
return $GLOBALS['TSFE']->csConvObj->crop($GLOBALS['TSFE']->charSet, $string, $chars, $appendString);
|
||
} else {
|
||
// this case should not happen
|
||
$csConvObj = t3lib_div::makeInstance('t3lib_cs');
|
||
return $csConvObj->crop('iso-8859-1', $string, $chars, '...');
|
||
return $csConvObj->crop('iso-8859-1', $string, $chars, $appendString);
|
||
}
|
||
}
|
||
- « Previous
- 1
- 2
- Next »