#12468 Fixed instructions

This commit is contained in:
Daniel Maya 2023-11-29 10:27:55 +01:00
parent 22969eff6e
commit 892048554e
2 changed files with 4 additions and 17 deletions

View File

@ -5775,7 +5775,7 @@ function events_get_field_value_by_event_id(
}
function events_get_instructions($event)
function events_get_instructions($event, $max_text_length=300)
{
if (is_array($event) === false) {
return '';
@ -5823,17 +5823,17 @@ function events_get_instructions($event)
return '';
}
$max_text_length = 300;
$over_text = io_safe_output($value);
if (strlen($over_text) > ($max_text_length + 3)) {
$over_text = substr($over_text, 0, $max_text_length).'...';
} else {
return $value;
}
$output = '<div id="hidden_event_instructions_'.$event['id_evento'].'"';
$output .= ' class="event_instruction">';
$output .= $value;
$output .= '</div>';
$output .= '<center>';
$output .= '<span id="value_event_'.$event['id_evento'].'" class="nowrap">';
$output .= '<span id="value_event_text_'.$event['id_evento'].'"></span>';
$output .= '<a href="javascript:show_instructions('.$event['id_evento'].')">';
@ -5842,7 +5842,6 @@ function events_get_instructions($event)
true,
['title' => $over_text]
).'</a></span>';
$output .= '</center>';
return $output;
}

View File

@ -644,19 +644,7 @@ if (is_ajax() === true) {
$tmp->data = ui_print_truncate_text($tmp->data, 10);
}
$tmp->instructions = events_get_instructions($item);
if (strlen($tmp->instructions) >= 20) {
$tmp->instructions = ui_print_truncate_text(
$tmp->instructions,
20,
false,
true,
false,
'&hellip;',
true,
true,
);
}
$tmp->instructions = events_get_instructions($item, 15);
$tmp->user_comment = ui_print_comments(
event_get_last_comment(