Ignore:
Timestamp:
Jan 9, 2016, 11:10:49 AM (9 years ago)
Author:
chronos
Message:
  • Modified: Page class separated to basic Page class and to BaseView class which is project specific.
  • Fixed: RSS channel list was not displayed.
  • Modified: Database updates specific for project moved to Application directory.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Application/View.php

    r780 r782  
    33define('PAGE_NOT_FOUND', 'Stránka nenalezena');
    44
    5 class Page extends Model
     5class BaseView extends View
    66{
    77  var $TimeStart;
     
    3636  }
    3737
    38   function Show()
    39   {
    40     return('');
    41   }
    42 
    4338  function SystemMessage($Title, $Text)
    4439  {
     
    4843  }
    4944
    50   function ShowHeader($Title, $Path)
     45  function ShowNavigation($Page)
    5146  {
    5247    if(array_key_exists('REQUEST_URI', $_SERVER))
     
    5954    $ScriptName = substr($ScriptName, strlen($this->System->Link('')));
    6055    if(substr($ScriptName, -1, 1) == '/') $ScriptName = substr($ScriptName, 0, -1);
    61     $Page = $this;
    62     $Navigation = '';
     56
     57    $Output = '';
    6358    while($Page)
    6459    {
    65       $Navigation = ' &gt; <a href="'.$this->System->Link($ScriptName).'/">'.$Page->ShortTitle.'</a>'.$Navigation;
     60      $Output = ' &gt; <a href="'.$this->System->Link($ScriptName).'/">'.$Page->ShortTitle.'</a>'.$Output;
    6661
    6762      if(class_exists($Page->ParentClass))
     
    7267      } else $Page = null;
    7368    }
    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);
    7579
    7680    $BodyParam = '';
     
    8387    '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->Encoding.'" />'.
    8488    '<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.'>';
    8792    if($this->BasicHTML == false)
    8893    {
     
    118123  }
    119124
    120   function GetOutput()
     125  function GetOutput($Page)
    121126  {
    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)
    128129    {
    129       $Output = $this->ShowHeader($this->FullTitle, $this->ShortTitle).$Output;
    130       $Output .= $this->ShowFooter();
     130      $Output = $this->ShowHeader($Page).$Output.$this->ShowFooter();
    131131      if($this->FormatHTML == true) $Output = $this->FormatOutput($Output);
    132132    }
    133     echo($Output);
     133    return($Output);
    134134  }
    135135
Note: See TracChangeset for help on using the changeset viewer.