Changeset 782 for trunk/Application


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.
Location:
trunk/Application
Files:
1 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/Application/System.php

    r781 r782  
    77include_once(dirname(__FILE__).'/../Common/Global.php');
    88include_once(dirname(__FILE__).'/FormClasses.php');
     9include_once(dirname(__FILE__).'/FullInstall.php');
     10include_once(dirname(__FILE__).'/UpdateTrace.php');
     11include_once(dirname(__FILE__).'/View.php');
    912
    1013class Core extends Application
     
    8083  function ShowPage()
    8184  {
     85    $this->BaseView = new BaseView($this);
     86
    8287    /* @var $Page Page */
    8388    $ClassName = $this->SearchPage($this->PathItems, $this->Pages);
     
    8590    {
    8691      $Page = new $ClassName($this);
    87       $Page->GetOutput();
    8892    } else {
    8993      $Page = new PageMissing($this);
    90       $Page->GetOutput();
    91     }
     94    }
     95    echo($this->BaseView->GetOutput($Page));
    9296  }
    9397
     
    99103  function AddModule($Module)
    100104  {
    101     //echo('Přidávám modul '.get_class($Module).'<br />');
    102105    $this->Modules[get_class($Module)] = $Module;
    103106  }
  • 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.