Changeset 658 for trunk/Modules/Export/Export.php
- Timestamp:
- Dec 19, 2013, 11:23:12 PM (11 years ago)
- File:
-
- 1 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']];
Note:
See TracChangeset
for help on using the changeset viewer.