leftypol/templates/themes/about/theme.php
2024-05-21 16:43:26 +02:00

37 lines
No EOL
779 B
PHP

<?php
require_once 'info.php';
function about_build(string $action, array $theme_config, $board): void {
$obj = new AboutTheme($theme_config);
$obj->build($action);
}
class AboutTheme {
private $theme_config;
private function render(): string {
global $config;
return Element('themes/about/about.html', [
'theme_config' => $this->theme_config,
'config' => $config,
'board_list' => createBoardlist(),
]);
}
public function __construct(array $theme_config) {
$this->theme_config = $theme_config;
}
public function build(string $action): void {
global $config;
if ($action == 'all') {
$about_page = $this->render();
$home = $config['dir']['home'];
$path = $this->theme_config['path'];
file_write($home . $path, $about_page);
}
}
}