diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index cfebf548869..6b68819ce9b 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -771,14 +771,16 @@ function dolibarr_print_phone($phone,$country="FR") /** \brief Tronque une chaine à une taille donnée en ajoutant les points de suspension si cela dépasse - \param string Chaine à tronquer - \param size Longueur max de la chaine. Si 0, pas de limite. - \return string Chaine tronquée + \param string String to truncate + \param size Max string size. 0 for no limit. + \param trunc Where to trunc: right, left, middle + \return string Truncated string + \remarks USE_SHORT_TITLE=0 can disable all truncings */ function dolibarr_trunc($string,$size=40,$trunc='right') { if ($size==0) return $string; - if ((!defined('USE_SHORT_TITLE')) || defined('USE_SHORT_TITLE') && USE_SHORT_TITLE) + if (! defined('USE_SHORT_TITLE') || (defined('USE_SHORT_TITLE') && USE_SHORT_TITLE)) { // We go always here if ($trunc == 'right') @@ -788,7 +790,7 @@ function dolibarr_trunc($string,$size=40,$trunc='right') else return $string; } - if ($trunc == 'center') + if ($trunc == 'middle') { // \TODO A developper.