Add about theme

This commit is contained in:
Zankaria 2024-05-07 12:48:05 +02:00 committed by Zankaria
parent 2030b60acf
commit cfdbcfcad9
4 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,37 @@
<?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);
}
}
}