Changeset 880 for trunk/Application/View.php
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/View.php
r864 r880 9 9 //$Output .= ' <form action="?setlocale" method="get">'; 10 10 $Output = ' <select onchange="window.location=this.value">'; 11 foreach ($this->System->LocaleManager->Available as $Locale)11 foreach ($this->System->LocaleManager->Available as $Locale) 12 12 { 13 13 $Remaining = substr($_SERVER["REQUEST_URI"], strlen($this->System->BaseURL)); 14 if (substr($Remaining, 1, strlen($Locale['Code'].'/')) == $this->System->LocaleManager->LangCode.'/')14 if (substr($Remaining, 1, strlen($Locale['Code'].'/')) == $this->System->LocaleManager->LangCode.'/') 15 15 $Remaining = substr($Remaining, strlen('/'.$Locale['Code'])); 16 if ($Locale['Code'] == $this->System->LocaleManager->CurrentLocale->Texts->Code) $Selected = ' selected="selected"';16 if ($Locale['Code'] == $this->System->LocaleManager->CurrentLocale->Texts->Code) $Selected = ' selected="selected"'; 17 17 else $Selected = ''; 18 18 $Remaining = $this->System->TranslateReverseURL($Remaining, $this->System->LocaleManager->LangCode); … … 23 23 $Output .= '</select><noscript><span><input type="submit" value="Submit"/></span></noscript>'; 24 24 25 return ($Output);25 return $Output; 26 26 } 27 27 … … 29 29 { 30 30 $Output = '<div class="Menu">'; 31 if (isset($this->System->User))31 if (isset($this->System->User)) 32 32 { 33 if (!$this->System->User->Licence(LICENCE_USER))33 if (!$this->System->User->Licence(LICENCE_USER)) 34 34 $Output .= '<div class="advert">'.$this->System->Config['Web']['Advertisement'].'</div>'; 35 35 } … … 38 38 // Show bars items 39 39 $Bar = ''; 40 foreach ($this->System->Bars['Top'] as $BarItem)40 foreach ($this->System->Bars['Top'] as $BarItem) 41 41 $Bar .= call_user_func($BarItem); 42 if (trim($Bar) != '') $Output .= $Bar;42 if (trim($Bar) != '') $Output .= $Bar; 43 43 else $Output .= ' '; 44 44 … … 46 46 //$Output .= '</form>'; 47 47 $Output .= '</span></div>'; 48 return ($Output);48 return $Output; 49 49 } 50 50 … … 53 53 $Output = '<strong>'.T('Menu').':</strong>'. 54 54 '<div class="verticalmenu"><ul>'; 55 foreach ($this->System->Menu as $MenuItem)56 if (!isset($this->System->User) or $this->System->User->Licence($MenuItem['Permission']))55 foreach ($this->System->Menu as $MenuItem) 56 if (!isset($this->System->User) or $this->System->User->Licence($MenuItem['Permission'])) 57 57 { 58 if (isset($MenuItem['Click'])) $OnClick = ' onclick="'.$MenuItem['Click'].'"';58 if (isset($MenuItem['Click'])) $OnClick = ' onclick="'.$MenuItem['Click'].'"'; 59 59 else $OnClick = ''; 60 if ($MenuItem['Icon'] != '') $Icon = '<img src="'.$this->System->Link('/images/menu/'.$MenuItem['Icon']).'"/>';60 if ($MenuItem['Icon'] != '') $Icon = '<img src="'.$this->System->Link('/images/menu/'.$MenuItem['Icon']).'"/>'; 61 61 else $Icon = ''; 62 62 $Output .= '<li>'.$Icon.'<a class="verticalmenua" title="'.$MenuItem['Hint'].'" href="'. … … 64 64 } 65 65 $Output .= '</ul></div>'; 66 return ($Output);66 return $Output; 67 67 } 68 68 … … 83 83 // Show page headers 84 84 $Bar = ''; 85 foreach ($this->System->PageHeaders as $Item)85 foreach ($this->System->PageHeaders as $Item) 86 86 $Output .= call_user_func($Item); 87 87 88 88 $Title = $this->System->Config['Web']['Title']; 89 if ($this->Title != '') $Title = $this->Title.' - '.$Title;89 if ($this->Title != '') $Title = $this->Title.' - '.$Title; 90 90 $Output .= '<title>'.$Title.'</title>'. 91 91 '<script src="'.$this->System->Link('/style/respond.js').'"></script>'. … … 98 98 // Show bars items 99 99 $Bar = ''; 100 foreach ($this->System->Bars['Left'] as $BarItem)100 foreach ($this->System->Bars['Left'] as $BarItem) 101 101 $Bar .= call_user_func($BarItem); 102 if (trim($Bar) != '') $Output .= $Bar;102 if (trim($Bar) != '') $Output .= $Bar; 103 103 else $Output .= ' '; 104 104 105 105 $Output .= '</td><td id="border-left"></td><td class="content">'; 106 return ($Output);106 return $Output; 107 107 } 108 108 … … 117 117 // Show bars items 118 118 $Bar = ''; 119 foreach ($this->System->Bars['Right'] as $BarItem)119 foreach ($this->System->Bars['Right'] as $BarItem) 120 120 $Bar .= call_user_func($BarItem); 121 if (trim($Bar) != '') $Output .= $Bar;121 if (trim($Bar) != '') $Output .= $Bar; 122 122 else $Output .= ' '; 123 123 $Output .= '</td>'; … … 129 129 130 130 $Output .= '</td></tr>'; 131 if ($this->System->Config['Web']['ShowRuntimeInfo'] == true)131 if ($this->System->Config['Web']['ShowRuntimeInfo'] == true) 132 132 $Output .= '<tr><td colspan="3" style="text-align: center;">'.T('Generating duration').': '. 133 133 $ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s '.T('Used memory').': '. … … 137 137 '</body>'. 138 138 '</html>'; 139 return ($Output);139 return $Output; 140 140 } 141 141 … … 143 143 { 144 144 $Output = $this->ShowHeader().$Content.$this->ShowFooter(); 145 if ($this->System->Config['Web']['FormatOutput'])145 if ($this->System->Config['Web']['FormatOutput']) 146 146 $Output = $this->FormatOutput($Output); 147 return ($Output);147 return $Output; 148 148 } 149 149 … … 153 153 $nn = 0; 154 154 $n = 0; 155 while ($s != '')155 while ($s != '') 156 156 { 157 157 $start = strpos($s, '<'); 158 158 $end = strpos($s, '>'); 159 if ($start != 0)159 if ($start != 0) 160 160 { 161 161 $end = $start - 1; … … 163 163 } 164 164 $line = trim(substr($s, $start, $end + 1)); 165 if (strlen($line) > 0)166 if ($line[0] == '<')165 if (strlen($line) > 0) 166 if ($line[0] == '<') 167 167 { 168 if ($s[$start + 1] == '/')168 if ($s[$start + 1] == '/') 169 169 { 170 170 $n = $n - 2; … … 172 172 } else 173 173 { 174 if (strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1);174 if (strpos($line, ' ')) $cmd = substr($line, 1, strpos($line, ' ') - 1); 175 175 else $cmd = substr($line, 1, strlen($line) - 2); 176 176 //echo('['.$cmd.']'); 177 if (strpos($s, '</'.$cmd.'>')) $n = $n + 2;177 if (strpos($s, '</'.$cmd.'>')) $n = $n + 2; 178 178 } 179 179 }// else $line = '['.$line.']'; 180 //if ($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n"));181 if ($nn < 0) $nn = 0;182 if ($line != '') $out .= (str_repeat(' ', $nn).$line."\n");180 //if ($line != '') echo(htmlspecialchars(str_repeat(' ',$nn).$line."\n")); 181 if ($nn < 0) $nn = 0; 182 if ($line != '') $out .= (str_repeat(' ', $nn).$line."\n"); 183 183 $s = substr($s, $end + 1, strlen($s)); 184 184 $nn = $n; 185 185 } 186 return ($out);186 return $out; 187 187 } 188 188 }
Note:
See TracChangeset
for help on using the changeset viewer.