Index: branches/5.1.x/core/units/logs/change_logs/changes_formatter.php
===================================================================
diff -u -N -r13086 -r13161
--- branches/5.1.x/core/units/logs/change_logs/changes_formatter.php (.../changes_formatter.php) (revision 13086)
+++ branches/5.1.x/core/units/logs/change_logs/changes_formatter.php (.../changes_formatter.php) (revision 13161)
@@ -1,6 +1,6 @@
Application->Phrase('la_fld_'.$field);
// remove translation link (added in debug mode)
- $fld_translation = preg_replace('/(.*?)<\/a>/', '\\2', $fld_translation);
+ $fld_translation = preg_replace('/(.*?)<\/a>/', '\\2', $fld_translation);
if ($fld_translation == '!'.strtoupper('la_fld_'.$field).'!') {
// when phrase is not translated use field name as label
$fld_translation = $field;
}
- if (is_array($data) && isset($data['old']) && isset($data['new'])) {
- $res .= "$fld_translation: {$data['old']} => {$data['new']}
\n";
+ if (is_array($data)) {
+ if ($format == 'auto_cut') {
+ $data = array_map(Array (&$this, 'cutValue'), $data);
+ }
+
+ if (array_key_exists('old', $data) && array_key_exists('new', $data)) {
+ $res .= "$fld_translation: {$data['old']} => {$data['new']}
\n";
+ }
+ else {
+ $res .= "$fld_translation: {$data['new']}
\n";
+ }
}
else {
- $res .= "$fld_translation: {$data['new']}
\n";
+ if ($format == 'auto_cut') {
+ $data = $this->cutValue($data);
+ }
+
+ $res .= "$fld_translation: {$data}
\n";
}
+
}
return $res;
}
+ function cutValue($data)
+ {
+ if (strlen($data) > 200) {
+ $data = substr($data, 0, 50) . ' ...';
+ }
+
+ return $data;
+ }
}
\ No newline at end of file