source: branches/mvc/Application/CustomOutput.php

Last change on this file was 59, checked in by chronos, 10 years ago
  • Moved trunk as mvc branch.
File size: 3.0 KB
Line 
1<?php
2
3include_once(dirname(__FILE__).'/../Base/Output.php');
4
5class CustomOutput extends Output
6{
7 var $Load = '';
8 var $Unload = '';
9 var $Document;
10 var $Title = '';
11 var $FullPage = true;
12
13 function Header()
14 {
15 $Tag = new XMLTag('div');
16 $Tag->Attributes = array('class' => 'Header');
17 $Tag->SubElements = ' ';
18 return($Tag);
19 }
20
21 function Footer()
22 {
23 $Time = round($this->System->GetMicrotime() - $this->System->TimeStart, 2);
24 $Tag = new XMLTag('ul');
25 $Tag->Attributes = array('class' => 'Footer');
26 $AdminTag = new XMLTag('li');
27 $AdminTag->SubElements = $this->Config['System']['Admin'];
28 $EmailTag = new XMLTag('li');
29 $EmailTag->SubElements = $this->Config['System']['AdminEmail'];
30 $Tag->SubElements = array($AdminTag, $EmailTag);
31 if($this->Config['System']['ShowRuntimeInfo'] == true)
32 {
33 $ExecutionTimeTag = new XMLTag('li');
34 $ExecutionTimeTag->SubElements = 'Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s';
35 $Tag->SubElements[] = $ExecutionTimeTag;
36 $UsedMemoryTag = new XMLTag('li');
37 $PrefixMultiplier = new PrefixMultiplier();
38 $UsedMemoryTag->SubElements = 'Použitá paměť: '.$PrefixMultiplier->Add(memory_get_peak_usage(FALSE), 'B').' / '.ini_get('memory_limit').'B';
39 $Tag->SubElements[] = $UsedMemoryTag;
40 }
41 return($Tag);
42 }
43
44 function Show($Content)
45 {
46 if($this->FullPage)
47 {
48 $this->Document = new XHTMLDocument();
49 $BodyParam = '';
50 if($this->Load != '') $BodyParam .= ' onload="'.$this->Load.'"';
51 if($this->Unload != '') $BodyParam .= ' onunload="'.$this->Unload.'"';
52 $this->Document->Encoding = $this->Config['System']['Charset'];
53 $this->Document->Formated = $this->Config['System']['FormatHTML'];
54 $Style = new XMLTag('link');
55 $Style->Attributes = array('rel' => 'stylesheet', 'href' => 'Application/Style/'.$this->Config['System']['Style'].'/Style.css',
56 'type' => 'text/css', 'media' => 'all');
57 $this->Document->HeadTag->SubElements[] = $Style;
58 $JavaScript = new XMLTag('script');
59 $JavaScript->Attributes = array('type' => 'text/javascript', 'src' => 'Application/Style/'.$this->Config['System']['Style'].'/Global.js');
60 $JavaScript->ShringEmpty = false;
61 $this->Document->HeadTag->SubElements[] = $JavaScript;
62 $JavaScript = new XMLTag('script');
63 $JavaScript->Attributes = array('type' => 'text/javascript', 'src' => 'Base/Style/jquery.js');
64 $JavaScript->ShringEmpty = false;
65 $this->Document->HeadTag->SubElements[] = $JavaScript;
66 $this->Document->TitleTag->SubElements = $this->Config['System']['Title'].' - '.$this->Title;
67 $this->Document->BodyTag->SubElements = array($this->Header(), $Content, $this->Footer());
68 echo($this->Document->GetOutput());
69 } else echo($Content);
70 }
71
72 function SystemMessage($Text)
73 {
74 return('<table align="center"><tr><td><div class="SystemMessage"><h3>Systémová zpráva</h3><div>'.$Text.'</div></div</td></tr></table>');
75 }
76}
Note: See TracBrowser for help on using the repository browser.