1 | <?php
|
---|
2 |
|
---|
3 | class PageView extends View
|
---|
4 | {
|
---|
5 | var $TimeStart;
|
---|
6 | var $ShortTitle;
|
---|
7 | var $FullTitle;
|
---|
8 | var $Load;
|
---|
9 | var $Unload;
|
---|
10 | var $Content;
|
---|
11 |
|
---|
12 | function ShowHeader($Title, $Path)
|
---|
13 | {
|
---|
14 | $BodyParam = '';
|
---|
15 | if($this->Load != '') $BodyParam .= ' onload="'.$this->Load.'"';
|
---|
16 | if($this->Unload != '') $BodyParam .= ' onunload="'.$this->Unload.'"';
|
---|
17 | $Output = '<?xml version="1.0" encoding="'.$this->Config['Web']['Charset'].'"?>'."\n".
|
---|
18 | '<!DOCTYPE html>'.
|
---|
19 | '<html>'.
|
---|
20 | '<head><link rel="stylesheet" href="Application/Style/Style.css" type="text/css" media="all" />'.
|
---|
21 | '<meta http-equiv="content-type" content="text/html; charset='.$this->Config['Web']['Charset'].'" />'.
|
---|
22 | '<script type="text/javascript" src="Application/Style/Global.js"></script>'.
|
---|
23 | '<title>'.$this->Config['Web']['Title'].' - '.$Path.'</title>
|
---|
24 | </head><body'.$BodyParam.'>';
|
---|
25 | return($Output);
|
---|
26 | }
|
---|
27 |
|
---|
28 | function ShowFooter()
|
---|
29 | {
|
---|
30 | global $ScriptTimeStart;
|
---|
31 |
|
---|
32 | $Time = round($this->System->GetMicrotime() - $ScriptTimeStart, 2);
|
---|
33 | $Output = '<div class="Footer">
|
---|
34 | <ul><li>Založeno na projektu <a href="http://svn.zdechov.net/trac/statistic/">Statistika</a></li>'.
|
---|
35 | '<li><a href="http://svn.zdechov.net/trac/statistic/browser">Zdrojové kódy</a></li>'.
|
---|
36 | '<li><a href="http://svn.zdechov.net/trac/statistic/log?verbose=on">Novinky</a></li>'.
|
---|
37 | '<li>Správce: '.$this->Config['Web']['Admin'].'</li>'.
|
---|
38 | '<li>E-mail: '.$this->Config['Web']['AdminEmail'].'</li>';
|
---|
39 | if($this->Config['Web']['ShowRuntimeInfo'] == true) $Output .= '<li>Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s</li><li>Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B</li>';
|
---|
40 | $Output .= '</ul></div></body></html>';
|
---|
41 | return($Output);
|
---|
42 | }
|
---|
43 |
|
---|
44 | function GetOutput($Content)
|
---|
45 | {
|
---|
46 | global $Config;
|
---|
47 |
|
---|
48 | $Output = $this->ShowHeader($this->FullTitle, $this->ShortTitle).$Content;
|
---|
49 | $Output .= $this->ShowFooter();
|
---|
50 | $Html = new Html();
|
---|
51 | if($Config['Web']['FormatHTML'] == true) echo($Html->FormatOutput($Output));
|
---|
52 | else echo($Output);
|
---|
53 | }
|
---|
54 |
|
---|
55 | function SystemMessage($Text)
|
---|
56 | {
|
---|
57 | return('<table align="center"><tr><td><div class="SystemMessage"><h3>Systémová zpráva</h3><div>'.$Text.'</div></div</td></tr></table>');
|
---|
58 | //ShowFooter();
|
---|
59 | //die();
|
---|
60 | }
|
---|
61 |
|
---|
62 | function AccessDenied()
|
---|
63 | {
|
---|
64 | return($this->GetOutput($this->SystemMessage($this->System->Translate('AccessDenied'))));
|
---|
65 | }
|
---|
66 | }
|
---|