2010-06-25 Sergio Martin <sergio.martin@artica.es>

* include/functions_ui.php: Adding a parameter to
	printTruncateText to personalize the suffix string
	of a truncate string



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2927 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-06-25 08:12:25 +00:00
parent 68825e8565
commit 88a8bc1308
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2010-06-25 Sergio Martin <sergio.martin@artica.es>
* include/functions_ui.php: Adding a parameter to
printTruncateText to personalize the suffix string
of a truncate string
2010-06-25 Sergio Martin <sergio.martin@artica.es>
* include/functions_ui.php: Changed substr() to

View File

@ -28,10 +28,11 @@
* @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.
* @param string $suffix String at the end of a strimmed string.
*/
function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true) {
function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '&hellip;') {
if (strlen($text) > ($numChars - 1)) {
$truncateText = mb_strimwidth($text, 0, ($numChars - 1)) . '&hellip;';
$truncateText = mb_strimwidth($text, 0, ($numChars - 1)) . $suffix;
if ($showTextInTitle) {
$truncateText = '<span title="'.$text.'">'.$truncateText.'</span>';