Index: trunk/core/units/languages/languages_event_handler.php =================================================================== diff -u -N -r4712 -r4758 --- trunk/core/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 4712) +++ trunk/core/units/languages/languages_event_handler.php (.../languages_event_handler.php) (revision 4758) @@ -15,11 +15,11 @@ 'OnImportLanguage' => Array('self' => 'advanced:import'), 'OnExportLanguage' => Array('self' => 'advanced:export'), 'OnExportProgress' => Array('self' => 'advanced:export'), - + ); $this->permMapping = array_merge($this->permMapping, $permissions); } - + /** * Updates table structure on new language adding/removing language * @@ -29,8 +29,8 @@ { $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); - $unit_config_reader =& $this->Application->recallObject('kUnitConfigReader'); - foreach ($unit_config_reader->configData as $prefix => $config_data) { + $this->Application->UnitConfigReader->includeConfigFiles(); //make sure to re-read all configs + foreach ($this->Application->UnitConfigReader->configData as $prefix => $config_data) { $ml_helper->createFields($prefix); } } @@ -130,7 +130,7 @@ // 1. phrases import $phrases_live = $this->Application->getUnitOption('phrases','TableName'); - $phrases_temp = kTempTablesHandler::GetTempName($phrases_live); + $phrases_temp = $this->Application->GetTempName($phrases_live); $sql = 'INSERT INTO '.$phrases_temp.' SELECT Phrase, Translation, PhraseType, 0-PhraseId, '.$lang_id.', '.adodb_mktime().', "", Module FROM '.$phrases_live.' @@ -139,7 +139,7 @@ // 2. events import $em_table_live = $this->Application->getUnitOption('emailmessages','TableName'); - $em_table_temp = kTempTablesHandler::GetTempName($em_table_live); + $em_table_temp = $this->Application->GetTempName($em_table_live); $sql = 'SELECT * FROM '.$em_table_live.' WHERE LanguageId = '.$from_lang_id; $email_messages = $this->Conn->Query($sql); @@ -177,7 +177,7 @@ $object =& $event->getObject(); $object->SetDBField('CopyLabels', 1); - $live_table = kTempTablesHandler::GetLiveName($object->TableName); + $live_table = $this->Application->GetLiveName($object->TableName); $primary_lang_id = $this->Conn->GetOne('SELECT '.$object->IDField.' FROM '.$live_table.' WHERE PrimaryLang = 1'); $object->SetDBField('CopyFromLanguage', $primary_lang_id); @@ -247,7 +247,7 @@ $import_start = (int)$this->Application->GetVar('start'); $id_field = $this->Application->getUnitOption($import_prefix,'IDField'); $dst_table = $this->Application->getUnitOption($import_prefix,'TableName'); - $src_table = kTempTablesHandler::GetTempName($dst_table); + $src_table = $this->Application->GetTempName($dst_table); $import_total = $this->Application->GetVar('total'); if(!$import_total) $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table); @@ -266,7 +266,7 @@ $import_start = 0; $id_field = $this->Application->getUnitOption($import_prefix,'IDField'); $dst_table = $this->Application->getUnitOption($import_prefix,'TableName'); - $src_table = kTempTablesHandler::GetTempName($dst_table); + $src_table = $this->Application->GetTempName($dst_table); $import_total = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$src_table); }