Changeset 873 for trunk/Application
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- Location:
- trunk/Application
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/DefaultConfig.php
r791 r873 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'), -
trunk/Application/System.php
r858 r873 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__).'/Version.php'); … … 40 40 $this->ConfigManager = new Config(); 41 41 $this->RootURLFolder = $_SERVER['SCRIPT_NAME']; 42 if (substr($this->RootURLFolder, -10, 10) == '/index.php')42 if (substr($this->RootURLFolder, -10, 10) == '/index.php') 43 43 $this->RootURLFolder = substr($this->RootURLFolder, 0, -10); 44 44 $this->CommandLine = array(); … … 48 48 function RegisterPage($Path, $Handler) 49 49 { 50 if (is_array($Path))50 if (is_array($Path)) 51 51 { 52 52 $Page = &$this->Pages; 53 53 $LastKey = array_pop($Path); 54 foreach ($Path as $PathItem)54 foreach ($Path as $PathItem) 55 55 { 56 56 $Page = &$Page[$PathItem]; 57 57 } 58 if (!is_array($Page)) $Page = array('' => $Page);58 if (!is_array($Page)) $Page = array('' => $Page); 59 59 $Page[$LastKey] = $Handler; 60 60 } else $this->Pages[$Path] = $Handler; … … 68 68 function SearchPage($PathItems, $Pages) 69 69 { 70 if (count($PathItems) > 0) $PathItem = $PathItems[0];70 if (count($PathItems) > 0) $PathItem = $PathItems[0]; 71 71 else $PathItem = ''; 72 if (array_key_exists($PathItem, $Pages))73 { 74 if (is_array($Pages[$PathItem]))72 if (array_key_exists($PathItem, $Pages)) 73 { 74 if (is_array($Pages[$PathItem])) 75 75 { 76 76 array_shift($PathItems); 77 return ($this->SearchPage($PathItems, $Pages[$PathItem]));78 } else return ($Pages[$PathItem]);79 } else return ('');77 return ($this->SearchPage($PathItems, $Pages[$PathItem])); 78 } else return ($Pages[$PathItem]); 79 } else return (''); 80 80 } 81 81 82 82 function PageNotFound() 83 83 { 84 return ('Page '.implode('/', $this->PathItems).' not found.');84 return ('Page '.implode('/', $this->PathItems).' not found.'); 85 85 } 86 86 … … 91 91 /* @var $Page Page */ 92 92 $ClassName = $this->SearchPage($this->PathItems, $this->Pages); 93 if ($ClassName != '')93 if ($ClassName != '') 94 94 { 95 95 $Page = new $ClassName($this); … … 102 102 function ModulePresent($Name) 103 103 { 104 return (array_key_exists($Name, $this->Modules));104 return (array_key_exists($Name, $this->Modules)); 105 105 } 106 106 … … 112 112 function HumanDate($Time) 113 113 { 114 return (date('j.n.Y', $Time));114 return (date('j.n.Y', $Time)); 115 115 } 116 116 117 117 function Link($Target) 118 118 { 119 return ($this->RootURLFolder.$Target);119 return ($this->RootURLFolder.$Target); 120 120 } 121 121 … … 126 126 'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '. 127 127 'WHERE (`Action`.`Id`='.$Id.')'); 128 if ($DbResult->num_rows > 0)128 if ($DbResult->num_rows > 0) 129 129 { 130 130 $Action = $DbResult->fetch_assoc(); 131 if ($Action['Icon'] == '') $Action['Icon'] = 'clear.png';132 if (substr($Action['URL'], 0, 4) != 'http') $Action['URL'] = $this->Link($Action['URL']);133 if (!defined('NEW_PERMISSION') or $this->User->CheckPermission('System', 'Read', 'Item', $Id))131 if ($Action['Icon'] == '') $Action['Icon'] = 'clear.png'; 132 if (substr($Action['URL'], 0, 4) != 'http') $Action['URL'] = $this->Link($Action['URL']); 133 if (!defined('NEW_PERMISSION') or $this->User->CheckPermission('System', 'Read', 'Item', $Id)) 134 134 $Output .= '<img alt="'.$Action['Title'].'" src="'.$this->Link('/images/favicons/'.$Action['Icon']). 135 135 '" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a>'; 136 136 } 137 return ($Output);137 return ($Output); 138 138 } 139 139 … … 148 148 149 149 // SQL injection hack protection 150 foreach ($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);151 foreach ($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);152 153 if (isset($_SERVER['REMOTE_ADDR'])) session_start();150 foreach ($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 151 foreach ($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 152 153 if (isset($_SERVER['REMOTE_ADDR'])) session_start(); 154 154 155 155 $ConfigFileName = dirname(dirname(__FILE__)).'/config.php'; 156 if (file_exists($ConfigFileName))156 if (file_exists($ConfigFileName)) 157 157 $this->ConfigManager->LoadFromFile($ConfigFileName); 158 158 //$this->Config = $this->ConfigManager->GetAsArray(); … … 166 166 $this->Database->ShowSQLError = $this->Config['Web']['ShowSQLError']; 167 167 $this->Database->ShowSQLQuery = $this->Config['Web']['ShowSQLQuery']; 168 if (isset($this->Config['Web']['LogSQLQuery']))168 if (isset($this->Config['Web']['LogSQLQuery'])) 169 169 $this->Database->LogSQLQuery = $this->Config['Web']['LogSQLQuery']; 170 170 } catch (Exception $E) { … … 181 181 $this->LinkLocaleExceptions = array('images', 'style', 'files'); 182 182 183 if (isset($this->Config['Web']['RootFolder']))183 if (isset($this->Config['Web']['RootFolder'])) 184 184 $this->RootURLFolder = $this->Config['Web']['RootFolder']; 185 185 $this->FormManager->Root = $this->RootURLFolder; … … 193 193 $this->Setup = new Setup($this); 194 194 $this->Setup->Start(); 195 if ($this->Setup->CheckState())195 if ($this->Setup->CheckState()) 196 196 { 197 197 $this->ModuleManager->Start(); … … 202 202 { 203 203 $this->RunCommon(); 204 if ($this->ShowPage)204 if ($this->ShowPage) 205 205 { 206 206 $this->PathItems = ProcessURL(); 207 207 208 208 // Detect interface locale 209 if (isset($this->Config['Web']['Locale']))209 if (isset($this->Config['Web']['Locale'])) 210 210 $this->LocaleManager->DefaultLangCode = $this->Config['Web']['Locale']; 211 211 $this->LocaleManager->LangCode = $this->LocaleManager->DefaultLangCode; 212 if (count($this->PathItems) > 0)212 if (count($this->PathItems) > 0) 213 213 { 214 214 $NewLangCode = $this->PathItems[0]; 215 if (array_key_exists($NewLangCode, $this->LocaleManager->Available))215 if (array_key_exists($NewLangCode, $this->LocaleManager->Available)) 216 216 { 217 217 array_shift($this->PathItems); … … 219 219 } 220 220 } 221 if (array_key_exists($this->LocaleManager->LangCode, $this->LocaleManager->Available))221 if (array_key_exists($this->LocaleManager->LangCode, $this->LocaleManager->Available)) 222 222 $this->LocaleManager->LoadLocale($this->LocaleManager->LangCode); 223 223 … … 231 231 232 232 $this->RunCommon(); 233 if (count($argv) > 1)234 { 235 if (array_key_exists($argv[1], $this->CommandLine))233 if (count($argv) > 1) 234 { 235 if (array_key_exists($argv[1], $this->CommandLine)) 236 236 { 237 237 $Command = $this->CommandLine[$argv[1]]; … … 282 282 { 283 283 Header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); 284 return ('<h3 align="center">Požadovaná stránka neexistuje.</h3>');284 return ('<h3 align="center">Požadovaná stránka neexistuje.</h3>'); 285 285 } 286 286 } -
trunk/Application/UpdateTrace.php
r870 r873 203 203 $ServiceCategoryHire = $Manager->Database->insert_id; 204 204 $DbResult = $Manager->Execute("SELECT * FROM Member WHERE Hire>0"); 205 while ($Member = $DbResult->fetch_assoc())205 while ($Member = $DbResult->fetch_assoc()) 206 206 { 207 207 $Manager->Execute("INSERT INTO `Service` ( … … 308 308 // Set all string collation to utf8 general 309 309 $DbResult = $Manager->Execute("SHOW TABLES"); 310 while ($DbRow = $DbResult->fetch_row())310 while ($DbRow = $DbResult->fetch_row()) 311 311 { 312 312 $Manager->Execute("ALTER TABLE `".$DbRow[0]."` CONVERT TO CHARACTER SET utf8"); … … 871 871 $ActionId = $Manager->Database->insert_id; 872 872 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Nabídky"'); 873 if ($DbResult->num_rows > 0)873 if ($DbResult->num_rows > 0) 874 874 { 875 875 $DbRow = $DbResult->fetch_assoc(); … … 889 889 // Convert monthly plus payment for consumption to regular service 890 890 $DbResult = $Manager->Execute('SELECT `MonthlyPlus`, `Member` FROM `MemberPayment` WHERE `MonthlyPlus` > 0'); 891 while ($DbRow = $DbResult->fetch_assoc)891 while ($DbRow = $DbResult->fetch_assoc) 892 892 { 893 893 $Manager->Execute("INSERT INTO `Service` (`Id` ,`Name` ,`Category` ,`Price` ,`VAT`) ". … … 987 987 $ActionId = $Manager->Database->insert_id; 988 988 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Sklad"'); 989 if ($DbResult->num_rows > 0)989 if ($DbResult->num_rows > 0) 990 990 { 991 991 $DbRow = $DbResult->fetch_assoc(); … … 1025 1025 $ActionId = $Manager->Database->insert_id; 1026 1026 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Finance"'); 1027 if ($DbResult->num_rows > 0)1027 if ($DbResult->num_rows > 0) 1028 1028 { 1029 1029 $DbRow = $DbResult->fetch_assoc(); … … 1047 1047 // IS menu item 1048 1048 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Příjmy a výdaje"'); 1049 if ($DbResult->num_rows > 0)1049 if ($DbResult->num_rows > 0) 1050 1050 { 1051 1051 $DbRow = $DbResult->fetch_assoc(); … … 1089 1089 // IS menu item 1090 1090 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Závazky a pohledávky"'); 1091 if ($DbResult->num_rows > 0)1091 if ($DbResult->num_rows > 0) 1092 1092 { 1093 1093 $DbRow = $DbResult->fetch_assoc(); … … 1120 1120 $SearchText = 'Připojení k síti'; 1121 1121 $DbResult = $Manager->Execute('SELECT * FROM `FinanceInvoiceItem` WHERE `Description` LIKE "'.$SearchText.' za období%";'); 1122 while ($DbRow = $DbResult->fetch_assoc())1122 while ($DbRow = $DbResult->fetch_assoc()) 1123 1123 { 1124 1124 $Text = trim(substr($DbRow['Description'], strlen($SearchText.' za období') + 1)); … … 1134 1134 $SearchText = 'Připojení k Internetu'; 1135 1135 $DbResult = $Manager->Execute('SELECT * FROM `FinanceInvoiceItem` WHERE `Description` LIKE "'.$SearchText.' za období%";'); 1136 while ($DbRow = $DbResult->fetch_assoc())1136 while ($DbRow = $DbResult->fetch_assoc()) 1137 1137 { 1138 1138 $Text = trim(substr($DbRow['Description'], strlen($SearchText.' za období') + 1)); … … 1141 1141 $PeriodFrom = $PeriodFrom[2].'-'.$PeriodFrom[1].'-'.$PeriodFrom[0]; 1142 1142 $Text[1] = trim($Text[1]); 1143 if (strpos($Text[1], ' ') !== false) $Text[1] = substr($Text[1], 0, strpos($Text[1], ' '));1143 if (strpos($Text[1], ' ') !== false) $Text[1] = substr($Text[1], 0, strpos($Text[1], ' ')); 1144 1144 $PeriodTo = explode('.', trim($Text[1])); 1145 1145 $PeriodTo = $PeriodTo[2].'-'.$PeriodTo[1].'-'.$PeriodTo[0]; … … 1199 1199 $ActionId = $Manager->Database->insert_id; 1200 1200 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Systém"'); 1201 if ($DbResult->num_rows > 0)1201 if ($DbResult->num_rows > 0) 1202 1202 { 1203 1203 $DbRow = $DbResult->fetch_assoc(); … … 1250 1250 $ActionId = $Manager->Database->insert_id; 1251 1251 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Síť"'); 1252 if ($DbResult->num_rows > 0)1252 if ($DbResult->num_rows > 0) 1253 1253 { 1254 1254 $DbRow = $DbResult->fetch_assoc(); … … 1457 1457 'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id` = `FinanceOperation`.`Group` '. 1458 1458 'WHERE `FinanceOperation`.`BillCodeText`!=""'); 1459 while ($DbRow = $DbResult->fetch_assoc())1459 while ($DbRow = $DbResult->fetch_assoc()) 1460 1460 { 1461 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';1461 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1462 1462 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1463 1463 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); … … 1475 1475 'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id` = `FinanceInvoice`.`Group` '. 1476 1476 'WHERE `FinanceInvoice`.`BillCodeText`!=""'); 1477 while ($DbRow = $DbResult->fetch_assoc())1477 while ($DbRow = $DbResult->fetch_assoc()) 1478 1478 { 1479 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';1479 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1480 1480 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1481 1481 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); … … 1512 1512 { 1513 1513 $DbResult = $Manager->Database->query('SELECT * FROM (SELECT `FinanceInvoice`.`Id`, ((SELECT SUM(`Price` * `Quantity`) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=`FinanceInvoice`.`Id`) * `FinanceInvoiceGroup`.`ValueSign`) AS `Sum`,`FinanceInvoice`.`Value` FROM `FinanceInvoice` LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group`) AS `T` WHERE `Sum` != `Value`'); 1514 while ($DbRow = $DbResult->fetch_assoc())1514 while ($DbRow = $DbResult->fetch_assoc()) 1515 1515 { 1516 1516 $Manager->Database->query('UPDATE `FinanceInvoiceItem` SET `Price` = -`Price` WHERE `FinanceInvoice`='.$DbRow['Id']); … … 1624 1624 $ActionId = $Manager->Database->insert_id; 1625 1625 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Zákazníci"'); 1626 if ($DbResult->num_rows > 0)1626 if ($DbResult->num_rows > 0) 1627 1627 { 1628 1628 $DbRow = $DbResult->fetch_assoc(); … … 1812 1812 'FROM `Contract` '. 1813 1813 'WHERE `Contract`.`BillCodeText`!=""'); 1814 while ($DbRow = $DbResult->fetch_assoc())1814 while ($DbRow = $DbResult->fetch_assoc()) 1815 1815 { 1816 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';1816 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1817 1817 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1818 1818 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); … … 1877 1877 'LEFT JOIN `StockMoveGroup` ON `StockMoveGroup`.`Id` = `StockMove`.`Group` '. 1878 1878 'WHERE `StockMove`.`BillCodeText`!=""'); 1879 while ($DbRow = $DbResult->fetch_assoc())1879 while ($DbRow = $DbResult->fetch_assoc()) 1880 1880 { 1881 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';1881 if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL'; 1882 1882 $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '. 1883 1883 'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");'); … … 1940 1940 $ActionId = $Manager->Database->insert_id; 1941 1941 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Pokladny"'); 1942 if ($DbResult->num_rows > 0)1942 if ($DbResult->num_rows > 0) 1943 1943 { 1944 1944 $DbRow = $DbResult->fetch_assoc(); … … 2096 2096 $ActionId = $Manager->Database->insert_id; 2097 2097 $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Síť"'); 2098 if ($DbResult->num_rows > 0)2098 if ($DbResult->num_rows > 0) 2099 2099 { 2100 2100 $DbRow = $DbResult->fetch_assoc(); … … 2115 2115 function Get() 2116 2116 { 2117 return (array(2117 return (array( 2118 2118 491 => array('Revision' => 493, 'Function' => 'UpdateTo493'), 2119 2119 493 => array('Revision' => 494, 'Function' => 'UpdateTo494'), -
trunk/Application/Version.php
r872 r873 1 1 <?php 2 2 3 $Revision = 87 2; // Subversion revision3 $Revision = 873; // Subversion revision 4 4 $DatabaseRevision = 870; // SQL structure revision 5 5 $ReleaseTime = strtotime('2020-04-06'); -
trunk/Application/View.php
r796 r873 26 26 27 27 // TODO: Move to external code 28 if (isset($this->System->Config['Web']['FormatHTML']))28 if (isset($this->System->Config['Web']['FormatHTML'])) 29 29 $this->FormatHTML = $this->System->Config['Web']['FormatHTML']; 30 if (isset($this->System->Config['Web']['ShowRuntimeInfo']))30 if (isset($this->System->Config['Web']['ShowRuntimeInfo'])) 31 31 $this->ShowRuntimeInfo = $this->System->Config['Web']['ShowRuntimeInfo']; 32 if (isset($this->System->Config['Web']['Charset']))32 if (isset($this->System->Config['Web']['Charset'])) 33 33 $this->Encoding = $this->System->Config['Web']['Charset']; 34 if (isset($this->System->Config['Web']['Style']))34 if (isset($this->System->Config['Web']['Style'])) 35 35 $this->Style = $this->System->Config['Web']['Style']; 36 36 } … … 38 38 function SystemMessage($Title, $Text) 39 39 { 40 return ('<table align="center"><tr><td><div class="SystemMessage"><h3>'.$Title.'</h3><div>'.$Text.'</div></div></td></tr></table>');40 return ('<table align="center"><tr><td><div class="SystemMessage"><h3>'.$Title.'</h3><div>'.$Text.'</div></div></td></tr></table>'); 41 41 //ShowFooter(); 42 42 //die(); … … 45 45 function ShowNavigation($Page) 46 46 { 47 if (array_key_exists('REQUEST_URI', $_SERVER))47 if (array_key_exists('REQUEST_URI', $_SERVER)) 48 48 $ScriptName = $_SERVER['REQUEST_URI']; 49 49 else $ScriptName = ''; 50 while (strpos($ScriptName, '//') !== false)50 while (strpos($ScriptName, '//') !== false) 51 51 $ScriptName = str_replace('//', '/', $ScriptName); 52 if (strpos($ScriptName, '?') !== false)52 if (strpos($ScriptName, '?') !== false) 53 53 $ScriptName = substr($ScriptName, 0, strrpos($ScriptName, '?')); 54 54 $ScriptName = substr($ScriptName, strlen($this->System->Link(''))); 55 if (substr($ScriptName, -1, 1) == '/') $ScriptName = substr($ScriptName, 0, -1);55 if (substr($ScriptName, -1, 1) == '/') $ScriptName = substr($ScriptName, 0, -1); 56 56 57 57 $Output = ''; 58 while ($Page)58 while ($Page) 59 59 { 60 60 $Output = ' > <a href="'.$this->System->Link($ScriptName).'/">'.$Page->ShortTitle.'</a>'.$Output; 61 61 62 if (class_exists($Page->ParentClass))62 if (class_exists($Page->ParentClass)) 63 63 { 64 64 $PageClass = $Page->ParentClass; … … 68 68 } 69 69 $Output = substr($Output, 6); 70 return ($Output);70 return ($Output); 71 71 } 72 72 … … 79 79 80 80 $BodyParam = ''; 81 if (isset($Page->Load)) $BodyParam .= ' onload="'.$Page->Load.'"';82 if (isset($Page->Unload)) $BodyParam .= ' onunload="'.$Page->Unload.'"';81 if (isset($Page->Load)) $BodyParam .= ' onload="'.$Page->Load.'"'; 82 if (isset($Page->Unload)) $BodyParam .= ' onunload="'.$Page->Unload.'"'; 83 83 $Output = '<?xml version="1.0" encoding="'.$this->Encoding.'"?>'."\n". 84 84 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'. … … 91 91 // Show page headers 92 92 $Bar = ''; 93 foreach ($this->System->PageHeaders as $Item)93 foreach ($this->System->PageHeaders as $Item) 94 94 $Output .= call_user_func($Item); 95 95 96 96 $Output .= '</head><body'.$BodyParam.'>'; 97 if ($this->BasicHTML == false)97 if ($this->BasicHTML == false) 98 98 { 99 99 //$Output .= '<div class="MainTitle">'.$Title.'</div>'; 100 100 $Output .= '<div class="MainTitle"><span class="MenuItem"><strong>Navigace :: </strong> '.$Navigation.'</span><div class="MenuItem2">'; 101 101 $Bar = ''; 102 foreach ($this->System->Bars['Top'] as $BarItem)102 foreach ($this->System->Bars['Top'] as $BarItem) 103 103 $Bar .= call_user_func($BarItem); 104 if (trim($Bar) != '') $Output .= $Bar;104 if (trim($Bar) != '') $Output .= $Bar; 105 105 else $Output .= ' '; 106 106 $Output .= '</div></div>'; 107 107 } 108 return ($Output);108 return ($Output); 109 109 } 110 110 … … 115 115 $Time = round(GetMicrotime() - $ScriptTimeStart, 2); 116 116 $Output = ''; 117 if ($this->BasicHTML == false)117 if ($this->BasicHTML == false) 118 118 { 119 119 $Output .= '<div id="Footer">'. 120 120 '<i>| Správa webu: '.$this->System->Config['Web']['Admin'].' | e-mail: '.$this->System->Config['Web']['AdminEmail'].' | '. 121 121 ' Verze: '.$Revision.' ('.$this->System->HumanDate($ReleaseTime).') |'; 122 if ($this->ShowRuntimeInfo == true) $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time').122 if ($this->ShowRuntimeInfo == true) $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time'). 123 123 ' s | Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B |'; 124 124 $Output .= '</i></div>'; 125 125 } 126 126 $Output .= '</body></html>'; 127 return ($Output);127 return ($Output); 128 128 } 129 129 … … 133 133 134 134 $Output = $Page->Show(); 135 if ($Page->ClearPage == false)135 if ($Page->ClearPage == false) 136 136 { 137 137 $Output = $this->ShowHeader($Page).$Output.$this->ShowFooter(); 138 if ($this->FormatHTML == true) $Output = $this->FormatOutput($Output);138 if ($this->FormatHTML == true) $Output = $this->FormatOutput($Output); 139 139 } 140 return ($Output);140 return ($Output); 141 141 } 142 142 … … 147 147 $Page->Database = $this->Database; 148 148 $Page->FormatHTML = $this->FormatHTML; 149 return ($Page);149 return ($Page); 150 150 } 151 151 … … 156 156 $nn = 0; 157 157 $n = 0; 158 while ($s != '')158 while ($s != '') 159 159 { 160 160 $start = strpos($s, '<'); 161 161 $end = strpos($s, '>'); 162 if ($start != 0)162 if ($start != 0) 163 163 { 164 164 $end = $start - 1; … … 166 166 } 167 167 $line = trim(substr($s, $start, $end + 1)); 168 if (strlen($line) > 0)169 if ($line[0] == '<')168 if (strlen($line) > 0) 169 if ($line[0] == '<') 170 170 { 171 if ($s[$start + 1] == '/')171 if ($s[$start + 1] == '/') 172 172 { 173 173 $n = $n - 2; … … 175 175 } else 176 176 { 177 if (strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1);177 if (strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1); 178 178 else $cmd = substr($line, 1, strlen($line) - 2); 179 179 //echo('['.$cmd.']'); 180 if (strpos($s, '</'.$cmd.'>')) $n = $n + 2;180 if (strpos($s, '</'.$cmd.'>')) $n = $n + 2; 181 181 } 182 182 }// else $line = '['.$line.']'; 183 //if ($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n"));184 if ($line != '') $out .= (str_repeat(' ', $nn).$line."\n");183 //if ($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n")); 184 if ($line != '') $out .= (str_repeat(' ', $nn).$line."\n"); 185 185 $s = substr($s, $end + 1, strlen($s)); 186 186 $nn = $n; 187 187 } 188 return ($out);188 return ($out); 189 189 } 190 190 }
Note:
See TracChangeset
for help on using the changeset viewer.