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:
parent
9bd5bb107f
commit
bdcfd8fbe2
|
@ -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
|
||||
|
|
|
@ -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)) . '…' . '<a href="#" class="tip"> <span>' . $text . '</span></a>';
|
||||
$truncateText = substr($text, 0, ($numChars - 1)) . '…';
|
||||
|
||||
if ($showTextInTitle) {
|
||||
$truncateText = '<span title="'.$text.'">'.$truncateText.'</span>';
|
||||
}
|
||||
else {
|
||||
$truncateText = substr($text, 0, ($numChars - 1)) . '…';
|
||||
if ($showTextInAToopTip) {
|
||||
$truncateText = $truncateText . '<a href="#" class="tip"> <span>' . $text . '</span></a>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue