diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d9e551c5e9..b37b757098 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-04-30 Sergio Martin + + * include/functions_ui.php: Improved the printTruncateText + function adding the parameter showTextInTitle + 2010-04-30 Sergio Martin * operation/snmpconsole/snmp_view.php: Fixed the custom diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 4dee48f4af..8f9e490ca1 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -27,14 +27,17 @@ * @param integer $numChars Number chars (-1 for char "...") max the text. * @param boolean $showTextInAToopTip Flag to show the tooltip. * @param boolean $return Flag to return as string or not. + * @param boolean $showTextInTitle Flag to show the text on title. */ -function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true) { +function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true) { if (strlen($text) > ($numChars - 1)) { - if ($showTextInAToopTip) { - $truncateText = substr($text, 0, ($numChars - 1)) . '…' . ' ' . $text . ''; + $truncateText = substr($text, 0, ($numChars - 1)) . '…'; + + if ($showTextInTitle) { + $truncateText = ''.$truncateText.''; } - else { - $truncateText = substr($text, 0, ($numChars - 1)) . '…'; + if ($showTextInAToopTip) { + $truncateText = $truncateText . ' ' . $text . ''; } } else {