Changeset 22 for trunk/index.php
- Timestamp:
- Mar 1, 2010, 9:12:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r19 r22 14 14 include_once(dirname(__FILE__).'/CustomOutput.php'); 15 15 16 include_once(dirname(__FILE__).'/Module/User/Controller.php'); 16 17 include_once(dirname(__FILE__).'/Module/Main/Controller.php'); 17 18 include_once(dirname(__FILE__).'/Module/Network/Controller.php'); … … 27 28 var $BaseURL; 28 29 var $Type; 30 var $DefaultModule; 29 31 30 32 function __construct() … … 40 42 $this->BaseURL = new URL(); 41 43 44 $this->DefaultModule = 'Main'; 42 45 $this->BaseURL->Scheme = 'http'; 43 46 $this->BaseURL->Host = $_SERVER['SERVER_NAME']; … … 59 62 } 60 63 64 function GetModuleOutput() 65 { 66 if(!array_key_exists('M', $_GET)) $_GET['M'] = $this->DefaultModule; 67 $ModuleName = $_GET['M']; 68 $ModuleName .= 'Controller'; 69 if(class_exists($ModuleName)) 70 { 71 $Module = new $ModuleName($this); 72 if(array_key_exists('Panel', $_GET)) $Output = $Module->Show(); 73 else $Output = $this->Output->Show($Module->Show()); 74 } else 75 throw new Exception('Module not found'); 76 return($Output); 77 } 78 61 79 function Run() 62 80 { … … 65 83 $this->User->Id = $this->UserOnline->User; 66 84 $this->User->LoadData(); 67 if(!array_key_exists('M', $_GET)) $_GET['M'] = 'Main'; 68 $ModuleName = $_GET['M']; 69 $ModuleName .= 'Controller'; 70 if(class_exists($ModuleName)) 71 { 72 $Module = new $ModuleName($this); 73 if(array_key_exists('Panel', $_GET)) echo($Module->Show()); 74 else $this->Output->Show($Module->Show()); 75 } else 76 throw new Exception('Module not found'); 85 echo($this->GetModuleOutput()); 77 86 } 78 87 }
Note:
See TracChangeset
for help on using the changeset viewer.