Ignore:
Timestamp:
Aug 15, 2013, 11:17:26 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: System variable as parameter to constructors of descendents of Module class.
  • Removed: End PHP mark "?>" from all files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/Application/View/Realm.php

    r92 r93  
    105105  function ItemList()
    106106  {
    107     global $Config;
    108    
    109107    if(array_key_exists('Id', $_GET)) $ServerId = $_GET['Id'];
    110108   
    111     $Realm = new Realm($this->Database, 0);
     109    $Realm = new Realm($this->System, 0);
    112110    //$Realm->UpdateServerList();
    113111    $Output = '<h4>Seznam světů</h4>';
     
    131129      //$DbResult = $this->Database->query('SELECT COUNT(*) FROM Realm WHERE Server='.$this->System->Modules['User']->User['Id']);
    132130      //$DbRow = $DbResult->fetch_row();
    133       if(($RealmCount < $Config['MaxRealmPerServerCount']))
     131      if(($RealmCount < $this->Config['MaxRealmPerServerCount']))
    134132        $Output .= '<br /><div style="text-align: center;"><a href="?Module=Realm&amp;Action=Add">Vytvořit nový svět</a></dev>';     
    135133    }
     
    139137  function Item()
    140138  {
    141     global $Config;
    142    
    143139    $Id = $_GET['Id'];
    144     $Realm = new Realm($this->Database, $Id);
     140    $Realm = new Realm($this->System, $Id);
    145141    //if(isset($Server->Server))
    146142    //{
     
    179175  function Add()
    180176  {
    181     global $Config;
    182    
    183177    if(array_key_exists('Id', $_GET))
    184178    {
     
    190184      $DbRow = $DbResult->fetch_row();
    191185      $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ů');
    195191        else
    196192        {
     
    209205  function Create()
    210206  {
    211     global $Config;   
    212      
    213207    if(array_key_exists('Id', $_GET))
    214208    {
     
    216210    if($this->System->Modules['Permission']->Check('Realm', 'Add'))
    217211    {
    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ů');
    219215      else
    220216      {
     
    223219        $DbRow = $DbResult->fetch_row();
    224220        $NewPortWorldd = $DbRow[0] + 1;
    225         if($NewPortWorldd < $Config['BaseNetworkPortWorldd']) $NewPortWorldd = $Config['BaseNetworkPortWorldd'];
     221        if($NewPortWorldd < $this->Config['BaseNetworkPortWorldd']) $NewPortWorldd = $this->Config['BaseNetworkPortWorldd'];
    226222           
    227223        $Form = new Form($this->System, $this->CreateFormClass, array());
     
    229225        $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()'));
    230226        $LastInsertId = $this->Database->insert_id;
    231         $Realm = new Realm($this->Database, $LastInsertId);
     227        $Realm = new Realm($this->System, $LastInsertId);
    232228        $Realm->CreateDatabase();           
    233229        $Output = $this->System->SystemMessage('Vytvoření světu', $Realm->ImportDatabase(true));
     
    246242  {
    247243    $Output = '';
    248     $Realm = new Realm($this->Database, $_POST['RealmId']);
     244    $Realm = new Realm($this->System, $_POST['RealmId']);
    249245    if($this->System->Modules['Permission']->Check('Realm', 'Save', $Realm->Id))
    250246    {
     
    257253      $Form->OnSubmit = '?Module=Realm&amp;Action=Save';
    258254       
    259       $Realm = new Realm($this->Database, $_POST['RealmId']);
     255      $Realm = new Realm($this->System, $_POST['RealmId']);
    260256      $Realm->SaveConfiguration();
    261257      $Form->Values['RealmId'] = $RealmId;
     
    268264  {
    269265    $Output = '';
    270     $Realm = new Realm($this->Database, $_GET['Id']);
     266    $Realm = new Realm($this->System, $_GET['Id']);
    271267    if($this->System->Modules['Permission']->Check('Realm', 'Edit', $Realm->Id))
    272268    {
     
    283279  {
    284280    $Output = '';
    285     $Realm = new Realm($this->Database, $_GET['Id']);
     281    $Realm = new Realm($this->System, $_GET['Id']);
    286282    if($this->System->Modules['Permission']->Check('Realm', 'EditDetailed', $Realm->Id))
    287283    {
    288284      $Form = new Form($this->System, $this->SettingDetailedFormClass);
    289       $EmulatorConfig = new MangosConfigurationFile($this->Database);
     285      $EmulatorConfig = new MangosConfigurationFile($this->System);
    290286      $EmulatorConfig->Load('../realm/'.$Realm->Id.'/etc/mangosd.conf');
    291287      $Form->Values = array();
     
    302298  {
    303299    $Output = '';
    304     $Realm = new Realm($this->Database, $_POST['RealmId']);
     300    $Realm = new Realm($this->System, $_POST['RealmId']);
    305301    if($this->System->Modules['Permission']->Check('Realm', 'SaveDetailed', $Realm->Id))
    306302    {
    307303      $Form = new Form($this->System, $this->SettingDetailedFormClass, array());
    308304      $Form->LoadValuesFromForm();
    309       $EmulatorConfig = new MangosConfigurationFile($this->Database);
     305      $EmulatorConfig = new MangosConfigurationFile($this->System);
    310306      $EmulatorConfig->Load('../realm/'.$Realm->Id.'/etc/mangosd.conf');
    311307      foreach($Form->Definition['Items'] as $Index => $Item)
     
    322318      $Form->OnSubmit = '?Module=Realm&amp;Action=SaveDetailed';
    323319       
    324       $Realm = new Realm($this->Database, $_POST['RealmId']);
     320      $Realm = new Realm($this->System, $_POST['RealmId']);
    325321      $Realm->SaveConfiguration();
    326322      $Form->Values['RealmId'] = $RealmId;
     
    333329  {
    334330    $Output = '';
    335     $Realm = new Realm($this->Database, $_GET['Id']);
     331    $Realm = new Realm($this->System, $_GET['Id']);
    336332    if($this->System->Modules['Permission']->Check('Realm', 'Start', $Realm->Id))
    337333    {
     
    346342  {
    347343    $Output = '';
    348     $Realm = new Realm($this->Database, $_GET['Id']);
     344    $Realm = new Realm($this->System, $_GET['Id']);
    349345    if($this->System->Modules['Permission']->Check('Realm', 'Stop', $Realm->Id))
    350346    {
     
    358354  function InitDatabase()
    359355  {
    360     global $Config;   
    361      
    362356    if(array_key_exists('Id', $_GET))
    363357    {
    364358      $RealmId = $_GET['Id'];
    365       $Realm = new Realm($this->Database, $RealmId);
     359      $Realm = new Realm($this->System, $RealmId);
    366360      if($this->System->Modules['Permission']->Check('Realm', 'InitDatabase', $Realm->Id))
    367361      {
     
    377371  }
    378372}
    379 
    380 ?>
Note: See TracChangeset for help on using the changeset viewer.