Changeset 695 for trunk/Modules/Export/Page.php
- Timestamp:
- Jan 3, 2014, 11:09:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Page.php
r690 r695 430 430 $Output .= ShowMessage('Výběr uložen.'); 431 431 } 432 //items 433 foreach($TranslationTree as $Group) 434 { 435 // echo $Group['Id'].' '; 436 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 437 if(array_key_exists('item'.$Column['Id'], $_POST)) $Selected = true; 438 else $Selected = false; 439 //we will save only forbitten collums and need to be visible 440 $Selected = !$Selected; 441 if (!$Column['Visible']) $Selected = false; 442 443 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `GroupItem`='.$Column['Id']; 444 $DbResult = $this->System->Database->query('SELECT * FROM `ExportGroupItem` '.$Condition); 445 if($DbResult->num_rows > 0) 446 { 447 if(!$Selected) $this->System->Database->query('DELETE FROM `ExportGroupItem` '.$Condition); 448 } else 449 { 450 if($Selected) $this->System->Database->query('INSERT INTO `ExportGroupItem` (`Export`, `GroupItem`) VALUES ('.$_GET['ExportId'].', '.$Column['Id'].')'); 451 } 452 453 } 454 } 432 455 } 433 456 … … 439 462 440 463 $TableColumns = array( 464 array('Name' => '', 'Title' => 'Výběr'), 441 465 array('Name' => 'Name', 'Title' => 'Jméno'), 442 array('Name' => 'MangosTable', 'Title' => ' Tabulka MaNGOSu'),443 array('Name' => 'DBCFileName', 'Title' => 'DBC soubor'),444 array('Name' => 'LuaFileName', 'Title' => 'Lua soubor'),445 array('Name' => '', 'Title' => ' Výběr'),466 array('Name' => 'MangosTable', 'Title' => 'Mangos/DBC/Lua'), 467 // array('Name' => 'DBCFileName', 'Title' => 'DBC soubor'), 468 // array('Name' => 'LuaFileName', 'Title' => 'Lua soubor'), 469 array('Name' => '', 'Title' => 'Položky překladu'), 446 470 ); 447 471 $Order = GetOrderTableHeader($TableColumns, 'Name'); … … 460 484 '<table class="BaseTable">'. 461 485 $Order['Output']; 486 487 $DbResultItem = $this->System->Database->query('SELECT * FROM `ExportGroupItem` WHERE `Export`='.$_GET['ExportId']); 488 while($GroupItem = $DbResultItem->fetch_assoc()) 489 { 490 $GroupItems[$GroupItem['GroupItem']] = 1; 491 } 462 492 463 493 $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit']; … … 465 495 while($Group = $DbResult->fetch_assoc()) 466 496 { 497 $Columns = ''; 498 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 499 if ($Column['Visible']) $Columns .= CheckBox('item'.$Column['Id'], !isset($GroupItems[$Column['Id']]), '', 'CheckBox', !$Editable).' '.$Column['Name'].' <br />'; 500 } 467 501 $Checked = $Group['ExportGroupId'] != ''; 468 502 $Selection = CheckBox('sel'.$Group['Id'], $Checked, '', 'CheckBox', !$Editable); 469 503 $Output .= '<tr>'. 470 '<td>'.$Group['Name'].'</td>'. 471 '<td>'.$Group['MangosTable'].'</td>'. 472 '<td>'.$Group['DBCFileName'].'</td>'. 473 '<td>'.$Group['LuaFileName'].'</td>'. 474 '<td>'.$Selection.'<input type="hidden" name="seq'.$Group['Id'].'"/></td></tr>'; 504 '<td>'.$Selection.'<input type="hidden" name="seq'.$Group['Id'].'"/></td>'. 505 '<td>'.$Group['Name'].'</td><td>'; 506 if ($Group['MangosTable'] <> '') 507 $Output .= $Group['MangosTable'].'.sql '; 508 if ($Group['LuaFileName'] <> '') 509 $Output .= $Group['LuaFileName'].'.lua '; 510 if ($Group['DBCFileName'] <> '') 511 $Output .= $Group['DBCFileName'].'.dbc '; 512 513 $Output .= '</td><td>'; 514 $Output .= $Columns. '</td>'; 515 $Output .= '</tr>'; 475 516 } 476 517 $Output .= '</table>'.
Note:
See TracChangeset
for help on using the changeset viewer.