Changeset 374


Ignore:
Timestamp:
Jan 20, 2012, 7:36:57 AM (13 years ago)
Author:
chronos
Message:
  • Opraveno: Při inicializaci modulů se musí nejdříve zinicializovat moduly uvedené v závislostech.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Module.php

    r373 r374  
    1414  var $Database;
    1515  var $Installed;
     16  var $Initialized;
    1617  var $System;
    1718 
     
    2021    $this->Database = &$Database;   
    2122    $this->System = &$System;   
     23    $this->Initialized = false;
     24    $this->Installed = false;
    2225  }
    2326 
     
    4952  function Init()
    5053  {
     54    $this->Initialized = true;
     55    foreach($this->Dependencies as $Dependency) 
     56      if(!$this->System->Modules[$Dependency]->Initialized)
     57        $this->System->Modules[$Dependency]->Init();
    5158  }
    5259}
     
    8087      $this->Modules[$Module['Name']] = new $ModuleClassName($this->Database, $this);
    8188      $this->Modules[$Module['Name']]->Id = $Module['Id'];
    82       $this->Modules[$Module['Name']]->Init();
    8389    }     
     90    foreach($this->Modules as $Index => $Module)
     91      $this->Modules[$Index]->Init();
    8492  }
    8593 
Note: See TracChangeset for help on using the changeset viewer.