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:
parent
68825e8565
commit
88a8bc1308
|
@ -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
|
||||
|
|
|
@ -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 = '…') {
|
||||
if (strlen($text) > ($numChars - 1)) {
|
||||
$truncateText = mb_strimwidth($text, 0, ($numChars - 1)) . '…';
|
||||
$truncateText = mb_strimwidth($text, 0, ($numChars - 1)) . $suffix;
|
||||
|
||||
if ($showTextInTitle) {
|
||||
$truncateText = '<span title="'.$text.'">'.$truncateText.'</span>';
|
||||
|
|
Loading…
Reference in New Issue