2010-04-30 Sergio Martin <sergio.martin@artica.es>

* include/functions_ui.php: Improved the printTruncateText
	function adding the parameter showTextInTitle



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2645 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-04-30 11:07:26 +00:00
parent 9bd5bb107f
commit bdcfd8fbe2
2 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2010-04-30 Sergio Martin <sergio.martin@artica.es>
* include/functions_ui.php: Improved the printTruncateText
function adding the parameter showTextInTitle
2010-04-30 Sergio Martin <sergio.martin@artica.es>
* operation/snmpconsole/snmp_view.php: Fixed the custom

View File

@ -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)) . '&hellip;' . '<a href="#" class="tip">&nbsp;<span>' . $text . '</span></a>';
$truncateText = substr($text, 0, ($numChars - 1)) . '&hellip;';
if ($showTextInTitle) {
$truncateText = '<span title="'.$text.'">'.$truncateText.'</span>';
}
else {
$truncateText = substr($text, 0, ($numChars - 1)) . '&hellip;';
if ($showTextInAToopTip) {
$truncateText = $truncateText . '<a href="#" class="tip">&nbsp;<span>' . $text . '</span></a>';
}
}
else {