File: //opt/proundcontra.mosmuc.de/pages/page.php
<?php
/*
* Basic page class.
*/
class Page
{
public function __construct($row)
{
global $sRequest, $sUser;
$this->templateFile = $row->templateFile ?? '';
$this->pageTitle = $row->pageTitle ?? '';
$this->error = '';
$this->notice = '';
$this->shortUrl = '';
}
/*
* Returns true if and only if $sUser can view this page
*/
public function canView()
{
return true;
}
/*
* Returns the HTML title of this page
*/
public function title()
{
global $sTemplate;
return $sTemplate->getString("HTML_META_TITLE");
}
public function templateFile()
{
return $this->templateFile;
}
protected function setError($error)
{
$this->error = $error;
}
public function error()
{
return $this->error;
}
protected function setNotice($notice)
{
$this->notice = $notice;
}
public function notice()
{
return $this->notice;
}
public function setShortUrl($url)
{
$this->shortUrl = $url;
}
public function shortUrl()
{
// Check if SHORTURL_BASE is defined to avoid notices in PHP 8
if (!defined('SHORTURL_BASE') || !SHORTURL_BASE) {
return "";
}
return $this->shortUrl;
}
public function pageTitle()
{
return $this->pageTitle;
}
public function getQuestion()
{
return false;
}
protected $templateFile;
protected $pageTitle;
protected $error;
protected $notice;
protected $shortUrl;
}
?>