Changeset 71 for trunk/www/Application/View
- Timestamp:
- Aug 23, 2009, 6:14:01 PM (15 years ago)
- Location:
- trunk/www/Application/View
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/View/Page.php
r69 r71 29 29 { 30 30 $Output = '<div class="Navigation"><span class="MenuItem">'. 31 '<a href="? Action=Info">Informace</a>'.32 ' <a href="?Module= System&Action=State">Stav systému</a>'.33 ' <a href="?Module=Server&Action= List">Seznam serverů</a>'.34 ' <a href="?Module=Client&Action= List">Verze klienta</a>'.35 ' <a href="?Module=Emulator&Action= List">Verze emulátoru</a>'.31 '<a href="?Module=HomePage&Action=Info">Informace</a>'. 32 ' <a href="?Module=HomePage&Action=State">Stav systému</a>'. 33 ' <a href="?Module=Server&Action=ItemList">Seznam serverů</a>'. 34 ' <a href="?Module=Client&Action=ItemList">Verze klienta</a>'. 35 ' <a href="?Module=Emulator&Action=ItemList">Verze emulátoru</a>'. 36 36 '</span><div class="MenuItem2">'; 37 37 if($this->System->Modules['User']->User['Id'] == $this->System->Modules['User']->AnonymousUserId) … … 40 40 if($this->Config['Web']['UserRegistrationEnabled']) $Output .= ' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Module=User&Action=Register">Registrace</a>'; 41 41 } else $Output .= $this->System->Modules['User']->User['Name'].' <a href="'.$this->Config['Web']['RootFolder'].'/?Module=User&Action=Logout">Odhlásit</a>'. 42 ' <a href="'.$this->Config['Web']['RootFolder'].'/?Module=User r&Action=Options">Nastavení</a>';42 ' <a href="'.$this->Config['Web']['RootFolder'].'/?Module=User&Action=Options">Nastavení</a>'; 43 43 $Output .= '</div></div>'; 44 44 return($Output); … … 50 50 51 51 $Time = round($this->System->GetMicrotime() - $ScriptTimeStart, 2); 52 $Output = '<div id="Footer">53 < i>| Založeno na projektu <a href="http://svn.zdechov.net/trac/wowhosting/">WoW hosting</a>'.54 ' | <a href="http://svn.zdechov.net/trac/wowhosting/browser">Zdrojové kódy</a>'.55 ' | <a href="http://svn.zdechov.net/trac/wowhosting/log?verbose=on">Novinky</a>'.56 ' | Správce: '.$this->Config['Web']['Admin'].57 ' | E-mail: '.$this->Config['Web']['AdminEmail'].' |';58 if($this->Config['Web']['ShowRuntimeInfo'] == true) $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s | Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B |';59 $Output .= '</ i></div></body></html>';52 $Output = '<div class="Footer"> 53 <ul><li>Založeno na projektu <a href="http://svn.zdechov.net/trac/wowhosting/">WoW hosting</a></li>'. 54 '<li><a href="http://svn.zdechov.net/trac/wowhosting/browser">Zdrojové kódy</a></li>'. 55 '<li><a href="http://svn.zdechov.net/trac/wowhosting/log?verbose=on">Novinky</a></li>'. 56 '<li>Správce: '.$this->Config['Web']['Admin'].'</li>'. 57 '<li>E-mail: '.$this->Config['Web']['AdminEmail'].'</li>'; 58 if($this->Config['Web']['ShowRuntimeInfo'] == true) $Output .= '<li>Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s</li><li>Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B</li>'; 59 $Output .= '</ul></div></body></html>'; 60 60 return($Output); 61 61 } -
trunk/www/Application/View/Server.php
r69 r71 97 97 foreach($Table->Values as $Index => $Item) 98 98 { 99 $Table->Values[$Index]['Actions'] = '<a href="? Action=ServerShow&Id='.$Item['Id'].'">Podrobnosti</a>';99 $Table->Values[$Index]['Actions'] = '<a href="?Module=Server&Action=Show&Id='.$Item['Id'].'">Podrobnosti</a>'; 100 100 unset($Table->Values[$Index]['Id']); 101 101 } … … 109 109 $DbRow = $DbResult->fetch_row(); 110 110 if(($ServerCount < $Config['MaxServerCount']) and ($DbRow[0] < $Config['MaxServerCountPerUser'])) 111 $Output .= '<br /><div style="text-align: center;"><a href="? Action=ServerAdd">Vytvořit nový server</a></dev>';111 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Server&Action=Add">Vytvořit nový server</a></dev>'; 112 112 } 113 113 return($Output); … … 123 123 { 124 124 $Output = '<h4>Podrobnosti serveru</h4>'; 125 $Form = new Form($this-> ItemFormClass);125 $Form = new Form($this->System, $this->ItemFormClass); 126 126 $Form->LoadValuesFromDatabase($Id); 127 127 $Form->Definition['Items']['Realmlist'] = array('Type' => 'String', 'Caption' => 'Adresa k připojení', 'Default' => ''); … … 142 142 if(array_key_exists('Id', $Server->Server['Database']) and ($Server->Server['Lock'] == 0)) 143 143 { 144 if($ServerStatus['RealmdPortState'] == true) $Output .= ' <a href="?Action=ServerStop&Id='.$Server->Id.'">Zastavit</a> <a href="? Action=ServerRestart&Id='.$Server->Id.'">Restartovat</a>';145 else $Output .= ' <a href="? Action=ServerStart&Id='.$Server->Id.'">Spustit</a>';144 if($ServerStatus['RealmdPortState'] == true) $Output .= ' <a href="?Action=ServerStop&Id='.$Server->Id.'">Zastavit</a> <a href="?Module=Server&Action=Restart&Id='.$Server->Id.'">Restartovat</a>'; 145 else $Output .= ' <a href="?Module=Server&Action=Start&Id='.$Server->Id.'">Spustit</a>'; 146 146 } 147 147 if($Server->Server['Lock'] == 0) 148 148 { 149 $Output .= ' <a href="? Action=ServerEdit&Id='.$Server->Id.'">Upravit základní nastavení</a>';149 $Output .= ' <a href="?Module=Server&Action=Edit&Id='.$Server->Id.'">Upravit základní nastavení</a>'; 150 150 } 151 151 //$Output .= ' <a href="?Action=ServerDatabaseImport&Id='.$Server->Id.'">Načtení čisté databáze</a>'; 152 $Output .= ' <a href="? Action=RealmAdd&Id='.$Server->Id.'">Vytvořit nový svět</a>';153 $Output .= ' <a href="? Action=UpdateRealmCharacters&Id='.$Server->Id.'">Aktualizovat počty postav</a>';152 $Output .= ' <a href="?Module=Realm&Action=Add&Id='.$Server->Id.'">Vytvořit nový svět</a>'; 153 $Output .= ' <a href="?Module=Realm&Action=UpdateCharacters&Id='.$Server->Id.'">Aktualizovat počty postav</a>'; 154 154 } 155 $Output .= ' <a href="? Action=GameAccountRegister&Id='.$Server->Id.'">Vytvoření herního účtu</a>';155 $Output .= ' <a href="?Module=Server&Action=GameAccountRegister&Id='.$Server->Id.'">Vytvoření herního účtu</a>'; 156 156 $Output .= '</div>'; 157 157 158 158 // Show realmlist 159 $RealmView = new RealmView($this-> Database, $this->System);159 $RealmView = new RealmView($this->System); 160 160 $Output .= $RealmView->ItemList(); 161 161 } else $Output = $this->System->SystemMessage('Zobrazení serveru', 'Server se zadaným id nenalezen.'); … … 180 180 else 181 181 { 182 $Form = new Form($this-> CreateFormClass);182 $Form = new Form($this->System, $this->CreateFormClass); 183 183 $Form->LoadValuesFromForm(); 184 184 $Form->OnSubmit = '?Action=ServerCreate'; … … 208 208 if($NewPortRealmd < $Config['BaseNetworkPortRealmd']) $NewPortRealmd = $Config['BaseNetworkPortRealmd']; 209 209 210 $Form = new Form($this-> CreateFormClass, array());210 $Form = new Form($this->System, $this->CreateFormClass, array()); 211 211 $Form->LoadValuesFromForm(); 212 212 $this->Database->insert('Server', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'User' => $this->System->Modules['User']->User['Id'], 'Homepage' => $Form->Values['Homepage'], 'Database' => $Form->Values['Database'], 'NetworkPortRealmd' => $NewPortRealmd, 'Lock' => 1, 'TimeCreate' => 'NOW()')); … … 215 215 $Server->CreateDatabase(); 216 216 $Output .= $this->System->SystemMessage('Vytvoření serveru', $Server->ImportDatabase(true)); 217 $TaskView = new TaskView($this-> Database, $this->System);217 $TaskView = new TaskView($this->System); 218 218 $Output .= $TaskView->ItemList(); 219 219 //$UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); … … 231 231 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 232 232 { 233 $Form = new Form($this-> EditFormClass, array());233 $Form = new Form($this->System, $this->EditFormClass, array()); 234 234 $Form->LoadValuesFromForm(); 235 235 $ServerId = $_POST['ServerId']; … … 253 253 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 254 254 { 255 $Form = new Form($this-> EditFormClass);255 $Form = new Form($this->System, $this->EditFormClass); 256 256 $Form->LoadValuesFromDatabase($_GET['Id']); 257 257 $Form->Values['ServerId'] = $_GET['Id']; … … 271 271 { 272 272 $Output .= $this->System->SystemMessage('Spuštění serveru', $Server->Start()); 273 $TaskView = new TaskView($this-> Database, $this->System);273 $TaskView = new TaskView($this->System); 274 274 $Output .= $TaskView->ItemList();; 275 275 } else $this->System->SystemMessage('Spuštění serveru', 'Nemáte oprávnění'); … … 287 287 { 288 288 $Output .= $this->System->SystemMessage('Zastavení serveru', $Server->Stop()); 289 $TaskView = new TaskView($this-> Database, $this->System);289 $TaskView = new TaskView($this->System); 290 290 $Output .= $TaskView->ItemList();; 291 291 } else $this->System->SystemMessage('Zastavení serveru', 'Nemáte oprávnění'); … … 296 296 function AccountCreate() 297 297 { 298 $Form = new Form($this-> GameAccountNewFormClass);298 $Form = new Form($this->System, $this->GameAccountNewFormClass); 299 299 $Form->LoadValuesFromForm(); 300 300 $Form->Values['ServerId'] = $_GET['Id']; 301 $Form->OnSubmit = '? Action=GameAccountRegister2';301 $Form->OnSubmit = '?Module=Server&Action=GameAccountRegisterFinish'; 302 302 $Output = $Form->ShowEditForm(); 303 303 return($Output); … … 306 306 function AccountCreateFinish() 307 307 { 308 $Form = new Form($this-> GameAccountNewFormClass);308 $Form = new Form($this->System, $this->GameAccountNewFormClass); 309 309 $Form->LoadValuesFromForm(); 310 310 $Server = new Server($this->Database, $Form->Values['ServerId']); 311 311 $Output = $this->System->SystemMessage('Vytvoření herního účtu', $Server->NewAccount($Form->Values['Name'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Expansion'])); 312 $Output .= '<a href="? Action=GameAccountRegister&Id='.$Form->Values['ServerId'].'">Zpět k zadání údajů</a>';312 $Output .= '<a href="?Module=Server&Action=GameAccountRegister&Id='.$Form->Values['ServerId'].'">Zpět k zadání údajů</a>'; 313 313 return($Output); 314 314 } -
trunk/www/Application/View/User.php
r69 r71 49 49 ); 50 50 51 function Login Form()51 function Login() 52 52 { 53 53 global $Config; 54 54 55 $Form = new Form($this-> LoginFormClass);56 $Form->OnSubmit = '? Action=Login';55 $Form = new Form($this->System, $this->LoginFormClass); 56 $Form->OnSubmit = '?Module=User&Action=LoginFinish'; 57 57 $Output = $Form->ShowEditForm(); 58 58 $Output .= '<div class="Centred">'; 59 59 if($Config['Web']['UserRegistrationEnabled']) 60 $Output .= '<a href="? Action=UserRegister">Registrovat se</a> ';61 $Output .= '<a href="? Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>';60 $Output .= '<a href="?Module=User&Action=Register">Registrovat se</a> '; 61 $Output .= '<a href="?Module=User&Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 62 62 return($Output); 63 63 } 64 64 65 function Login Result()65 function LoginFinish() 66 66 { 67 $Form = new Form($this-> LoginFormClass);68 $Form->OnSubmit = '? Action=Login';67 $Form = new Form($this->System, $this->LoginFormClass); 68 $Form->OnSubmit = '?Module=User&Action=LoginFinish'; 69 69 $Form->LoadValuesFromForm(); 70 70 $Result = $this->System->Modules['User']->Login($Form->Values['Username'], $Form->Values['Password']); … … 74 74 $Form->Values['Password'] = ''; 75 75 $Output .= $Form->ShowEditForm(); 76 $Output .= '<div class="Centred"><a href="? Action=UserRegister">Registrovat se</a> '.77 '<a href="? Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>';76 $Output .= '<div class="Centred"><a href="?Module=User&Action=UserRegister">Registrovat se</a> '. 77 '<a href="?Module=User&Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 78 78 } 79 79 return($Output); … … 86 86 if($Config['Web']['UserRegistrationEnabled']) 87 87 { 88 $Form = new Form($this-> RegisterFormClass, array());88 $Form = new Form($this->System, $this->RegisterFormClass, array()); 89 89 $Form->LoadValuesFromForm(); 90 90 $Result = $this->System->Modules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']); … … 92 92 if($Result <> USER_REGISTRATED) 93 93 { 94 $Form->OnSubmit = '? Action=UserRegisterSave';94 $Form->OnSubmit = '?Module=User&Action=UserRegisterSave'; 95 95 $Output = $Form->ShowEditForm(); 96 96 } … … 108 108 function PasswordRecoveryFinish() 109 109 { 110 $Form = new Form($this-> PasswordRecoveryFormClass);110 $Form = new Form($this->System, $this->PasswordRecoveryFormClass); 111 111 $Form->LoadValuesFromForm(); 112 112 $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); … … 121 121 function PasswordRecovery() 122 122 { 123 $Form = new Form($this-> PasswordRecoveryFormClass);124 $Form->OnSubmit = '? Action=PasswordRecovery2';123 $Form = new Form($this->System, $this->PasswordRecoveryFormClass); 124 $Form->OnSubmit = '?Module=User&Action=PasswordRecovery2'; 125 125 $Output = $Form->ShowEditForm(); 126 126 return($Output); … … 130 130 { 131 131 $Output = $this->System->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout()); 132 $Output .= $this->Login Form();132 $Output .= $this->Login(); 133 133 return($Output); 134 134 } … … 136 136 function Options() 137 137 { 138 $UserOptions = new Form($this-> OptionsFormClass);138 $UserOptions = new Form($this->System, $this->OptionsFormClass); 139 139 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 140 $UserOptions->OnSubmit = '? Action=UserOptionsSave';140 $UserOptions->OnSubmit = '?Module=User&Action=UserOptionsSave'; 141 141 $Output = $UserOptions->ShowEditForm(); 142 142 return($Output); … … 145 145 function OptionsSave() 146 146 { 147 $UserOptions = new Form($this-> OptionsFormClass, array());147 $UserOptions = new Form($this->System, $this->OptionsFormClass, array()); 148 148 $UserOptions->LoadValuesFromForm(); 149 149 $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->User['Id']); … … 151 151 $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']); 152 152 $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 153 $UserOptions->OnSubmit = '? Action=UserOptionsSave';153 $UserOptions->OnSubmit = '?Module=User&Action=UserOptionsSave'; 154 154 $Output .= $UserOptions->ShowEditForm(); 155 155 return($Output); … … 162 162 if($Config['Web']['UserRegistrationEnabled']) 163 163 { 164 $Form = new Form($this-> RegisterFormClass);164 $Form = new Form($this->System, $this->RegisterFormClass); 165 165 $Form->LoadValuesFromForm(); 166 $Form->OnSubmit = '? Action=UserRegisterSave';166 $Form->OnSubmit = '?Module=User&Action=UserRegisterSave'; 167 167 $Output = 'Vyplňte správně požadované údaje. Na zadaný email vám bude zaslán aktivační email.'; 168 168 $Output .= $Form->ShowEditForm();
Note:
See TracChangeset
for help on using the changeset viewer.