Index: trunk/core/units/languages/import_xml.php =================================================================== diff -u -N -r7391 -r7855 --- trunk/core/units/languages/import_xml.php (.../import_xml.php) (revision 7391) +++ trunk/core/units/languages/import_xml.php (.../import_xml.php) (revision 7855) @@ -214,14 +214,16 @@ $this->current_phrase = Array( 'LanguageId' => $this->current_language['LanguageId'], 'Phrase' => $attributes['LABEL'], 'PhraseType' => $attributes['TYPE'], + 'PhraseId' => 0, 'Module' => $phrase_module, 'LastChanged' => adodb_mktime(), 'LastChangeIP' => $this->ip_address, 'Translation' => ''); break; case 'LANGUAGES LANGUAGE EVENTS EVENT': - $this->current_event = Array( 'LanguageId' => $this->current_language['LanguageId'], + $this->current_event = Array( 'EmailMessageId'=> 0, + 'LanguageId' => $this->current_language['LanguageId'], 'EventId' => $this->events_hash[ $attributes['EVENT'].'_'.$attributes['TYPE'] ], 'MessageType' => $attributes['MESSAGETYPE'], 'Template' => ''); @@ -298,7 +300,7 @@ else { $this->current_phrase['Translation'] = base64_decode($this->current_phrase['Translation']); } - $this->insertRecord($this->tables['phrases'], $this->current_phrase); + $this->Conn->doInsert($this->current_phrase, $this->tables['phrases']); } break; @@ -310,33 +312,13 @@ else { $this->current_event['Template'] = base64_decode($this->current_event['Template']); } - $this->insertRecord($this->tables['emailmessages'],$this->current_event); + $this->Conn->doInsert($this->current_event, $this->tables['emailmessages']); break; } array_pop($this->path); } - function insertRecord($table, $fields_hash) - { - $fields = ''; - $values = ''; - - foreach($fields_hash as $field_name => $field_value) - { - $fields .= '`'.$field_name.'`,'; - $values .= $this->Conn->qstr($field_value).','; - } - - $fields = preg_replace('/(.*),$/', '\\1', $fields); - $values = preg_replace('/(.*),$/', '\\1', $values); - - $sql = 'INSERT INTO `'.$table.'` ('.$fields.') VALUES ('.$values.')'; - $this->Conn->Query($sql); - -// return $this->Conn->getInsertID(); // no need because of temp table without auto_increment column at all - } - /** * Creates XML file with exported language data *