Changeset 425 for branches/Modular/Modules/System/System.php
- Timestamp:
- Oct 10, 2012, 12:21:38 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Modular/Modules/System/System.php
r424 r425 205 205 parent::Start(); 206 206 $this->System->Pages['module'] = 'PageModules'; 207 $this->M odularSystem->OnModuleChange = array($this, 'ModuleChange');207 $this->Manager->OnModuleChange = array($this, 'ModuleChange'); 208 208 $this->LoadFromDatabase(); 209 209 } … … 224 224 function ModuleChange($Module) 225 225 { 226 if($this->IsInstalled())227 { 228 if($Module->I nstalled)226 //if($this->IsInstalled()) 227 { 228 if($Module->IsInstalled()) 229 229 $this->Database->query('UPDATE `SystemModule` SET `Installed`=1 WHERE `Name`="'.$Module->Name.'"'); 230 230 else $this->Database->query('UPDATE `SystemModule` SET `Installed`=0 WHERE `Name`="'.$Module->Name.'"'); … … 243 243 include_once('Modules/'.$Module['Name'].'/'.$Module['Name'].'.php'); 244 244 $ModuleClassName = 'Module'.$Module['Name']; 245 $NewModule = new $ModuleClassName($this->Database, $this );245 $NewModule = new $ModuleClassName($this->Database, $this->Manager); 246 246 $NewModule->Id = $Module['Id']; 247 247 $NewModule->Installed = $Module['Installed']; 248 $this->M odularSystem->RegisterModule($NewModule);248 $this->Manager->RegisterModule($NewModule); 249 249 } 250 250 } … … 258 258 259 259 // Add missing 260 foreach($this->M odularSystem->Modules as $Module)260 foreach($this->Manager->Modules as $Module) 261 261 { 262 262 if(!array_key_exists($Module->Name, $Modules)) … … 273 273 // Remove exceeding 274 274 foreach($Modules as $Module) 275 if(!$this->M odularSystem->ModulePresent($Module['Name']))275 if(!$this->Manager->ModulePresent($Module['Name'])) 276 276 { 277 277 DebugLog('Removing module '.$Module['Name'].' from list'); … … 285 285 $DbDependency[$DbRow['Module']][] = $DbRow['DependencyModule']; 286 286 287 foreach($this->M odularSystem->Modules as $Module)287 foreach($this->Manager->Modules as $Module) 288 288 { 289 289 // Add missing … … 291 291 { 292 292 if(!array_key_exists($Module->Id, $DbDependency) or 293 !in_array($this->M odularSystem->Modules[$Dependency]->Id, $DbDependency[$Module->Id]))293 !in_array($this->Manager->Modules[$Dependency]->Id, $DbDependency[$Module->Id])) 294 294 $this->Database->insert('SystemModuleDependency', array('Module' => $Module->Id, 295 'DependencyModule' => $this->M odularSystem->Modules[$Dependency]->Id));295 'DependencyModule' => $this->Manager->Modules[$Dependency]->Id)); 296 296 } 297 297 … … 300 300 foreach($DbDependency[$Module->Id] as $Dep) 301 301 { 302 $DepModName = $this->M odularSystem->SearchModuleById($Dep);302 $DepModName = $this->Manager->SearchModuleById($Dep); 303 303 if(!in_array($DepModName, $Module->Dependencies)) 304 304 $this->Database->query('DELETE FROM `SystemModuleDependency` WHERE `Module` = '.
Note:
See TracChangeset
for help on using the changeset viewer.