1 | <?php
|
---|
2 |
|
---|
3 | // Grafic user interface class
|
---|
4 | // Date: 2012-06-13
|
---|
5 |
|
---|
6 | class Gui
|
---|
7 | {
|
---|
8 | private $Config;
|
---|
9 | private $Messages;
|
---|
10 | private $ActivePage = 'home';
|
---|
11 | private $Links = array();
|
---|
12 | private $Pages = array();
|
---|
13 |
|
---|
14 | function __construct()
|
---|
15 | {
|
---|
16 | $this->Config = new Config();
|
---|
17 | $this->Messages = new Messages();
|
---|
18 | $this->Feedback();
|
---|
19 | $this->InitLinks();
|
---|
20 | $this->InitPages();
|
---|
21 | }
|
---|
22 |
|
---|
23 | //init links
|
---|
24 | private function InitLinks() {
|
---|
25 | $this->Links['SourceCode'] = new Link('Zdrojové kódy','http://svn.zdechov.net/svn/phpvpsadmin/','');
|
---|
26 |
|
---|
27 | }
|
---|
28 |
|
---|
29 | //init Pages
|
---|
30 | private function InitPages() {
|
---|
31 | $this->Pages['home'] = new PageHome();
|
---|
32 |
|
---|
33 | }
|
---|
34 |
|
---|
35 | //shows page concent
|
---|
36 | public function ShowPage() {
|
---|
37 | $this->ShowHeader();
|
---|
38 |
|
---|
39 | //generate and shows active page
|
---|
40 | $this->Pages[$this->ActivePage]->Show();
|
---|
41 |
|
---|
42 | $this->ShowFooter();
|
---|
43 | }
|
---|
44 |
|
---|
45 | //gets feedback from post and get
|
---|
46 | private function Feedback() {
|
---|
47 | $this->ActivePage = $this->Messages->WhichPage();
|
---|
48 | $this->Messages->GetPost();
|
---|
49 | $this->Messages->GetGet();
|
---|
50 | }
|
---|
51 |
|
---|
52 |
|
---|
53 | //shows header of web page
|
---|
54 | private function ShowHeader()
|
---|
55 | {
|
---|
56 |
|
---|
57 | echo('<?xml version="1.0" encoding="'.$this->Config->Web['Charset'].'"?>
|
---|
58 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
---|
59 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cz">'.
|
---|
60 | '<head>'.
|
---|
61 | '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->Config->Web['Charset'].'" />'.
|
---|
62 | '<meta name="keywords" content="virtualizace, virtuálnÃ, server, hosting, webhosting, web" />'.
|
---|
63 | '<meta name="description" content="'.$this->Config->Web['Title'].'" />'.
|
---|
64 | '<meta name="robots" content="all" />'.
|
---|
65 | '<link rel="stylesheet" href="'.$this->Config->Web['Style'].'" type="text/css" media="all" />'.
|
---|
66 | '<script type="text/javascript" src="'.$this->Config->Web['Script'].'"></script>'.
|
---|
67 | '<link rel="shortcut icon" href="'.$this->Config->Web['Icon'].'" />');
|
---|
68 | echo('<title>'.$this->Config->Web['Title'].'</title></head><body><table><tr><td>');
|
---|
69 |
|
---|
70 | }
|
---|
71 |
|
---|
72 | //shows footer of webpage
|
---|
73 | private function ShowFooter()
|
---|
74 | {
|
---|
75 | echo('</td>'.
|
---|
76 | '</tr><tr>'.
|
---|
77 | '<td colspan="4" class="page-bottom">AutoÅi: '.$this->Config->Web['Authors'].' '.$this->Links['SourceCode']->Get().'');
|
---|
78 |
|
---|
79 | echo('</td></tr>');
|
---|
80 | echo('</table>'.
|
---|
81 | '</body>'.
|
---|
82 | '</html>');
|
---|
83 | }
|
---|
84 |
|
---|
85 | }
|
---|
86 | ?>
|
---|