Changeset 873 for trunk/Application/View.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.