Changeset 590 for trunk/Common/Page.php


Ignore:
Timestamp:
Nov 2, 2013, 12:10:42 AM (11 years ago)
Author:
chronos
Message:
  • Opraveno: Chování systému při čisté instalaci bez aktivních modulů.
  • Upraveno: Seznam celkových aktualiací se nyní uchovává jako metoda třídy namísto globální proměnné. Moduly se totiž vkládají ve funkci a proměnná nebyla tedy globální.
  • Přidáno: Implementace metod Install a Uninstall modulů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Page.php

    r578 r590  
    1313  var $ShortTitle;
    1414  var $FullTitle;
     15  var $Encoding;
     16  var $Style;
    1517 
    1618  function __construct($System)
     
    1820    parent::__construct($System);
    1921   
    20     $this->FormatHTML = $this->System->Config['Web']['FormatHTML'];
    21     $this->ShowRuntimeInfo = $this->System->Config['Web']['ShowRuntimeInfo'];
     22    $this->FormatHTML = false;
     23    $this->ShowRuntimeInfo = false;
     24    $this->Encoding = 'utf-8';
     25    $this->Style = 'new';
     26   
     27    // TODO: Move to external code
     28    if(isset($this->System->Config['Web']['FormatHTML']))
     29      $this->FormatHTML = $this->System->Config['Web']['FormatHTML'];
     30    if(isset($this->System->Config['Web']['ShowRuntimeInfo']))
     31      $this->ShowRuntimeInfo = $this->System->Config['Web']['ShowRuntimeInfo'];
     32    if(isset($this->System->Config['Web']['Charset']))
     33      $this->Encoding = $this->System->Config['Web']['Charset'];
     34    if(isset($this->System->Config['Web']['Style']))
     35      $this->Style = $this->System->Config['Web']['Style'];
    2236  }
    2337 
     
    4862    {
    4963      $Navigation = ' &gt; <a href="'.$this->System->Link($ScriptName).'/">'.$Page->ShortTitle.'</a>'.$Navigation;
    50       
    51       if($Page->ParentClass != '')
     64     
     65      if(class_exists($Page->ParentClass))
    5266      {
    5367        $PageClass = $Page->ParentClass;
     
    6175    if(isset($this->Load)) $BodyParam .= ' onload="'.$this->Load.'"';
    6276    if(isset($this->Unload)) $BodyParam .= ' onunload="'.$this->Unload.'"';
    63     $Output = '<?xml version="1.0" encoding="'.$this->System->Config['Web']['Charset'].'"?>'."\n".
     77    $Output = '<?xml version="1.0" encoding="'.$this->Encoding.'"?>'."\n".
    6478    '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'.
    6579    '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">'.
    66     '<head><link rel="stylesheet" href="'.$this->System->Link('/style/').$this->System->Config['Web']['Style'].'/style.css" type="text/css" media="all" />'.
    67     '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->System->Config['Web']['Charset'].'" />'.
    68     '<script type="text/javascript" src="'.$this->System->Link('/style/').$this->System->Config['Web']['Style'].'/global.js"></script>'.
     80    '<head><link rel="stylesheet" href="'.$this->System->Link('/style/').$this->Style.'/style.css" type="text/css" media="all" />'.
     81    '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->Encoding.'" />'.
     82    '<script type="text/javascript" src="'.$this->System->Link('/style/').$this->Style.'/global.js"></script>'.
    6983    '<title>'.$this->System->Config['Web']['Title'].' - '.$Path.'</title>
    7084    </head><body'.$BodyParam.'>';
     
    7589      if($this->System->Config['Web']['UserSupport'] == 1)
    7690      {
    77         if($this->System->User->User['Id'] == null)
     91        if(isset($this->System->User) and ($this->System->User->User['Id'] == null))
    7892          $Output .= '<a href="'.$this->System->Link('/?Action=LoginForm').'">Přihlášení</a> '.
    7993            '<a href="'.$this->System->Link('/?Action=UserRegister').'">Registrace</a>';
Note: See TracChangeset for help on using the changeset viewer.