Changeset 6
- Timestamp:
- Jun 13, 2012, 10:16:46 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/class/Database.php
r5 r6 15 15 var $ShowSQLError = false; 16 16 17 function __construct( $Config)17 function __construct() 18 18 { 19 include_once('Config.php'); 20 $this->Config = $Config; 19 $this->Config = new Config(); 21 20 $this->Database->HostName = $this->Config->Database['Host']; 22 21 $this->Database->UserName = $this->Config->Database['User']; -
trunk/class/Gui.php
r5 r6 2 2 3 3 // Grafic user interface class 4 // Date: 2012-06-1 24 // Date: 2012-06-13 5 5 6 6 class Gui 7 7 { 8 var $Config; 9 var $Links = array( 10 'SourceCode' => 'http://svn.zdechov.net/svn/phpvpsadmin/', 11 ); 12 var $LinksNames = array( 13 'SourceCode' => 'Zdrojové kódy', 14 ); 8 private $Config; 9 private $Messages; 10 private $ActivePage = 'home'; 11 private $Links = array(); 12 private $Pages = array(); 15 13 16 function __construct( $Config)14 function __construct() 17 15 { 18 include_once('Config.php'); 19 $this->Config = $Config; 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 20 27 } 21 28 22 function Link($key) { 23 return '<a href="'.$this->Links[$key].'">'.$this->LinksNames[$key].'</a>'; 24 return '<a href="'.$this->Links[$key].'">'.$this->LinksNames[$key].'</a>'; 29 //init Pages 30 private function InitPages() { 31 $this->Pages['home'] = new PageHome(); 32 25 33 } 26 34 27 function ShowHeader() 28 { 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 { 29 56 30 57 echo('<?xml version="1.0" encoding="'.$this->Config->Web['Charset'].'"?> … … 41 68 echo('<title>'.$this->Config->Web['Title'].'</title></head><body><table><tr><td>'); 42 69 43 }70 } 44 71 45 function ShowFooter() 46 { 72 //shows footer of webpage 73 private function ShowFooter() 74 { 47 75 echo('</td>'. 48 76 '</tr><tr>'. 49 '<td colspan="4" class="page-bottom">AutoÅi: '.$this->Config->Web['Authors'].' '.$this->Link('SourceCode').' '. 50 '<a href="http://wowpreklad.zdechov.net/trac/wowpreklad/log/trunk?verbose=on">Novinky</a> '); 77 '<td colspan="4" class="page-bottom">AutoÅi: '.$this->Config->Web['Authors'].' '.$this->Links['SourceCode']->Get().''); 51 78 52 79 echo('</td></tr>'); … … 54 81 '</body>'. 55 82 '</html>'); 56 }83 } 57 84 58 85 } -
trunk/index.php
r5 r6 16 16 } 17 17 18 include_once('class/Config.php'); 19 $Config = new Config(); 20 $Database = new Database($Config); 21 $Gui = new Gui($Config); 18 $Database = new Database(); 19 $Gui = new Gui(); 22 20 23 $Gui->ShowHeader(); 24 $Gui->ShowFooter(); 21 $Gui->ShowPage(); 25 22 26 echo 'hello world!';23 27 24 ?>
Note:
See TracChangeset
for help on using the changeset viewer.