Changeset 8 for trunk/Application
- Timestamp:
- Jun 1, 2023, 12:18:18 AM (19 months ago)
- Location:
- trunk/Application
- Files:
-
- 1 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/BaseView.php
r7 r8 26 26 $Output .= $Content; 27 27 $Output .= '<br/><div style="text-align: center; font-size: small;">Verze: '.$Revision.' ('.HumanDate($ReleaseTime).')'. 28 ' <a href="http ://svn.zdechov.net/trac/open2ride/browser/trunk">Zdrojový kód</a> '.29 '<a href="http ://svn.zdechov.net/trac/open2ride/log/trunk?verbose=on">Historie změn</a></div>';28 ' <a href="https://svn.zdechov.net/trac/open2ride/browser/trunk">Zdrojový kód</a> '. 29 '<a href="https://svn.zdechov.net/trac/open2ride/log/trunk?verbose=on">Historie změn</a></div>'; 30 30 $Output .= '</body></html>'; 31 31 echo($Output); -
trunk/Application/Core.php
r7 r8 4 4 if (file_exists($ConfigFileName)) include_once($ConfigFileName); 5 5 6 include_once(dirname(__FILE__).'/../Packages/Common/Common.php'); 6 include_once(dirname(__FILE__).'/../Packages/Common/PackageCommon.php'); 7 include_once(dirname(__FILE__).'/../Packages/FormManager/PackageFormManager.php'); 7 8 include_once(dirname(__FILE__).'/Version.php'); 8 include_once(dirname(__FILE__).'/View.php'); 9 include_once(dirname(__FILE__).'/BaseView.php'); 10 include_once(dirname(__FILE__).'/PageMissing.php'); 9 11 include_once(dirname(__FILE__).'/UpdateTrace.php'); 10 12 include_once(dirname(__FILE__).'/DefaultConfig.php'); 11 13 include_once(dirname(__FILE__).'/../Global.php'); 12 14 13 class Core extends Application15 class Core extends System 14 16 { 15 var $Pages;16 var $ShowPage;17 var $BaseURL;18 var $Config;19 var $HeadItems;20 var $Bars;21 /** @var FormManager */22 var $FormManager;17 public bool $ShowPage; 18 public string $BaseURL; 19 public array $Config; 20 public array $HeadItems; 21 public array $Bars; 22 public array $PathItems; 23 public FormManager $FormManager; 24 public BaseView $BaseView; 23 25 24 26 function __construct() … … 65 67 $this->RegisterPageBar('TopLeft'); 66 68 67 // Register and start existing modules 68 $this->Setup = new Setup($this); 69 $this->Setup->Start(); 70 if ($this->Setup->CheckState()) 69 $this->StartModules(); 70 } 71 72 function StartModules(): void 73 { 74 $ModuleSetup = $this->ModuleManager->LoadModule(dirname(__FILE__).'/../Packages/Common/Modules/ModuleSetup.php'); 75 $ModuleSetup->Install(); 76 $ModuleSetup->Start(); 77 $this->ModuleManager->LoadModules(); 78 $this->ModuleManager->LoadModule(dirname(__FILE__).'/../Packages/Common/Modules/ModuleAdmin.php'); 79 if (file_exists($this->ModuleManager->FileName)) $this->ModuleManager->LoadState(); 80 if (ModuleSetup::Cast($ModuleSetup)->CheckState()) 71 81 { 72 $this->ModuleManager->Start ();82 $this->ModuleManager->StartAll(array(ModuleCondition::Enabled)); 73 83 } 74 84 } 75 85 76 function Run() 86 function Run(): void 77 87 { 78 88 $this->RunCommon(); … … 98 108 echo($this->BaseView->GetOutput($Page)); 99 109 } 100 101 function RegisterPage($Path, $Handler) 102 { 103 if (is_array($Path)) 104 { 105 $Page = &$this->Pages; 106 $LastKey = array_pop($Path); 107 foreach ($Path as $PathItem) 108 { 109 $Page = &$Page[$PathItem]; 110 } 111 if (!is_array($Page)) $Page = array('' => $Page); 112 $Page[$LastKey] = $Handler; 113 } else $this->Pages[$Path] = $Handler; 114 } 115 116 function UnregisterPage($Path) 117 { 118 unset($this->Pages[$Path]); 119 } 120 110 121 111 function RegisterPageBar($Name) 122 112 { … … 148 138 } 149 139 150 function Link($Target) 140 function Link($Target): string 151 141 { 152 142 return $this->BaseURL.$Target; 153 143 } 154 }155 144 156 class PageMissing extends Page 157 { 158 function __construct($System) 145 static function Cast(System $System): Core 159 146 { 160 parent::__construct($System); 161 $this->ParentClass = ''; 162 $this->Title = T('Page not found'); 163 } 164 165 function Show() 166 { 167 Header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); 168 return '<h3 align="center">'.T('Required page not found').'</h3>'; 147 if ($System instanceof Core) 148 { 149 return $System; 150 } 151 throw new Exception('Expected Core type but '.gettype($System)); 169 152 } 170 153 } -
trunk/Application/Version.php
r6 r8 6 6 // and system will need database update. 7 7 8 $Revision = 6;9 $DatabaseRevision = 6;10 $ReleaseTime = strtotime('202 0-04-14');8 $Revision = 8; 9 $DatabaseRevision = 8; 10 $ReleaseTime = strtotime('2023-06-01');
Note:
See TracChangeset
for help on using the changeset viewer.