mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 09:24:32 +02:00
Show the diff of element edited log entries on detail pages
This commit is contained in:
parent
923e40ed8f
commit
b62fd602f2
8 changed files with 369 additions and 11 deletions
|
@ -50,7 +50,14 @@ class LogDataFormatter
|
|||
public function formatData($data, AbstractLogEntry $logEntry, string $fieldName): string
|
||||
{
|
||||
if (is_string($data)) {
|
||||
return '"' . mb_strimwidth(htmlspecialchars($data), 0, self::STRING_MAX_LENGTH, ) . '"';
|
||||
$tmp = '<span class="text-muted user-select-none">"</span>' . mb_strimwidth(htmlspecialchars($data), 0, self::STRING_MAX_LENGTH, ) . '<span class="text-muted user-select-none">"</span>';
|
||||
|
||||
//Show special characters and line breaks
|
||||
$tmp = preg_replace('/\n/', '<span class="text-muted user-select-none">\\n</span><br>', $tmp);
|
||||
$tmp = preg_replace('/\r/', '<span class="text-muted user-select-none">\\r</span>', $tmp);
|
||||
$tmp = preg_replace('/\t/', '<span class="text-muted user-select-none">\\t</span>', $tmp);
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
if (is_bool($data)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue