Changeset 7 for trunk/Application
- Timestamp:
- Apr 14, 2020, 11:13:32 PM (5 years ago)
- Location:
- trunk/Application
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Core.php
r3 r7 2 2 3 3 $ConfigFileName = dirname(__FILE__).'/../Config/Config.php'; 4 if (file_exists($ConfigFileName)) include_once($ConfigFileName);4 if (file_exists($ConfigFileName)) include_once($ConfigFileName); 5 5 6 6 include_once(dirname(__FILE__).'/../Packages/Common/Common.php'); … … 31 31 $this->BaseURL = $_SERVER['SCRIPT_NAME']; 32 32 $BaseScriptName = '/index.php'; 33 if (substr($this->BaseURL, -strlen($BaseScriptName), strlen($BaseScriptName)) == $BaseScriptName)33 if (substr($this->BaseURL, -strlen($BaseScriptName), strlen($BaseScriptName)) == $BaseScriptName) 34 34 $this->BaseURL = substr($this->BaseURL, 0, -strlen($BaseScriptName)); 35 35 $this->FormManager = new FormManager($this->Database); … … 48 48 $this->Config = &$Config; 49 49 50 if (isset($this->Config['Database']))50 if (isset($this->Config['Database'])) 51 51 { 52 52 $this->Database->Connect($Config['Database']['Host'], $Config['Database']['User'], … … 59 59 60 60 // SQL injection hack protection 61 foreach ($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);62 foreach ($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);61 foreach ($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 62 foreach ($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 63 63 64 64 $this->RegisterPageBar('Top'); … … 68 68 $this->Setup = new Setup($this); 69 69 $this->Setup->Start(); 70 if ($this->Setup->CheckState())70 if ($this->Setup->CheckState()) 71 71 { 72 72 $this->ModuleManager->Start(); … … 77 77 { 78 78 $this->RunCommon(); 79 if ($this->ShowPage)79 if ($this->ShowPage) 80 80 { 81 81 $this->PathItems = ProcessURL(); … … 90 90 /* @var $Page Page */ 91 91 $ClassName = $this->SearchPage($this->PathItems, $this->Pages); 92 if ($ClassName != '')92 if ($ClassName != '') 93 93 { 94 94 $Page = new $ClassName($this); … … 101 101 function RegisterPage($Path, $Handler) 102 102 { 103 if (is_array($Path))103 if (is_array($Path)) 104 104 { 105 105 $Page = &$this->Pages; 106 106 $LastKey = array_pop($Path); 107 foreach ($Path as $PathItem)107 foreach ($Path as $PathItem) 108 108 { 109 109 $Page = &$Page[$PathItem]; 110 110 } 111 if (!is_array($Page)) $Page = array('' => $Page);111 if (!is_array($Page)) $Page = array('' => $Page); 112 112 $Page[$LastKey] = $Handler; 113 113 } else $this->Pages[$Path] = $Handler; … … 136 136 function SearchPage($PathItems, $Pages) 137 137 { 138 if (count($PathItems) > 0) $PathItem = $PathItems[0];138 if (count($PathItems) > 0) $PathItem = $PathItems[0]; 139 139 else $PathItem = ''; 140 if (array_key_exists($PathItem, $Pages))140 if (array_key_exists($PathItem, $Pages)) 141 141 { 142 if (is_array($Pages[$PathItem]))142 if (is_array($Pages[$PathItem])) 143 143 { 144 144 array_shift($PathItems); 145 return ($this->SearchPage($PathItems, $Pages[$PathItem]));146 } else return ($Pages[$PathItem]);147 } else return ('');145 return $this->SearchPage($PathItems, $Pages[$PathItem]); 146 } else return $Pages[$PathItem]; 147 } else return ''; 148 148 } 149 149 150 150 function Link($Target) 151 151 { 152 return ($this->BaseURL.$Target);152 return $this->BaseURL.$Target; 153 153 } 154 154 } … … 166 166 { 167 167 Header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); 168 return ('<h3 align="center">'.T('Required page not found').'</h3>');168 return '<h3 align="center">'.T('Required page not found').'</h3>'; 169 169 } 170 170 } -
trunk/Application/DefaultConfig.php
r1 r7 6 6 { 7 7 $IsDeveloper = in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1')); 8 return (array8 return array 9 9 ( 10 10 array('Name' => 'SystemPassword', 'Type' => 'PasswordEncoded', 'Default' => '', 'Title' => 'Systémové heslo'), … … 36 36 array('Name' => 'Web/ShowPHPError', 'Type' => 'Boolean', 'Default' => '0', 'Title' => 'Ukazovat PHP chyby'), 37 37 array('Name' => 'Web/ShowRuntimeInfo', 'Type' => 'Boolean', 'Default' => '0', 'Title' => 'Ukazovat běhové informace'), 38 ) );38 ); 39 39 } 40 40 } -
trunk/Application/UpdateTrace.php
r1 r7 9 9 function Get() 10 10 { 11 return (array(12 ) );11 return array( 12 ); 13 13 } 14 14 } -
trunk/Application/View.php
r3 r7 5 5 function SystemMessage($Title, $Text) 6 6 { 7 return ('<table align="center"><tr><td><div class="SystemMessage"><h3>'.$Title.'</h3><div>'.$Text.'</div></div></td></tr></table>');7 return '<table align="center"><tr><td><div class="SystemMessage"><h3>'.$Title.'</h3><div>'.$Text.'</div></div></td></tr></table>'; 8 8 } 9 9 … … 37 37 $Output .= '<div class="MenuItem">'; 38 38 $Bar = ''; 39 foreach ($this->System->Bars['TopLeft'] as $BarItem)39 foreach ($this->System->Bars['TopLeft'] as $BarItem) 40 40 $Bar .= call_user_func($BarItem); 41 if (trim($Bar) != '') $Output .= $Bar;41 if (trim($Bar) != '') $Output .= $Bar; 42 42 else $Output .= ' '; 43 43 $Output .= '</div><div class="MenuItem2">'; 44 44 $Bar = ''; 45 foreach ($this->System->Bars['Top'] as $BarItem)45 foreach ($this->System->Bars['Top'] as $BarItem) 46 46 $Bar .= call_user_func($BarItem); 47 if (trim($Bar) != '') $Output .= $Bar;47 if (trim($Bar) != '') $Output .= $Bar; 48 48 else $Output .= ' '; 49 49 $Output .= '</div></div>'; 50 return ($Output);50 return $Output; 51 51 } 52 52 … … 55 55 $Page->OnSystemMessage = array($this->System->BaseView, 'SystemMessage'); 56 56 $Output = $this->ShowPage($Page->Show()); 57 return ($Output);57 return $Output; 58 58 } 59 59 }
Note:
See TracChangeset
for help on using the changeset viewer.