- Timestamp:
- Jun 14, 2012, 12:04:49 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/class/Gui.php
r8 r9 18 18 $this->Messages = new Messages(); 19 19 $this->Language = new Language(); 20 $this->Feedback();20 21 21 $this->InitLinks(); 22 22 $this->InitPages(); 23 24 //have to be after inicialization of pages 25 $this->Feedback(); 23 26 } 24 27 … … 35 38 } 36 39 40 //gets feedback from post and get 41 private function Feedback() { 42 $this->Messages->GetPost(); 43 $this->Messages->GetGet(); 44 $this->ActivePage = $this->Messages->WhichPage($this->Pages); 45 } 46 37 47 //shows page concent 38 48 public function ShowPage() { … … 45 55 } 46 56 47 //gets feedback from post and get48 private function Feedback() {49 $this->ActivePage = $this->Messages->WhichPage();50 $this->Messages->GetPost();51 $this->Messages->GetGet();52 }53 54 57 55 58 //shows header of web page -
trunk/class/Messages.php
r7 r9 20 20 21 21 //returns actual page 22 public function WhichPage() { 23 return 'home'; 22 public function WhichPage($Pages) { 23 foreach($Pages as $Key => $Page ) 24 { 25 if ( isset($_GET[$Page->GetKey()]) ) { 26 return $Page->GetKey(); 27 } 28 } 29 if ($_GET == array()) return 'home'; 30 return 'notfound'; 24 31 } 25 32 //returns -
trunk/class/Page.php
r8 r9 7 7 { 8 8 protected $Content = 'ggg'; 9 protected $Title = '';10 9 protected $Language; 10 protected $Key; 11 public $Link; 11 12 12 function __construct($ Language)13 function __construct($Key,$Language) 13 14 { 14 15 $this->Language = $Language; 15 print_r($this->Language->Texts); 16 $Name = $Language->Texts[$Key]['name']; 17 $Title = $Language->Texts[$Key]['title']; 18 $Addres = '?'.$Key; 19 $this->Key = $Key; 20 $this->Link = new Link($Name,$Addres,$Title); 16 21 } 17 22 … … 26 31 } 27 32 33 //Get key of page 34 public function GetKey() { 35 return $this->Key; 36 } 37 28 38 //sets title of page 29 39 protected function SetTitle($Title) { 30 $this-> Title = $Title;40 $this->Link->Title = $Title; 31 41 } 32 42 -
trunk/class/PageHome.php
r8 r9 8 8 class PageHome extends Page 9 9 { 10 /* 11 function __construct($ __)10 11 function __construct($Language) 12 12 { 13 parent::__construct( $__);13 parent::__construct('home',$Language); 14 14 } 15 */15 16 16 protected function Generate() { 17 17 //generation of the page 18 parent::Generate($this->Language->Texts['home']['content']); 19 parent::SetTitle($this->Language->Texts['home']['title']); 18 parent::Generate($this->Language->Texts['home']['content'].' '.$this->Link->Get()); 20 19 21 20 } -
trunk/cs_lang.php
r8 r9 4 4 5 5 $Texts = array( 6 'home' => array( 6 'home' => array( //key page 7 7 'title' => 'Ãvodnà stránka', 8 'name' => 'Ãvodnà stránka', 8 9 'content' => 'Toto je úvodnà stránka' 9 10
Note:
See TracChangeset
for help on using the changeset viewer.