Index: branches/5.2.x/core/units/helpers/language_import_helper.php =================================================================== diff -u -N -r15224 -r15225 --- branches/5.2.x/core/units/helpers/language_import_helper.php (.../language_import_helper.php) (revision 15224) +++ branches/5.2.x/core/units/helpers/language_import_helper.php (.../language_import_helper.php) (revision 15225) @@ -1,6 +1,6 @@ '; - $ret .= $this->_exportEncoding == 'base64' ? base64_encode($replacements) : ''; - $ret .= '' . "\n"; + if ( $replacements ) { + $ret .= "\t\t" . '' . $this->_exportConvert($replacements) . '' . "\n"; } + // e-mail design templates + if ( $language_info['HtmlEmailTemplate'] || $language_info['TextEmailTemplate'] ) { + $ret .= "\t\t" . '' . "\n"; + + if ( $language_info['HtmlEmailTemplate'] ) { + $ret .= "\t\t\t" . '' . $this->_exportConvert($language_info['HtmlEmailTemplate']) . '' . "\n"; + } + + if ( $language_info['TextEmailTemplate'] ) { + $ret .= "\t\t\t" . '' . $this->_exportConvert($language_info['TextEmailTemplate']) . '' . "\n"; + } + + $ret .= "\t\t" . '' . "\n"; + } + // phrases if ($phrases) { $ret .= "\t\t" . '' . "\n"; @@ -344,12 +361,10 @@ } if ( $this->_exportEncoding == 'base64' ) { - $data = base64_encode($translation); $hint_translation = base64_encode($hint_translation); $column_translation = base64_encode($column_translation); } else { - $data = ''; $hint_translation = htmlspecialchars($hint_translation); $column_translation = htmlspecialchars($column_translation); } @@ -368,7 +383,7 @@ $attributes[] = 'Column="' . $column_translation . '"'; } - $ret .= "\t\t\t" . '' . $data . '' . "\n"; + $ret .= "\t\t\t" . '' . $this->_exportConvert($translation) . '' . "\n"; } $ret .= "\t\t" . '' . "\n"; @@ -774,6 +789,7 @@ 'Encoding' => (string)$language_node['Encoding'], 'Charset' => 'utf-8', 'SynchronizationModes' => Language::SYNCHRONIZE_DEFAULT, + 'HtmlEmailTemplate' => '$body', ); if ( $version > 1 ) { @@ -823,6 +839,12 @@ $fields_hash['FilenameReplacements'] = $replacements; break; + case 'EMAILDESIGNS': + // added since v6 + $this->_decodeEmailDesignTemplate($fields_hash, 'HtmlEmailTemplate', (string)$sub_node->HTML); + $this->_decodeEmailDesignTemplate($fields_hash, 'TextEmailTemplate', (string)$sub_node->TEXT); + break; + default: if ( $version == 1 ) { $fields_hash[$field_mapping[$sub_node->Name]] = (string)$sub_node; @@ -834,6 +856,24 @@ } /** + * Decodes e-mail template design from language pack + * + * @param Array $fields_hash + * @param string $field + * @param string $design_template + */ + protected function _decodeEmailDesignTemplate(&$fields_hash, $field, $design_template) + { + if ( $fields_hash['Encoding'] != 'plain' ) { + $design_template = base64_decode($design_template); + } + + if ( $design_template ) { + $fields_hash[$field] = $design_template; + } + } + + /** * Performs phases import * * @param SimpleXMLElement $phrases @@ -913,8 +953,8 @@ $this->Application->Debugger->profileStart('L[' . $language_id . ']E', 'Language: ' . $language_id . '; Events Import'); } - $email_message_helper = $this->Application->recallObject('EmailMessageHelper'); - /* @var $email_message_helper EmailMessageHelper */ + $email_message_helper = $this->Application->recallObject('kEmailMessageHelper'); + /* @var $email_message_helper kEmailMessageHelper */ foreach ($events as $event_node) { /* @var $event_node SimpleXMLElement */