mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 04:30:12 +01:00
Minor gui fixes
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
a8f037c3e9
commit
dacb7c85aa
@ -1,5 +1,10 @@
|
||||
<?php
|
||||
|
||||
unction H($s = '') {
|
||||
print htmlentities($s);
|
||||
}
|
||||
|
||||
|
||||
function LOGGER($event = '', $username = '') {
|
||||
$ipaddr = '';
|
||||
|
||||
@ -493,7 +498,31 @@ function fixup_date_condition($field = '', $date1 = 0, $date2 = 0) {
|
||||
|
||||
|
||||
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 . '...';
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,7 +135,7 @@
|
||||
|
||||
|
||||
<?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 } else { print $text_none_found; } ?>
|
||||
|
Loading…
Reference in New Issue
Block a user