46 lines
1.3 KiB
PHP
46 lines
1.3 KiB
PHP
<?php
|
|
namespace YTKNS\Effects;
|
|
|
|
use YTKNS\HtmlTag;
|
|
use YTKNS\HtmlText;
|
|
use YTKNS\PageBuilder;
|
|
use YTKNS\PageEffectInterface;
|
|
|
|
class NewlyCreatedPageEffect implements PageEffectInterface {
|
|
private $headerText = null;
|
|
private $subText = null;
|
|
|
|
public function getEffectName(): string {
|
|
return 'Newly Created Page Notice';
|
|
}
|
|
|
|
public function getEffectProperties(): array {
|
|
return [];
|
|
}
|
|
|
|
public function setEffectParams(array $vars, bool $quiet = false): void {
|
|
if(!empty($vars['h']))
|
|
$this->headerText = $vars['h'];
|
|
if(!empty($vars['s']))
|
|
$this->subText = $vars['s'];
|
|
}
|
|
|
|
public function getEffectParams(): array {
|
|
$vars = [];
|
|
|
|
if(!empty($this->headerText))
|
|
$vars['h'] = $this->headerText;
|
|
if(!empty($this->subText))
|
|
$vars['s'] = $this->subText;
|
|
|
|
return $vars;
|
|
}
|
|
|
|
public function applyEffect(PageBuilder $builder): void {
|
|
$builder->getContainer()->appendChild(new HtmlTag('div', ['class' => 'NewCreatePageEffect_Main'], [
|
|
new HtmlTag('h1', [], [new HtmlText($this->headerText ?? 'This page is still empty')]),
|
|
new HtmlTag('p', [], [new HtmlText($this->subText ?? 'Please come back later')]),
|
|
]));
|
|
}
|
|
}
|