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