source: trunk/Application/BaseView.php

Last change on this file was 10, checked in by chronos, 18 months ago
  • Fixed: More class type casting.
File size: 2.1 KB
Line 
1<?php
2
3class BaseView extends View
4{
5 function SystemMessage($Title, $Text)
6 {
7 return '<table align="center"><tr><td><div class="SystemMessage"><h3>'.$Title.'</h3><div>'.$Text.'</div></div></td></tr></table>';
8 }
9
10 function ShowPage($Content)
11 {
12 global $ReleaseTime, $Revision;
13
14 $Output = '<?xml version="1.0" encoding="'.Core::Cast($this->System)->Config['Web']['Charset'].'"?>'."\n".
15 '<!DOCTYPE html>'.
16 '<html>'.
17 '<head>'.
18 '<meta http-equiv="Content-Language" content="cs"/>'.
19 '<meta http-equiv="content-type" content="text/html; charset='.Core::Cast($this->System)->Config['Web']['Charset'].'" />'.
20 '<meta name="robots" content="all" />'.
21 '<title>'.Core::Cast($this->System)->Config['Web']['Title'].'</title>'.
22 '<link rel="StyleSheet" href="'.$this->System->Link('/style/basic/style.css').'" type="text/css" media="all"/>'.
23 implode("\n", Core::Cast($this->System)->HeadItems).
24 '</head><body>';
25 $Output .= $this->ShowHeader();
26 $Output .= $Content;
27 $Output .= '<br/><div style="text-align: center; font-size: small;">Verze: '.$Revision.' ('.HumanDate($ReleaseTime).')'.
28 ' &nbsp; <a href="https://app.zdechov.net/open2ride/browser/trunk">Zdrojový kód</a> &nbsp; '.
29 '<a href="https://app.zdechov.net/open2ride/log/trunk?verbose=on">Historie změn</a></div>';
30 $Output .= '</body></html>';
31 echo($Output);
32 }
33
34 function ShowHeader()
35 {
36 $Output = '<div>';
37 $Output .= '<div class="MenuItem">';
38 $Bar = '';
39 foreach (Core::Cast($this->System)->Bars['TopLeft'] as $BarItem)
40 $Bar .= call_user_func($BarItem);
41 if (trim($Bar) != '') $Output .= $Bar;
42 else $Output .= '&nbsp;';
43 $Output .= '</div><div class="MenuItem2">';
44 $Bar = '';
45 foreach (Core::Cast($this->System)->Bars['Top'] as $BarItem)
46 $Bar .= call_user_func($BarItem);
47 if (trim($Bar) != '') $Output .= $Bar;
48 else $Output .= '&nbsp;';
49 $Output .= '</div></div>';
50 return $Output;
51 }
52
53 function GetOutput($Page)
54 {
55 $Page->OnSystemMessage = array(Core::Cast($this->System)->BaseView, 'SystemMessage');
56 $Output = $this->ShowPage($Page->Show());
57 return $Output;
58 }
59}
60
Note: See TracBrowser for help on using the repository browser.