Changeset 469 for trunk/Common/Global.php
- Timestamp:
- Dec 30, 2012, 9:13:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Global.php
r463 r469 2 2 3 3 $ConfigFileName = dirname(__FILE__).'/../config.php'; 4 /* @var $System System */ 5 $System = NULL; 6 /* @var $Database Database */ 7 $Database = NULL; 4 8 5 9 if(file_exists($ConfigFileName)) include_once($ConfigFileName); … … 23 27 24 28 include_once(dirname(__FILE__).'/../Modules/Meteostation/Meteostation.php'); 29 include_once(dirname(__FILE__).'/../Modules/Portal/Portal.php'); 25 30 26 31 $PrefixMultipliers = array … … 95 100 class System extends Module 96 101 { 97 var $Modules = array();102 var $Modules; 98 103 /** @var Type */ 99 104 var $Type; 105 var $Pages; 106 /** @var AppModuleManager */ 107 var $ModuleManager; 100 108 101 109 function __construct() 102 110 { 103 111 parent::__construct(); 112 $this->Modules = array(); 104 113 $this->Type = new Type($this); 114 $this->Pages = array(); 115 $this->ModuleManager = new AppModuleManager(); 116 } 117 118 function RegisterPage($Path, $Handler) 119 { 120 $this->Pages[$Path] = $Handler; 121 } 122 123 function ShowPage($Path) 124 { 125 /* @var $Page Page */ 126 $ClassName = $this->Pages[$Path]; 127 $Page = new $ClassName(); 128 $Page->System = &$this; 129 $Page->Database = &$this->Database; 130 $Page->GetOutput(); 105 131 } 106 132 … … 209 235 210 236 return($Config['Web']['RootFolder'].$Target); 211 } 237 } 212 238 } 213 239 … … 243 269 $System->AddModule(new Finance()); 244 270 $System->Modules['Finance']->LoadMonthParameters(0); 271 272 // Register new modules 273 $System->ModuleManager->RegisterModule(new Meteostation($System)); 274 $System->ModuleManager->RegisterModule(new Portal($System)); 275 $System->ModuleManager->StartAll(); 245 276 } 246 277
Note:
See TracChangeset
for help on using the changeset viewer.