source: trunk/class/Gui.php@ 8

Last change on this file since 8 was 8, checked in by maron, 13 years ago

podpora jazyků

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