Changeset 93 for trunk/www/Application/View/Realm.php
- Timestamp:
- Aug 15, 2013, 11:17:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Application/View/Realm.php
r92 r93 105 105 function ItemList() 106 106 { 107 global $Config;108 109 107 if(array_key_exists('Id', $_GET)) $ServerId = $_GET['Id']; 110 108 111 $Realm = new Realm($this-> Database, 0);109 $Realm = new Realm($this->System, 0); 112 110 //$Realm->UpdateServerList(); 113 111 $Output = '<h4>Seznam světů</h4>'; … … 131 129 //$DbResult = $this->Database->query('SELECT COUNT(*) FROM Realm WHERE Server='.$this->System->Modules['User']->User['Id']); 132 130 //$DbRow = $DbResult->fetch_row(); 133 if(($RealmCount < $ Config['MaxRealmPerServerCount']))131 if(($RealmCount < $this->Config['MaxRealmPerServerCount'])) 134 132 $Output .= '<br /><div style="text-align: center;"><a href="?Module=Realm&Action=Add">Vytvořit nový svět</a></dev>'; 135 133 } … … 139 137 function Item() 140 138 { 141 global $Config;142 143 139 $Id = $_GET['Id']; 144 $Realm = new Realm($this-> Database, $Id);140 $Realm = new Realm($this->System, $Id); 145 141 //if(isset($Server->Server)) 146 142 //{ … … 179 175 function Add() 180 176 { 181 global $Config;182 183 177 if(array_key_exists('Id', $_GET)) 184 178 { … … 190 184 $DbRow = $DbResult->fetch_row(); 191 185 $RealmCount = $DbRow[0]; 192 if($RealmCount < $Config['MaxRealmCount']) 193 { 194 if($this->System->Modules['User']->RealmCount() >= $Config['MaxServerCountPerUser']) $Output .= $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' světů'); 186 if($RealmCount < $this->Config['MaxRealmCount']) 187 { 188 if($this->System->Modules['User']->RealmCount() >= $this->Config['MaxServerCountPerUser']) 189 $Output .= $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '. 190 $this->Config['MaxServerCountPerUser'].' světů'); 195 191 else 196 192 { … … 209 205 function Create() 210 206 { 211 global $Config;212 213 207 if(array_key_exists('Id', $_GET)) 214 208 { … … 216 210 if($this->System->Modules['Permission']->Check('Realm', 'Add')) 217 211 { 218 if($this->System->Modules['User']->RealmCount() >= $Config['MaxServerCountPerUser']) $Output = $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '.$Config['MaxServerCountPerUser'].' světů'); 212 if($this->System->Modules['User']->RealmCount() >= $this->Config['MaxServerCountPerUser']) 213 $Output = $this->System->SystemMessage('Nový svět', 'Na jeden účet lze vytvořit maximálně '. 214 $this->Config['MaxServerCountPerUser'].' světů'); 219 215 else 220 216 { … … 223 219 $DbRow = $DbResult->fetch_row(); 224 220 $NewPortWorldd = $DbRow[0] + 1; 225 if($NewPortWorldd < $ Config['BaseNetworkPortWorldd']) $NewPortWorldd = $Config['BaseNetworkPortWorldd'];221 if($NewPortWorldd < $this->Config['BaseNetworkPortWorldd']) $NewPortWorldd = $this->Config['BaseNetworkPortWorldd']; 226 222 227 223 $Form = new Form($this->System, $this->CreateFormClass, array()); … … 229 225 $this->Database->insert('Realm', array('Name' => $Form->Values['Name'], 'Description' => $Form->Values['Description'], 'Server' => $ServerId, 'Motd' => $Form->Values['Motd'], 'Homepage' => $Form->Values['Homepage'], 'Type' => $Form->Values['Type'], 'Database' => $Form->Values['Database'], 'NetworkPortWorldd' => $NewPortWorldd, 'Lock' => 1, 'TimeCreate' => 'NOW()')); 230 226 $LastInsertId = $this->Database->insert_id; 231 $Realm = new Realm($this-> Database, $LastInsertId);227 $Realm = new Realm($this->System, $LastInsertId); 232 228 $Realm->CreateDatabase(); 233 229 $Output = $this->System->SystemMessage('Vytvoření světu', $Realm->ImportDatabase(true)); … … 246 242 { 247 243 $Output = ''; 248 $Realm = new Realm($this-> Database, $_POST['RealmId']);244 $Realm = new Realm($this->System, $_POST['RealmId']); 249 245 if($this->System->Modules['Permission']->Check('Realm', 'Save', $Realm->Id)) 250 246 { … … 257 253 $Form->OnSubmit = '?Module=Realm&Action=Save'; 258 254 259 $Realm = new Realm($this-> Database, $_POST['RealmId']);255 $Realm = new Realm($this->System, $_POST['RealmId']); 260 256 $Realm->SaveConfiguration(); 261 257 $Form->Values['RealmId'] = $RealmId; … … 268 264 { 269 265 $Output = ''; 270 $Realm = new Realm($this-> Database, $_GET['Id']);266 $Realm = new Realm($this->System, $_GET['Id']); 271 267 if($this->System->Modules['Permission']->Check('Realm', 'Edit', $Realm->Id)) 272 268 { … … 283 279 { 284 280 $Output = ''; 285 $Realm = new Realm($this-> Database, $_GET['Id']);281 $Realm = new Realm($this->System, $_GET['Id']); 286 282 if($this->System->Modules['Permission']->Check('Realm', 'EditDetailed', $Realm->Id)) 287 283 { 288 284 $Form = new Form($this->System, $this->SettingDetailedFormClass); 289 $EmulatorConfig = new MangosConfigurationFile($this-> Database);285 $EmulatorConfig = new MangosConfigurationFile($this->System); 290 286 $EmulatorConfig->Load('../realm/'.$Realm->Id.'/etc/mangosd.conf'); 291 287 $Form->Values = array(); … … 302 298 { 303 299 $Output = ''; 304 $Realm = new Realm($this-> Database, $_POST['RealmId']);300 $Realm = new Realm($this->System, $_POST['RealmId']); 305 301 if($this->System->Modules['Permission']->Check('Realm', 'SaveDetailed', $Realm->Id)) 306 302 { 307 303 $Form = new Form($this->System, $this->SettingDetailedFormClass, array()); 308 304 $Form->LoadValuesFromForm(); 309 $EmulatorConfig = new MangosConfigurationFile($this-> Database);305 $EmulatorConfig = new MangosConfigurationFile($this->System); 310 306 $EmulatorConfig->Load('../realm/'.$Realm->Id.'/etc/mangosd.conf'); 311 307 foreach($Form->Definition['Items'] as $Index => $Item) … … 322 318 $Form->OnSubmit = '?Module=Realm&Action=SaveDetailed'; 323 319 324 $Realm = new Realm($this-> Database, $_POST['RealmId']);320 $Realm = new Realm($this->System, $_POST['RealmId']); 325 321 $Realm->SaveConfiguration(); 326 322 $Form->Values['RealmId'] = $RealmId; … … 333 329 { 334 330 $Output = ''; 335 $Realm = new Realm($this-> Database, $_GET['Id']);331 $Realm = new Realm($this->System, $_GET['Id']); 336 332 if($this->System->Modules['Permission']->Check('Realm', 'Start', $Realm->Id)) 337 333 { … … 346 342 { 347 343 $Output = ''; 348 $Realm = new Realm($this-> Database, $_GET['Id']);344 $Realm = new Realm($this->System, $_GET['Id']); 349 345 if($this->System->Modules['Permission']->Check('Realm', 'Stop', $Realm->Id)) 350 346 { … … 358 354 function InitDatabase() 359 355 { 360 global $Config;361 362 356 if(array_key_exists('Id', $_GET)) 363 357 { 364 358 $RealmId = $_GET['Id']; 365 $Realm = new Realm($this-> Database, $RealmId);359 $Realm = new Realm($this->System, $RealmId); 366 360 if($this->System->Modules['Permission']->Check('Realm', 'InitDatabase', $Realm->Id)) 367 361 { … … 377 371 } 378 372 } 379 380 ?>
Note:
See TracChangeset
for help on using the changeset viewer.