Changeset 782 for trunk/Application
- Timestamp:
- Jan 9, 2016, 11:10:49 AM (9 years ago)
- Location:
- trunk/Application
- Files:
-
- 1 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/System.php
r781 r782 7 7 include_once(dirname(__FILE__).'/../Common/Global.php'); 8 8 include_once(dirname(__FILE__).'/FormClasses.php'); 9 include_once(dirname(__FILE__).'/FullInstall.php'); 10 include_once(dirname(__FILE__).'/UpdateTrace.php'); 11 include_once(dirname(__FILE__).'/View.php'); 9 12 10 13 class Core extends Application … … 80 83 function ShowPage() 81 84 { 85 $this->BaseView = new BaseView($this); 86 82 87 /* @var $Page Page */ 83 88 $ClassName = $this->SearchPage($this->PathItems, $this->Pages); … … 85 90 { 86 91 $Page = new $ClassName($this); 87 $Page->GetOutput();88 92 } else { 89 93 $Page = new PageMissing($this); 90 $Page->GetOutput();91 }94 } 95 echo($this->BaseView->GetOutput($Page)); 92 96 } 93 97 … … 99 103 function AddModule($Module) 100 104 { 101 //echo('Přidávám modul '.get_class($Module).'<br />');102 105 $this->Modules[get_class($Module)] = $Module; 103 106 } -
trunk/Application/View.php
r780 r782 3 3 define('PAGE_NOT_FOUND', 'Stránka nenalezena'); 4 4 5 class Page extends Model5 class BaseView extends View 6 6 { 7 7 var $TimeStart; … … 36 36 } 37 37 38 function Show()39 {40 return('');41 }42 43 38 function SystemMessage($Title, $Text) 44 39 { … … 48 43 } 49 44 50 function Show Header($Title, $Path)45 function ShowNavigation($Page) 51 46 { 52 47 if(array_key_exists('REQUEST_URI', $_SERVER)) … … 59 54 $ScriptName = substr($ScriptName, strlen($this->System->Link(''))); 60 55 if(substr($ScriptName, -1, 1) == '/') $ScriptName = substr($ScriptName, 0, -1); 61 $Page = $this; 62 $ Navigation= '';56 57 $Output = ''; 63 58 while($Page) 64 59 { 65 $ Navigation = ' > <a href="'.$this->System->Link($ScriptName).'/">'.$Page->ShortTitle.'</a>'.$Navigation;60 $Output = ' > <a href="'.$this->System->Link($ScriptName).'/">'.$Page->ShortTitle.'</a>'.$Output; 66 61 67 62 if(class_exists($Page->ParentClass)) … … 72 67 } else $Page = null; 73 68 } 74 $Navigation = substr($Navigation, 6); 69 $Output = substr($Output, 6); 70 return($Output); 71 } 72 73 function ShowHeader($Page) 74 { 75 $Title = $Page->FullTitle; 76 $Path = $Page->ShortTitle; 77 78 $Navigation = $this->ShowNavigation($Page); 75 79 76 80 $BodyParam = ''; … … 83 87 '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->Encoding.'" />'. 84 88 '<script type="text/javascript" src="'.$this->System->Link('/style/').$this->Style.'/global.js"></script>'. 85 '<title>'.$this->System->Config['Web']['Title'].' - '.$Path.'</title> 86 </head><body'.$BodyParam.'>'; 89 '<title>'.$this->System->Config['Web']['Title'].' - '.$Path.'</title>'; 90 $Output .= $this->System->ModuleManager->Modules['RSS']->ShowRSSHeader(); 91 $Output .= '</head><body'.$BodyParam.'>'; 87 92 if($this->BasicHTML == false) 88 93 { … … 118 123 } 119 124 120 function GetOutput( )125 function GetOutput($Page) 121 126 { 122 //try { 123 $Output = $this->Show(); 124 //} catch (Exception $E) { 125 // $Output = 'Chyba: '.$E->getMessage(); 126 //} 127 if($this->ClearPage == false) 127 $Output = $Page->Show(); 128 if($Page->ClearPage == false) 128 129 { 129 $Output = $this->ShowHeader($this->FullTitle, $this->ShortTitle).$Output; 130 $Output .= $this->ShowFooter(); 130 $Output = $this->ShowHeader($Page).$Output.$this->ShowFooter(); 131 131 if($this->FormatHTML == true) $Output = $this->FormatOutput($Output); 132 132 } 133 echo($Output);133 return($Output); 134 134 } 135 135
Note:
See TracChangeset
for help on using the changeset viewer.