forked from leftypol/leftypol
Add about theme
This commit is contained in:
parent
2030b60acf
commit
cfdbcfcad9
4 changed files with 100 additions and 0 deletions
37
templates/themes/about/theme.php
Normal file
37
templates/themes/about/theme.php
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue