Changeset 658 for trunk/Modules/Export
- Timestamp:
- Dec 19, 2013, 11:23:12 PM (11 years ago)
- Location:
- trunk/Modules/Export
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Export.php
r646 r658 278 278 "</document>"; 279 279 return($Buffer); 280 } 280 } 281 282 function HaveVarible($String1, $String2) 283 { 284 //Export only if translate have same varible % 285 if (strpos($String1,'$')) { 286 while (strpos($String1,'$')) { 287 $String1 = substr($String1,strpos($String1,'$')); 288 $varible = $String1; 289 if (strpos($varible,' ')) $varible = substr($varible,0,strpos($varible,' ')); 290 if (strpos($varible,'.')) $varible = substr($varible,0,strpos($varible,'.')); 291 if (strpos($varible,'%')) $varible = substr($varible,0,strpos($varible,'%')); 292 if (strpos($varible,chr(10))) $varible = substr($varible,0,strpos($varible,chr(10))); 293 if (false == strpos($String2,$varible)) { 294 295 return(false); 296 } 297 } 298 } 299 return (true); 300 } 281 301 282 302 function ExportToDBC() … … 309 329 $LookupTable = array(); 310 330 $DbResult2 = $this->Database->query($this->BuildQuery($Group)); 311 while($DbRow = $DbResult2->fetch_assoc()) 312 $LookupTable[$DbRow[$Group['PrimaryKeyItem']]] = $DbRow; 331 while($DbRow = $DbResult2->fetch_assoc()) { 332 //Export only if translate have same varible % 333 $CanExport = true; 334 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 335 $DbRow[$Column['Column']] = str_replace ( '$ ','$',$DbRow[$Column['Column']]); 336 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']])) { 337 $CanExport = false; 338 } 339 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']])) { 340 $CanExport = false; 341 } 342 } 343 344 if ($CanExport) 345 $LookupTable[$DbRow[$Group['PrimaryKeyItem']]] = $DbRow; 346 else echo 'NE='.$DbRow[$Column['ID']].','; 347 } 313 348 314 349 // Open original DBC file … … 348 383 $LookupTableItem = $LookupTable[$PrimaryKeyItem]; 349 384 foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem) 350 { 385 { 351 386 if(array_key_exists($GroupItem['Id'], $ColumnIndexes)) 352 387 $Line[$ColumnIndexes[$GroupItem['Id']]] = $LookupTableItem[$GroupItem['Column']]; -
trunk/Modules/Export/cmdmpqexport.php
r657 r658 36 36 } 37 37 } 38 38 if(!array_key_exists('ExportId', $_GET) and !array_key_exists('dbc', $_GET) and !array_key_exists('lua', $_GET) and !array_key_exists('addon', $_GET)) { 39 $Output .= 'Usage type_export=id_export -for export<br />'; 40 $Output .= 'Usage ExportId=id_export - for write export info<br />'; 41 42 $Output .= 'type_export={lua,dbc,addon} <br />'; 43 $Output = str_replace('<br />',' 44 ',$Output); 45 } 39 46 //37 40 47 if(array_key_exists('lua', $_GET)) {
Note:
See TracChangeset
for help on using the changeset viewer.