Changeset 55 for trunk/View.php
- Timestamp:
- Apr 7, 2020, 12:55:39 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/View.php
r39 r55 27 27 28 28 // TODO: Move to external code 29 if (isset($this->System->Config['Web']['FormatHTML']))29 if (isset($this->System->Config['Web']['FormatHTML'])) 30 30 $this->FormatHTML = $this->System->Config['Web']['FormatHTML']; 31 if (isset($this->System->Config['Web']['ShowRuntimeInfo']))31 if (isset($this->System->Config['Web']['ShowRuntimeInfo'])) 32 32 $this->ShowRuntimeInfo = $this->System->Config['Web']['ShowRuntimeInfo']; 33 if (isset($this->System->Config['Web']['Charset']))33 if (isset($this->System->Config['Web']['Charset'])) 34 34 $this->Encoding = $this->System->Config['Web']['Charset']; 35 if (isset($this->System->Config['Web']['Style']))35 if (isset($this->System->Config['Web']['Style'])) 36 36 $this->Style = $this->System->Config['Web']['Style']; 37 37 } … … 39 39 function SystemMessage($Title, $Text) 40 40 { 41 return ('<table align="center"><tr><td><div class="SystemMessage"><h3>'.$Title.'</h3><div>'.$Text.'</div></div></td></tr></table>');41 return '<table align="center"><tr><td><div class="SystemMessage"><h3>'.$Title.'</h3><div>'.$Text.'</div></div></td></tr></table>'; 42 42 //ShowFooter(); 43 43 //die(); … … 46 46 function ShowNavigation($Page) 47 47 { 48 if (array_key_exists('REQUEST_URI', $_SERVER))48 if (array_key_exists('REQUEST_URI', $_SERVER)) 49 49 $ScriptName = $_SERVER['REQUEST_URI']; 50 50 else $ScriptName = ''; 51 while (strpos($ScriptName, '//') !== false)51 while (strpos($ScriptName, '//') !== false) 52 52 $ScriptName = str_replace('//', '/', $ScriptName); 53 if (strpos($ScriptName, '?') !== false)53 if (strpos($ScriptName, '?') !== false) 54 54 $ScriptName = substr($ScriptName, 0, strrpos($ScriptName, '?')); 55 55 $ScriptName = substr($ScriptName, strlen($this->System->Link(''))); 56 if (substr($ScriptName, -1, 1) == '/') $ScriptName = substr($ScriptName, 0, -1);56 if (substr($ScriptName, -1, 1) == '/') $ScriptName = substr($ScriptName, 0, -1); 57 57 58 58 $Output = ''; 59 while ($Page)59 while ($Page) 60 60 { 61 61 $Output = ' > <a href="'.$this->System->Link($ScriptName).'/">'.$Page->ShortTitle.'</a>'.$Output; 62 62 63 if (class_exists($Page->ParentClass))63 if (class_exists($Page->ParentClass)) 64 64 { 65 65 $PageClass = $Page->ParentClass; … … 69 69 } 70 70 $Output = substr($Output, 6); 71 return ($Output);71 return $Output; 72 72 } 73 73 … … 80 80 81 81 $BodyParam = ''; 82 if (isset($Page->Load)) $BodyParam .= ' onload="'.$Page->Load.'"';83 if (isset($Page->Unload)) $BodyParam .= ' onunload="'.$Page->Unload.'"';82 if (isset($Page->Load)) $BodyParam .= ' onload="'.$Page->Load.'"'; 83 if (isset($Page->Unload)) $BodyParam .= ' onunload="'.$Page->Unload.'"'; 84 84 $Output = '<?xml version="1.0" encoding="'.$this->Encoding.'"?>'."\n". 85 85 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'. … … 96 96 // Show page headers 97 97 $Bar = ''; 98 foreach ($this->System->PageHeaders as $Item)98 foreach ($this->System->PageHeaders as $Item) 99 99 $Output .= call_user_func($Item); 100 100 101 101 $Output .= '</head><body'.$BodyParam.'>'; 102 102 $Output .= $this->System->ShowMenu(); 103 if ($this->BasicHTML == false)103 if ($this->BasicHTML == false) 104 104 { 105 105 //$Output .= '<div class="MainTitle">'.$Title.'</div>'; … … 107 107 $Output .= '<div class="MainTitle"><span class="MenuItem"><strong>Navigace :: </strong> '.$Navigation.'</span><div class="MenuItem2">'; 108 108 $Bar = ''; 109 foreach ($this->System->Bars['Top'] as $BarItem)109 foreach ($this->System->Bars['Top'] as $BarItem) 110 110 $Bar .= call_user_func($BarItem); 111 if (trim($Bar) != '') $Output .= $Bar;111 if (trim($Bar) != '') $Output .= $Bar; 112 112 else $Output .= ' '; 113 113 $Output .= '</div></div>'; 114 114 } 115 return ($Output);115 return $Output; 116 116 } 117 117 … … 122 122 $Time = round(GetMicrotime() - $ScriptTimeStart, 2); 123 123 $Output = ''; 124 if ($this->BasicHTML == false)124 if ($this->BasicHTML == false) 125 125 { 126 126 $Output .= '<div class="Footer">'. … … 129 129 $Output .= ' <a href="https://app.zdechov.net/tanec/">Zdrojový kód</a> '; 130 130 //$Output .= ' Verze: '.$Revision.' ('.HumanDate($ReleaseTime).') '; 131 if ($this->ShowRuntimeInfo == true)131 if ($this->ShowRuntimeInfo == true) 132 132 { 133 133 $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s '. … … 137 137 } 138 138 $Output .= '</body></html>'; 139 return ($Output);139 return $Output; 140 140 } 141 141 … … 145 145 146 146 $Output = $Page->Show(); 147 if ($Page->ClearPage == false)147 if ($Page->ClearPage == false) 148 148 { 149 149 $Output = $this->ShowHeader($Page).$Output.$this->ShowFooter(); 150 if ($this->FormatHTML == true) $Output = $this->FormatOutput($Output);151 } 152 return ($Output);150 if ($this->FormatHTML == true) $Output = $this->FormatOutput($Output); 151 } 152 return $Output; 153 153 } 154 154 … … 159 159 $Page->Database = $this->Database; 160 160 $Page->FormatHTML = $this->FormatHTML; 161 return ($Page);161 return $Page; 162 162 } 163 163 … … 168 168 $nn = 0; 169 169 $n = 0; 170 while ($s != '')170 while ($s != '') 171 171 { 172 172 $start = strpos($s, '<'); 173 173 $end = strpos($s, '>'); 174 if ($start != 0)174 if ($start != 0) 175 175 { 176 176 $end = $start - 1; … … 178 178 } 179 179 $line = trim(substr($s, $start, $end + 1)); 180 if (strlen($line) > 0)181 if ($line[0] == '<')182 { 183 if ($s[$start + 1] == '/')180 if (strlen($line) > 0) 181 if ($line[0] == '<') 182 { 183 if ($s[$start + 1] == '/') 184 184 { 185 185 $n = $n - 2; … … 187 187 } else 188 188 { 189 if (strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1);189 if (strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1); 190 190 else $cmd = substr($line, 1, strlen($line) - 2); 191 191 //echo('['.$cmd.']'); 192 if (strpos($s, '</'.$cmd.'>')) $n = $n + 2;192 if (strpos($s, '</'.$cmd.'>')) $n = $n + 2; 193 193 } 194 194 }// else $line = '['.$line.']'; 195 //if ($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n"));196 if ($line != '') $out .= (str_repeat(' ', $nn).$line."\n");195 //if ($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n")); 196 if ($line != '') $out .= (str_repeat(' ', $nn).$line."\n"); 197 197 $s = substr($s, $end + 1, strlen($s)); 198 198 $nn = $n; 199 199 } 200 return ($out);200 return $out; 201 201 } 202 202 }
Note:
See TracChangeset
for help on using the changeset viewer.