2020-09-30 10:03:05 +00:00
|
|
|
<?php
|
|
|
|
# Date: 30.09.2020 (09:42)
|
|
|
|
|
2020-09-30 10:53:39 +00:00
|
|
|
class Template
|
2020-09-30 10:03:05 +00:00
|
|
|
{
|
2020-09-30 10:53:39 +00:00
|
|
|
/**
|
|
|
|
* Template constructor.
|
|
|
|
*/
|
2020-09-30 10:03:05 +00:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-09-30 11:12:39 +00:00
|
|
|
/**
|
|
|
|
* @param string|null $title
|
|
|
|
* @param int|null $return
|
|
|
|
*
|
|
|
|
* @return false|string
|
|
|
|
*/
|
|
|
|
public static function header(string $title = null, int $return = null)
|
2020-09-30 10:03:05 +00:00
|
|
|
{
|
2020-09-30 11:12:39 +00:00
|
|
|
$head = <<<HTML_HEADER
|
2020-09-30 10:03:05 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="ru">
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<link href="/css/main.css" rel="stylesheet">
|
2020-09-30 19:12:34 +00:00
|
|
|
<link href="/css/btn.css" rel=stylesheet >
|
2020-09-30 10:03:05 +00:00
|
|
|
<title>$title</title>
|
|
|
|
HTML_HEADER;
|
2020-09-30 11:12:39 +00:00
|
|
|
if (!$return) {
|
|
|
|
echo $head;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return $head;
|
2020-09-30 10:03:05 +00:00
|
|
|
}
|
2020-10-28 12:32:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $buildingName название здания
|
|
|
|
* @param string $streetName служебное название улицы на которой стоит здание для кнопки возврата.
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function buildingTop(string $buildingName, string $streetName): void
|
|
|
|
{
|
|
|
|
echo <<<HTML
|
|
|
|
<div style="float: right">
|
|
|
|
<button onclick="top.frames['gameframe'].location = 'city.php?$streetName'">Выйти из здания</button>
|
|
|
|
</div>
|
|
|
|
<h1>$buildingName</h1>
|
|
|
|
HTML;
|
|
|
|
}
|
2020-09-30 10:03:05 +00:00
|
|
|
}
|