Minor gui fixes

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2021-05-02 08:19:09 +02:00
parent a8f037c3e9
commit dacb7c85aa
2 changed files with 34 additions and 5 deletions

View File

@ -1,5 +1,10 @@
<?php <?php
unction H($s = '') {
print htmlentities($s);
}
function LOGGER($event = '', $username = '') { function LOGGER($event = '', $username = '') {
$ipaddr = ''; $ipaddr = '';
@ -493,7 +498,31 @@ function fixup_date_condition($field = '', $date1 = 0, $date2 = 0) {
function make_short_string($what, $length) { function make_short_string($what, $length) {
return strlen($what) > $length ? substr($what, 0, $length) . "..." : $what; if($length < 1) { return ''; }
if(strlen($what) <= $length) { return $what; }
$arr = preg_split("/\s/", $what);
$s = '';
$i = 0;
foreach($arr as $a) {
if($i == 0) {
if($length > 0 && strlen($a) > $length) {
return substr($a, 0, $length) . '...';
}
}
if(strlen($s) + strlen($a) <= $length) {
$s .= $a . ' ';
} else {
break;
}
$i++;
}
return $s . '...';
} }

View File

@ -43,7 +43,7 @@
</thead> </thead>
<tbody> <tbody>
<?php $i=0; foreach ($messages as $message) { ?> <?php $i=0; foreach ($messages as $message) { ?>
<tr onmouseover="Piler.current_message_id = <?php print $message['id']; ?>; return false;" id="e_<?php print $message['id']; ?>" class="resultrow new <?php if($message['deleted'] == 1) { ?>xxx<?php } ?>" onclick="Piler.view_message_by_pos(<?php print $i; ?>);"> <tr onmouseover="Piler.current_message_id = <?php print $message['id']; ?>; return false;" id="e_<?php print $message['id']; ?>" class="resultrow new <?php if($message['deleted'] == 1) { ?>xxx<?php } ?>" onclick="Piler.view_message_by_pos(<?php print $i; ?>);">
<td id="c1_r<?php print $i; ?>" class="resultcell restore" onclick="Piler.stop_propagation(event);"><input type="checkbox" id="r_<?php print $message['id']; ?>" name="r_<?php print $message['id']; ?>" value="iiii" <?php if(SEARCH_RESULT_CHECKBOX_CHECKED == 1) { ?>checked="checked"<?php } ?> class="restorebox" /></td> <td id="c1_r<?php print $i; ?>" class="resultcell restore" onclick="Piler.stop_propagation(event);"><input type="checkbox" id="r_<?php print $message['id']; ?>" name="r_<?php print $message['id']; ?>" value="iiii" <?php if(SEARCH_RESULT_CHECKBOX_CHECKED == 1) { ?>checked="checked"<?php } ?> class="restorebox" /></td>
<td id="c2_r<?php print $i; ?>" class="resultcell id"><?php print ($page*$page_len) + $i + 1; ?></td> <td id="c2_r<?php print $i; ?>" class="resultcell id"><?php print ($page*$page_len) + $i + 1; ?></td>
@ -67,7 +67,7 @@
<?php $i++; } ?> <?php $i++; } ?>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th id="restore-header"><input type="checkbox" id="bulkcheck2" name="bulkcheck2" value="1" <?php if(SEARCH_RESULT_CHECKBOX_CHECKED == 1) { ?>checked="checked"<?php } ?> class="restorebox" onclick="Piler.toggle_bulk_check('2');" /></th> <th id="restore-header"><input type="checkbox" id="bulkcheck2" name="bulkcheck2" value="1" <?php if(SEARCH_RESULT_CHECKBOX_CHECKED == 1) { ?>checked="checked"<?php } ?> class="restorebox" onclick="Piler.toggle_bulk_check('2');" /></th>
@ -106,7 +106,7 @@
<?php } ?> <?php } ?>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
<?php } else if($n == 0) { ?> <?php } else if($n == 0) { ?>
@ -135,7 +135,7 @@
&nbsp; &nbsp;
<?php if(Registry::get('auditor_user') == 1 && $session->get("sphx_query")) { ?> <?php if(Registry::get('auditor_user') == 1 && $session->get("sphx_query")) { ?>
<span style="margin-left: 30px;"><a href="#" onclick="Piler.show_message('messagebox1', '<?php print $session->get("sphx_query"); ?>', 5);">sphinx</a></span> <span style="margin-left: 30px;"><a href="#" onclick="Piler.show_message('messagebox1', '<?php H($session->get("sphx_query")); ?>', 5);">sphinx</a></span>
<?php } ?> <?php } ?>
<?php } else { print $text_none_found; } ?> <?php } else { print $text_none_found; } ?>