Improved truncate system and solved issue

This commit is contained in:
Jose Gonzalez 2019-10-01 11:22:25 +02:00
parent b072bb5314
commit f55b2ce80f
2 changed files with 6 additions and 14 deletions

View File

@ -162,6 +162,10 @@ function ui_print_truncate_text($text, $numChars=GENERIC_SIZE_TEXT, $showTextInA
}
if ($showTextInAToopTip) {
if (is_string($showTextInAToopTip)) {
$text = ui_print_truncate_text($showTextInAToopTip, ($numChars * 2), false, true, false);
}
$truncateText = $truncateText.ui_print_help_tip(htmlspecialchars($text), true);
} else {
if ($style !== false) {

View File

@ -280,17 +280,9 @@ if (is_ajax()) {
$events,
function ($carry, $item) {
$tmp = (object) $item;
$tmp->hint = '';
$tmp->meta = false;
$tmp->evento = str_replace('"', '', io_safe_output($tmp->evento));
if (strlen($tmp->evento) >= 255) {
$tmp->hint = io_safe_output(chunk_split(substr($tmp->evento, 0, 600), 80, '<br>').'(...)');
$tmp->meta = is_metaconsole();
$tmp->evento = io_safe_output(substr($tmp->evento, 0, 253).'(...)');
if (strpos($tmp->evento, ' ') === false) {
$tmp->evento = substr($tmp->evento, 0, 80).'(...)';
}
} else {
$tmp->evento = io_safe_output($tmp->evento);
$tmp->evento = ui_print_truncate_text($tmp->evento, 255, $tmp->evento, true, false);
}
if ($tmp->module_name) {
@ -1659,10 +1651,6 @@ function process_datatables_item(item) {
evn += '('+item.event_rep+') ';
}
evn += item.evento+'</a>';
if(item.hint !== ''){
let ruta = item.meta == true ? '../../images/tip_help.png' : 'images/tip_help.png';
evn += '&nbsp;<img src="'+ruta+'" data-title="'+item.hint+'" data-use_title_for_force_title="1" class="forced_title" alt="'+item.hint+'">';
}
item.mini_severity = '<div class="event flex-row h100p nowrap">';
item.mini_severity += output;