Changeset 63 for trunk/View.php


Ignore:
Timestamp:
Aug 3, 2021, 11:20:41 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Used explicit types where possible for better error reporting.
  • Modified: Updated Common packaged to newer version.
  • Modified: Simplified pages title.
  • Added: Simple keyword based spam filter for meet items.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 nbproject
        2 Config.php
        31.settings
        42.project
        53.buildpath
         4.htaccess
  • trunk/View.php

    r56 r63  
    55class BaseView extends View
    66{
    7   var $TimeStart;
    8   var $FormatHTML = false;
    9   var $ShowRuntimeInfo = false;
    10   var $ShowNavigation = false;
    11   var $BasicHTML = false;
    12   var $ParentClass = '';
    13   var $ShortTitle;
    14   var $FullTitle;
    15   var $Encoding;
    16   var $Style;
     7  public int $TimeStart;
     8  public bool $FormatHTML = false;
     9  public bool $ShowRuntimeInfo = false;
     10  public bool $ShowNavigation = false;
     11  public bool $BasicHTML = false;
     12  public string $ParentClass = '';
     13  public string $Title;
     14  public string $Description;
     15  public string $Encoding;
     16  public string $Style;
    1717
    1818  function __construct($System)
     
    3636  }
    3737
    38   function SystemMessage($Title, $Text)
     38  function SystemMessage(string $Title, string $Text): string
    3939  {
    4040    return '<table align="center"><tr><td><div class="SystemMessage"><h3>'.$Title.'</h3><div>'.$Text.'</div></div></td></tr></table>';
     
    4343  }
    4444
    45   function ShowNavigation($Page)
     45  function ShowNavigation(Page $Page): string
    4646  {
    4747    if (array_key_exists('REQUEST_URI', $_SERVER))
     
    7171  }
    7272
    73   function ShowHeader($Page)
    74   {
    75     $Title = $Page->FullTitle;
    76     $Path = $Page->ShortTitle;
     73  function ShowHeader(Page $Page): string
     74  {
     75    $Path = $Page->Title;
    7776
    7877    $Navigation = $this->ShowNavigation($Page);
     
    9998
    10099    $Output .= '</head><body'.$BodyParam.'>';
    101     $Output .= $this->System->ShowMenu();
     100    $Output .= Core::Cast($this->System)->ShowMenu();
    102101    if ($this->BasicHTML == false)
    103102    {
     
    115114  }
    116115
    117   function ShowFooter()
     116  function ShowFooter(): string
    118117  {
    119118    global $ScriptTimeStart, $Revision, $ReleaseTime;
     
    125124      $Output .= '<div class="Footer">'.
    126125      '<i>';
    127       $Output .= ' Kontakt: <a href="mailto:'.$this->System->Config['Web']['AdminEmail'].'">'.$this->System->Config['Web']['AdminEmail'].'</a> ';
    128       $Output .= ' <a href="https://app.zdechov.net/tanec/">Zdrojový kód</a> ';
     126      $Output .= ' Projekt <a href="https://app.zdechov.net/tanec/">Tanec</a> | ';
     127      $Output .= ' Správce: <a href="mailto:'.$this->System->Config['Web']['AdminEmail'].'">'.$this->System->Config['Web']['AdminEmail'].'</a> ';
     128
    129129      //$Output .= ' Verze: '.$Revision.' ('.HumanDate($ReleaseTime).') ';
    130130      if ($this->ShowRuntimeInfo == true)
     
    139139  }
    140140
    141   function GetOutput($Page)
     141  function GetOutput(Page $Page): string
    142142  {
    143143    $Page->OnSystemMessage = array($this->System->BaseView, 'SystemMessage');
     
    152152  }
    153153
    154   function NewPage($ClassName)
     154  function NewPage(string $ClassName): Page
    155155  {
    156156    $Page = new $ClassName();
     
    162162
    163163  // XML formating function
    164   function FormatOutput($s)
     164  function FormatOutput(string $s): string
    165165  {
    166166    $out = '';
Note: See TracChangeset for help on using the changeset viewer.