2020-01-14 22:25:43 +01:00
|
|
|
<?php
|
2020-01-13 14:39:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
class PageFrameOptions
|
|
|
|
{
|
|
|
|
/** @var string */
|
|
|
|
public $raw;
|
|
|
|
|
|
|
|
/** @var string */
|
2020-01-15 01:46:31 +01:00
|
|
|
public $title = 'Mikescher.com';
|
2020-01-13 14:39:35 +01:00
|
|
|
|
|
|
|
/** @var int */
|
|
|
|
public $statuscode = 200;
|
|
|
|
|
|
|
|
/** @var bool */
|
|
|
|
public $force_404 = false;
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
public $force_404_message = '';
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
public $frame = 'default_frame.php';
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
public $contentType = null;
|
2020-01-15 01:46:31 +01:00
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
public $activeHeader = null;
|
|
|
|
|
|
|
|
/** @var string */
|
|
|
|
public $canonical_url = null;
|
|
|
|
|
|
|
|
/** @var string[] */
|
|
|
|
public $contentCSSClasses = [ 'content-responsive' ];
|
|
|
|
|
|
|
|
/** @var array */
|
|
|
|
public $stylesheets = [];
|
|
|
|
|
|
|
|
/** @var array */
|
|
|
|
public $scripts = [];
|
|
|
|
|
|
|
|
public function addStylesheet(string $url)
|
|
|
|
{
|
|
|
|
foreach ($this->stylesheets as $css) if ($css === $url) return;
|
|
|
|
$this->stylesheets []= $url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function addScript(string $url, bool $defer = false)
|
|
|
|
{
|
|
|
|
foreach ($this->scripts as &$script)
|
|
|
|
{
|
|
|
|
if ($script[0] === $url)
|
|
|
|
{
|
|
|
|
if (!$defer && $script[1]) $script[1] = false; // upgrade from defered to immediate script
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->scripts []= [ $url, $defer ];
|
|
|
|
}
|
2020-01-13 14:39:35 +01:00
|
|
|
}
|