2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Laurent Destailleur
2008-10-20 23:14:50 +00:00
parent d47dc7c77f
commit 33ee88da19

View File

@@ -759,16 +759,21 @@ function dol_phone_link($phone,$option=0)
*/
function dolibarr_trunc($string,$size=40,$trunc='right')
{
global $conf;
if ($size==0) return $string;
if (! defined('USE_SHORT_TITLE') || (defined('USE_SHORT_TITLE') && USE_SHORT_TITLE))
{
// We go always here
if ($trunc == 'right')
{
//mb_internal_encoding("UTF-8");
//print $conf->character_set_client.'-'.mb_strlen($string).'-'.strlen($string);
//print 'ee'.$string.$size.mb_strcut($string,0,$size,'UTF-8').'rr';
if (strlen($string) > $size)
return substr($string,0,$size).'...';
return substr($string,0,$size).'...';
else
return $string;
return $string;
}
if ($trunc == 'middle')
{