Changeset 56 for trunk/www/view/emulator.php
- Timestamp:
- Aug 4, 2009, 9:53:52 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/view/emulator.php
r55 r56 3 3 class EmulatorView extends Module 4 4 { 5 var $ItemFormClass = array( 6 'Title' => 'Emulátor', 7 'Table' => 'Emulator', 8 'Items' => array( 9 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 10 'Version' => array('Type' => 'String', 'Caption' => 'Verze', 'Default' => ''), 11 'Revision' => array('Type' => 'Integer', 'Caption' => 'Revize', 'Default' => 0), 12 'Client' => array('Type' => 'Client', 'Caption' => 'Verze klienta', 'Default' => 0), 13 'ScriptDev2Revision' => array('Type' => 'Integer', 'Caption' => 'Verze SD2', 'Default' => 0), 14 'ScriptDev2PatchFileName' => array('Type' => 'String', 'Caption' => 'SD2 záplata', 'Default' => ''), 15 'CommitHash' => array('Type' => 'String', 'Caption' => 'Commit HASH', 'Default' => ''), 16 ), 17 ); 18 var $ItemListFormClass = array( 19 'Title' => 'Emulátory', 20 'Table' => '(SELECT `Emulator`.`Name`, `Emulator`.`Id`, `Client`.`Version` AS `ClientVersion`, `Emulator`.`Revision`, `Emulator`.`ScriptDev2Revision`, `Emulator`.`ScriptDev2PatchFileName`, `Emulator`.`Version`, `Emulator`.`CommitHash` FROM `Emulator` JOIN `Client` ON `Client`.`Id` = `Emulator`.`Client` WHERE `Emulator`.`Enable` = 1)', 21 'DefaultOrderColumn' => 'Revision', 22 'DefaultOrderDirection' => 1, 23 'Items' => array( 24 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 25 'Version' => array('Type' => 'String', 'Caption' => 'Verze', 'Default' => ''), 26 'Revision' => array('Type' => 'Integer', 'Caption' => 'Revize', 'Default' => 0), 27 'ClientVersion' => array('Type' => 'Integer', 'Caption' => 'Verze klienta', 'Default' => 0), 28 'ScriptDev2Revision' => array('Type' => 'Integer', 'Caption' => 'Verze SD2', 'Default' => 0), 29 //'ScriptDev2PatchFileName' => array('Type' => 'String', 'Caption' => 'SD2 záplata', 'Default' => ''), 30 //'CommitHash' => array('Type' => 'String', 'Caption' => 'Commit HASH', 'Default' => ''), 31 ), 32 ); 33 5 34 function ItemList() 6 35 { … … 8 37 9 38 $Output = '<h4>Seznam verzí emulátoru</h4>'; 10 $Table = new Table( 'EmulatorList');39 $Table = new Table($this->ItemListFormClass); 11 40 $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => ''); 12 41 $Table->LoadValuesFromDatabase($this->Database); … … 30 59 //$Server = new Server($this->Database, $Id); 31 60 $Output = '<h4>Podrobnosti emulátoru</h4>'; 32 $Form = new Form( 'EmulatorItem');61 $Form = new Form($this->ItemFormClass); 33 62 $Form->LoadValuesFromDatabase($Id); 34 63 $Output .= $Form->ShowTable(); … … 48 77 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) 49 78 { 50 $Form = new Form( 'EmulatorItem');79 $Form = new Form($this->ItemFormClass); 51 80 $Form->LoadValuesFromForm(); 52 81 $Form->OnSubmit = '?Action=EmulatorAdd2'; … … 60 89 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) 61 90 { 62 $Form = new Form( 'EmulatorItem');91 $Form = new Form($this->ItemFormClass); 63 92 $Form->LoadValuesFromForm(); 64 93 $Form->SaveValuesToDatabase(0);
Note:
See TracChangeset
for help on using the changeset viewer.